/* 근본 테스트 — 인주 도장 (docs/design-direction.md §4) */
:root {
  --bg: #F3F1EC; --surface: #FBFAF7; --ink: #1C1C1E; --muted: #6F6B64; --line: #DDD8CE; --accent: #8E2B22;
  --ink-2: #45423D; --sunken: #EAE7E0; --bar-2: #CFC9BE; --on-accent: #FFFFFF;
  --accent-soft: #F4E9E4;
  --field: #8E2B22; --on-field: #F7EFE6; --on-field-2: #E7CFC7; --field-line: #A9483F;
  --seal: #8E2B22; --seal-ink: #FBFAF7;
  --btn-bg: #8E2B22; --btn-fg: #FFFFFF;
  /* 데이터 전용 (채도 낮춤) */
  --d1: #A88A4E; --d2: #4F7A63; --d3: #8A8178;
  --serif: "Nanum Myeongjo", "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --r-card: 12px; --r-ctl: 10px;
  --sheet-shadow: 0 8px 24px -12px rgba(0,0,0,.12);
  color-scheme: light;
  /* 예전 이름 (JS 인라인 스타일 호환) */
  --red: var(--accent); --paper: var(--bg); --card: var(--surface); --paper-2: var(--sunken);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141312; --surface: #1D1C1A; --ink: #ECE8E0; --muted: #96918A; --line: #2E2C29; --accent: #B9615A;
    --ink-2: #C4BFB6; --sunken: #262522; --bar-2: #45423D; --on-accent: #141312;
    --accent-soft: #2A1E1B;
    --field: #4A201C; --on-field: #ECE4DA; --on-field-2: #C9B3AB; --field-line: #6A3530;
    --seal: #B9615A; --seal-ink: #141312;
    --btn-bg: #ECE8E0; --btn-fg: #141312;
    --d1: #9C8457; --d2: #5E8A72; --d3: #7E776F;
    --sheet-shadow: 0 8px 24px -12px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141312; --surface: #1D1C1A; --ink: #ECE8E0; --muted: #96918A; --line: #2E2C29; --accent: #B9615A;
  --ink-2: #C4BFB6; --sunken: #262522; --bar-2: #45423D; --on-accent: #141312;
  --accent-soft: #2A1E1B;
  --field: #4A201C; --on-field: #ECE4DA; --on-field-2: #C9B3AB; --field-line: #6A3530;
  --seal: #B9615A; --seal-ink: #141312;
  --btn-bg: #ECE8E0; --btn-fg: #141312;
  --d1: #9C8457; --d2: #5E8A72; --d3: #7E776F;
  --sheet-shadow: 0 8px 24px -12px rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--bg); font-family: var(--sans); font-size: 16px; line-height: 1.6; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere; min-height: 100vh; min-height: 100dvh;
}
img, svg { max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* header */
.top { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1080px; margin: 0 auto; height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; }
.brand { text-decoration: none; font-family: var(--serif); font-weight: 800; letter-spacing: -.04em; font-size: 20px; line-height: 1; }
.top-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 500; cursor: pointer; }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.wide { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; cursor: pointer; border-radius: var(--r-ctl); font-weight: 700; font-size: 16px; padding: 15px 22px; text-decoration: none; transition: background .15s, border-color .15s; letter-spacing: -.01em; min-height: 52px; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn small { font-weight: 500; font-size: 14px; }
.btn-primary:hover { filter: brightness(.94); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-light { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-sm { font-size: 14px; padding: 10px 14px; min-height: 44px; }

/* landing · 인주색 면 */
.stage { background: var(--field); color: var(--on-field); }
.stage-in { max-width: 1080px; margin: 0 auto; padding: 32px 16px 40px; display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "card" "cta"; }
.stage-head { grid-area: head; min-width: 0; }
.stage-card { grid-area: card; min-width: 0; padding-top: 6px; }
.stage-cta { grid-area: cta; display: grid; gap: 10px; align-content: start; width: 100%; max-width: 440px; margin: 0 auto; }
.stage-kicker { margin: 0; font-size: 14px; font-weight: 500; color: var(--on-field-2); }
.stage-title { font-family: var(--serif); font-weight: 800; font-size: clamp(36px, 10vw, 88px); line-height: 1.12; letter-spacing: -.04em; margin: 10px 0 16px; word-break: keep-all; }
.stage-lead { margin: 0; font-size: 16px; color: var(--on-field-2); max-width: 30em; }
.stage-lead b { color: var(--on-field); font-weight: 700; }
.stage-meta { margin: 2px 0 0; font-size: 12px; color: var(--on-field-2); text-align: center; }
.stage .kw { justify-content: flex-start; }
.stage .kw span { background: transparent; border-color: var(--field-line); color: var(--on-field); }
.stage .kw span::before { color: var(--on-field-2); }
.stage .btn-row { grid-template-columns: 1.3fr 1fr; }
.btn-stamp { background: var(--on-field); color: var(--field); flex-direction: column; gap: 0; line-height: 1.25; min-height: 60px; }
.btn-stamp small { color: var(--field); font-size: 12px; }
.btn-stamp:hover { filter: brightness(.96); }
.btn-on-field { background: transparent; color: var(--on-field); border-color: var(--on-field-2); }
.btn-on-field:hover { background: var(--field-line); }
.invite-banner { border: 1px solid var(--field-line); border-radius: var(--r-card); padding: 12px 14px; margin-bottom: 20px; max-width: 460px; font-size: 14px; color: var(--on-field); }
@media (min-width: 900px) {
  .stage-in { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); grid-template-areas: "head card" "cta card"; column-gap: 64px; row-gap: 28px; padding: 72px 16px 80px; align-items: start; }
  .stage-head { align-self: end; }
  .stage-cta { margin: 0; }
  .stage-meta { text-align: left; }
}

/* 결과 카드 (예시·실제) */
.cc { position: relative; margin: 0 auto; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 20px 24px; max-width: 440px; }
@media (min-width: 900px) { .stage-card .cc { margin: 0 0 0 auto; } }
.ex-tag { position: absolute; top: -12px; left: 16px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; letter-spacing: .04em; }
.cc-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.cc-no { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-code { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 12px 0 12px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); padding: 12px 0 10px; }
.cc-code span { display: grid; justify-items: center; }
.cc-code b { font-family: var(--serif); font-weight: 800; font-size: clamp(44px, 14vw, 64px); line-height: 1; }
.cc-code small { font-family: var(--serif); font-weight: 800; font-size: 14px; color: var(--muted); margin-top: 6px; }
.cc-nick { font-family: var(--serif); font-weight: 800; font-size: 28px; letter-spacing: -.04em; line-height: 1.3; }
.cc-type { font-size: 14px; color: var(--ink-2); margin: 4px 0 14px; }
.cc-axes { list-style: none; margin: 0; padding: 0 84px 0 0; display: grid; gap: 7px; }
.cc-axes li { display: grid; grid-template-columns: 52px 1fr 34px; gap: 8px; align-items: center; font-size: 12px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-axes i { display: block; height: 6px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.cc-axes i b { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.cc-axes em { font-style: normal; font-weight: 700; color: var(--ink); text-align: right; }
.cc-foot { margin-top: 14px; font-size: 12px; color: var(--muted); }
.seal.cc-seal { position: absolute; right: 18px; bottom: 22px; --s: 72px; transform: rotate(-6deg); animation: stamp .12s ease-out both; }
@keyframes stamp { from { transform: rotate(-6deg) scale(1.15); } to { transform: rotate(-6deg) scale(1); } }

/* 인주 도장 */
.seal { --s: 56px; width: var(--s); height: var(--s); flex: none; display: grid; place-items: center; text-align: center; border-radius: 6px; background: var(--seal); color: var(--seal-ink); font-family: var(--serif); font-weight: 800; line-height: 1.04; }
.seal-l1 { font-size: calc(var(--s) * .6); }
.seal-l2 { font-size: calc(var(--s) * .38); }
.seal-l3 { font-size: calc(var(--s) * .27); }
.seal.is-line { background: transparent; color: var(--seal); border: 2px solid var(--seal); }
.seal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 6px; }
@media (min-width: 760px) { .seal-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.seal-cell { background: none; border: 0; padding: 8px 2px; cursor: pointer; display: grid; justify-items: center; gap: 6px; min-width: 0; border-radius: var(--r-ctl); }
.seal-cell:hover { background: var(--sunken); }
.seal-cell b { font-size: 14px; font-weight: 700; letter-spacing: .08em; line-height: 1.2; }
.seal-cell small { font-size: 12px; color: var(--muted); line-height: 1.2; }

.section { padding-top: 48px; padding-bottom: 48px; }
.sec-head { margin-bottom: 24px; }
.sec-title { font-family: var(--serif); font-weight: 800; font-size: 28px; letter-spacing: -.04em; line-height: 1.3; margin: 0 0 8px; }
.sec-sub { color: var(--muted); margin: 0; font-size: 14px; max-width: 36em; }
.sec-kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.today-strong { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); padding: 18px 0; }
.ts-day { font-family: var(--serif); font-weight: 800; font-size: 32px; line-height: 1.05; text-align: center; color: var(--accent); }
.ts-h { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.today-strong p { margin: 0; color: var(--ink-2); font-size: 14px; }
.how-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; }
.how-list li { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); }
.how-n { font-weight: 800; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.how-list h3 { margin: 0 0 4px; font-size: 16px; }
.how-list p { margin: 0; color: var(--ink-2); font-size: 14px; }
.faq h3 { font-size: 16px; margin: 20px 0 4px; }
.faq p { margin: 0; color: var(--ink-2); font-size: 14px; }
.fact-list { margin: 16px 0 0; display: grid; }
.fact-list > div { display: grid; grid-template-columns: minmax(0, 116px) 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); align-items: baseline; }
.fact-list dt { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.fact-list dd { margin: 0; color: var(--ink-2); font-size: 14px; }
.bottom-cta { padding-top: 24px; padding-bottom: 32px; }
.left { text-align: left; }

/* 다른 서비스 · 미니 테스트 */
.minis { margin: 40px 0 8px; }
.others-h { font-family: var(--serif); font-weight: 800; font-size: 20px; letter-spacing: -.03em; margin: 0 0 8px; }
.mini-grid { display: grid; gap: 8px; }
@media (min-width: 560px) { .mini-grid { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); grid-auto-flow: column; } }
.mini-card { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; min-width: 0; }
.mini-card:hover { border-color: var(--muted); }
.mini-hz { grid-row: 1 / span 2; font-family: var(--serif); font-weight: 800; font-size: 32px; line-height: 1; color: var(--accent); }
.mini-card b { font-size: 14px; line-height: 1.4; }
.mini-card small { font-size: 12px; color: var(--muted); }


/* flow */
.flow { max-width: 560px; margin: 0 auto; padding: 14px 16px 40px; min-height: calc(100dvh - 56px); display: flex; flex-direction: column; }
.flow-top { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.back { width: 44px; height: 44px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; flex: none; }
.prog { flex: 1; height: 4px; background: var(--sunken); border-radius: 999px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.prog-n { font-size: 12px; font-weight: 500; color: var(--muted); min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-art { text-align: center; margin: 8px auto 14px; font-family: var(--serif); font-weight: 800; font-size: 44px; line-height: 1; color: var(--accent); }
.q-label { text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.q-title { text-align: center; font-family: var(--serif); font-weight: 800; font-size: 28px; line-height: 1.35; letter-spacing: -.03em; margin: 6px 0 8px; }
.q-sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.opts { display: grid; gap: 8px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 16px 18px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 16px; font-weight: 500; transition: border-color .15s, background .15s; min-height: 58px; }
.opt:hover { border-color: var(--muted); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.opt.center { justify-content: center; text-align: center; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.input, select.input { width: 100%; font: inherit; font-size: 16px; padding: 14px 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); color: var(--ink); outline: none; appearance: none; -webkit-appearance: none; min-height: 52px; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2396918A' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.input:focus { border-color: var(--ink); }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 500; font-size: 14px; }
.chip.sel { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.hint { font-size: 12px; color: var(--muted); margin: 6px 2px 0; }
.hint.err { color: var(--accent); font-weight: 700; }
.surname-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--sunken); border-radius: 999px; padding: 6px 6px 6px 12px; font-size: 14px; margin-top: 10px; }
.surname-pill input { width: 64px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 10px; font: inherit; font-weight: 700; text-align: center; }
.flow-foot { margin-top: auto; padding-top: 24px; display: grid; gap: 10px; }
.skip { background: none; border: 0; color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; padding: 8px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--sunken); border-radius: var(--r-ctl); padding: 3px; margin: 0 0 12px; }
.seg button { border: 0; background: none; padding: 10px; border-radius: 8px; font-weight: 500; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); }
.leap { display: flex; gap: 8px; align-items: center; margin: 10px 2px 0; font-weight: 500; font-size: 14px; }
.leap input { width: 18px; height: 18px; accent-color: var(--accent); }
.leap small { color: var(--muted); font-weight: 500; font-size: 12px; }
select.input:disabled { opacity: .45; }

/* loading */
.loading { min-height: calc(100dvh - 56px); display: grid; place-items: center; text-align: center; padding: 24px 16px; }
.load-seal { width: 88px; height: 88px; margin: 0 auto 20px; display: grid; place-items: center; text-align: center; border: 2px solid var(--accent); border-radius: 8px; color: var(--accent); font-family: var(--serif); font-weight: 800; font-size: 30px; line-height: 1.05; transform: rotate(-6deg); }
.load-title { font-family: var(--serif); font-weight: 800; font-size: 28px; margin: 0 0 6px; }
.load-msg { color: var(--muted); font-size: 14px; min-height: 1.6em; margin: 0; }
.load-bar { width: 200px; height: 2px; background: var(--sunken); border-radius: 2px; margin: 20px auto 0; overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; background: var(--accent); animation: lb 2s linear forwards; }
@keyframes lb { to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .cc-seal { animation: none; }
  .load-bar i { animation: none; width: 100%; }
  .sheet { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* result */
.result { padding-bottom: 110px; }
.stage-title.stage-title-sm { font-size: clamp(28px, 7vw, 48px); margin-bottom: 4px; }
.daily { margin: 24px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
.daily-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 500; flex-wrap: wrap; }
.streak { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.daily-msg { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0; }
.daily-msg svg { flex: none; }
.daily-msg p { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 800; line-height: 1.6; }
.daily-msg small { display: block; color: var(--muted); font-family: var(--sans); font-weight: 500; font-size: 12px; margin-top: 4px; }
.daily-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); padding-top: 12px; }
.daily-stats div { text-align: center; padding: 0 4px; min-width: 0; }
.daily-stats div + div { border-left: 1px solid var(--line); }
.daily-stats b { display: block; font-size: 14px; font-weight: 700; }
.daily-stats span { font-size: 12px; color: var(--muted); }
.kw { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.kw span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-weight: 500; font-size: 14px; }
.kw span::before { content: "#"; color: var(--muted); margin-right: 2px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; margin: 16px 0; }
.card h2, .card-h { font-family: var(--serif); font-weight: 800; font-size: 20px; letter-spacing: -.03em; margin: 0 0 4px; line-height: 1.35; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.axes { display: grid; gap: 14px; }
.axis-t { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; font-size: 14px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.axis-t small { font-size: 12px; color: var(--muted); font-weight: 500; text-align: center; }
.axis-t span.win { color: var(--ink); font-weight: 700; }
.axis-t b { font-family: var(--sans); font-weight: 700; color: var(--ink); }
.axis-track { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--sunken); margin-top: 6px; gap: 2px; }
.axis-track i { display: block; height: 100%; width: 0; }
.axis-track i.l { background: var(--ink); }
.axis-track i.r { background: var(--bar-2); }
.mini-h { font-size: 16px; font-weight: 700; margin: 24px 0 10px; }
.blend-bars { display: grid; gap: 12px; }
.bb { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; cursor: pointer; background: none; border: 0; padding: 0; text-align: left; width: 100%; }
.bb svg { width: 40px; height: 40px; }
.bb-name { font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; gap: 6px; }
.bb-name small { font-weight: 500 !important; font-size: 12px; }
.bb-track { height: 8px; background: var(--sunken); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.bb-track i { display: block; height: 100%; border-radius: 999px; width: 0; }
.bb-pct { font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.formula { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 12px 14px; background: var(--bg); }
.formula summary { font-weight: 700; cursor: pointer; font-size: 14px; }
.formula p, .formula li { font-size: 14px; color: var(--ink-2); }
.formula ul { padding-left: 18px; margin: 10px 0 0; }
.formula li { margin: 6px 0; }
.ftable { display: grid; gap: 2px; margin: 8px 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.ftable > div { display: grid; grid-template-columns: 1fr 1fr 1fr 1.2fr 1fr; gap: 4px; padding: 6px 8px; background: var(--surface); border-radius: 6px; text-align: right; }
.ftable > div span:first-child { text-align: left; font-family: var(--serif); font-weight: 800; }
.ftable .fh { background: none; color: var(--muted); font-weight: 500; }

.desc { font-size: 16px; line-height: 1.75; margin: 0; }
.two-col { display: grid; gap: 8px; margin-top: 16px; }
@media (min-width: 560px) { .two-col { grid-template-columns: 1fr 1fr; } }
.box { border-radius: var(--r-ctl); padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); }
.box h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.box ul { margin: 0; padding-left: 18px; font-size: 14px; }
.box li { margin: 3px 0; }
.jobs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.jobs span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 500; }
.today-box { margin-top: 16px; border-left: 2px solid var(--ink); padding: 4px 0 4px 14px; font-size: 14px; color: var(--ink-2); }
.today-box b { display: block; color: var(--ink); margin-bottom: 2px; }

/* saju */
.pillars { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 6px; margin: 4px 0 18px; }
.pillar { border-radius: var(--r-ctl); overflow: hidden; border: 1px solid var(--line); text-align: center; background: var(--bg); }
.pillar .pl { font-size: 12px; font-weight: 500; color: var(--muted); padding: 6px 0 4px; }
.pillar .ch { font-family: var(--serif); font-weight: 800; font-size: 24px; line-height: 1.15; padding: 6px 0; color: #fff; }
.pillar .ch small { display: block; font-family: var(--sans); font-size: 12px; font-weight: 500; opacity: .9; }
.pillar.me { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.warn { background: var(--sunken); border-radius: var(--r-ctl); padding: 10px 12px; font-size: 14px; color: var(--ink-2); margin: -6px 0 14px; display: flex; gap: 8px; align-items: flex-start; }
.warn .ic { width: 18px; height: 18px; margin-top: 2px; color: var(--muted); }
.el-head { display: grid; grid-template-columns: 52px 1fr 40px 52px; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 4px; }
.el-head span:nth-child(2) { grid-column: 3; text-align: right; white-space: nowrap; }
.el-head span:nth-child(3) { grid-column: 4; text-align: right; white-space: nowrap; }
.el-bars { display: grid; gap: 10px; }
.el-row { display: grid; grid-template-columns: 52px 1fr 40px 52px; gap: 10px; align-items: center; font-size: 14px; }
.el-row b { font-family: var(--serif); font-size: 16px; }
.el-row b small { font-size: 12px; color: var(--muted); font-family: var(--sans); }
.el-track { height: 8px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.el-track i { display: block; height: 100%; border-radius: 999px; }
.el-row > span { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.el-row .hid { color: var(--muted); font-weight: 500; font-size: 12px; }
.saju-note { margin: 16px 0 0; font-size: 14px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); padding: 12px 14px; border-radius: var(--r-ctl); }
.saju-note p { margin: 0 0 6px; }
.saju-note p:last-child { margin: 0; }
.basis { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }

/* ancestors */
.anc-hook, .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 2px 0 16px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--bg); }
.stat-row { margin: 6px 0 12px; }
.anc-hook div, .stat-row div { padding: 12px 6px; text-align: center; min-width: 0; }
.anc-hook div + div, .stat-row div + div { border-left: 1px solid var(--line); }
.anc-hook b, .stat-row b { display: block; font-weight: 700; font-size: 20px; line-height: 1.25; word-break: keep-all; font-variant-numeric: tabular-nums; }
.anc-hook span, .stat-row span { font-size: 12px; color: var(--muted); }
.tl { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.tl::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl li { position: relative; padding: 0 0 16px; }
.tl li::before { content: ""; position: absolute; left: -20px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--ink); }
.tl-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.tl-h b { font-size: 16px; }
.tl-h span { font-size: 12px; color: var(--muted); font-weight: 500; }
.tl-h em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.tl p { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tl.future p { display: block; font-size: 14px; color: var(--ink-2); }
.ev { display: inline-flex; gap: 6px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 12px; }
.ev i { font-style: normal; background: var(--sunken); color: var(--ink); border-radius: 999px; padding: 1px 7px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.deep-li .tl-h b { color: var(--muted); }
.deep-li::before { border-style: dashed !important; }
.muted { color: var(--muted); font-size: 14px; }
.fine { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.6; }
.likely p { font-size: 14px; margin: 0 0 10px; }
.stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; }
.stack i { display: block; height: 100%; }
.stack-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; font-weight: 500; margin: 8px 0 4px; }
.stack-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.resemble { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 14px; border-radius: var(--r-ctl); background: var(--bg); border: 1px solid var(--line); }
.resemble svg { flex: none; }
.resemble small { color: var(--muted); font-weight: 500; font-size: 12px; }
.resemble b { display: block; font-family: var(--serif); font-size: 16px; }
.resemble p { margin: 2px 0 0; font-size: 14px; color: var(--ink-2); }
.inline-cta { display: inline-block; margin-top: 12px; font-weight: 700; font-size: 14px; color: var(--ink); text-underline-offset: 3px; }
.pass { margin-top: 4px; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--bg); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.fact { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-ctl); background: var(--bg); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.fact b { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.clan { margin-top: 14px; border-radius: var(--r-ctl); padding: 16px; background: var(--bg); border: 1px solid var(--line); }
.clan h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clan p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* eras */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px 14px; padding: 2px 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 700; }
.era-card { display: grid; grid-template-columns: 68px 1fr; gap: 14px; align-items: start; }
.era-card svg { width: 68px; height: 68px; }
.era-y { font-size: 12px; font-weight: 500; color: var(--muted); }
.era-h { font-family: var(--serif); font-weight: 800; font-size: 20px; line-height: 1.4; margin: 2px 0 6px; }
.era-card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.era-dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.era-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.era-dots i.on { background: var(--ink); width: 16px; border-radius: 3px; }

/* code final */
.code-final { text-align: center; }
.code-badge { display: flex; justify-content: center; gap: 8px; margin: 16px 0 6px; }
.code-badge span { width: 60px; height: 72px; border-radius: var(--r-ctl); background: var(--bg); border: 1px solid var(--line); color: var(--ink); display: grid; place-items: center; align-content: center; }
.code-badge b { font-size: 36px; font-weight: 700; line-height: 1; }
.code-badge small { font-family: var(--serif); font-weight: 800; font-size: 12px; color: var(--muted); margin-top: 2px; }
.code-final h2.code-nick { font-size: 28px; margin: 12px 0 4px; }
.code-meta { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.code-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.code-sum { text-align: left; margin: 0 0 14px; padding: 12px 14px 12px 30px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-ctl); font-size: 14px; color: var(--ink-2); }
.code-sum li { margin: 4px 0; }
.code-sum b { color: var(--ink); }
.code-match { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-bottom: 10px; text-align: left; }
.code-match > div > small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.cm { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-ctl); padding: 8px 10px; margin: 0 6px 6px 0; font-weight: 700; letter-spacing: .06em; cursor: pointer; font-size: 16px; }
.cm small { display: block; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.code-final .btn-row { margin-top: 12px; }

/* compat */
.invite-box { margin-top: 16px; padding: 16px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--bg); }
.invite-box h3 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.invite-box p { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
.friend-form { margin-top: 20px; }
.friend-form .row3 select { padding: 12px 28px 12px 12px; }
.cmp { margin-top: 16px; border-radius: var(--r-ctl); padding: 18px 16px; background: var(--bg); border: 1px solid var(--line); }
.cmp-label { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.cmp-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cmp-p { text-align: center; flex: 1; min-width: 0; }
.cmp-p svg { width: 56px; height: 56px; }
.cmp-p b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-p small { color: var(--muted); font-size: 12px; }
.ring { width: 96px; height: 96px; flex: none; position: relative; }
.ring svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.ring span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-weight: 700; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--accent); }
.ring span small { font-size: 12px; display: block; color: var(--muted); font-weight: 500; }
.cmp-rows { display: grid; gap: 12px; margin: 16px 0 12px; }
.cmp-row { font-size: 14px; }
.cmp-row .t { display: flex; justify-content: space-between; font-weight: 700; font-variant-numeric: tabular-nums; }
.cmp-row .bar { height: 6px; background: var(--sunken); border-radius: 999px; margin: 6px 0 4px; overflow: hidden; }
.cmp-row .bar i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.cmp-row p { margin: 0; color: var(--muted); font-size: 12px; }
.cmp-story { margin: 0; font-family: var(--serif); font-size: 16px; line-height: 1.7; color: var(--ink); border-top: 1px solid var(--line); padding-top: 12px; }
.cmp-est { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.history { margin-top: 14px; display: grid; gap: 6px; }
.history > b { font-size: 14px; margin-top: 6px; }
.history button { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: 8px 12px; cursor: pointer; text-align: left; font-size: 14px; }
.history svg { width: 32px; height: 32px; flex: none; }
.history .sc { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* dex */
.dex { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dex button { border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-ctl); padding: 8px 2px 6px; cursor: pointer; color: var(--muted); min-width: 0; }
.dex button svg { width: 48px; height: 48px; display: block; margin: 0 auto; }
.dex button b { display: block; font-size: 12px; color: var(--ink); margin-top: 2px; }
.dex button small { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dex button.locked b { color: var(--muted); font-weight: 500; }
.dex button.mine { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dex-progress { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.dex-progress .prog { height: 6px; }

.share-card-sec { text-align: center; }
.share-preview { width: 100%; max-width: 320px; border-radius: var(--r-card); display: block; margin: 0 auto 14px; border: 1px solid var(--line); aspect-ratio: 4 / 5; background: var(--bg); }

.retry { text-align: center; margin: 26px 0 10px; display: grid; gap: 8px; justify-items: center; }

/* sticky share */
.sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); transform: translateY(110%); visibility: hidden; }
.sticky.show { transform: none; visibility: visible; }
.sticky-in { max-width: 608px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }
.sticky .btn { padding: 12px 10px; font-size: 16px; min-height: 48px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .4); }
.modal.open { display: flex; }
.sheet { width: 100%; max-width: 520px; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: var(--r-card) var(--r-card) 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); animation: up .22s ease both; position: relative; box-shadow: var(--sheet-shadow); }
@media (min-width: 640px) { .modal { align-items: center; } .sheet { border-radius: var(--r-card); } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet-x { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.sheet h2 { font-family: var(--serif); font-weight: 800; margin: 4px 0 12px; font-size: 20px; padding-right: 40px; }
.share-actions { display: grid; gap: 8px; }
.type-modal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.type-modal-head svg { width: 76px; height: 76px; flex: none; }
.tm-kicker { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.tm-tag { color: var(--ink-2); font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 12px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 500; font-size: 14px; z-index: 80; opacity: 0; pointer-events: none; transition: .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* footer */
body.in-flow .jl-footer, body.in-flow .top-btn { display: none; }
body.has-sticky .jl-footer { padding-bottom: 120px; }
@media (min-width: 900px) { .hero-in { padding: 88px 16px 80px; } }

.code-sm { font-family: var(--sans) !important; font-weight: 700; letter-spacing: .08em; color: var(--muted) !important; }

/* 결과 읽는 법 · 텍스트 구간 */
.read-note { padding: 28px 0 20px; border-top: 1px solid var(--line); margin-top: 28px; }
.read-note h2 { font-family: var(--serif); font-weight: 800; font-size: 20px; letter-spacing: -.03em; margin: 0 0 8px; }
.read-note p { margin: 0 0 8px; font-size: 14px; color: var(--ink-2); }

/* mini tests */
.mini { padding-bottom: 30px; }
.rank { display: grid; gap: 8px; }
.rank > div { display: grid; grid-template-columns: 22px 30px 1fr 56px; gap: 8px; align-items: center; font-size: 14px; }
.rank b { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; }
.rank span { font-family: var(--serif); font-weight: 800; font-size: 16px; }
.rank em { font-style: normal; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.rk-track { height: 8px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.rk-track i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.big-num { text-align: center; font-weight: 800; font-size: clamp(44px, 14vw, 64px); color: var(--ink); line-height: 1.1; margin: 4px 0 8px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.big-num small { font-size: .4em; color: var(--ink); margin-left: 4px; }
.center { text-align: center; }
.range { width: 100%; accent-color: var(--accent); margin: 4px 0 0; }
.evs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 0; }
.anc-result .btn { margin-top: 14px; }

/* 질문 이동: 이전·다음, 건너뛰기, 진행 점 */
.nav-row { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.skip-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 16px; }
.skip-note { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.q-status { display: flex; align-items: center; gap: 12px; margin: -16px 0 20px; min-width: 0; }
.qdots { list-style: none; margin: 0; padding: 0 0 0 56px; display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.qdots li { box-sizing: border-box; flex: none; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--bar-2); background: transparent; }
.qdots li.is-done { background: var(--accent); border-color: var(--accent); }
.qdots li.is-skip { border-style: dashed; border-color: var(--muted); }
.qdots li.is-cur { outline: 2px solid var(--ink); outline-offset: 2px; }
.q-count { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.opt:focus-visible, .skip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-notice { margin: 20px 0 0; padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-ctl); background: var(--surface); display: grid; gap: 12px; }
.skip-notice p { margin: 0; font-size: 15px; color: var(--ink-2); }
.skip-notice .btn { justify-self: start; }
.formula .f-skip { background: var(--surface); padding: 8px 10px; border-radius: 8px; }

/* 서비스 안내 글 (정적 HTML, 앱 아래) */
.svc-guide { margin-top: 56px; padding-top: 32px; padding-bottom: 8px; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.75; color: var(--ink); }
.svc-guide > * { max-width: 680px; }
.svc-guide h2 { font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.4; letter-spacing: -.02em; margin: 0 0 8px; }
.svc-guide h3 { font-size: 16px; font-weight: 700; line-height: 1.5; margin: 32px 0 8px; }
.svc-guide p, .svc-guide ul, .svc-guide ol { margin: 0 0 12px; }
.svc-guide ul, .svc-guide ol { padding-left: 20px; }
.svc-guide li { margin: 4px 0; }
.svc-guide .lead, .svc-guide .note { color: var(--muted); }
.svc-guide .note { font-size: 14px; }
.svc-guide a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.svc-faq details { border-bottom: 1px solid var(--line); }
.svc-faq details:first-child { border-top: 1px solid var(--line); }
.svc-faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 12px 0; font-weight: 500; }
.svc-faq summary::-webkit-details-marker { display: none; }
.svc-faq summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: translateY(-3px) rotate(45deg); transition: transform .15s; }
.svc-faq details[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.svc-faq details p { margin: 0 0 16px; }
body.in-flow .svc-guide { display: none; }
