/* nowpick 디자인 토큰 — 값의 역할은 DESIGN.md. 페이지에서는 토큰 이름만 쓴다 */
:root {
  /* 색: 밤하늘 남색 단계 + 금색 하나 */
  --bg: #0b1024;          /* 페이지 바탕 */
  --surface: #131a36;     /* 카드·입력칸 */
  --surface-2: #1a2347;   /* 눌림·선택 바탕, 표 머리 */
  --line: #283262;        /* 테두리·구분선 */
  --line-strong: #3a4682; /* 입력칸 테두리 (3:1 이상) */
  --text: #f1f2fb;        /* 본문 */
  --muted: #a5acd2;       /* 보조 글자 (바탕 대비 7:1) */
  --faint: #7c84ad;       /* 아주 약한 글자 (큰 숫자 단위 등) */
  --primary: #f4c867;     /* 주요 버튼·링크·강조 하나 */
  --primary-hover: #f8d68c;
  --on-primary: #1b1405;  /* 금색 위 글자 */
  --primary-soft: rgba(244, 200, 103, .12);
  --starlight: #f0d9a0;   /* 별자리 선·별빛 (금색보다 연한 크림) */
  --sky-deep: #020718;    /* 공유 카드 하늘 아래쪽 */
  --success: #7fd6a4;
  --error: #ff8f86;
  --success-soft: rgba(127, 214, 164, .14);
  --error-soft: rgba(255, 143, 134, .14);
  --kakao: #fee500;
  --kakao-hover: #ffeb3b;
  --brand-line: #06c755;
  --brand-line-hover: #05b34c;
  --on-brand-line: #ffffff;
  --brand-x: #000000;
  --brand-x-hover: #272c30;
  --on-brand-x: #ffffff;
  --on-kakao: #191919;    /* 카카오 노랑 위 글자 */
  --surface-3: #222c58;   /* 톤 버튼 hover·눌림 (surface-2보다 한 단 밝게) */
  --scrim: rgba(3, 6, 18, .62); /* 시트 뒤 어둡게 */
  --highlight: rgba(244, 200, 103, .35); /* 1순위 형광펜 밑줄 */

  /* 글자 */
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --fs-xs: .8125rem;  /* 13 */
  --fs-sm: .9375rem;  /* 15 */
  --fs-md: 1.0625rem; /* 17 본문 */
  --fs-lg: 1.25rem;   /* 20 */
  --fs-xl: 1.5rem;    /* 24 */
  --fs-2xl: 1.875rem; /* 30 */
  --fs-3xl: 2.375rem; /* 38 */

  /* 간격 (4 단위) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;
  --content: 560px;

  /* 모양 */
  --r-sm: 10px; --r-md: 14px; --r-btn: 16px; --r-lg: 20px; --r-sheet: 24px; --r-pill: 999px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --focus: 0 0 0 3px var(--bg), 0 0 0 5px var(--primary);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* .btn·.badge의 display가 hidden을 덮지 않게 */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  color: var(--text); font: 400 var(--fs-md)/1.7 var(--font); letter-spacing: -.01em; word-break: keep-all; overflow-wrap: anywhere;
  background-color: var(--bg);
  /* 별 몇 개 (점 무늬, 화면 위쪽만) */
  background-image:
    radial-gradient(1.2px 1.2px at 12% 6%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 78% 3%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1.4px 1.4px at 92% 14%, rgba(244,200,103,.6), transparent 60%),
    radial-gradient(1px 1px at 34% 18%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 60% 11%, rgba(255,255,255,.3), transparent 60%);
  background-repeat: no-repeat; background-size: 100% 520px;
  -webkit-font-smoothing: antialiased;
}
/* 일본어·중국어: 띄어쓰기가 없어 keep-all이면 줄을 못 나눔 → 글자 단위 + 금칙(줄 맨 앞 。、 금지) */
html:lang(ja) body, html:lang(ja) .share-card, html:lang(zh) body, html:lang(zh) .share-card { word-break: normal; line-break: strict; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
::selection { background: var(--primary); color: var(--on-primary); }

/* ── 머리·바닥 ── */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(11, 16, 36, .92); border-bottom: 1px solid var(--line); }
.site-header-in { max-width: var(--content); margin: 0 auto; padding: var(--s3) var(--s4); }
.logo { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text); font-weight: 800; font-size: var(--fs-lg); letter-spacing: -.03em; text-decoration: none; }
.logo:hover { color: var(--text); }
.logo-mark { width: 18px; height: 18px; fill: var(--primary); }
.wrap { flex: 1; width: 100%; max-width: var(--content); margin: 0 auto; padding: var(--s8) var(--s4) var(--s12); }
.site-footer { width: 100%; max-width: var(--content); margin: 0 auto; padding: var(--s6) var(--s4) var(--s10); border-top: 1px solid var(--line); color: var(--faint); font-size: var(--fs-xs); text-align: center; }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s2) var(--s5); margin-bottom: var(--s2); }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer p { margin: 0; }

/* ── 글자 ── */
h1, h2, h3 { margin: 0; letter-spacing: -.03em; text-wrap: balance; }
h1 { font-size: var(--fs-2xl); line-height: 1.25; font-weight: 800; margin-bottom: var(--s3); }
h1.display { font-size: var(--fs-3xl); line-height: 1.18; }
h2 { font-size: var(--fs-xl); line-height: 1.35; font-weight: 750; margin: var(--s10) 0 var(--s3); }
h3 { font-size: var(--fs-lg); line-height: 1.4; font-weight: 700; margin: var(--s8) 0 var(--s2); }
p { margin: 0 0 var(--s4); }
ul { padding-left: 1.2em; margin: 0 0 var(--s4); }
li { margin-bottom: var(--s2); }
li::marker { color: var(--primary); }
.lead { color: var(--muted); font-size: var(--fs-md); }
.eyebrow { color: var(--primary); font-size: var(--fs-sm); font-weight: 650; letter-spacing: 0; margin: 0 0 var(--s2); }
.notice { color: var(--faint); font-size: var(--fs-xs); line-height: 1.6; }
.keywords { color: var(--muted); font-size: var(--fs-sm); }
.page-head { margin-bottom: var(--s6); }
.hub-hero { margin-bottom: var(--s6); }
.hub-hero h1 { font-size: var(--fs-3xl); line-height: 1.18; }

/* ── 버튼: 톤 버튼 (테두리 없이 면 색만, DESIGN.md 5) ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; min-height: 54px; padding: var(--s3) var(--s5); margin: 0;
  border: 0; border-radius: var(--r-btn);
  background: var(--surface-2); color: var(--text);
  font: 600 var(--fs-md)/1.4 var(--font); letter-spacing: -.015em; text-align: center; text-decoration: none;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, transform .1s;
}
.btn svg { width: 18px; height: 18px; flex: none; color: var(--primary); }
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn:active { transform: scale(.985); }
.btn:focus-visible { box-shadow: var(--focus); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.btn-primary svg { color: currentColor; }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-lg { min-height: 58px; font-size: var(--fs-lg); }
.btn-quiet, .link-btn { background: transparent; color: var(--muted); font-weight: 500; min-height: 44px; }
.btn-quiet:hover, .link-btn:hover { background: transparent; color: var(--text); }
.link-btn { display: block; width: 100%; margin: var(--s2) 0 0; padding: 10px var(--s4); border: 0; font: 500 var(--fs-sm)/1.4 var(--font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: center; }
.actions { display: flex; flex-direction: column; gap: var(--s3); margin: var(--s10) 0 var(--s4); }
.actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }

/* ── 허브: 카드 그리드 (모바일 1줄, 넓으면 2~3줄). 썸네일 = OG 이미지(별자리) ── */
body[data-page="hub"] .wrap, body[data-page="hub"] .site-header-in, body[data-page="hub"] .site-footer { max-width: 1040px; }
.test-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); grid-auto-rows: 1fr; } /* 1fr 줄 = 모든 카드가 가장 큰 카드 높이로 통일 */
.test-card { margin: 0; }
.test-card a { display: flex; flex-direction: column; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; }
.test-card a:hover, .test-card a:focus-visible { color: var(--text); transform: translateY(-3px); border-color: var(--primary); }
.test-card a:focus-visible { border-radius: var(--r-lg); }
.test-card img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--surface-2); }
.test-card-body { display: flex; flex-direction: column; flex: 1; gap: var(--s2); padding: var(--s4) var(--s5) var(--s5); }
.test-card h2 { margin: 0; font-size: var(--fs-lg); line-height: 1.35; }
.test-card p { flex: 1; margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.6; }
.tag { align-self: flex-start; padding: 2px 10px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--primary); font-size: var(--fs-xs); font-weight: 600; }
.go { margin-top: var(--s1); color: var(--primary); font-weight: 700; font-size: var(--fs-sm); }

/* ── 테스트 화면 ── */
.screen-title { font-size: var(--fs-xl); margin: 0 0 var(--s6); }
.hero { display: flex; flex-direction: column; }
.hero .lead { font-size: var(--fs-md); margin-bottom: var(--s6); }
.hero .notice { text-align: center; margin-top: var(--s4); }
.hero-art { margin: calc(var(--s4) * -1) calc(var(--s4) * -1) var(--s2); }
.hero-constellation { display: block; width: 100%; height: auto; max-height: 300px; }
.invite { padding: var(--s4); border-radius: var(--r-md); background: var(--primary-soft); border: 1px solid rgba(244,200,103,.35); font-size: var(--fs-sm); }

