/* =========================================================
 * 토큰
 * 브랜드(로즈)는 질문·로딩·버튼에만, 16유형 그룹색은 결과 공개 순간부터 씁니다.
 * ========================================================= */
:root {
  color-scheme: light;
  --bg: #f6f5f8;
  --surface: #ffffff;
  --surface-2: #f0eef3;
  --ink: #17151c;
  --ink-2: #4b4855;
  --ink-3: #6a6675;
  --line: #e4e1e8;

  --brand: #cf3460;
  --brand-ink: #ffffff;
  --brand-text: #b82a53;
  --brand-soft: #fce8ee;
  --link: var(--brand-text);

  --bubble-ai: #ffffff;
  --bubble-ai-ink: var(--ink);
  --bubble-me: var(--brand);
  --bubble-me-ink: var(--brand-ink);
  --m-body: var(--brand);
  --m-face: #ffffff;
  --toast-bg: #17151c;
  --shadow: 0 1px 2px rgba(20, 16, 30, .06), 0 6px 20px rgba(20, 16, 30, .06);
  --radius: 18px;

  /* 배경·테두리용 그룹색, 글자용(-ink, 대비 4.5:1 이상), 연한 배경(-soft) */
  --nt: #6d4ae6; --nt-ink: #5b3fd6; --nt-soft: #efeafd;
  --nf: #0c9a6c; --nf-ink: #08754f; --nf-soft: #e3f6ee;
  --sj: #2563eb; --sj-ink: #1d55cf; --sj-soft: #e6eefd;
  --sp: #e2620f; --sp-ink: #b44a07; --sp-soft: #fdeee3;
  --group: var(--brand);
  --group-ink: var(--brand-text);
  --group-soft: var(--brand-soft);

  /* 모션 */
  --dur-press: 90ms;
  --dur-fast: 150ms;
  --dur-base: 240ms;
  --dur-pop: 360ms;
  --dur-land: 560ms;
  --dur-hero: 650ms;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.4, 0, 1, 1);
  --spring-soft: cubic-bezier(.34, 1.3, .64, 1);
  --spring-bouncy: cubic-bezier(.34, 1.56, .64, 1);
  --pop-from: translateY(8px) scale(.97);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring-soft: linear(0, .009, .035 2.1%, .141 4.4%, .5 8.7%, .723 12.9%, .938 18.7%, 1.017 23%, 1.046 27.5%, 1.045 31.5%, 1.025 37.5%, 1.009 43.5%, .999 52%, .997 60%, 1);
    --spring-bouncy: linear(0, .05 1.2%, .2 2.5%, .5 4.8%, .763 7.5%, .98 10%, 1.111 13.3%, 1.126 15%, 1.112 17%, 1.03 22.5%, .99 26.7%, .976 30%, .987 36%, 1.003 42.5%, 1.003 50%, .999 62%, 1);
  }
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101014;
    --surface: #18171d;
    --surface-2: #211f27;
    --ink: #f0eef4;
    --ink-2: #bdb8c6;
    --ink-3: #9d97a8;
    --line: #2d2a34;
    --brand: #ff7a9c;
    --brand-ink: #2a0c16;
    --brand-text: #ff8fad;
    --brand-soft: #3a1822;
    --bubble-ai: #1d1b22;
    --m-face: #2a0c16;
    --toast-bg: #2d2a34;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --nt: #a58bff; --nt-ink: #a58bff; --nt-soft: #2a2443;
    --nf: #3fd3a0; --nf-ink: #3fd3a0; --nf-soft: #17332a;
    --sj: #7aa7ff; --sj-ink: #7aa7ff; --sj-soft: #1c2a45;
    --sp: #ff9a55; --sp-ink: #ff9a55; --sp-soft: #3a2617;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101014;
  --surface: #18171d;
  --surface-2: #211f27;
  --ink: #f0eef4;
  --ink-2: #bdb8c6;
  --ink-3: #9d97a8;
  --line: #2d2a34;
  --brand: #ff7a9c;
  --brand-ink: #2a0c16;
  --brand-text: #ff8fad;
  --brand-soft: #3a1822;
  --bubble-ai: #1d1b22;
  --m-face: #2a0c16;
  --toast-bg: #2d2a34;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --nt: #a58bff; --nt-ink: #a58bff; --nt-soft: #2a2443;
  --nf: #3fd3a0; --nf-ink: #3fd3a0; --nf-soft: #17332a;
  --sj: #7aa7ff; --sj-ink: #7aa7ff; --sj-soft: #1c2a45;
  --sp: #ff9a55; --sp-ink: #ff9a55; --sp-soft: #3a2617;
}

/* 움직임 줄이기: 이동·확대는 빼고 짧은 페이드만 남김 (상태 변화는 색으로 계속 보임) */
@media (prefers-reduced-motion: reduce) {
  :root {
    --spring-soft: ease-out;
    --spring-bouncy: ease-out;
    --dur-pop: 160ms;
    --dur-land: 160ms;
    --dur-hero: 160ms;
    --pop-from: none;
  }
}

.g-nt { --group: var(--nt); --group-ink: var(--nt-ink); --group-soft: var(--nt-soft); }
.g-nf { --group: var(--nf); --group-ink: var(--nf-ink); --group-soft: var(--nf-soft); }
.g-sj { --group: var(--sj); --group-ink: var(--sj-ink); --group-soft: var(--sj-soft); }
.g-sp { --group: var(--sp); --group-ink: var(--sp-ink); --group-soft: var(--sp-soft); }

/* =========================================================
 * 기본
 * ========================================================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html[data-screen="quiz"], html[data-screen="loading"] { overscroll-behavior-y: none; }
html[data-screen="quiz"] footer, html[data-screen="loading"] footer { display: none; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--link); }
button { font: inherit; color: inherit; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
[tabindex="-1"]:focus { outline: none; }

.wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 32px; }
.screen { animation: screen-in var(--dur-base) var(--ease-out); }
@keyframes screen-in { from { opacity: 0; transform: var(--pop-from); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: var(--pop-from); } to { opacity: 1; transform: none; } }

/* =========================================================
 * 눌림 피드백: 누를 때 빠르게 줄고, 뗄 때 살짝 튀며 돌아옴
 * ========================================================= */
