/* 레이아웃: 허브(일곱 테스트 카드) → 테스트별 5페이지(소개·결과·자세히·보너스·다른 나라). 한국 심리테스트 사이트 관습: 파스텔 배경, 둥근 카드, 큰 일러스트, 결과 카드 + 공유 줄, 페이지마다 광고. */
:root {
  --bg: #f6f3fb; --fg: #2a2733; --muted: #6d6879; --line: #e3dfee; --card: #ffffff; --soft: #f1eef8;
  --accent: #6a4c9c; --ac: #6a4c9c; --tint: #efe8fb;
  --th: #6a4c9c; --jv: #8a5a2b; --in: #d2691e; --my: #1d8a8a; --jp: #2f4476; --ws: #8a2f50; --nm: #4b5560;
  --th-t: #efe8fb; --jv-t: #f7efe4; --in-t: #fff0e3; --my-t: #e2f4f4; --jp-t: #e8ecf7; --ws-t: #fae8ee; --nm-t: #e9edf2; --qz: #b5532a; --qz-t: #fbeae2;
  --ok: #2e7d5b; --bad: #c0453a; --adline: #c9b36a; --adbg: #fff9e6; --adfg: #7a6a2c;
  --display: "Jua", "Gowun Dodum", "Apple SD Gothic Neo", sans-serif;
  --body: "IBM Plex Sans KR", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14121a; --fg: #ece8f3; --muted: #a39db1; --line: #2d2838; --card: #1d1a26; --soft: #241f30;
    --accent: #a98ad9; --ac: #a98ad9; --tint: #221b33;
    --th: #a98ad9; --jv: #c99a62; --in: #f0945a; --my: #4fbcc2; --jp: #7c93d1; --ws: #d06a8c; --nm: #9aa5b1;
    --th-t: #221b33; --jv-t: #2a2219; --in-t: #2d2016; --my-t: #142727; --jp-t: #1a2033; --ws-t: #2d1a22; --nm-t: #1d2228; --qz: #e8865a; --qz-t: #2f1d16;
    --ok: #4fb286; --bad: #ef7a66; --adline: #8a7a3a; --adbg: #26221a; --adfg: #cdb96a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14121a; --fg: #ece8f3; --muted: #a39db1; --line: #2d2838; --card: #1d1a26; --soft: #241f30;
  --accent: #a98ad9; --ac: #a98ad9; --tint: #221b33;
  --th: #a98ad9; --jv: #c99a62; --in: #f0945a; --my: #4fbcc2; --jp: #7c93d1; --ws: #d06a8c; --nm: #9aa5b1;
  --th-t: #221b33; --jv-t: #2a2219; --in-t: #2d2016; --my-t: #142727; --jp-t: #1a2033; --ws-t: #2d1a22; --nm-t: #1d2228; --qz: #e8865a; --qz-t: #2f1d16;
  --ok: #4fb286; --bad: #ef7a66; --adline: #8a7a3a; --adbg: #26221a; --adfg: #cdb96a; color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.65; margin: 0; padding-inline: 16px; padding-block: 16px 96px; }
.wrap { max-width: 600px; margin: 0 auto; display: grid; gap: 14px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; line-height: 1.2; letter-spacing: 0.01em; }
h1 { font-size: 34px; } h2 { font-size: 24px; } h3 { font-size: 18px; }
p { margin: 0; }
.eyebrow { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); } .small { font-size: 13px; } .hint { font-size: 12px; color: var(--muted); }
.priv { font-size: 12.5px; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 9px 11px; margin: 12px 0 0; line-height: 1.5; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brand { font-family: var(--display); font-size: 20px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.topbar a.small { text-decoration: none; }
.progress a.small { text-decoration: none; color: var(--muted); }
.btn { display: inline-block; font: inherit; font-weight: 600; border-radius: 12px; padding: 12px 18px; border: 1px solid var(--line); background: var(--soft); color: var(--fg); text-decoration: none; text-align: center; cursor: pointer; line-height: 1.3; }
.btn.primary { background: var(--ac); border-color: var(--ac); color: #fff; }
.btn.disabled { opacity: .5; pointer-events: none; }
.nav > * { flex: 1; }
footer a { color: var(--accent); }
.progress { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.progress .pbar { height: 4px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.progress .pbar div { height: 100%; background: var(--ac); width: 0; transition: width .25s; }
.page { display: grid; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px; display: grid; gap: 14px; }
button { font: inherit; font-weight: 600; border-radius: 12px; padding: 12px 18px; border: 1px solid var(--line); background: var(--soft); color: var(--fg); cursor: pointer; }
button.primary { background: var(--ac); border-color: var(--ac); color: #fff; }
button:disabled { opacity: .5; cursor: default; }
button:active:not(:disabled) { transform: translateY(1px); }
input[type="text"], input[type="date"], input[type="time"] { font: inherit; font-size: 16px; color: var(--fg); background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%; min-width: 0; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 420px) { .form-grid { grid-template-columns: 1fr; } }
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* 허브 */
.hero { display: grid; justify-items: center; text-align: center; gap: 8px; padding-block: 8px; }
.hero img { width: 160px; height: 160px; border-radius: 28px; object-fit: cover; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.tcard { display: grid; gap: 6px; padding: 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--card); text-align: left; cursor: pointer; font-weight: 500; min-width: 0; }
.tcard img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: var(--tint); max-width: 100%; }
a.tcard { text-decoration: none; color: inherit; }
#homeAbout a { color: var(--accent); }
.tcard .tname { font-family: var(--display); font-size: 17px; color: var(--ac); line-height: 1.2; }
.tcard .ttag { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.tcard .tcount { font-size: 11.5px; color: var(--ac); background: var(--tint); border-radius: 999px; padding: 2px 8px; justify-self: start; }
.grid.small .tcard img { aspect-ratio: 2 / 1; }
/* 테스트 소개 */
.thero { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 24px 20px; border-radius: 24px; background: var(--tint); }
.thero img { width: 220px; height: 220px; border-radius: 24px; object-fit: cover; max-width: 100%; }
.thero h1 { color: var(--ac); }
/* 결과 카드 */
.rcard { background: var(--card); border: 2px solid var(--ac); border-radius: 24px; padding: 22px 20px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.rcard img { width: 150px; height: 150px; border-radius: 20px; object-fit: cover; }
.rcard .rtitle { font-family: var(--display); font-size: 30px; color: var(--ac); line-height: 1.15; }
.rcard .rsub { font-size: 13px; color: var(--muted); }
.rcard .rline { font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { font-size: 13px; padding: 4px 11px; border-radius: 999px; background: var(--tint); color: var(--fg); }
.rare { font-size: 13.5px; background: var(--tint); border-radius: 12px; padding: 8px 12px; }
.rare b { color: var(--ac); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; }
.adj { font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.adj b { color: var(--fg); font-weight: 600; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; border: 1px solid rgba(0,0,0,0.15); }
.nav { display: flex; justify-content: space-between; gap: 8px; }
.nav button { flex: 1; }
.verdict { display: grid; gap: 4px; }
.verdict .big { font-family: var(--display); font-size: 26px; color: var(--ac); }
.koot { display: grid; gap: 5px; }
.koot .r { display: grid; grid-template-columns: 110px 1fr 54px; gap: 8px; align-items: center; font-size: 13.5px; }
.koot .r .t { color: var(--muted); font-size: 12.5px; }
.koot .r .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.koot .track { height: 8px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.koot .fill { height: 100%; background: var(--ac); border-radius: 999px; }
.invitee { background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; display: grid; gap: 2px; }
.bonus .big { font-family: var(--display); font-size: 24px; color: var(--ac); }
/* 광고 자리 */
.ad { border: 1.5px dashed var(--adline); background: var(--adbg); color: var(--adfg); font-size: 12px; display: grid; place-items: center; text-align: center; border-radius: 10px; padding: 6px 10px; line-height: 1.4; }
.ad b { font-weight: 600; }
.ad-top { min-height: 100px; } .ad-inart { min-height: 250px; margin: 6px 0 14px; } .ad-multi { min-height: 300px; } .ad-load { min-height: 250px; }
.adcap { font-size: 11px; color: var(--muted); letter-spacing: .08em; text-align: center; margin: 10px 0 0; }
.ad.coupang { min-height: 100px; border-color: #c9412f; color: #b0452f; background: rgba(224,70,47,0.07); }
.ad-anchor { position: fixed; left: 0; right: 0; bottom: 0; min-height: 0; height: calc(56px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); border-radius: 0; border-width: 1.5px 0 0; z-index: 20; }
.rail { display: none; }
@media (min-width: 1240px) { .rail { display: grid; position: fixed; top: 90px; width: 160px; min-height: 600px; z-index: 5; } .rail.left { left: calc(50% - 300px - 184px); } .rail.right { left: calc(50% + 300px + 24px); } }
.aff { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; gap: 6px; background: var(--card); }
.aff .tag { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; }
.aff .t { font-weight: 600; } .aff .d { font-size: 13.5px; color: var(--muted); }
.aff button { justify-self: start; padding: 8px 14px; font-size: 14px; }
.imgov { position: fixed; inset: 0; background: rgba(12,10,18,0.88); z-index: 60; display: grid; place-items: center; padding: 16px; overflow: auto; }
.imgbox { background: var(--card); color: var(--fg); border-radius: 18px; padding: 22px; max-width: 380px; width: 100%; display: grid; gap: 12px; }
.imgbox img { width: 100%; height: auto; border-radius: 8px; display: block; }
/* 공유 */
.share { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sb { font: inherit; font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); color: var(--fg); text-decoration: none; cursor: pointer; line-height: 1.2; }
.sb.kakao { background: #FEE500; color: #191919; border-color: #FEE500; }
.sb.threads, .sb.x { background: #111111; color: #ffffff; border-color: #111111; }
.sb.fb { background: #1877F2; color: #ffffff; border-color: #1877F2; }
.sb.line { background: #06C755; color: #ffffff; border-color: #06C755; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.toast.show { opacity: 1; }
/* 계산 페이지(결과 직전, 광고 자리 포함) */
.loadcard { text-align: center; justify-items: center; }
.loadcard .big { font-family: var(--display); font-size: 22px; color: var(--ac); min-height: 1.3em; }
.loadbar { width: 100%; height: 6px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.loadbar div { height: 100%; background: var(--ac); width: 0; transition: width .12s linear; }
/* 질문형 테스트 */
.qnum { font-size: 12px; color: var(--muted); letter-spacing: .08em; }
.qopt { display: grid; gap: 8px; }
.qopt button { text-align: left; padding: 14px 16px; border-radius: 14px; font-weight: 500; line-height: 1.4; }
.qopt button:hover { border-color: var(--ac); }
.qopt button.sel { border-color: var(--ac); background: var(--tint); font-weight: 600; }
footer { font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
textarea.copybuf { position: absolute; left: -9999px; top: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