.options { display: flex; flex-direction: column; gap: var(--s3); }
.options .btn { justify-content: flex-start; text-align: left; min-height: 62px; padding: var(--s4) var(--s5); font-weight: 500; border-radius: var(--r-lg); background: var(--surface); }
.options .btn:hover { background: var(--surface-2); }
.options .btn:active { background: var(--surface-3); }
/* 성향 질문 4단계: 왼쪽 문장 vs 오른쪽 문장 + 아래 점 4칸 (큰 점 = 완전, 작은 점 = 살짝) */
.options.scale { gap: var(--s4); }
.scale-sides { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.scale-side { display: flex; align-items: center; justify-content: center; min-height: 112px; padding: var(--s4); border-radius: var(--r-lg); background: var(--surface); text-align: center; font-weight: 500; line-height: 1.5; }
.scale-dots { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.options .btn.scale-dot { flex-direction: column; justify-content: flex-start; gap: var(--s2); min-height: 0; padding: var(--s2) 0; background: transparent; border-radius: var(--r-md); }
.options .btn.scale-dot:hover { background: var(--surface); }
.scale-dot .dot { display: block; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line-strong); transition: background .15s, border-color .15s; }
.scale-dot.is-lean .dot { width: 30px; height: 30px; margin: 7px 0; }
.scale-dot:hover .dot, .scale-dot:active .dot { border-color: var(--primary); background: var(--primary-soft); }
.scale-dot .dot-label { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.quiz-hint { margin: calc(var(--s4) * -1) 0 var(--s5); color: var(--faint); font-size: var(--fs-xs); }
.progress-row { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s5); }
.progress { margin: 0; color: var(--primary); font-weight: 700; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.progress-bar { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.progress-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--primary); transition: width .3s ease; }

.loading { text-align: center; padding-top: var(--s12); }
.orbit { position: relative; width: 72px; height: 72px; margin: var(--s8) auto var(--s6); border-radius: 50%; border: 1px dashed var(--line-strong); animation: spin 1.6s linear infinite; }
.orbit::before { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 24px rgba(244,200,103,.55); }
.orbit span { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .orbit { animation-duration: 6s; }
  .btn, .test-card a, .progress-bar span { transition: none; }
}

/* ── 입력 폼 ── */
.form { display: flex; flex-direction: column; gap: var(--s6); }
.birth-form { margin: var(--s2) 0 var(--s4); padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.birth-form .input, .birth-form .segmented { background: var(--bg); }
.form-title { margin: 0; font-size: var(--fs-lg); }
.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.label { display: block; padding: 0; color: var(--text); font-size: var(--fs-sm); font-weight: 650; }
fieldset > .label { margin-bottom: var(--s2); }
.optional { margin-left: var(--s1); color: var(--faint); font-weight: 500; font-size: var(--fs-xs); }
.input {
  display: block; width: 100%; min-height: 52px; padding: var(--s3) var(--s4);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text);
  font: 500 var(--fs-md)/1.3 var(--font); transition: border-color .15s, background-color .15s;
}
.input-xl { min-height: 60px; font-size: var(--fs-xl); font-weight: 650; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.input::placeholder { color: var(--faint); opacity: .6; font-weight: 500; }
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: var(--surface-2); }
.input:disabled { opacity: .4; cursor: not-allowed; }
.hint { margin: var(--s2) 0 0; color: var(--faint); font-size: var(--fs-xs); }
.hint.ok { color: var(--success); font-weight: 600; }
.error { margin: 0; padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: rgba(255, 143, 134, .1); color: var(--error); font-size: var(--fs-sm); }

/* 고르기: 라디오를 나란히 붙인 버튼처럼 */
.segmented { display: flex; padding: 4px; gap: 4px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.segmented label { flex: 1; position: relative; }
.segmented input, .chip-toggle input, .check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span { white-space: nowrap; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--s2); border-radius: var(--r-sm); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; text-align: center; cursor: pointer; transition: background-color .15s, color .15s; }
.segmented label:hover span { color: var(--text); }
.segmented input:checked + span { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--primary); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }
.segmented-sm { padding: 3px; border-radius: var(--r-pill); }
.segmented-sm span { min-height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); font-size: var(--fs-xs); }
.chip-toggle span, .check span { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--s3); border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.chip-toggle span::before, .check span::before { content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid currentColor; }
.chip-toggle input:checked + span, .check input:checked + span { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.chip-toggle input:checked + span::before, .check input:checked + span::before { background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.2 2.2 4.8-4.8' fill='none' stroke='%231b1405' stroke-width='1.8'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--primary); }
.chip-toggle input:focus-visible + span, .check input:focus-visible + span { box-shadow: var(--focus); }
.check { display: inline-block; margin-top: var(--s3); }

/* ── 결과 ── */
.card { padding: var(--s6) var(--s5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); margin-bottom: var(--s6); }
.hero-card { position: relative; overflow: hidden; padding: 0 0 var(--s6); text-align: center; border: 1px solid var(--accent, var(--line-strong)); box-shadow: var(--shadow);
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 75%); }
.hero-card .hero-art { margin: 0; }
.hero-art .constellation { display: block; width: 100%; height: auto; margin: 0 0 calc(var(--s10) * -1); }
.hero-body { position: relative; padding: 0 var(--s5); }
.hanja { margin: 0 0 var(--s2); text-align: center; color: var(--muted); font-size: var(--fs-sm); letter-spacing: .5em; padding-left: .5em; }
.hero-name { margin: 0; font-size: calc(var(--fs-3xl) * 1.35); font-weight: 800; line-height: 1.1; letter-spacing: -.04em; color: var(--text); }
.hero-name small { margin-left: 2px; font-size: var(--fs-2xl); font-weight: 700; color: var(--primary); }
.nickname { margin: var(--s2) 0 0; color: var(--text); font-weight: 600; font-size: var(--fs-lg); }
.meaning { margin: var(--s1) 0 0; color: var(--muted); font-size: var(--fs-sm); } /* 닉네임 아래 전통 의미 쉬운 풀이 */
.hero-element { margin: var(--s3) 0 0; color: var(--muted); font-size: var(--fs-sm); }
.hero-element b { color: var(--accent, var(--text)); font-weight: 650; }
.hero-intro { margin: var(--s6) 0; }
.hero-intro .eyebrow-sub { color: var(--muted); font-weight: 500; }
.panel { padding: var(--s5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); margin-bottom: var(--s6); }
.panel h2 { margin-top: 0; font-size: var(--fs-lg); }
.panel p:last-child { margin-bottom: 0; }
/* 결과 「너만의 결」 4줄 (07-성향-질문.md 6). 답이 없으면(공유 링크) 잠금 칸 */
.traits { margin-top: var(--s6); }
.traits h2 { margin-bottom: var(--s4); }
.trait-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s4); }
.trait-list li { display: flex; gap: var(--s3); align-items: flex-start; }
.trait-ic { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: var(--fs-sm); }
.trait-list p { margin: 0; color: var(--muted); line-height: 1.7; }
.trait-list .trait-lean { margin-bottom: var(--s1); color: var(--primary); font-size: var(--fs-xs); font-weight: 700; }
.trait-lock p { margin: 0 0 var(--s4); color: var(--muted); font-size: var(--fs-sm); }
.notes { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s6); }
.note { margin: 0; padding: var(--s4); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: var(--fs-sm); }
.note .btn { margin-top: var(--s3); min-height: 44px; font-size: var(--fs-sm); }
.reading > h2:first-child { margin-top: var(--s8); }
.reading-title { font-size: var(--fs-xl); line-height: 1.3; margin: var(--s8) 0 var(--s2); }
.reading > .lead { margin: 0 0 var(--s6); }
/* 본문 = 소제목마다 카드 한 덩어리. 첫 문장만 굵게(빌드가 <strong>), 나머지는 한 단 옅게. 접지 않음(스크롤↑ = 광고 노출↑) */
.read-card { margin: 0 0 var(--s4); padding: var(--s5); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.read-card[hidden] { display: none; }
.read-card h3 { margin: 0 0 var(--s3); font-size: var(--fs-lg); }
.read-card h3::before { height: .9em; }
.read-card p { margin: 0 0 var(--s3); color: var(--muted); line-height: 1.75; }
.read-card p:last-child, .read-card ul:last-child { margin-bottom: 0; }
.read-card p strong { color: var(--text); font-weight: 700; }
.read-card > ul:not(.pick-list) { margin: 0; padding-left: var(--s5); color: var(--muted); }
.read-card > ul:not(.pick-list) li { margin: 0 0 var(--s2); line-height: 1.7; }
.read-card > ul:not(.pick-list) li:last-child { margin-bottom: 0; }
.read-card .table-wrap { margin-bottom: 0; }
.reading h3, .result h3 { display: flex; align-items: center; gap: var(--s2); }
.reading h3::before, .result h3::before { content: ""; flex: none; width: 4px; height: 1em; border-radius: 2px; background: var(--primary); }
.closing { font-weight: 600; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--s4); }
.oi { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); table-layout: fixed; }
.oi th { background: var(--surface-2); color: var(--primary); font-weight: 700; }
.oi th, .oi td { padding: var(--s3); text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.oi td + td, .oi th + th { border-left: 1px solid var(--line); }
.oi tr:last-child td { border-bottom: 0; }
.score { color: var(--primary); font-size: var(--fs-xl); letter-spacing: .1em; }
.chem ul, .links { list-style: none; padding: 0; display: grid; gap: var(--s3); }
.chem li, .links li { margin: 0; padding: var(--s4); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.chem li a, .links li a { font-weight: 700; }
.star-index { margin: var(--s10) 0 0; }
.star-index h2 { margin: 0 0 var(--s3); font-size: var(--fs-lg); }
.star-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
.star-links li { padding: var(--s3); }
.star-links li a { display: block; }
.star-links li span { color: var(--muted); font-size: var(--fs-xs); }
.match h1 { font-size: var(--fs-2xl); }
/* 궁합 페이지: 첫 카드 = 두 별자리 나란히 + 케미 이름 + 점수 (결과 첫 카드와 같은 틀) */
.match-art { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: var(--s4) var(--s3) 0; }
.match-star { display: block; color: var(--text); text-decoration: none; }
.match-star .constellation { display: block; width: 100%; height: auto; margin: 0 0 calc(var(--s4) * -1); }
.match-star-name { display: block; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.03em; }
.match-star-name small { margin-left: 1px; font-size: var(--fs-md); font-weight: 700; color: var(--primary); }
.match-star-nick { display: block; margin-top: var(--s1); color: var(--muted); font-size: var(--fs-xs); }
.match-x { color: var(--primary); font-size: var(--fs-2xl); font-weight: 300; padding: 0 var(--s1); }
.match-hero .hero-body { margin-top: var(--s6); }
.match-hero .eyebrow { margin-bottom: var(--s2); }
.match .match-name { margin: 0; font-size: var(--fs-3xl); font-weight: 800; line-height: 1.2; letter-spacing: -.03em; }
.match-score { margin: var(--s3) 0 0; display: flex; justify-content: center; align-items: center; gap: var(--s2); }
.match-score b { color: var(--text); font-size: var(--fs-sm); font-weight: 650; }
.match-reading { margin-top: var(--s8); }
.match-roles { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.match-roles li { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-2); }
.match-roles span { color: var(--muted); font-size: var(--fs-sm); flex: none; }
.match-roles b { color: var(--text); font-weight: 700; text-align: right; }
.friend .btn + .btn { margin-top: 10px; }

/* ── 문서 페이지 ── */
.doc h2 { font-size: var(--fs-lg); }
.doc pre { white-space: pre-wrap; font-size: .75rem; color: var(--muted); background: var(--surface); padding: var(--s3); border-radius: var(--r-sm); }

/* ── 광고 ── */
.picks .disclosure { color: var(--faint); font-size: var(--fs-xs); } /* 대가성 문구는 상품 위 */
.pick-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.pick-list a { display: block; padding: var(--s4); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); font-weight: 700; text-decoration: none; }
.pick-list a:hover { background: var(--surface-3); }
.pick-go { display: block; margin-top: var(--s2); color: var(--primary); font-size: var(--fs-sm); font-weight: 600; }
.pick-kicker { display: block; margin-bottom: var(--s1); color: var(--faint); font-size: var(--fs-xs); font-weight: 600; }
.coupang { margin-top: var(--s12); }
.coupang .disclosure, .gate .disclosure { color: var(--faint); font-size: var(--fs-xs); }
.adfit { display: flex; justify-content: center; margin: var(--s8) 0; min-height: 250px; }
.gate { text-align: center; }
.gate .disclosure { margin-top: var(--s4); }
.jm-result > .adfit, .match > .adfit { margin: 56px 0; } /* 결과 첫 화면 끝·본문 끝, 궁합 본문 끝: 위아래 링크·버튼과 띄움 */
.screen .adfit, .test-grid + .adfit { margin-top: 56px; } /* 버튼·선택지와 56px 이상 띄움 (실수 클릭 방지, 광고-수익-기획.md). 높이는 .adfit min-height로 미리 잡아 화면이 안 밀림 */
.test-grid + .adfit { justify-content: flex-start; } /* 허브: 카드 그리드가 왼쪽부터 채워지니 광고도 왼쪽 줄에 맞춤 */
.btn-big { min-height: 64px; font-size: var(--fs-lg); }
/* 건너뛰기: 글자 링크. 숨긴 것처럼 보이지 않게 글씨·대비·누를 자리는 충분히 */
.skip-link { display: block; min-height: 44px; margin: var(--s2) auto 0; padding: 10px var(--s4); border: 0; background: none; color: var(--text); font: inherit; font-size: var(--fs-sm); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.gate { display: flex; flex-direction: column; gap: var(--s3); }
/* 아래 고정 배너 (config.adfitAnchor). 본문이 가려지지 않게 body 아래 여백 */
body:has(.ad-anchor:not([hidden])) { padding-bottom: 64px; }
.ad-anchor { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: center; padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); background: rgba(11, 16, 36, .96); border-top: 1px solid var(--line); min-height: calc(var(--ad-h, 50px) + 12px); }
.ad-anchor-close { position: absolute; right: var(--s2); top: -26px; width: 26px; height: 26px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: rgba(11, 16, 36, .96); color: var(--muted); font: inherit; line-height: 1; cursor: pointer; }

/* 카드 미리보기 (공유 시트가 안 될 때: 길게 눌러 저장 / 내려받기) */
.card-preview { position: fixed; inset: 0; z-index: 100; overflow: auto; padding: var(--s4); background: rgba(8, 11, 26, .96); text-align: center; }
.card-preview img { display: block; width: min(100%, 360px); height: auto; margin: var(--s2) auto var(--s3); border-radius: var(--r-md); }
.card-preview .btn { max-width: 360px; margin: var(--s2) auto; }

/* 카드 이미지 원본 (화면 밖, 1080×1920). 위 절반 = 별자리, 아래 = 글자. 픽셀 고정이라 토큰 대신 px */
.share-card { position: fixed; left: -10000px; top: 0; width: 1080px; height: 1920px; overflow: hidden; color: var(--text); font-family: var(--font); letter-spacing: -.02em; word-break: keep-all;
  background: linear-gradient(180deg, #0b1745 0%, #06103a 35%, #030a26 70%, var(--sky-deep) 100%); }
.share-card p { margin: 0; }
.sc-sky { position: absolute; inset: 0; width: 1080px; height: 1920px; }
.sc-art { position: absolute; left: 0; top: 0; width: 1080px; height: 860px; }
.sc-constellation { width: 1080px; height: 860px; display: block; }
.sc-body { position: absolute; left: 0; right: 0; top: 780px; bottom: 0; display: flex; flex-direction: column; align-items: center; padding: 0 100px 72px; text-align: center; }
.sc-hanja { font-size: 34px; color: var(--muted); letter-spacing: .6em; padding-left: .6em; }
.sc-name { margin-top: 18px !important; font-size: 156px; font-weight: 800; line-height: 1.05; letter-spacing: -.05em; color: #fbf3dc; }
.sc-name small { font-size: 92px; font-weight: 700; color: var(--primary); margin-left: 4px; }
.sc-nick { margin-top: 20px !important; font-size: 54px; font-weight: 600; }
.sc-element { margin-top: 28px !important; font-size: 32px; color: var(--muted); }
.sc-element b { color: var(--accent, var(--text)); font-weight: 650; }
.sc-dual { margin-top: 28px !important; font-size: 32px; color: var(--starlight); }
.sc-tags { margin-top: 28px !important; font-size: 34px; color: var(--muted); }
.sc-foot { margin-top: auto; padding-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sc-logo { display: flex; align-items: center; gap: 12px; font-size: 38px; font-weight: 800; letter-spacing: -.03em; }
.sc-logo svg { width: 26px; height: 26px; fill: var(--primary); }
.sc-site { font-size: 30px; color: var(--muted); }
.sc-site em { font-style: normal; color: var(--primary); }

@media (min-width: 600px) {
  .wrap { padding-top: var(--s12); }
  h1.display { font-size: 2.75rem; }
}

/* ── 공유 시트 (06-화면-기획.md F). 버튼 1개 → 아래에서 올라옴. 열려 있으면 아래 고정 광고도 덮음 ── */
.share-row { margin: var(--s4) 0 0; }
.sheet { position: fixed; inset: 0; z-index: 90; } /* 아래 고정 광고(50) 위, 카드 미리보기(100) 아래 */
.sheet-dim { position: absolute; inset: 0; background: var(--scrim); animation: sheet-fade .2s ease; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: var(--content); margin: 0 auto; box-sizing: border-box;
  padding: 10px var(--s5) calc(var(--s6) + env(safe-area-inset-bottom)); border-radius: var(--r-sheet) var(--r-sheet) 0 0; background: var(--surface);
  animation: sheet-up .24s cubic-bezier(.2, .8, .2, 1); }
.sheet-handle { width: 36px; height: 4px; margin: 0 auto var(--s5); border-radius: var(--r-pill); background: var(--line-strong); }
.sheet h2 { margin: 0 0 var(--s5); font-size: var(--fs-lg); }
/* 한 줄 4칸, 넘치면 다음 줄 가운데 */
.share-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s3) var(--s2); }
.share-item { flex: 0 0 calc((100% - 3 * var(--s2)) / 4); display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s1) 0; border: 0; background: none; color: var(--muted); font: 500 var(--fs-xs)/1.3 var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.share-ic { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: var(--surface-2); color: var(--primary); transition: background-color .15s, transform .1s; }
.share-ic svg { width: 24px; height: 24px; }
.share-item:hover .share-ic { background: var(--surface-3); }
.share-item:active .share-ic { transform: scale(.94); }
.share-item:focus-visible { outline: none; }
.share-item:focus-visible .share-ic { box-shadow: var(--focus); }
.share-kakao .share-ic { background: var(--kakao); color: var(--on-kakao); }
.share-kakao:hover .share-ic { background: var(--kakao-hover); }
.share-line .share-ic { background: var(--brand-line); color: var(--on-brand-line); }
.share-line:hover .share-ic { background: var(--brand-line-hover); }
.share-x .share-ic { background: var(--brand-x); color: var(--on-brand-x); box-shadow: inset 0 0 0 1px var(--line); }
.share-x:hover .share-ic { background: var(--brand-x-hover); }
.share-item.done .share-label { color: var(--success); }
/* PC(마우스)에서만: 카카오 웹 공유는 카카오 로그인을 요구함. 폰은 앱으로 바로 열려서 안내 숨김 */
.share-hint { display: none; margin: var(--s4) 0 0; color: var(--faint); font-size: var(--fs-xs); text-align: center; }
@media (hover: hover) and (pointer: fine) { .share-hint { display: block; } }
.sheet-close { margin-top: var(--s5); }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet-panel, .sheet-dim { animation: none; } }
body.sheet-open { overflow: hidden; }

/* ── 결과 아래: 친구 케미 구역 · 다른 테스트 · 글자 링크 ── */
.friend { margin: var(--s10) 0 0; text-align: center; }
.friend h2 { margin: 0 0 var(--s2); font-size: var(--fs-xl); }
.friend p { margin: 0 0 var(--s5); color: var(--muted); font-size: var(--fs-sm); }
.more-tests { margin: var(--s10) 0 0; }
.more-tests h2 { margin: 0 0 var(--s4); font-size: var(--fs-lg); }
.more-links { display: flex; justify-content: center; align-items: center; gap: var(--s3); margin: var(--s8) 0 var(--s4); font-size: var(--fs-sm); }
.more-links a { color: var(--muted); text-decoration: none; padding: 10px var(--s1); }
.more-links a:hover { color: var(--text); }
.more-links span { color: var(--faint); }

/* ── 설문 결과: 내 1순위 · 체크리스트 ── */
.pick { margin: 0 0 var(--s2); display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); }
.pick span { font-size: var(--fs-sm); font-weight: 700; color: var(--muted); }
.pick strong { font-size: var(--fs-3xl); font-weight: 900; line-height: 1.2; letter-spacing: -.04em; background: linear-gradient(transparent 58%, var(--highlight) 58%); }

/* ── 테스트별 색 테마 (survey JSON "theme"). 토큰만 갈아 끼움 ── */
/* omr: 수능 답안지 — 크림 종이 + 빨간 칸 + 노란 형광펜 */
[data-theme="omr"] {
  --bg: #fbf6ea;
  --surface: #fffdf7;
  --surface-2: #f6ead6;
  --surface-3: #efdfc4;
  --line: #ecd3cc;
  --line-strong: #e2a3ae;
  --text: #1d1a16;
  --muted: #5f574d;
  --faint: #7d7368;
  --primary: #c8334f;
  --primary-hover: #a82a43;
  --on-primary: #ffffff;
  --primary-soft: rgba(200, 51, 79, .08);
  --scrim: rgba(40, 28, 20, .45);
  --shadow: 0 10px 30px rgba(120, 60, 40, .12);
  --highlight: #ffd84d;
}
body[data-theme="omr"] { background-image: none; }
[data-theme="omr"] .ad-anchor, [data-theme="omr"] .ad-anchor-close { background: var(--surface); }
[data-theme="omr"] .site-header { background: var(--bg); border-bottom-color: var(--line-strong); }
[data-theme="omr"] .options .btn { box-shadow: inset 0 0 0 2px var(--line); }
[data-theme="omr"] .options .btn:hover { box-shadow: inset 0 0 0 2px var(--line-strong); }

/* ── 설문 결과: 순위 (1위 이거!!! → 2·3위 순서대로) ── */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.rank-list li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--surface-2); }
.rank-list b { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); font-size: var(--fs-sm); font-weight: 800; }
.rank-list strong, .rank-list a { font-size: var(--fs-lg); font-weight: 800; color: var(--text); }
.rank-list li:first-child { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.rank-list li:first-child strong { background: linear-gradient(transparent 58%, var(--highlight) 58%); }
.rank-list span { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); text-align: right; }
.rank-list a { text-decoration: none; }