.btn, .chip, .icon-btn, .type-card, .match-card, .sb-icon, .fx-btn {
  transition: transform 420ms var(--spring-soft), background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, opacity var(--dur-fast) ease;
}
.btn:active, .chip:active, .icon-btn:active, .type-card:active, .match-card:active, .sb-icon:active, .fx-btn:active {
  transform: scale(.96);
  transition-duration: var(--dur-press);
  transition-timing-function: var(--ease-out);
}

/* =========================================================
 * 버튼
 * ========================================================= */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 14px 18px;
  border: 0; border-radius: 16px; cursor: pointer; text-decoration: none;
  font-size: 17px; font-weight: 800; text-align: center;
  background: var(--brand); color: var(--brand-ink);
}
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn.small { min-height: 46px; font-size: 15px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-btn { background: none; border: 0; padding: 10px 14px; color: var(--ink-3); font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
:is(.btn, .chip, .icon-btn, .type-card, .match-card, .sb-icon, .fx-btn, .link-btn):focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(1.05); }
  .chip:hover { border-color: var(--brand); }
  .type-card:hover, .match-card:hover { border-color: var(--group); }
}

/* =========================================================
 * 마스코트 '깜빡이'
 * ========================================================= */
.m-slot { display: inline-block; }
.mascot { display: block; width: 100%; height: 100%; overflow: visible; }
.mascot .m-root { transform-box: fill-box; transform-origin: 50% 100%; }
.mascot .m-body { fill: var(--m-body); }
.mascot .eye-cursor, .mascot .eye-line, .mascot .mouth-dots, .mascot .mouth-open { fill: var(--m-face); }
.mascot .eye-happy, .mascot .mouth-smile, .mascot .mouth-o { fill: none; stroke: var(--m-face); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.mascot .eye-cursor, .mascot .eye-line, .mascot .eye-happy,
.mascot .mouth-smile, .mascot .mouth-dots, .mascot .mouth-o, .mascot .mouth-open { opacity: 0; transition: opacity 80ms linear; }
.mascot .eye-cursor { transform-box: fill-box; transform-origin: 50% 50%; transition: opacity 80ms linear, transform 160ms var(--spring-soft); }

[data-mood="idle"] .eye-cursor, [data-mood="idle"] .mouth-smile { opacity: 1; }
[data-mood="typing"] .eye-cursor, [data-mood="typing"] .mouth-dots { opacity: 1; }
[data-mood="typing"] .eye-cursor { transform: translateY(1.5px); }
[data-mood="thinking"] .eye-line, [data-mood="thinking"] .mouth-smile { opacity: 1; }
[data-mood="surprised"] .eye-cursor, [data-mood="surprised"] .mouth-o { opacity: 1; }
[data-mood="surprised"] .eye-cursor { transform: scaleY(1.3); }
[data-mood="laugh"] .eye-happy, [data-mood="laugh"] .mouth-open,
[data-mood="celebrate"] .eye-happy, [data-mood="celebrate"] .mouth-open { opacity: 1; }

[data-mood="typing"] .mouth-dots circle { animation: dot-bounce 900ms ease-in-out infinite; transform-box: fill-box; }
[data-mood="typing"] .mouth-dots circle:nth-child(2) { animation-delay: 120ms; }
[data-mood="typing"] .mouth-dots circle:nth-child(3) { animation-delay: 240ms; }
@keyframes dot-bounce { 0%, 70%, 100% { transform: translateY(0); } 35% { transform: translateY(-2.5px); } }
[data-mood="thinking"] .eye-line { animation: scan 900ms ease-in-out infinite alternate; }
@keyframes scan { from { transform: translateX(-3px); } to { transform: translateX(3px); } }
[data-blink][data-mood="idle"] .eye-cursor { animation: blink 5s steps(1) infinite; }
@keyframes blink { 0%, 88%, 92%, 96%, 100% { opacity: 1; } 90%, 94% { opacity: 0; } }
.m-squash .m-root { animation: squash 240ms var(--ease-out); }
@keyframes squash { 50% { transform: scale(1.06, .92); } }
html[data-lite] [data-blink] .eye-cursor { animation: none; }

/* =========================================================
 * 말풍선
 * ========================================================= */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg.me { justify-content: flex-end; }
.avatar { flex: none; width: 34px; height: 34px; }
.bubbles { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; max-width: 84%; min-width: 0; }
.bubble {
  max-width: 84%; padding: 11px 14px; border-radius: 18px;
  background: var(--bubble-ai); color: var(--bubble-ai-ink); border: 1px solid var(--line);
  font-size: 15.5px; box-shadow: var(--shadow);
}
.bubbles .bubble { max-width: 100%; }
.msg.ai .bubble { border-bottom-left-radius: 6px; transform-origin: 0 100%; }
.msg.me .bubble {
  background: var(--bubble-me); color: var(--bubble-me-ink); border-color: transparent;
  border-bottom-right-radius: 6px; transform-origin: 100% 100%;
}
.bubble .label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 2px; }
.msg.me .bubble .label { color: inherit; }
.bubble.q { font-size: 17px; font-weight: 700; line-height: 1.45; }
.bubble.react { font-size: 15px; font-weight: 500; }
.bubble.typing-b { padding: 12px 16px; }
.typing { display: inline-flex; gap: 5px; padding: 3px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: tdot 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes tdot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.pop { animation: pop-in var(--dur-pop) var(--spring-soft) both; }
.read-mark { font-size: 11px; font-weight: 800; color: var(--brand-text); align-self: flex-end; margin-right: -2px; transition: opacity 200ms ease; }

/* =========================================================
 * 시작 화면
 * ========================================================= */
.hero-chat { margin: 12px 0 28px; }
.hero-chat .msg { opacity: 0; animation: pop-in var(--dur-pop) var(--spring-soft) forwards; }
.hero-chat .msg:nth-child(2) { animation-delay: .35s; }
.hero-chat .msg:nth-child(3) { animation-delay: .8s; }
.hero-chat .msg:nth-child(4) { animation-delay: 1.25s; }

.kicker { font-size: 14px; font-weight: 800; color: var(--brand-text); margin: 0 0 6px; }
h1.title { font-size: 32px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.02em; }
.subtitle { font-size: 18px; font-weight: 600; color: var(--ink-2); margin: 0 0 14px; }
.intro { color: var(--ink-2); margin: 0 0 24px; }
.meta-line { display: flex; gap: 14px; justify-content: center; color: var(--ink-3); font-size: 13px; margin-top: 12px; }
.fx-line { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.fx-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 99px;
  padding: 7px 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; min-height: 36px;
}
.fx-btn[aria-pressed="true"] { border-color: var(--brand); color: var(--brand-text); }

.section-title { font-size: 18px; font-weight: 800; margin: 36px 0 12px; }
.axes { display: flex; flex-direction: column; gap: 10px; }
.axes p { margin: 0; color: var(--ink-2); font-size: 15px; display: grid; grid-template-columns: 44px 1fr; gap: 6px; }
.axes b { color: var(--ink); white-space: nowrap; }

.type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; content-visibility: auto; contain-intrinsic-size: auto 420px; }
.type-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 4px 10px; border-radius: 14px; cursor: pointer;
  background: var(--group-soft); border: 2px solid transparent; text-align: center;
  color: inherit; text-decoration: none;
}
.type-card[aria-current] { border-color: var(--group); box-shadow: var(--shadow); }
.type-card .e { font-size: 24px; line-height: 1.2; }
.type-card .c { font-size: 13px; font-weight: 800; color: var(--group-ink); letter-spacing: .02em; }
.type-card .n { font-size: 11.5px; color: var(--ink-2); line-height: 1.3; }

