/* 디자인 토큰: 명세 13장. 단위는 CSS px. */
@font-face { font-family: "Pretendard"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/Pretendard-Regular.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/Pretendard-Medium.woff2") format("woff2"); }
@font-face { font-family: "Pretendard"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/Pretendard-Bold.woff2") format("woff2"); }
/* 로고 전용 ExtraBold: 브랜드 글자만 담은 작은 subset(make_assets.py logofont) */
@font-face { font-family: "Pretendard"; font-weight: 800; font-style: normal; font-display: swap; src: url("/assets/fonts/Pretendard-ExtraBold.woff2") format("woff2"); }

:root {
  --bg: #FFF8F0; --text: #2B2036; --sub: #655B6C; --accent: #B53F5B; --primary: #4B315E;
  --line: #E8DDE7; --focus: #B53F5B; --shadow: 0 4px 16px rgba(75, 49, 94, 0.08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Pretendard", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 16px; line-height: 26px; font-weight: 400; word-break: keep-all; overflow-wrap: anywhere;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 20px 20px 40px; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

h1, h2, h3, p, ul { margin: 0; padding: 0; }
.list { list-style: none; }
.h1 { font-size: 28px; line-height: 36px; font-weight: 700; margin-bottom: 12px; }
.h2 { font-size: 20px; line-height: 28px; font-weight: 700; margin-bottom: 12px; }
.h3 { font-size: 18px; line-height: 26px; font-weight: 700; margin-bottom: 12px; }
.body { font-size: 16px; line-height: 26px; }
.body + .body { margin-top: 12px; }
.small { font-size: 14px; line-height: 21px; color: var(--sub); }
.muted { color: var(--sub); }

/* 버튼 */
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 12px 16px;
  border: 1px solid var(--primary); border-radius: 14px; font: inherit; font-size: 17px; font-weight: 700; line-height: 24px;
  text-decoration: none; text-align: center; cursor: pointer; transition: opacity 150ms;
}
.btn-primary { background: var(--primary); color: #FFFFFF; }
.btn-secondary { background: #FFFFFF; color: var(--primary); }
.btn:hover { opacity: 0.92; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn[hidden] { display: none; }

/* 브랜드 로고(모든 페이지 맨 위, 글자 로고) */
.brandbar { max-width: 480px; margin: 0 auto; padding: 8px 20px 0; line-height: 20px; }
.brand { display: inline-block; padding: 4px 0; font-size: 18px; line-height: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--primary); text-decoration: none; }
.brandbar + .wrap { padding-top: 8px; }
.brand-line { margin-top: 4px; font-size: 14px; line-height: 21px; color: var(--sub); }

/* 시작 화면 */
.start { padding-top: 20px; }
.title { font-size: 28px; line-height: 36px; font-weight: 700; }
.subtitle { margin-top: 8px; font-size: 16px; line-height: 24px; color: var(--sub); }
.collage { display: block; width: 100%; max-width: 320px; height: auto; margin: 16px auto 0; }
.meta { margin-top: 12px; font-size: 14px; line-height: 21px; font-weight: 500; text-align: center; }
.notice { font-size: 14px; line-height: 21px; color: var(--sub); }
.notice.short { margin-top: 4px; margin-bottom: 12px; text-align: center; }
.affiliate-line { margin-top: 12px; text-align: center; }
.affiliate { margin-top: 4px; }
.affiliate.top { margin-bottom: 16px; }
.fold { margin-top: 12px; font-size: 14px; line-height: 21px; }
.fold summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--sub); }
.footlinks { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 12px; font-size: 14px; line-height: 21px; }
.footlinks a { display: inline-flex; align-items: center; min-height: 44px; }

/* 문항 */
.progress { font-size: 14px; line-height: 21px; color: var(--sub); }
.q { margin: 8px 0 20px; font-size: 24px; line-height: 34px; font-weight: 700; outline: none; }
.opts { display: flex; flex-direction: column; gap: 12px; }
.opt {
  position: relative; display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; align-items: start; width: 100%; min-height: 76px; padding: 16px;
  text-align: left; font: inherit; font-size: 17px; line-height: 27px; font-weight: 500; color: var(--text);
  background: #FFFFFF; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); cursor: pointer; transition: opacity 150ms;
}
.opt-key { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.opt-txt { grid-column: 2; }
.opt-chk { grid-column: 2; font-size: 14px; line-height: 21px; font-weight: 700; color: var(--primary); }
.opt-chk:empty { display: none; }
.opt.on { border: 2px solid var(--primary); padding: 15px; }
.opt.on .opt-key { background: var(--primary); color: #FFFFFF; border-color: var(--primary); }
.err { margin-top: 12px; min-height: 21px; font-size: 14px; line-height: 21px; color: var(--accent); font-weight: 500; }
.err .btn { margin-top: 8px; min-height: 44px; }
.qnav { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.qnav .btn-secondary { min-height: 44px; }

/* 결과 */
.result .block, .types .block, .legal .block { margin-top: 28px; }
.identity { text-align: center; }
.state { font-size: 14px; line-height: 21px; color: var(--accent); font-weight: 700; }
.type-name { margin-top: 12px; font-size: 30px; line-height: 38px; font-weight: 700; outline: none; }
.axes { margin-top: 12px; font-size: 14px; line-height: 21px; color: var(--sub); font-weight: 500; }
.def { margin-top: 12px; font-size: 18px; line-height: 28px; }
.char-bg { width: min(232px, 100%); aspect-ratio: 1 / 1; margin: 12px auto 0; border-radius: 50%; background: var(--tm, #F3E7F0); display: grid; place-items: center; }
.char { display: block; width: 94%; height: auto; }
.identity { border-top: 6px solid var(--tc, transparent); border-radius: 0 0 0 0; padding-top: 14px; }
.state { color: var(--accent); }
.quote { margin-top: 12px; font-size: 20px; line-height: 30px; font-weight: 700; color: var(--accent); }
.identity .share-actions { margin-top: 12px; }
.share-actions { display: flex; flex-direction: column; gap: 12px; }
.status { min-height: 21px; margin-top: 12px; font-size: 14px; line-height: 21px; color: var(--sub); }
.manual-copy { display: block; width: 100%; margin-top: 12px; padding: 12px; font: inherit; font-size: 14px; line-height: 21px; border: 1px solid var(--line); border-radius: 14px; background: #FFFFFF; color: var(--text); }
.external { padding: 20px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 20px; }
.external .btn { margin-top: 12px; }
.card { background: #FFFFFF; border: 1px solid var(--line); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.combo { min-height: 112px; }
.combo-title { font-size: 16px; line-height: 24px; font-weight: 700; margin-bottom: 4px; }
.combo .small { font-size: 14px; line-height: 22px; }
.combo-title a { display: inline-block; padding: 8px 0; }
.product-name { font-size: 16px; line-height: 24px; font-weight: 700; }
.product .btn { margin-top: 12px; min-height: 48px; }
.next { min-height: 96px; opacity: 0.7; }
.end { margin-top: 28px; }
.end-actions { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

/* 전체 유형 */
.types .h1 + .body { margin-bottom: 16px; }
.type-list { margin-top: 20px; }
.type-card { display: grid; grid-template-columns: 96px 1fr; gap: 16px; min-height: 176px; align-items: center; }
.type-img { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: var(--tm, #F3E7F0); }
.type-card { border-left: 6px solid var(--tc, var(--line)); }
.type-card img { width: 92px; height: 92px; }
.type-card-name { font-size: 20px; line-height: 28px; font-weight: 700; }
.def2 { font-size: 16px; line-height: 26px; margin: 4px 0; }
.type-card a { display: inline-flex; align-items: center; min-height: 44px; }
.types > .h2 { margin-top: 28px; }

/* 문서 페이지 */
.legal h1 { font-size: 28px; line-height: 36px; font-weight: 700; margin-bottom: 8px; }
.legal h2 { font-size: 18px; line-height: 26px; font-weight: 700; margin: 24px 0 4px; }
.legal p { font-size: 16px; line-height: 26px; margin-bottom: 8px; }
.legal .small { font-size: 14px; }

/* 공유 이미지 선택창 */
.sheet { width: 100%; max-width: 480px; margin: auto auto 0; padding: 0; border: 0; border-radius: 20px 20px 0 0; background: var(--bg); color: var(--text); }
.sheet::backdrop { background: rgba(43, 32, 54, 0.45); }
.sheet-in { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.radio { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 16px; font-weight: 500; }
.radio input { width: 22px; height: 22px; accent-color: var(--primary); }

@media (prefers-reduced-motion: reduce) {
  .btn, .opt { transition: none; }
}
@media (min-width: 520px) {
  .wrap { padding-top: 32px; }
  .start { padding-top: 32px; }
  .brandbar { padding-top: 20px; }
  .brandbar + .wrap, .brandbar + .start { padding-top: 12px; }
}
.fold summary::after { content: "▾"; margin-left: 6px; }
.fold[open] summary::after { content: "▴"; }
@media (max-width: 300px) {
  .type-card { grid-template-columns: 1fr; justify-items: start; }
  .wrap, .brandbar { padding-left: 12px; padding-right: 12px; }
  .card { padding: 14px; }
}