/* ── 설문 시작 화면: D-day · 결과 미리보기 쪽지 · 한 줄 안내 ── */
.dday { align-self: flex-start; margin: 0 0 var(--s4); padding: var(--s1) var(--s4); border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font-size: var(--fs-sm); font-weight: 800; }
.survey-start h1.display { font-size: 2.75rem; letter-spacing: -.045em; margin-bottom: var(--s3); }
.pick-note { margin: var(--s6) var(--s1) var(--s2); padding: var(--s5); border-radius: var(--r-lg); background: var(--surface); border: 2px solid var(--primary); box-shadow: var(--shadow); transform: rotate(-1.2deg); }
.pick-note-head { margin: 0 0 var(--s2); padding-bottom: var(--s2); border-bottom: 2px solid var(--primary); color: var(--primary); font-weight: 800; }
.start-meta { margin: var(--s3) 0 0; text-align: center; font-size: var(--fs-sm); color: var(--muted); }
.pick-note { padding: var(--s4); }
.survey-start .lead { margin-bottom: var(--s5); }
/* 쪽지 안 목록은 알약(칩)으로 촘촘히 → 결과가 많아도 시작 버튼이 첫 화면에 */

/* sale: 블랙프라이데이 — 새까만 바탕 + 형광 노랑 가격표 */
[data-theme="sale"] {
  --bg: #121212;
  --surface: #1c1c1c;
  --surface-2: #262626;
  --surface-3: #313131;
  --line: #343434;
  --line-strong: #5a5a5a;
  --text: #f6f6f6;
  --muted: #bdbdbd;
  --faint: #8f8f8f;
  --primary: #ffe14d;
  --primary-hover: #fff07a;
  --on-primary: #121212;
  --primary-soft: rgba(255, 225, 77, .1);
  --scrim: rgba(0, 0, 0, .7);
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  --highlight: transparent; /* 검정 위 반투명 노랑은 탁해 보여서 → 글자를 노랑으로 */
}
body[data-theme="sale"] { background-image: none; }
[data-theme="sale"] .site-header { background: var(--bg); }
[data-theme="sale"] .ad-anchor, [data-theme="sale"] .ad-anchor-close { background: var(--surface); }
[data-theme="sale"] .options .btn { box-shadow: inset 0 0 0 1px var(--line-strong); }
[data-theme="sale"] .options .btn:hover { box-shadow: inset 0 0 0 2px var(--primary); }
[data-theme="sale"] .pick strong, [data-theme="sale"] .rank-list li:first-child strong { color: var(--primary); }
/* 순위 줄: 이름은 한 줄로, 유형 이름은 작게 오른쪽 */
.rank-list strong, .rank-list a { min-width: 0; font-size: var(--fs-md); }
.rank-list span { flex: none; white-space: nowrap; }
[data-theme="sale"] .pick strong { font-size: var(--fs-xl); }