/* =========================================================
 * 질문 화면
 * ========================================================= */
.quiz { display: flex; flex-direction: column; height: calc(100vh - 40px); height: calc(100svh - 40px); }
html[data-screen="quiz"] .wrap { padding-bottom: 8px; }
.topbar { display: flex; align-items: center; gap: 10px; flex: none; }
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-size: 17px;
}
.icon-btn[aria-pressed="true"] { border-color: var(--brand); }
.count { flex: none; font-size: 13px; font-weight: 800; color: var(--ink-3); min-width: 54px; text-align: right; font-variant-numeric: tabular-nums; }

.dots { flex: 1; display: flex; justify-content: center; align-items: center; gap: 10px; min-width: 0; }
.dot-group { display: flex; gap: 5px; position: relative; }
.dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--line); transform: scale(.65); transition: transform 420ms var(--spring-soft); }
.dot:not(.done):not(.current) { box-shadow: inset 0 0 0 1.5px var(--ink-3); background: transparent; }
@media (max-width: 380px) {
  .dots { gap: 6px; }
  .dot-group { gap: 3px; }
  .dot { width: 8px; height: 8px; }
}
.dot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--brand); opacity: 0; transition: opacity 200ms ease; }
.dot.done, .dot.current { transform: scale(1); }
.dot.done::before { opacity: 1; }
.dot.current { background: transparent; box-shadow: inset 0 0 0 2px var(--brand); }
.dot.current::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--brand);
  animation: ring 1600ms ease-in-out infinite;
}
@keyframes ring { 0%, 100% { opacity: .2; transform: scale(.9); } 50% { opacity: .8; transform: scale(1.25); } }
.group-check {
  position: absolute; left: 50%; top: -15px; transform: translateX(-50%);
  font-size: 10px; font-weight: 900; color: var(--brand-text); opacity: 0; transition: opacity 240ms ease;
}
.dot-group.full .group-check { opacity: 1; }

.thread {
  flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 56px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 56px);
  cursor: default; -webkit-tap-highlight-color: transparent;
}
#screen-loading { -webkit-tap-highlight-color: transparent; }
html[data-lite] .thread { -webkit-mask-image: none; mask-image: none; }
.thread-inner { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 10px; }
.turn { display: flex; flex-direction: column; gap: 10px; }
/* 지난 대화는 투명도 대신 색을 낮춰 흐리게 (글자 대비 유지) */
.turn.past .msg.ai .bubble { color: var(--ink-2); box-shadow: none; }
.turn.past .msg.me .bubble { background: var(--brand-soft); color: var(--brand-text); }
.turn.past .read-mark { display: none; }
.bubble.fly {
  position: fixed; z-index: 13; margin: 0; max-width: none; pointer-events: none;
  background: var(--bubble-me); color: var(--bubble-me-ink); border-color: transparent;
  border-bottom-right-radius: 6px; transform-origin: 100% 100%;
}