/* cocoa: 겨울 간식 — 따뜻한 코코아 갈색 + 붕어빵 주황 */
[data-theme="cocoa"] {
  --bg: #2b1d16;
  --surface: #382820;
  --surface-2: #45322a;
  --surface-3: #523c32;
  --line: #4e3a30;
  --line-strong: #7a5d4f;
  --text: #fff4ea;
  --muted: #e0c9b8;
  --faint: #b39a88;
  --primary: #ffb35c;
  --primary-hover: #ffc884;
  --on-primary: #2b1d16;
  --primary-soft: rgba(255, 179, 92, .12);
  --scrim: rgba(20, 12, 8, .7);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --highlight: transparent; /* 어두운 바탕 → 형광펜 대신 글자색 */
}
body[data-theme="cocoa"] { background-image: none; }
[data-theme="cocoa"] .site-header { background: var(--bg); }
[data-theme="cocoa"] .ad-anchor, [data-theme="cocoa"] .ad-anchor-close { background: var(--surface); }
[data-theme="cocoa"] .options .btn { box-shadow: inset 0 0 0 1px var(--line-strong); }
[data-theme="cocoa"] .options .btn:hover { box-shadow: inset 0 0 0 2px var(--primary); }
[data-theme="cocoa"] .pick strong { font-size: var(--fs-xl); }
[data-theme="cocoa"] .pick strong, [data-theme="cocoa"] .rank-list li:first-child strong { color: var(--primary); }


/* chat: 채팅방 — 색만이 아니라 화면 구성이 다름.
   질문 = 상대가 보낸 말풍선(왼쪽), 보기 = 내가 보내는 답장(오른쪽), 로딩 = 입력 중 점 세 개 */
[data-theme="chat"] {
  --bg: #efe9f4;
  --surface: #ffffff;
  --surface-2: #f6f1f9;
  --surface-3: #ebe3f1;
  --line: #e2d7ea;
  --line-strong: #c9b6d6;
  --text: #2a1f33;
  --muted: #6c5c78;
  --faint: #8f80a0;
  --primary: #e8437a;
  --primary-hover: #d03268;
  --on-primary: #ffffff;
  --primary-soft: rgba(232, 67, 122, .1);
  --scrim: rgba(40, 20, 50, .45);
  --shadow: 0 6px 18px rgba(60, 30, 80, .1);
  --highlight: rgba(232, 67, 122, .2);
  --r-bubble: 22px;
}
body[data-theme="chat"] { background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 18px 18px; background-repeat: repeat; }
[data-theme="chat"] .site-header { background: var(--surface); border-bottom-color: var(--line); }
[data-theme="chat"] .ad-anchor, [data-theme="chat"] .ad-anchor-close { background: var(--surface); }

/* 말풍선 공통 */
.bubble { display: block; width: fit-content; max-width: 82%; margin: 0 0 var(--s2); padding: 10px 16px; font-size: var(--fs-md); line-height: 1.5; border-radius: var(--r-bubble, 20px); box-shadow: var(--shadow); }
.bubble.in { background: var(--surface); color: var(--text); border-bottom-left-radius: 6px; }
.bubble.out { margin-left: auto; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 6px; }
.chat-intro { position: relative; margin: 0 0 var(--s6); padding-left: 44px; }
.chat-intro::before { content: ""; position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--line-strong)); }
.chat-pair { margin: var(--s5) 0; }

/* 시작 화면 */
[data-theme="chat"] .survey-start h1.display { font-size: var(--fs-2xl); }
[data-theme="chat"] .btn-primary { border-radius: var(--r-pill); }
[data-theme="chat"] .pick-note { transform: none; border: 0; border-radius: var(--r-bubble); }
[data-theme="chat"] .pick-note-head { border-bottom: 1px solid var(--line); }

/* 질문 = 상대 말풍선 */
[data-theme="chat"] .progress-row { justify-content: center; }
[data-theme="chat"] .progress { color: var(--faint); font-weight: 600; }
[data-theme="chat"] .progress-bar { flex: 0 0 120px; height: 4px; }
[data-theme="chat"] .screen-title { position: relative; width: fit-content; max-width: 86%; margin: 0 0 var(--s6) 44px; padding: 14px 18px; background: var(--surface); border-radius: var(--r-bubble); border-bottom-left-radius: 6px; box-shadow: var(--shadow); font-size: var(--fs-lg); line-height: 1.45; }
[data-theme="chat"] .screen-title::before { content: ""; position: absolute; left: -44px; bottom: 0; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--line-strong)); }
/* 보기 = 내 답장 (오른쪽 분홍 말풍선) */
[data-theme="chat"] .options { align-items: flex-end; gap: var(--s2); }
[data-theme="chat"] .options .btn { width: fit-content; max-width: 86%; min-height: 0; padding: 12px 18px; text-align: left; border-radius: var(--r-bubble); border-bottom-right-radius: 6px; background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--primary); font-weight: 600; }
[data-theme="chat"] .options .btn:hover, [data-theme="chat"] .options .btn:active { background: var(--primary); color: var(--on-primary); }

/* 로딩 = 입력 중… */
[data-theme="chat"] .orbit { width: 76px; height: 42px; border: 0; border-radius: var(--r-bubble); background: var(--surface); box-shadow: var(--shadow); animation: none; }
[data-theme="chat"] .orbit::before, [data-theme="chat"] .orbit::after, [data-theme="chat"] .orbit span { content: ""; position: absolute; inset: auto; top: 17px; width: 8px; height: 8px; margin: 0; border-radius: 50%; background: var(--faint); box-shadow: none; animation: chat-dot 1s ease-in-out infinite; }
[data-theme="chat"] .orbit::before { left: 20px; }
[data-theme="chat"] .orbit span { left: 34px; animation-delay: .15s; }
[data-theme="chat"] .orbit::after { left: 48px; animation-delay: .3s; }
@keyframes chat-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* 결과 */
[data-theme="chat"] .pick strong { font-size: var(--fs-xl); }
[data-theme="chat"] .read-card { border: 0; border-radius: var(--r-bubble); box-shadow: var(--shadow); }
[data-theme="chat"] .rank-list li { background: var(--surface-2); border-radius: var(--r-bubble); }
[data-theme="chat"] .rank-list li:first-child { background: var(--primary-soft); }
[data-theme="chat"] .links li { border: 0; border-radius: var(--r-bubble); box-shadow: var(--shadow); }

/* ── 퀴즈쇼 (type: quiz): 정답 공개 · 맞힌 개수 · 정답 노트 ── */
.quiz-tally { margin: 0 0 var(--s2); font-size: var(--fs-sm); font-weight: 800; color: var(--primary); }
body .options .btn.is-correct { background: var(--success-soft); box-shadow: inset 0 0 0 2px var(--success); color: var(--text); opacity: 1; font-weight: 800; }
body .options .btn.is-wrong { background: var(--error-soft); box-shadow: inset 0 0 0 2px var(--error); color: var(--text); opacity: 1; text-decoration: line-through; }
.options .btn.is-correct::after { content: "O"; margin-left: auto; padding-left: var(--s3); color: var(--success); font-weight: 900; }
.options .btn.is-wrong::after { content: "X"; margin-left: auto; padding-left: var(--s3); color: var(--error); font-weight: 900; }
.quiz-feedback { margin-top: var(--s5); padding: var(--s5); border-radius: var(--r-lg); background: var(--surface); display: grid; gap: var(--s3); }
.quiz-verdict { margin: 0; font-size: var(--fs-xl); font-weight: 900; letter-spacing: -.03em; }
.quiz-verdict[data-ok="1"] { color: var(--success); }
.quiz-verdict[data-ok="0"] { color: var(--error); }
.quiz-explain { margin: 0; color: var(--muted); }
.quiz-tiers ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.quiz-tiers li { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); font-weight: 700; color: var(--text); }
.quiz-tiers li b { flex: none; color: var(--primary); font-weight: 800; }
.quiz-score strong { font-size: var(--fs-3xl); }
.quiz-note summary { cursor: pointer; list-style: none; }
.quiz-note summary::-webkit-details-marker { display: none; }
.quiz-note summary h3 { display: inline; }
.quiz-note summary::after { content: " ▾"; color: var(--muted); }
.quiz-note[open] summary::after { content: " ▴"; }
.quiz-note ol { list-style: none; margin: var(--s4) 0 0; padding: 0; counter-reset: qn; }
.quiz-note li { position: relative; padding: var(--s3) 0 var(--s3) 40px; border-bottom: 1px dashed var(--line); counter-increment: qn; }
.quiz-note li:last-child { border-bottom: 0; }
.quiz-note .qn-mark { position: absolute; left: 0; top: var(--s3); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: var(--fs-sm); font-weight: 900; color: var(--muted); }
.quiz-note .qn-mark:empty::before { content: counter(qn); }
.quiz-note li[data-ok="1"] .qn-mark { background: var(--success-soft); color: var(--success); }
.quiz-note li[data-ok="0"] .qn-mark { background: var(--error-soft); color: var(--error); }
.quiz-note p { margin: 0; }
.quiz-note .qn-q { font-weight: 700; color: var(--text); }
.quiz-note .qn-a { margin-top: var(--s1); font-weight: 800; color: var(--primary); }
.quiz-note .qn-x { margin-top: var(--s1); font-size: var(--fs-sm); color: var(--muted); }

/* show: 퀴즈쇼 무대 — 깊은 남보라 + 전광판 노랑 + 정답 초록·오답 빨강 */
[data-theme="show"] {
  --bg: #151238;
  --surface: #211c52;
  --surface-2: #2b2566;
  --surface-3: #362f7a;
  --line: #3a3480;
  --line-strong: #5a52b0;
  --text: #f7f5ff;
  --muted: #c3bfe8;
  --faint: #9590c8;
  --primary: #ffd23f;
  --primary-hover: #ffe070;
  --on-primary: #151238;
  --primary-soft: rgba(255, 210, 63, .12);
  --success: #3ee08f;
  --success-soft: rgba(62, 224, 143, .16);
  --error: #ff6b6b;
  --error-soft: rgba(255, 107, 107, .16);
  --scrim: rgba(8, 6, 28, .72);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --highlight: transparent; /* 어두운 바탕 → 형광펜 대신 글자색 */
}
body[data-theme="show"] { background-image: none; }
[data-theme="show"] .site-header { background: var(--bg); }
[data-theme="show"] .ad-anchor, [data-theme="show"] .ad-anchor-close { background: var(--surface); }
[data-theme="show"] .options .btn { box-shadow: inset 0 0 0 1px var(--line-strong); }
[data-theme="show"] .options .btn:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--primary); }
[data-theme="show"] .pick strong { color: var(--primary); }

/* weather: 날씨 앱 — 하늘색 + 눈송이. 결과 이름을 기온처럼 크게, 보기는 2×2 예보 타일, 로딩은 구름에서 눈 */
[data-theme="weather"] {
  --bg: #dcecfb;
  --surface: #ffffff;
  --surface-2: #eef6fd;
  --surface-3: #e1eefb;
  --line: #cfe2f5;
  --line-strong: #9cc3e6;
  --text: #10304d;
  --muted: #46698a;
  --faint: #6f8ca8;
  --primary: #2f7fd8;
  --primary-hover: #1f6cc2;
  --on-primary: #ffffff;
  --primary-soft: rgba(47, 127, 216, .1);
  --scrim: rgba(16, 48, 77, .4);
  --shadow: 0 8px 22px rgba(31, 90, 150, .12);
  --highlight: rgba(47, 127, 216, .18);
}
body[data-theme="weather"] {
  background-color: var(--bg);
  background-image: radial-gradient(var(--surface) 1.6px, transparent 2px), radial-gradient(var(--surface) 1px, transparent 1.4px), linear-gradient(180deg, var(--surface-2), var(--bg) 60%);
  background-size: 46px 46px, 23px 23px, 100% 100%;
  background-position: 0 0, 11px 17px, 0 0;
  background-repeat: repeat, repeat, no-repeat;
}
[data-theme="weather"] .site-header { background: var(--surface-2); border-bottom-color: var(--line); }
[data-theme="weather"] .ad-anchor, [data-theme="weather"] .ad-anchor-close { background: var(--surface); }
[data-theme="weather"] .btn-primary { border-radius: var(--r-lg); }

/* 시작: 예보 쪽지 = 가로 타일 4칸 */
[data-theme="weather"] .pick-note { transform: none; border: 0; border-radius: var(--r-lg); }
[data-theme="weather"] .pick-note-head { border-bottom: 1px solid var(--line); }

/* 질문 카드 + 보기 2×2 예보 타일 */
[data-theme="weather"] .screen-title { padding: var(--s5); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); font-size: var(--fs-lg); }
[data-theme="weather"] .options { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
[data-theme="weather"] .options .btn { flex-direction: column; justify-content: center; min-height: 112px; padding: var(--s4) var(--s3); text-align: center; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); font-size: var(--fs-sm); font-weight: 600; line-height: 1.45; }
[data-theme="weather"] .options .btn:hover, [data-theme="weather"] .options .btn:active { background: var(--primary); color: var(--on-primary); }
[data-theme="weather"] .progress-bar { height: 8px; background: var(--surface); }

/* 로딩: 구름 + 내리는 눈 */
[data-theme="weather"] .orbit { width: 96px; height: 46px; border: 0; border-radius: 30px; background: var(--surface); box-shadow: var(--shadow); animation: none; }
[data-theme="weather"] .orbit::before, [data-theme="weather"] .orbit::after, [data-theme="weather"] .orbit span { content: ""; position: absolute; inset: auto; top: 50px; width: 7px; height: 7px; margin: 0; border-radius: 50%; background: var(--line-strong); box-shadow: none; animation: snow-fall 1.2s linear infinite; }
[data-theme="weather"] .orbit::before { left: 26px; }
[data-theme="weather"] .orbit span { left: 46px; animation-delay: .4s; }
[data-theme="weather"] .orbit::after { left: 66px; animation-delay: .8s; }
@keyframes snow-fall { from { transform: translateY(0); opacity: 1; } to { transform: translateY(40px); opacity: 0; } }

/* 결과: 이름을 기온처럼 크게 */
[data-theme="weather"] .survey-result h1 { font-size: 3.25rem; font-weight: 900; letter-spacing: -.05em; color: var(--primary); }
[data-theme="weather"] .pick { margin-bottom: var(--s1); }
[data-theme="weather"] .pick strong { font-size: var(--fs-lg); }
[data-theme="weather"] .read-card { border: 0; box-shadow: var(--shadow); }
[data-theme="weather"] .links li { border: 0; box-shadow: var(--shadow); }

/* forest: 숲속 그림책 — 종이 바탕 + 숲 초록 + 손으로 그린 듯한 삐뚤한 테두리(--r-sketch) + 바느질 점선.
   질문 = 그림책 한 장(동그란 그림 + 문장), 보기 = 쪽지, 로딩 = 잠자는 Zzz */