.composer { position: relative; flex: none; padding: 8px 0 max(8px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.composer-cap { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.chips { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; width: 100%; min-height: 128px; justify-content: flex-end; }
.chip {
  width: 88%; text-align: left; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  padding: 14px 18px; border-radius: 20px; border-bottom-right-radius: 6px;
  background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow);
  font-size: 16px; font-weight: 700; line-height: 1.45; transform-origin: 100% 100%;
}
.chip.is-prev { border-color: var(--brand); }
.chip.is-sent { background: var(--bubble-me); color: var(--bubble-me-ink); border-color: var(--bubble-me); }
.chip.is-dim { opacity: .4; pointer-events: none; }
.chips.locked .chip { pointer-events: none; }
/* 마일스톤 알약은 '빠른 답장' 줄 왼쪽에 떠서 질문 말풍선을 가리지 않음 */
.milestone {
  position: absolute; left: 0; top: 4px; transform: translateY(6px);
  padding: 4px 12px; border-radius: 99px; background: var(--brand-soft); color: var(--brand-text);
  font-size: 13px; font-weight: 800; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity 240ms ease, transform 240ms var(--ease-out);
}
.milestone.on { opacity: 1; transform: none; }

/* 가로 모드 등 높이가 낮은 화면: 고정 높이를 풀고 스크롤로 읽게 함 */
@media (max-height: 480px) {
  .quiz { height: auto; min-height: calc(100svh - 40px); }
  .thread { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .composer-cap { visibility: hidden; }
  .chips { min-height: 0; }
}

/* =========================================================
 * 결과 공개 연출
 * ========================================================= */
.reveal { min-height: calc(100vh - 52px); min-height: calc(100svh - 52px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.reveal-m { width: 96px; height: 96px; }
#reveal-line { font-size: 17px; font-weight: 800; color: var(--ink-2); margin: 0; min-height: 1.6em; }
.replay { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; min-height: 104px; align-items: end; }
.replay-col { display: flex; flex-direction: column; gap: 4px; align-items: center; min-width: 0; }
.mini {
  max-width: 100%; padding: 4px 8px; border-radius: 10px; border-bottom-right-radius: 3px;
  background: var(--bubble-me); color: var(--bubble-me-ink); font-size: 11.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
.slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.slot-box {
  width: 100%; max-width: 76px; height: 84px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line);
  display: grid; place-items: center; overflow: hidden;
}
.slot-ch { font-size: 52px; font-weight: 900; line-height: 1; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.slot.landed .slot-box { border-color: var(--group); }
.slot.landed .slot-ch { color: var(--group-ink); }
.slot-name { font-size: 12.5px; font-weight: 800; color: var(--ink-2); opacity: 0; transition: opacity 200ms ease; }
.slot.landed .slot-name { opacity: 1; }

/* =========================================================
 * 결과
 * ========================================================= */
#result-root { padding-bottom: 92px; --on-group: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #result-root { --on-group: #101014; } }
:root[data-theme="dark"] #result-root { --on-group: #101014; }
/* 결과 화면에서는 내 말풍선도 유형 색을 따라감 (글자 대비 4.5:1 이상인 -ink 색 사용) */
#result-root .msg.me .bubble { background: var(--group-ink); color: var(--on-group); }
#result-root .m-slot { --m-body: var(--group); }
/* 하단 고정 공유 바에 키보드 포커스 대상이 가려지지 않게 */
html[data-screen="result"] { scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
/* 공유 링크 페이지: JS가 그릴 때까지 정적 본문을 숨겨 깜빡임 방지 (JS가 꺼져 있으면 그대로 보임) */
.js #result-root > [data-static] { visibility: hidden; }
.result-head .emoji { font-size: 56px; line-height: 1.2; }
.friend-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; margin-bottom: 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 700;
}
.friend-banner .btn { width: auto; min-height: 40px; padding: 8px 14px; font-size: 14px; flex: none; }

.result-head { position: relative; overflow: hidden; text-align: center; padding: 22px 18px 20px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); isolation: isolate; }
.burst-bg { position: absolute; left: 50%; top: 150px; width: 260%; aspect-ratio: 1; border-radius: 50%; background: var(--group-soft); transform: translate(-50%, -50%); z-index: -1; }
.result-head .pre { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.hero-m { position: relative; width: 112px; height: 112px; margin: 8px auto 2px; --m-body: var(--group); }
.hero-m .badge {
  position: absolute; right: -6px; top: -4px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 24px; background: var(--surface); box-shadow: var(--shadow);
}
.result-title { margin: 0; }
.result-title .code { display: flex; justify-content: center; gap: 2px; font-size: 54px; font-weight: 900; color: var(--group-ink); line-height: 1.1; }
.result-title .ch { display: inline-block; width: .74em; text-align: center; }
.result-title .name { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 6px 0 6px; }
.result-head .tagline { color: var(--ink-2); font-weight: 500; margin: 0; }

.meter { margin: 18px auto 0; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.meter-row { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
.meter-row .verdict { min-width: 54px; text-align: right; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.meter-row .side { color: var(--ink-3); white-space: nowrap; }
.meter-row .side.l { text-align: right; }
.meter-row .side.r { text-align: left; }
.meter-row .side.win { color: var(--group-ink); }
.cells { display: flex; gap: 4px; }
.cell { position: relative; width: 22px; height: 12px; border-radius: 4px; background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.cell::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--group); opacity: 0; transition: opacity 200ms ease; }
.cell.on::after { opacity: 1; }
.meter-note { font-size: 12px; color: var(--ink-3); margin: 2px 0 0; font-weight: 600; }

.card { margin-top: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.card h2 { font-size: 15px; margin: 0 0 12px; color: var(--ink-2); font-weight: 800; }
.card p { margin: 0; }
.card p + p { margin-top: 8px; }
.card.rise { opacity: 0; transform: translateY(16px); }
.card.rise.in { opacity: 1; transform: none; transition: opacity var(--dur-pop) var(--ease-out), transform var(--dur-pop) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .card.rise { transform: none; } }

.traits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.traits li { display: flex; gap: 10px; align-items: flex-start; }
.traits li::before {
  content: "✓"; flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 900;
  background: var(--group-soft); color: var(--group-ink); margin-top: 1px;
}
.tip { background: var(--group-soft); border-color: transparent; }
.tip h2 { color: var(--group-ink); }

.evidence .chat { margin-bottom: 14px; }
.ev-rows { display: flex; flex-direction: column; gap: 10px; }
.ev-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.ev-row .said { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-row .to { font-weight: 800; color: var(--group-ink); white-space: nowrap; }
.ev-row.new { animation: pop-in var(--dur-base) var(--ease-out) both; }
.ev-more { margin-top: 6px; padding-left: 0; }
.ev-note { font-size: 12px; color: var(--ink-3); margin-top: 10px !important; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-card {
  display: block; padding: 14px 12px; border-radius: 16px; cursor: pointer; text-align: center;
  background: var(--group-soft); border: 2px solid transparent; color: inherit; text-decoration: none;
}
.match-card .lbl { font-size: 12.5px; font-weight: 800; color: var(--ink-2); }
.match-card .e { font-size: 30px; line-height: 1.3; }
.match-card .c { font-weight: 900; color: var(--group-ink); }
.match-card .n { font-size: 13.5px; font-weight: 800; }
.match-card .w { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; }

.share { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.btn.kakao { background: #fee500; color: #191600; }

/* 하단 고정 공유 바 */
.sharebar {
  position: fixed; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 448px; margin-inline: auto; z-index: 12;
  display: flex; gap: 8px; padding: 8px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(20, 16, 30, .16);
  transform: translateY(140%); transition: transform 320ms var(--ease-out);
}
.sharebar.on { transform: none; }
.sharebar.away { transform: translateY(140%); transition-duration: 200ms; transition-timing-function: var(--ease-in); }
.sharebar.away:focus-within { transform: none; }
@media (prefers-reduced-motion: reduce) {
  /* 움직임 줄이기: 무한 반복 애니메이션은 멈추고, 공유 바는 미끄러지는 대신 나타났다 사라짐 */
  .dot.current::after, .typing i, .mascot *, [data-blink] .eye-cursor { animation: none !important; }
  .sharebar, .sharebar.on, .sharebar.away { transform: none; transition: opacity 160ms ease, visibility 160ms; }
  .sharebar:not(.on), .sharebar.away { opacity: 0; visibility: hidden; }
  .sharebar.away:focus-within { opacity: 1; visibility: visible; }
}
.sharebar .btn { flex: 1; min-height: 52px; }
.sb-icon {
  flex: none; width: 52px; height: 52px; border-radius: 14px; cursor: pointer; font-size: 22px;
  display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line);
}
.sb-icon.kakao { background: #fee500; border-color: #fee500; }

/* 토스트 */
.toast {
  position: fixed; left: 16px; right: 16px; margin-inline: auto;
  width: fit-content; max-width: 448px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  transform: translateY(16px);
  background: var(--toast-bg); color: #fff; padding: 12px 18px; border-radius: 16px;
  border: 1px solid var(--line);
  font-size: 14px; font-weight: 700; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s var(--ease-out); z-index: 14;
}
.toast.on { opacity: 1; transform: none; }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 15; }

.img-overlay {
  position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .82);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
}
.img-overlay p { margin: 0; color: #fff; font-weight: 700; }
.img-overlay img { max-width: 100%; max-height: 70vh; border-radius: 12px; }
.img-overlay .btn { width: auto; min-width: 120px; }
/* 결과 이미지 모양 고르기 */
.pick-box {
  width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px;
  padding: 20px; border-radius: 22px; background: var(--surface); color: var(--ink);
}
.pick-box p { color: var(--ink); text-align: center; margin-bottom: 4px; }
.pick-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  min-height: 64px; padding: 12px 16px; border-radius: 16px; border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer; font: inherit;
}
.pick-opt b { font-size: 16px; }
.pick-opt small { font-size: 13px; color: var(--ink-2); }
.pick-opt:active { transform: scale(.98); }
.pick-box .btn { width: 100%; }
.cmp-actions { display: flex; flex-direction: column; gap: 8px; }
.pair-save { margin-top: 14px; }

/* =========================================================
 * 광고
 * ========================================================= */
.ad-slot { margin: 40px -16px; display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.ad-slot:empty { display: none; }
.ad-label { font-size: 11px; color: var(--ink-3); font-weight: 700; margin-bottom: 4px; }
.ad-slot.placeholder {
  margin: 40px 0; min-height: 100px; justify-content: center; border-radius: 12px;
  border: 1.5px dashed var(--line); color: var(--ink-3); font-size: 13px;
}

/* =========================================================
 * 푸터
 * ========================================================= */
footer { max-width: 480px; margin: 0 auto; padding: 8px 16px 40px; color: var(--ink-2); font-size: 13px; text-align: center; }
footer a { color: inherit; display: inline-block; padding: 8px 2px; }
footer p { margin: 4px 0; }

/* =========================================================
 * 친구 비교 카드
 * ========================================================= */
.compare { text-align: center; }
.cmp-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.cmp-side { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 16px; background: var(--group-soft); }
.cmp-side .cmp-m { width: 56px; height: 56px; --m-body: var(--group); }
.cmp-label { font-size: 12px; font-weight: 800; color: var(--ink-2); }
.cmp-code { font-size: 24px; font-weight: 900; color: var(--group-ink); letter-spacing: .04em; }
.cmp-name { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.cmp-vs { font-size: 13px; font-weight: 900; color: var(--ink-3); }
.cmp-letters { display: flex; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.cmp-l { display: flex; flex-direction: column; align-items: center; width: 44px; padding: 6px 0; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); font-variant-numeric: tabular-nums; }
.cmp-l b { font-size: 17px; font-weight: 900; line-height: 1.2; }
.cmp-l i { font-style: normal; font-size: 12px; font-weight: 800; color: var(--ink-3); }
.cmp-l.same { background: var(--brand-soft); box-shadow: none; }
.cmp-l.same b, .cmp-l.same i { color: var(--brand-text); }
.cmp-relation { font-size: 20px; font-weight: 900; margin: 8px 0 2px !important; }
.cmp-same { font-size: 13.5px; color: var(--ink-2); margin-bottom: 14px !important; }

/* =========================================================
 * 정밀 분석 (내 대화 기록 넣기) · AI 대화 결산
 * ========================================================= */
.deep-card {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 14px 16px;
  border-radius: 16px; border: 1.5px solid var(--brand); background: var(--brand-soft); color: var(--ink);
  text-align: left; cursor: pointer;
}
.deep-ico { font-size: 26px; flex: none; }
.deep-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.deep-txt b { font-size: 15.5px; color: var(--brand-text); }
.deep-txt small { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.deep-arrow { font-size: 26px; color: var(--brand-text); flex: none; }

.an-head { text-align: center; padding: 8px 0 4px; }
.an-m { width: 84px; height: 84px; }
.an-title { font-size: 26px; line-height: 1.3; margin: 8px 0 8px; letter-spacing: -0.02em; }
.an-sub { color: var(--ink-2); margin: 0 0 12px; }
.privacy-pill { display: inline-block; margin: 0; padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab { flex: 1; min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 800; font-size: 14px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); font-size: 14.5px; }
.steps b { color: var(--ink); }
.an-note { font-size: 12.5px; color: var(--ink-3); margin: 10px 0 0 !important; }
.an-note.center { text-align: center; margin: 16px 0 0 !important; }
.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 14px;
  border: 2px dashed var(--line); border-radius: 16px; text-align: center; cursor: pointer; background: var(--surface-2);
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop:focus-within { outline: 3px solid var(--brand); outline-offset: 2px; }
.drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop.busy { opacity: .6; pointer-events: none; }
.drop-ico { font-size: 34px; }
.drop-main { font-weight: 800; font-size: 15px; }
.drop-sub { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.an-progress { margin-top: 14px; }
.an-progress .bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.an-progress .bar i { display: block; height: 100%; width: 3%; background: var(--brand); border-radius: inherit; transition: width .3s ease; }
.an-progress p { margin: 8px 0 0; font-size: 13.5px; font-weight: 700; color: var(--ink-2); text-align: center; }
.an-error { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-text); font-size: 14px; font-weight: 700; }

.report-head { text-align: center; padding: 22px 16px 18px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.report-head .pre { font-size: 13px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.report-title { font-size: 28px; margin: 4px 0 10px; letter-spacing: -0.02em; }
.src-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 14px; }
.src-chip { padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.tile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 8px; border-radius: 16px; background: var(--group-soft); }
.tile b { font-size: 22px; font-weight: 900; color: var(--group-ink); font-variant-numeric: tabular-nums; }
.tile span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.habits { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 14px; }
.habits-lbl { font-size: 12.5px; font-weight: 800; color: var(--ink-3); width: 100%; }
.habit { padding: 6px 12px; border-radius: 99px; background: var(--bubble-me); color: var(--bubble-me-ink); font-size: 13.5px; font-weight: 800; }
#report-root .habit { background: var(--group-ink); color: var(--on-group, #fff); }
.report-type { margin-top: 14px; }
.axes-report { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; text-align: left; }
.axis-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 800; }
.axis-top .side { color: var(--ink-3); }
.axis-top .side.win { color: var(--group-ink); }
.axis-bar { position: relative; height: 10px; margin: 6px 0; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.axis-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--ink-3); opacity: .5; }
.axis-dot { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--group); border: 3px solid var(--surface); transform: translate(-50%, -50%); box-shadow: var(--shadow); }
.axis-ev { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-2); }
.report-actions { margin-top: 18px; }
#report-root { --on-group: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #report-root { --on-group: #101014; } }
:root[data-theme="dark"] #report-root { --on-group: #101014; }
#report-root .m-slot { --m-body: var(--group); }
.report-type .burst-bg { top: 50%; width: 420%; }
.demo-btn { display: block; margin: 12px auto 0; }
.demo-banner { background: var(--brand-soft); border-color: transparent; }

/* =========================================================
 * 연말 결산 스토리 (탭해서 넘기는 전체 화면 슬라이드)
 * 진한 그라데이션 배경 위 흰 글자 (대비 4.5:1 이상)
 * ========================================================= */
.story { position: relative; margin: -4px -4px 0; }
.st-bars { display: flex; gap: 4px; margin: 0 4px 10px; }
.st-bars i { flex: 1; height: 4px; border-radius: 99px; background: var(--line); transition: background-color .3s ease; }
.st-bars i.on { background: var(--brand); }
.st-stage { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.st-slide {
  min-height: calc(100vh - 140px); min-height: calc(100svh - 140px);
  border-radius: 28px; padding: 36px 24px 68px; color: #fff; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
}
.bg-rose { background: linear-gradient(160deg, #cf3460, #6e1435); }
.bg-indigo { background: linear-gradient(160deg, #4338ca, #1e1b4b); }
.bg-teal { background: linear-gradient(160deg, #0f766e, #0b3b3a); }
.bg-night { background: linear-gradient(160deg, #1e293b, #0b0f1a); }
.bg-violet { background: linear-gradient(160deg, #6d28d9, #2e1065); }
.bg-group { background: linear-gradient(160deg, var(--group-ink), #111018); }
.bg-summary { background: linear-gradient(160deg, #2a1250, #8e1f43); }
:root[data-theme="dark"] .bg-group, .bg-group { --m-face: #111018; }
.st-center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.st-body { display: flex; flex-direction: column; gap: 10px; }
.st-m { width: 96px; height: 96px; --m-body: #ffffff; --m-face: #cf3460; }
.st-kicker { margin: 0; font-size: 16px; font-weight: 800; color: rgba(255, 255, 255, .82); }
.st-hero { margin: 0; font-size: 46px; line-height: 1.15; font-weight: 900; letter-spacing: -0.02em; white-space: pre-line; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.st-chips .src-chip { background: rgba(255, 255, 255, .16); color: #fff; }
.st-hint { margin: 24px 0 0; font-size: 14px; font-weight: 700; color: rgba(255, 255, 255, .78); }
.st-big { margin: 0; display: flex; align-items: baseline; gap: 6px; }
.st-big b { font-size: 72px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.st-big span { font-size: 28px; font-weight: 800; }
.st-big2 { margin: 0; font-size: 52px; font-weight: 900; line-height: 1.1; }
.st-line { margin: 0; font-size: 22px; font-weight: 800; }
.st-line.small { font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, .85); }
.st-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 22px; }
.st-row div { display: flex; flex-direction: column; gap: 2px; padding: 14px 10px; border-radius: 16px; background: rgba(255, 255, 255, .12); }
.st-row b { font-size: 21px; font-weight: 900; font-variant-numeric: tabular-nums; }
.st-row span { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .8); }
.st-rank { list-style: none; margin: 12px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.st-rank li { display: grid; grid-template-columns: 28px 36px 1fr auto; align-items: center; gap: 8px; padding: 14px 14px; border-radius: 18px; background: rgba(255, 255, 255, .12); }
.st-rank li:first-child { background: rgba(255, 255, 255, .22); }
.st-rank .rk { font-size: 20px; font-weight: 900; }
.st-rank .ri { font-size: 26px; }
.st-rank .rl { font-size: 18px; font-weight: 800; }
.st-rank .rp { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .82); }
.st-habits { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 18px; }
.st-habits span { width: 100%; font-size: 13px; font-weight: 800; color: rgba(255, 255, 255, .8); }
.st-habits b { padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .16); font-size: 14px; }
.st-score { margin: 4px 0 0; display: flex; align-items: baseline; gap: 4px; }
.st-score b { font-size: 92px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.st-score span { font-size: 30px; font-weight: 800; }
.st-level { margin: 0; font-size: 28px; font-weight: 900; color: #ffd23f; }
.st-skills { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.sk-top { display: flex; justify-content: space-between; font-size: 14px; font-weight: 800; }
.sk-top b { font-variant-numeric: tabular-nums; }
.sk-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .18); overflow: hidden; margin-top: 4px; }
.sk-bar i { display: block; height: 100%; background: #ffd23f; border-radius: inherit; transform: scaleX(0); transform-origin: 0 50%; transition: transform .7s var(--ease-out); }
.st-tip { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .12); font-size: 14px; }
.st-tip b { font-size: 14.5px; }
.st-tip span { color: rgba(255, 255, 255, .88); }
#report-root .st-m { --m-body: #ffffff; --m-face: #cf3460; }
#report-root .st-hero-m { --m-body: #ffffff; --m-face: var(--group-ink); }
.st-code { margin: 4px 0 0; font-size: 64px; font-weight: 900; letter-spacing: .06em; line-height: 1; }
.st-name { margin: 0; font-size: 26px; font-weight: 900; }
.st-axes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.st-axes span { padding: 6px 12px; border-radius: 99px; background: rgba(255, 255, 255, .16); font-size: 13.5px; font-weight: 800; }
.st-summary { gap: 14px; }
.st-demo { margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .16); font-size: 13px; font-weight: 800; text-align: center; }
.st-sum-title { margin: 0; font-size: 26px; font-weight: 900; text-align: center; }
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sum-grid div { display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; border-radius: 16px; background: rgba(255, 255, 255, .12); }
.sum-grid span { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .8); }
.sum-grid b { font-size: 24px; font-weight: 900; }
.sum-grid small { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .9); }
.st-actions { margin-top: 6px; }
.st-actions .btn { background: #ffffff; color: #2a1250; }
.st-actions .btn.ghost { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .3); }
.st-note { margin: 0; font-size: 12px; color: rgba(255, 255, 255, .75); text-align: center; }
.st-nav {
  position: absolute; bottom: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .2); color: #fff; font-size: 24px; font-weight: 800; display: grid; place-items: center;
}
.st-nav.prev { left: 10px; }
.st-nav.next { right: 10px; }
.story.at-start .st-nav.prev, .story.at-end .st-nav.next { display: none; }
.st-nav:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sk.na .sk-top b { font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .7); }
.sk.na .sk-bar { opacity: .4; }
.st-fair { margin: 8px 0 0; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .78); }

/* =========================================================
 * 유형 일러스트 (Gemini로 만든 깜빡이 16종)
 * ========================================================= */
.type-art { display: block; overflow: hidden; background: var(--group-soft); flex: none; }
.type-art img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.type-art.fallback { display: grid; place-items: center; }
.type-card .type-art.e { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 2px; font-size: 26px; }
.match-card .type-art.e { width: 76px; height: 76px; border-radius: 18px; margin: 6px auto 4px; font-size: 32px; }
.hero-art { width: 172px; height: 172px; margin: 8px auto 6px; border-radius: 36px; box-shadow: 0 10px 30px rgba(20, 16, 30, .14); font-size: 72px; }
.st-hero-art { width: 184px; height: 184px; border-radius: 40px; box-shadow: 0 14px 40px rgba(0, 0, 0, .35); }

/* =========================================================
 * 결산 병맛 연출: 노란 스티커 드립 · AI 속마음 · 연말 편지
 * ========================================================= */
.st-sub { margin: 2px 0 0; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .72); }
.st-punch {
  align-self: flex-start; max-width: 100%;
  margin: 10px 0 2px; padding: 9px 14px; border-radius: 12px;
  background: #ffd23f; color: #2a1250; font-size: 17px; font-weight: 900; line-height: 1.35;
  transform: rotate(-2deg); box-shadow: 0 6px 0 rgba(0, 0, 0, .22);
}
.st-center .st-punch { align-self: center; }
.st-ai { max-width: 340px; margin: 12px auto 0; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .14); font-size: 14px; font-weight: 600; line-height: 1.5; text-align: left; }
.st-ai b { color: #ffd23f; }
.bg-letter { background: linear-gradient(160deg, #ff9a8b, #c2185b 70%); }
.lt-kicker { margin: 0 0 6px; font-size: 16px; font-weight: 900; text-align: center; }
.lt-paper {
  margin: 0 auto; width: 100%; max-width: 380px; padding: 22px 20px 18px; border-radius: 6px;
  background: #fffaf0 repeating-linear-gradient(transparent 0 31px, rgba(194, 24, 91, .12) 31px 32px);
  color: #3b2030; transform: rotate(-1deg); box-shadow: 0 14px 34px rgba(0, 0, 0, .3);
}
.lt-paper p { margin: 0 0 6px; font-size: 15px; font-weight: 600; line-height: 1.65; }
.lt-paper .lt-to { font-size: 17px; font-weight: 900; color: #c2185b; }
.lt-paper .lt-from { margin-top: 10px; text-align: right; font-weight: 900; }
.lt-paper .lt-ps { margin: 10px 0 0; font-size: 13px; color: #8a5a6e; }
:root[data-theme="dark"] .lt-paper { background-color: #fffaf0; color: #3b2030; }
.st-sub.center { margin-top: -8px; text-align: center; }

/* =========================================================
 * 가이드·안내 페이지 (tools/doc.template.html)
 * ========================================================= */
.doc-top {
  max-width: 720px; margin: 0 auto; padding: 4px 16px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 0 12px; flex-wrap: wrap;
}
/* 휴대폰에서 누르기 쉽게 글자는 그대로 두고 누르는 영역만 44px로 */
.doc-brand, .doc-nav a { display: inline-flex; align-items: center; min-height: 44px; }
.doc-brand { font-weight: 900; font-size: 15px; color: var(--ink); text-decoration: none; }
.doc-nav { display: flex; gap: 6px; margin-right: -6px; }
.doc-nav a { padding: 0 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.doc-nav a:hover, .doc-brand:hover { color: var(--brand-text); }
.wrap.doc { max-width: 720px; }
.doc h1 { font-size: 28px; line-height: 1.3; margin: 8px 0 10px; letter-spacing: -0.01em; word-break: keep-all; }
.doc h2 { font-size: 20px; margin: 34px 0 10px; word-break: keep-all; }
.doc h3 { font-size: 17px; margin: 24px 0 6px; }
.doc p, .doc li { color: var(--ink-2); font-size: 16px; line-height: 1.8; word-break: keep-all; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc a { color: var(--link); }
.doc code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: .92em; }
.doc blockquote {
  margin: 14px 0; padding: 14px 16px; border-left: 4px solid var(--brand); border-radius: 0 12px 12px 0;
  background: var(--surface); color: var(--ink); font-size: 15.5px; line-height: 1.7; box-shadow: var(--shadow);
}
.doc-crumb { margin: 6px 0 0; font-size: 14px; font-weight: 700; }
.doc-crumb a { text-decoration: none; display: inline-block; padding: 6px 0; }
.doc-meta { margin: 0 0 18px; font-size: 13.5px !important; color: var(--ink-3) !important; }
.doc-cta {
  margin: 36px 0 0; padding: 20px; border-radius: var(--radius); text-align: center;
  background: var(--brand-soft); border: 1px solid var(--line);
}
.doc-cta p { margin: 0; }
.doc-cta-k { font-size: 13px !important; font-weight: 800; color: var(--brand-text) !important; }
.doc-cta-t { margin: 4px 0 14px !important; font-size: 18px !important; font-weight: 900; color: var(--ink) !important; }
.doc-cta-b { display: flex; flex-direction: column; gap: 8px; }
.doc-cta .btn { text-decoration: none; color: var(--brand-ink); }
.doc-cta .btn.ghost { color: var(--ink); }
.doc-related { margin-top: 32px; }
.doc-related h2 { font-size: 17px; margin: 0 0 8px; }
.doc-related ul, .guide-list, .home-guides, .type-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-related li a, .home-guides li a {
  display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; line-height: 1.4;
}
.guide-list li a, .type-list li a {
  display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow);
}
.guide-list .gi { font-size: 28px; line-height: 1; }
.guide-list b, .type-list b { display: block; color: var(--ink); font-size: 16px; line-height: 1.4; }
.guide-list small, .type-list small { display: block; margin-top: 4px; color: var(--ink-3); font-size: 13.5px; line-height: 1.55; }
.type-list img { width: 52px; height: 52px; border-radius: 14px; flex: none; }
.doc .type-list li { margin: 0; }
.doc-related li a:hover, .home-guides li a:hover, .guide-list li a:hover, .type-list li a:hover { border-color: var(--brand); }
.home-guides { margin-bottom: 8px; }
.home-guides-more { margin: 0 0 8px; text-align: right; font-size: 14px; font-weight: 700; }
.home-guides-more a { color: var(--link); }
.doc-page .ad-slot { margin: 32px 0; }
.doc .type-list, .doc .guide-list, .doc .doc-related ul { padding-left: 0; }
footer .copy { margin-top: 10px; color: var(--ink-3); font-size: 12px; }
.doc-page footer { max-width: 720px; }

/* 결과 화면: 유형별 추천 가이드 */
.rec-guides { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rec-guides a {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); color: var(--ink); text-decoration: none; line-height: 1.4;
}
.rec-guides a:hover { box-shadow: inset 0 0 0 1.5px var(--group-ink, var(--brand)); }
.rec-guides .rg-e { font-size: 24px; flex: none; }
.rec-guides b { display: block; font-size: 15px; }
.rec-guides small { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-3); }
/* 결산 처방전 링크 */
.st-tip a { margin-top: 4px; color: #ffd23f; font-weight: 800; font-size: 14px; text-decoration: none; }
.st-tip a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }
.an-error { display: flex; flex-direction: column; gap: 6px; }
.an-error .an-help { font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.6; }
.an-error .an-help a { color: var(--link); }

/* 결과 화면: 유형별 추가 본문 */
.sw-card h3 { margin: 12px 0 4px; font-size: 14.5px; }
.sw-card h3:first-of-type { margin-top: 4px; }
.sw-list { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.sw-list li { position: relative; padding-left: 24px; color: var(--ink-2); line-height: 1.55; }
.sw-list.good li::before { content: "👍"; position: absolute; left: 0; }
.sw-list.warn li::before { content: "⚠️"; position: absolute; left: 0; }
.prompt-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.prompt-list li {
  display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); line-height: 1.55; color: var(--ink);
}
.prompt-list li span { flex: 1; }
.copy-btn {
  flex: none; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 800; cursor: pointer;
}
.copy-btn:active { transform: scale(.96); }

/* AI 궁합 */
.pair-sub { color: var(--ink-2); margin: 16px 0 0 !important; }
.pair-quote { text-align: center; color: var(--ink-2); margin: 0 0 6px !important; }
.pair-quote small { display: block; font-size: 12px; font-weight: 800; color: var(--ink-3); }
.pair-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 4px; }
.pair-chip {
  min-height: 40px; border-radius: 12px; border: 2px solid transparent; background: var(--group-soft);
  color: var(--group-ink); font-size: 14px; font-weight: 900; letter-spacing: .03em; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.pair-chip[aria-pressed="true"] { border-color: var(--group); background: var(--surface); }
.pair-chip:active { transform: scale(.96); }
.pair-out { margin-top: 12px; }
.pair-out.in-compare { text-align: left; margin: 4px 0 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pair-hint { color: var(--ink-3); font-size: 13.5px; text-align: center; margin: 4px 0 !important; }
.pair-who { text-align: center; color: var(--ink-2); margin: 0 0 6px !important; }
.pair-score { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 0 !important; }
.pair-score span { font-size: 13.5px; font-weight: 800; color: var(--ink-2); }
.pair-score b { font-size: 34px; font-weight: 900; color: var(--brand-text); font-variant-numeric: tabular-nums; }
.pair-verdict { text-align: center; font-weight: 700; margin: 2px 0 10px !important; }
.pair-out h3 { margin: 14px 0 6px; font-size: 14.5px; }
.pair-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pair-lines li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.55; color: var(--ink-2); }
.pl-k {
  flex: none; min-width: 34px; padding: 2px 6px; border-radius: 8px; background: var(--brand-soft);
  color: var(--brand-text); font-size: 12px; font-weight: 900; text-align: center; margin-top: 2px;
}
.pair-card > .btn { margin-top: 14px; }

/* =========================================================
 * 단톡방 AI 유형 지도
 * ========================================================= */
.group-head { margin: 4px 0 14px; }
.group-head .title { font-size: 28px; }
.group-cta h2 { margin-top: 0; }
.group-cta p { color: var(--ink-2); }
.group-cta .btn + .btn { margin-top: 8px; }
.group-cta.pending, .group-cta.joined { border: 2px solid var(--brand); }
.nick-form { display: flex; gap: 8px; margin-top: 10px; }
.nick-input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px;
}
.nick-input:focus { outline: none; border-color: var(--brand); }
.nick-form .btn { width: auto; flex: none; padding: 0 18px; }
.group-room { display: flex; align-items: center; gap: 14px; background: var(--group-soft); }
.group-room-art { width: 64px; height: 64px; border-radius: 18px; flex: none; font-size: 30px; }
.group-room .gr-k { margin: 0; font-size: 13px; font-weight: 800; color: var(--ink-3); }
.group-room .gr-c { margin: 2px 0 0; font-size: 18px; font-weight: 800; color: var(--ink); }
.group-room .gr-c b { color: var(--group-ink); font-size: 22px; letter-spacing: .04em; }
.group-axes { display: flex; flex-direction: column; gap: 10px; }
.ga-row { display: grid; grid-template-columns: 72px 1fr 72px; grid-template-rows: auto auto; align-items: center; column-gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ga-r { text-align: right; }
.ga-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.ga-bar i { display: block; height: 100%; background: var(--brand); border-radius: inherit; }
.ga-n { grid-column: 2; text-align: center; font-size: 12px; color: var(--ink-3); }
.group-lines { margin: 12px 0 0; padding-left: 20px; color: var(--ink-2); }
.group-lines li { margin: 2px 0; }
.group-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.group-members a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.gm-art { width: 44px; height: 44px; border-radius: 12px; flex: none; font-size: 22px; }
.gm-t { flex: 1; min-width: 0; }
.gm-t b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-t small { display: block; font-size: 12.5px; color: var(--ink-3); }
.gm-role { flex: none; padding: 4px 10px; border-radius: 99px; background: var(--group-soft); color: var(--group-ink); font-size: 12px; font-weight: 800; }