[data-theme="forest"] {
  --bg: #f3ecd8;
  --surface: #fffaf0;
  --surface-2: #ece2c6;
  --surface-3: #e3d6b2;
  --line: #d6c79f;
  --line-strong: #6b7f4a;
  --text: #3b2f1e;
  --muted: #6b5a40;
  --faint: #8a7a5c;
  --primary: #4f7a3a;
  --primary-hover: #3f6a2c;
  --on-primary: #fffaf0;
  --primary-soft: rgba(79, 122, 58, .12);
  --scrim: rgba(59, 47, 30, .45);
  --shadow: 0 6px 0 var(--surface-3);
  --highlight: rgba(79, 122, 58, .2);
  --r-sketch: 255px 18px 225px 18px / 18px 225px 18px 255px;
}
body[data-theme="forest"] { background-image: radial-gradient(var(--line) 1px, transparent 1.2px); background-size: 26px 26px; background-repeat: repeat; }
[data-theme="forest"] .site-header { background: var(--bg); border-bottom: 2px dashed var(--line-strong); }
[data-theme="forest"] .ad-anchor, [data-theme="forest"] .ad-anchor-close { background: var(--surface); }
[data-theme="forest"] .btn-primary { border-radius: var(--r-sketch); border: 2px solid var(--line-strong); }
[data-theme="forest"] .pick-note { transform: none; border: 2px dashed var(--line-strong); border-radius: var(--r-sketch); box-shadow: none; }
[data-theme="forest"] .pick-note-head { color: var(--primary); border-bottom: 2px dashed var(--line); }
[data-theme="forest"] .pick-chips li { background: var(--surface-2); }
/* 질문 = 그림책 한 장 */
[data-theme="forest"] .q-art { width: 150px; height: 150px; border: 3px solid var(--line-strong); border-radius: var(--r-sketch); background: var(--surface); box-shadow: var(--shadow); font-size: 80px; }
[data-theme="forest"] .screen-title { text-align: center; font-size: var(--fs-xl); }
[data-theme="forest"] .progress-bar { height: 10px; border: 2px solid var(--line-strong); background: var(--surface); }
[data-theme="forest"] .options .btn { justify-content: center; text-align: center; border: 2px solid var(--line-strong); border-radius: var(--r-sketch); background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }
[data-theme="forest"] .options .btn:hover, [data-theme="forest"] .options .btn:active { background: var(--primary); color: var(--on-primary); }
/* 로딩 = 잠자는 Zzz */
[data-theme="forest"] .orbit { width: 90px; height: 90px; border: 3px solid var(--line-strong); border-radius: var(--r-sketch); background: var(--surface); animation: none; }
[data-theme="forest"] .orbit::before, [data-theme="forest"] .orbit::after, [data-theme="forest"] .orbit span { content: "z"; position: absolute; inset: auto; width: auto; height: auto; margin: 0; border-radius: 0; background: none; box-shadow: none; color: var(--primary); font-weight: 900; animation: zzz 1.8s ease-in infinite; }
[data-theme="forest"] .orbit::before { left: 22px; top: 40px; font-size: 18px; }
[data-theme="forest"] .orbit span { left: 40px; top: 30px; font-size: 24px; animation-delay: .4s; }
[data-theme="forest"] .orbit::after { left: 58px; top: 18px; font-size: 30px; animation-delay: .8s; }
@keyframes zzz { 0% { opacity: 0; transform: translateY(8px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
/* 결과 = 그림책 표지 */
[data-theme="forest"] .char-card { border: 3px solid var(--line-strong); border-radius: var(--r-sketch); background: var(--surface); box-shadow: var(--shadow); }
[data-theme="forest"] .char-quote { border: 2px solid var(--line-strong); }
[data-theme="forest"] .char-quote::before { border-bottom-color: var(--line-strong); }
[data-theme="forest"] .read-card { border: 2px dashed var(--line-strong); border-radius: var(--r-sketch); }
[data-theme="forest"] .mate { border: 2px solid var(--line-strong); border-radius: var(--r-sketch); }

/* gift: 크리스마스 선물 포장 — 빨간 포장지 줄무늬 + 금색 리본 + 크라프트 선물 태그(--tag).
   질문 = 리본 두른 선물 상자, 보기 = 구멍 뚫린 선물 태그, 로딩 = 흔들리는 상자, 결과 = 트리에 매단 오너먼트 + 사랑의 언어 그래프(사탕 지팡이 막대) */
[data-theme="gift"] {
  --bg: #9e1f30;
  --surface: #8a1828;
  --surface-2: #b22b3d;
  --surface-3: #c23a4b;
  --line: #c4505e;
  --line-strong: #f2c96b;
  --text: #fff7ea;
  --muted: #ffe0d6;
  --faint: #f4b7ad;
  --primary: #f5c84c;
  --primary-hover: #ffdc7a;
  --on-primary: #5a1414;
  --primary-soft: rgba(245, 200, 76, .2);
  --highlight: rgba(245, 200, 76, .35);
  --scrim: rgba(40, 6, 12, .6);
  --shadow: 0 6px 0 #6e1220;
  --tag: #f6e7c8;      /* 크라프트 선물 태그 면 */
  --tag-2: #ead2a4;    /* 태그 위 칩·눌림 */
  --on-tag: #4b2a14;   /* 태그 위 글자 */
  --stripe: rgba(255, 255, 255, .05); /* 포장지 줄무늬 */
}
body[data-theme="gift"] { background-image: repeating-linear-gradient(135deg, transparent 0 22px, var(--stripe) 22px 44px); background-size: auto; background-repeat: repeat; }
[data-theme="gift"] .site-header { background: var(--bg); border-bottom: 3px solid var(--primary); }
[data-theme="gift"] .ad-anchor, [data-theme="gift"] .ad-anchor-close { background: var(--surface); }
[data-theme="gift"] .btn-primary { box-shadow: var(--shadow); }
/* 시작 화면: 결과 미리보기 = 크라프트 선물 태그 (왼쪽 구멍 + 금색 끈) */
[data-theme="gift"] .pick-note { position: relative; padding-left: 44px; background: var(--tag) radial-gradient(circle at 22px 30px, var(--bg) 0 6px, transparent 7px) no-repeat; color: var(--on-tag); border: 0; border-radius: var(--r-sm); box-shadow: var(--shadow); transform: rotate(1deg); }
[data-theme="gift"] .pick-note::before { content: ""; position: absolute; left: -14px; top: 28px; width: 40px; height: 3px; background: var(--primary); transform: rotate(-20deg); }
[data-theme="gift"] .pick-note-head { color: var(--on-tag); border-bottom: 2px dashed var(--tag-2); }
[data-theme="gift"] .pick-chips li { background: var(--tag-2); color: var(--on-tag); }
/* 질문 = 리본 두른 선물 상자 (가운데 크라프트 스티커 위에 그림) */
[data-theme="gift"] .q-art { position: relative; width: 150px; height: 140px; margin-top: var(--s8); border-radius: var(--r-sm); font-size: 60px;
  background: radial-gradient(circle, var(--tag) 0 42px, var(--primary) 43px 48px, transparent 49px), linear-gradient(90deg, transparent 44%, var(--primary) 44% 56%, transparent 56%), linear-gradient(transparent 44%, var(--primary) 44% 56%, transparent 56%), var(--surface-2); }
[data-theme="gift"] .q-art::before { content: "🎀"; position: absolute; top: -30px; left: 50%; margin-left: -24px; font-size: 48px; letter-spacing: 0; }
[data-theme="gift"] .screen-title { text-align: center; font-size: var(--fs-xl); }
[data-theme="gift"] .progress-bar { height: 10px; border: 2px solid var(--primary); background: transparent; }
/* 보기 = 선물 태그: 크라프트 면 + 왼쪽 구멍 + 금색 끈 */
[data-theme="gift"] .options .btn { position: relative; overflow: visible; padding-left: 46px; border-radius: var(--r-sm); background: var(--tag) radial-gradient(circle at 22px 50%, var(--bg) 0 6px, transparent 7px) no-repeat; color: var(--on-tag); box-shadow: var(--shadow); font-weight: 650; }
[data-theme="gift"] .options .btn::before { content: ""; position: absolute; left: -10px; top: 50%; width: 30px; height: 3px; background: var(--primary); }
[data-theme="gift"] .options .btn:hover, [data-theme="gift"] .options .btn:active { background-color: var(--primary); color: var(--on-primary); }
/* 로딩 = 흔들리는 선물 상자 */
[data-theme="gift"] .orbit { width: 96px; height: 86px; margin-top: var(--s12); border: 0; border-radius: var(--r-sm); background: linear-gradient(90deg, transparent 42%, var(--primary) 42% 58%, transparent 58%), linear-gradient(transparent 42%, var(--primary) 42% 58%, transparent 58%), var(--surface-2); animation: giftshake .9s ease-in-out infinite; }
[data-theme="gift"] .orbit::before { content: "🎀"; inset: -30px auto auto 50%; width: auto; height: auto; margin-left: -22px; border-radius: 0; background: none; box-shadow: none; font-size: 44px; line-height: 1; }
[data-theme="gift"] .orbit span { display: none; }
@keyframes giftshake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(2deg); } }
/* 결과 = 트리에 매단 오너먼트: 위에 테스트 이름 태그 → 끈 → 금색 공 → 크라프트 태그 한마디 */
[data-theme="gift"] .survey-result { display: flex; flex-direction: column; }
[data-theme="gift"] .survey-result > .eyebrow { order: -1; align-self: center; margin: 0; padding: 4px 14px; border-radius: var(--r-pill); background: var(--tag); color: var(--on-tag); font-weight: 800; }
[data-theme="gift"] .char-card { width: 190px; height: 190px; margin: 72px auto var(--s4); background: radial-gradient(circle at 34% 28%, var(--primary-hover), var(--primary) 55%, var(--line-strong)); box-shadow: inset -10px -12px 0 rgba(0, 0, 0, .12), var(--shadow); }
[data-theme="gift"] .char-card::before { top: -20px; right: auto; left: 50%; width: 46px; height: 24px; margin-left: -23px; clip-path: none; border-radius: 6px 6px 3px 3px; background: var(--tag-2); box-shadow: inset 0 -4px 0 var(--faint); }
[data-theme="gift"] .char-card::after { top: -72px; bottom: auto; left: 50%; width: 3px; height: 54px; margin-left: -1px; clip-path: none; background: var(--primary); }
[data-theme="gift"] .char-quote { padding-left: 34px; border-radius: var(--r-sm); background: var(--tag) radial-gradient(circle at 16px 50%, var(--bg) 0 5px, transparent 6px) no-repeat; color: var(--on-tag); }
[data-theme="gift"] .char-quote::before { border-bottom-color: var(--tag); }
[data-theme="gift"] .read-card { border: 2px dashed var(--primary); }
[data-theme="gift"] .graph-bar { background: var(--surface-2); }
[data-theme="gift"] .graph-bar i { background: var(--faint); }
[data-theme="gift"] .graph-bars li.top .graph-bar i { background: repeating-linear-gradient(135deg, var(--primary) 0 8px, var(--text) 8px 16px); }
[data-theme="gift"] .keyword-tags li { padding-left: 24px; border-radius: 4px; background: var(--tag) radial-gradient(circle at 11px 50%, var(--surface) 0 3px, transparent 4px) no-repeat; color: var(--on-tag); }
[data-theme="gift"] .keyword-tags li:nth-child(3n+1) { background-color: var(--primary); color: var(--on-primary); }
[data-theme="gift"] .mate { border: 2px solid var(--primary); }
[data-theme="gift"] .mate-emoji { background: radial-gradient(circle at 34% 28%, var(--primary-hover), var(--primary) 60%); }
/* dict: 국어사전 한 쪽 — 얇은 사전 종이 + 사전 남색 + 빨간펜 채점.
   질문 = 표제어(왼쪽 남색 막대 + 겹줄), 보기 = 뜻풀이 번호 ①②③④ 줄, 정답 = 빨간펜 동그라미, 오답 = 연필 줄긋기,
   정답 공개 = 채점 도장, 로딩 = 책장 넘김, 결과 = 빨간 점수 도장 + 표제어 + 번호 뜻풀이. 오른쪽 끝에 손톱 색인 */
[data-theme="dict"] {
  --bg: #f4f1e8;
  --surface: #fffdf8;
  --surface-2: #ebe6d8;
  --surface-3: #e0d9c6;
  --line: #d9d2bf;
  --line-strong: #8b93a8;
  --text: #1c2333;
  --muted: #4b5266;
  --faint: #6c7184;
  --primary: #1f3a8a;
  --primary-hover: #172e70;
  --on-primary: #fffdf8;
  --primary-soft: rgba(31, 58, 138, .08);
  --success: #c8302a;              /* 빨간펜 = 맞음 동그라미 */
  --success-soft: rgba(200, 48, 42, .06);
  --error: #5c6270;                /* 연필 = 틀림 줄긋기 */
  --error-soft: rgba(92, 98, 112, .08);
  --foil: #d9b866;                 /* 사전 표지 금박 (허브 카드) */
  --scrim: rgba(28, 35, 51, .45);
  --shadow: 0 2px 0 var(--line);
  --highlight: rgba(31, 58, 138, .14);
}
body[data-theme="dict"] { background-image: linear-gradient(180deg, var(--primary) 0 40px, transparent 40px); background-size: 6px 120px; background-position: right top; background-repeat: repeat-y; background-attachment: fixed; }
[data-theme="dict"] .site-header { background: var(--bg); border-bottom: 3px double var(--text); }
[data-theme="dict"] .ad-anchor, [data-theme="dict"] .ad-anchor-close { background: var(--surface); }
[data-theme="dict"] .btn-primary { border-radius: var(--r-sm); }
/* 시작: 표제어 + 겹줄, 칭호표는 목차(점선 잇기) */
[data-theme="dict"] .survey-start .display { padding-bottom: var(--s3); border-bottom: 3px double var(--text); }
[data-theme="dict"] .pick-note { transform: none; border: 0; border-top: 3px double var(--text); border-bottom: 1px solid var(--text); border-radius: 0; box-shadow: none; background: transparent; padding: var(--s3) 0; }
[data-theme="dict"] .pick-note-head { border-bottom: 0; color: var(--text); }
[data-theme="dict"] .quiz-tiers li { background: transparent; border-radius: 0; padding: var(--s2) 0; gap: var(--s2); }
[data-theme="dict"] .quiz-tiers li span { flex: 1; display: flex; align-items: center; gap: var(--s2); }
[data-theme="dict"] .quiz-tiers li span::after { content: ""; flex: 1; border-bottom: 2px dotted var(--line-strong); }
/* 질문 = 표제어 */
[data-theme="dict"] .progress-bar { height: 10px; border-radius: 0; background: repeating-linear-gradient(90deg, var(--surface-2) 0 calc(10% - 2px), var(--bg) calc(10% - 2px) 10%); }
[data-theme="dict"] .progress-bar span { border-radius: 0; }
[data-theme="dict"] .screen-title { padding: var(--s1) 0 var(--s3) var(--s4); border-left: 6px solid var(--primary); border-bottom: 3px double var(--line-strong); }
/* 보기 = 뜻풀이 번호 줄 */
[data-theme="dict"] .options { gap: 0; counter-reset: opt; border-top: 1px solid var(--line); }
[data-theme="dict"] .options .btn { counter-increment: opt; gap: var(--s3); min-height: 60px; padding: var(--s3) var(--s4); border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: var(--fs-lg); font-weight: 600; }
[data-theme="dict"] .options .btn::before { content: counter(opt); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--primary); color: var(--primary); font-size: var(--fs-sm); font-weight: 800; }
[data-theme="dict"] .options .btn:hover:not(:disabled), [data-theme="dict"] .options .btn:active { background: var(--primary-soft); }
/* 정답 = 빨간펜 동그라미, 오답 = 연필 줄긋기 */
[data-theme="dict"] .options .btn.is-correct { background: var(--success-soft); box-shadow: none; border: 2.5px solid var(--success); border-radius: 48% 52% 45% 55% / 60% 46% 54% 40%; transform: rotate(-1deg); color: var(--success); }
[data-theme="dict"] .options .btn.is-correct::before { border-color: var(--success); background: var(--success); color: var(--on-primary); }
[data-theme="dict"] .options .btn.is-correct::after { font-size: var(--fs-xl); }
[data-theme="dict"] .options .btn.is-wrong { background: transparent; box-shadow: none; color: var(--error); text-decoration: line-through 2px var(--error); }
[data-theme="dict"] .options .btn.is-wrong::before { border-color: var(--error); color: var(--error); }
/* 정답 공개 = 사전 '참고' 칸 + 채점 도장 */
[data-theme="dict"] .quiz-feedback { border-radius: 0; border: 1px solid var(--line); border-top: 3px double var(--text); justify-items: start; }
[data-theme="dict"] .quiz-verdict { padding: 0 var(--s3); border: 3px solid currentColor; border-radius: var(--r-sm); transform: rotate(-4deg); }
[data-theme="dict"] .quiz-feedback .btn { justify-self: stretch; }
/* 로딩 = 책장 넘김 */
[data-theme="dict"] .orbit { width: 104px; height: 68px; border: 2px solid var(--primary); border-radius: 4px; background: linear-gradient(90deg, var(--surface) 0 49%, var(--line-strong) 49% 51%, var(--surface) 51%); perspective: 300px; animation: none; }
[data-theme="dict"] .orbit::before { inset: 0 0 0 50%; border-radius: 0 3px 3px 0; background: var(--surface-2); box-shadow: none; transform-origin: left center; animation: page-flip 1.2s ease-in-out infinite; }
[data-theme="dict"] .orbit span { top: auto; bottom: -14px; left: 72%; width: 10px; height: 18px; margin: 0; border-radius: 0; background: var(--success); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%); }
@keyframes page-flip { from { transform: rotateY(0); } to { transform: rotateY(-180deg); } }
@media (prefers-reduced-motion: reduce) { [data-theme="dict"] .orbit::before { animation-duration: 4s; } }
/* 결과 = 빨간 점수 도장 + 표제어 + 번호 뜻풀이 */
[data-theme="dict"] .quiz-score { flex-direction: column; align-items: center; gap: var(--s3); }
[data-theme="dict"] .quiz-score strong { display: inline-grid; place-items: center; min-width: 132px; min-height: 132px; padding: 0 var(--s4); border: 4px solid var(--success); border-radius: 50%; background: none; color: var(--success); font-size: var(--fs-2xl); transform: rotate(-8deg); }
[data-theme="dict"] .survey-result > h1 { width: fit-content; margin-inline: auto; padding: 0 var(--s2) var(--s2); border-bottom: 3px double var(--text); }
[data-theme="dict"] .read-card { border-radius: 0; border-width: 0 0 1px; border-top: 3px double var(--text); background: transparent; padding-inline: 0; }
[data-theme="dict"] .keyword-tags { display: block; counter-reset: def; }
[data-theme="dict"] .keyword-tags li, [data-theme="dict"] .keyword-tags li:nth-child(3n+1) { counter-increment: def; position: relative; padding: var(--s2) 0 var(--s2) var(--s8); border-radius: 0; background: none; border-bottom: 1px dashed var(--line); font-weight: 500; font-size: var(--fs-md); }
[data-theme="dict"] .keyword-tags li::before { content: counter(def) "."; position: absolute; left: var(--s1); color: var(--primary); font-weight: 900; }
[data-theme="dict"] .mate { border-radius: 0; border-top: 4px solid var(--primary); box-shadow: 0 0 0 1px var(--line); }
[data-theme="dict"] .mate.bad { border-top-color: var(--error); }

/* ── 허브 카드 — 한 덩어리 기본틀 (.card-art). 크기는 다 같고 나누지 않음 ──
   테스트마다 아래 "테스트별 디자인"을 새로 하나씩 만든다 (돌려쓰기 금지). 색은 data-theme 토큰 */
.test-card[data-theme] a { background: var(--bg); border-color: var(--line-strong); }
.card-art a { position: relative; gap: var(--s2); padding: var(--s5); min-height: 248px; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.card-emoji { font-size: 40px; line-height: 1; }
.card-art h2 { font-size: var(--fs-xl); line-height: 1.25; }
.card-art h2, .card-art p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } /* 글 길이로 높이가 늘지 않게 2줄까지 */
.card-art p { flex: 0 0 auto; }
.card-chips { list-style: none; margin: var(--s1) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.card-chips li { padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.card-foot { margin-top: auto; padding-top: var(--s3); display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.card-art .go { margin: 0; padding: 6px 14px; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); }
.card-badges { order: 2; display: flex; gap: 6px; align-items: center; }
/* 종류 알약: 유형·운세 = 카드 글자색 테두리, 퀴즈 = 금색(테마 primary) 면. 카드 글자색을 따라서 어떤 카드에서도 보임 */
.kind { padding: 2px 10px; border-radius: var(--r-pill); border: 1.5px solid currentColor; color: inherit; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .02em; }
.kind-quiz { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.badge-new { order: 2; padding: 2px 10px; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .05em; }

/* ── 허브 카드 — 테스트별 디자인 (테스트 하나 = 디자인 하나) ── */
/* 자미두수: 밤하늘 별 + 금빛 테두리 */
.test-card.card-jamidusu a { background-image: radial-gradient(1.5px 1.5px at 20% 30%, var(--starlight), transparent 60%), radial-gradient(1px 1px at 70% 20%, var(--text), transparent 60%), radial-gradient(1.5px 1.5px at 85% 60%, var(--primary), transparent 60%), radial-gradient(1px 1px at 40% 75%, var(--text), transparent 60%), radial-gradient(circle at 90% 0%, var(--primary-soft), transparent 50%); background-color: var(--surface); border: 2px solid var(--primary); } /* 바탕과 같은 남색이라 금색 2px로 경계를 또렷하게 */
.test-card.card-jamidusu h2 { color: var(--starlight); }

/* 연말 질투: 채팅방 — 점 무늬, 제목은 상대 말풍선, 설명은 내 답장 말풍선 */
.test-card.card-year-end-jealousy a { background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 16px 16px; }
.test-card.card-year-end-jealousy h2 { align-self: flex-start; padding: 10px 16px; background: var(--surface); border-radius: 20px 20px 20px 6px; box-shadow: var(--shadow); font-size: var(--fs-lg); }
.test-card.card-year-end-jealousy p { align-self: flex-end; max-width: 85%; padding: 8px 14px; background: var(--primary); color: var(--on-primary); border-radius: 20px 20px 6px 20px; font-weight: 600; }
.test-card.card-year-end-jealousy .card-chips li { background: var(--surface); }

/* 첫눈 정신연령: 날씨 위젯 — 파란 그라데이션, 흰 글자, 눈송이 */
.test-card.card-first-snow-age a { background-color: var(--primary); background-image: radial-gradient(var(--surface) 1.4px, transparent 1.8px), linear-gradient(160deg, var(--primary), var(--primary-hover)); background-size: 30px 30px, 100% 100%; border-color: transparent; color: var(--on-primary); }
.test-card.card-first-snow-age h2 { font-size: var(--fs-2xl); color: var(--on-primary); }
.test-card.card-first-snow-age p { color: var(--on-primary); opacity: .9; }
.test-card.card-first-snow-age .card-chips li { background: var(--primary-soft); color: var(--on-primary); border: 1px solid var(--line-strong); }
.test-card.card-first-snow-age .tag { border-color: var(--on-primary); color: var(--on-primary); }
.test-card.card-first-snow-age .go { background: var(--surface); color: var(--primary); }
.test-card.card-first-snow-age .badge-new { background: var(--surface); color: var(--primary); }

/* 2026 이슈 퀴즈: 퀴즈쇼 전광판 — 노란 테두리 + 위쪽 전구 줄 */
.test-card.card-2026-issue-quiz a { border: 3px solid var(--primary); box-shadow: 0 0 0 4px var(--surface), 0 0 24px var(--primary-soft); background-image: radial-gradient(circle, var(--primary) 3px, transparent 3.5px); background-size: 22px 22px; background-repeat: repeat-x; background-position: 8px 10px; padding-top: var(--s8); }
.test-card.card-2026-issue-quiz h2 { color: var(--primary); letter-spacing: -.02em; }

/* AI 활용 습관: 공책 — 크림 종이에 줄, 왼쪽 빨간 여백선 */
.test-card.card-ai-habit a { background-image: linear-gradient(90deg, transparent 30px, var(--primary-soft) 30px, var(--primary-soft) 32px, transparent 32px), repeating-linear-gradient(180deg, transparent 0 29px, var(--line) 29px 30px); padding-left: 48px; }

/* 겨울 이상형: 포장마차 메뉴판 — 나무 테두리 + 크림 판 */
.test-card.card-winter-ideal a { border: 6px solid var(--line-strong); box-shadow: inset 0 0 0 2px var(--primary-soft); background-image: radial-gradient(circle at 90% 10%, var(--primary-soft), transparent 45%); }
.test-card.card-winter-ideal h2 { color: var(--primary); }
.test-card.card-winter-ideal .card-chips li { background: var(--surface-2); border: 1px dashed var(--line-strong); }

/* 블프 지름신: 영수증 — 흰 종이, 아래 톱니 */
.test-card.card-blackfriday-cart a { background: var(--text); color: var(--bg); border: 0; border-radius: var(--r-sm) var(--r-sm) 0 0; -webkit-mask: radial-gradient(circle 7px at 50% 100%, transparent 6.5px, var(--text) 7px) 0 0 / 20px 100% repeat-x; mask: radial-gradient(circle 7px at 50% 100%, transparent 6.5px, var(--text) 7px) 0 0 / 20px 100% repeat-x; padding-bottom: var(--s8); }
.test-card.card-blackfriday-cart h2 { color: var(--bg); letter-spacing: .02em; }
.test-card.card-blackfriday-cart p { color: var(--surface-3); }
.test-card.card-blackfriday-cart .card-chips li { background: transparent; color: var(--bg); border-bottom: 1px dashed var(--faint); border-radius: 0; padding: 2px 4px; }
.test-card.card-blackfriday-cart .tag { color: var(--bg); border-color: var(--bg); }
.test-card.card-blackfriday-cart .go { background: var(--bg); color: var(--primary); }

/* 수능 버킷리스트: 답안지 — 빨간 테두리 + 위쪽 OMR 마킹 칸 */
.test-card.card-suneung-bucket a { border: 2px solid var(--primary); background-image: radial-gradient(ellipse 9px 6px, var(--text) 98%, transparent 100%), radial-gradient(ellipse 9px 6px, transparent 70%, var(--primary) 72%, var(--primary) 90%, transparent 92%); background-size: 26px 18px, 26px 18px; background-repeat: no-repeat, repeat-x; background-position: 72px 12px, 20px 12px; padding-top: var(--s8); }

/* 맞춤법 퀴즈: 국어사전 하드커버 — 남색 표지 + 왼쪽 책등 + 금박 테두리 + 오른쪽 손톱 색인 */
.test-card.card-spelling-quiz a { background-color: var(--primary); background-image: linear-gradient(90deg, var(--primary-hover) 0 14px, transparent 14px), linear-gradient(180deg, transparent 0 28px, var(--surface-2) 28px 54px, transparent 54px 70px, var(--surface-3) 70px 96px, transparent 96px 112px, var(--surface) 112px 138px, transparent 138px); background-size: 100% 100%, 8px 100%; background-position: 0 0, right 0 top 0; background-repeat: no-repeat; border: 0; box-shadow: inset 0 0 0 10px var(--primary), inset 0 0 0 11.5px var(--foil); color: var(--on-primary); padding-left: var(--s8); padding-right: var(--s8); }
.test-card.card-spelling-quiz h2 { color: var(--foil); letter-spacing: .02em; }
.test-card.card-spelling-quiz p { color: var(--on-primary); opacity: .88; }
.test-card.card-spelling-quiz .card-chips li { background: transparent; border: 1px solid var(--foil); color: var(--on-primary); }
.test-card.card-spelling-quiz .kind-quiz, .test-card.card-spelling-quiz .badge-new { background: var(--foil); border-color: var(--foil); color: var(--primary); }
.test-card.card-spelling-quiz .tag { border-color: var(--foil); color: var(--foil); }
.test-card.card-spelling-quiz .go { background: var(--foil); color: var(--primary); }


/* ── 설문 결과: 푸망식 캐릭터 카드 · 키워드 태그 · 궁합 캐릭터 카드 (체크박스 안 씀) ── */
.char-card { position: relative; display: grid; place-items: center; width: 200px; height: 200px; margin: var(--s2) auto var(--s4); border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, var(--surface), var(--primary-soft) 70%); box-shadow: inset 0 0 0 6px var(--surface-2), var(--shadow); }
.char-card::before, .char-card::after { content: ""; position: absolute; width: 18px; height: 18px; background: var(--primary); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.char-card::before { top: 14px; right: 18px; }
.char-card::after { bottom: 26px; left: 10px; width: 12px; height: 12px; }
.char-emoji { font-size: 104px; line-height: 1; letter-spacing: -.1em; }
.char-quote { position: relative; width: fit-content; max-width: 90%; margin: 0 auto var(--s5); padding: 10px 18px; border-radius: var(--r-lg); background: var(--surface); color: var(--text); font-weight: 700; text-align: center; box-shadow: var(--shadow); }
.char-quote::before { content: ""; position: absolute; top: -8px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top: 0; border-bottom-color: var(--surface); }
.survey-result > .eyebrow, .survey-result > h1, .survey-result > .lead, .survey-result > .pick { text-align: center; }
.survey-result > .pick { justify-content: center; }
.keyword-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.keyword-tags li { padding: 6px 14px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); font-weight: 700; }
.keyword-tags li:nth-child(3n+1) { background: var(--primary-soft); }
.pick-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pick-chips li { padding: 4px var(--s3); border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); font-size: var(--fs-sm); font-weight: 700; }
.mates { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin: var(--s5) 0; }
.mate { display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: var(--s4) var(--s3); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; text-align: center; }
.mate:hover { color: var(--text); transform: translateY(-2px); }
.mate-emoji { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--surface-2); font-size: 40px; }
.mate small { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.mate strong { font-size: var(--fs-md); }
.mate.good small { color: var(--primary); }

/* 질문 위 장면 그림 (질문 art) */
.q-art { display: grid; place-items: center; width: 132px; height: 132px; margin: 0 auto var(--s4); border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); font-size: 68px; line-height: 1; letter-spacing: -.1em; }

/* 겨울잠 동물: 그림책 표지 — 바느질 점선 테두리 + 동그란 곰 그림 + 별 */
.test-card.card-hibernation-animal a { border: 3px dashed var(--line-strong); border-radius: var(--r-sketch); background-image: radial-gradient(circle at 88% 18%, var(--primary-soft) 0 46px, transparent 47px); }
.test-card.card-hibernation-animal .card-emoji { display: grid; place-items: center; width: 72px; height: 72px; border: 3px solid var(--line-strong); border-radius: var(--r-sketch); background: var(--surface); font-size: 44px; }
.test-card.card-hibernation-animal h2 { color: var(--primary); }
.read-card > ul.keyword-tags { padding: 0; margin: 0; }
.read-card > ul.keyword-tags li { margin: 0; }

/* 성향 그래프 (설문 graph): 칸 이름 | 막대 | %. 큰 순서, 1위 줄은 금색·굵게 */
.graph-bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.graph-bars li { display: grid; grid-template-columns: 7rem 1fr 4.5rem; align-items: center; gap: var(--s3); color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.graph-bar { height: 12px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.graph-bar i { display: block; height: 100%; border-radius: inherit; background: var(--faint); }
.graph-bars b { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.graph-bars li.top { color: var(--primary); font-size: var(--fs-md); font-weight: 900; }
.graph-bars li.top .graph-bar { height: 18px; }
.graph-bars li.top .graph-bar i { background: var(--primary); }
.graph-bars li.top b { font-size: var(--fs-xl); }

/* 크리스마스 사랑의 언어: 리본 두른 선물 상자 — 오른쪽 세로 리본 + 위 가로 리본 + 리본 매듭, 칩은 크라프트 태그 */
.test-card.card-christmas-love-language a { border: 0; background-color: var(--bg); background-image: linear-gradient(90deg, transparent calc(100% - 64px), var(--primary) calc(100% - 64px) calc(100% - 44px), transparent calc(100% - 44px)), linear-gradient(transparent 58px, var(--primary) 58px 74px, transparent 74px), repeating-linear-gradient(135deg, transparent 0 18px, var(--stripe) 18px 36px); box-shadow: var(--shadow); padding-right: 84px; }
.test-card.card-christmas-love-language .card-top { position: relative; }
.test-card.card-christmas-love-language .card-emoji { position: absolute; top: 18px; right: -56px; font-size: 52px; filter: drop-shadow(0 4px 0 var(--surface)); }
.test-card.card-christmas-love-language h2 { margin-top: var(--s8); }
.test-card.card-christmas-love-language .card-chips li { background: var(--tag); color: var(--on-tag); border-radius: 4px; }
.test-card.card-christmas-love-language .tag { border-color: var(--text); color: var(--text); }
