/* Hallmark · checked · 사주×MBTI 우리 궁합 · job: 생일과 MBTI를 넣고 160가지 사주×MBTI 유형 중 내 유형을 받아 궁합을 공유 */
/* Hallmark · waive 39b · .ledger button and .rank row buttons (menu rows: title plus one description line) · two-line rows, height follows the text */
/* 2026-11-15 재구성 3: 캐릭터 중심. 참고: Pickle(pickle.com) 랜딩. 흰 바탕, 큰 굵은 고딕 제목, 말랑 3D 캐릭터가 주인공,
   크게 둥근 회색 카드, 검은 알약 버튼. 색은 캐릭터와 뱃지가 맡고 UI는 흑백으로 둔다. */
:root {
  --bg: #fbfbfc;
  --paper: #fdfdfe;
  --mute: #5f6570;
  --shadow: rgba(17, 18, 20, .12);
  --card: #f4f5f7;
  --card-deep: #eceef2;
  --ink: #111214;
  --ink-soft: #545a66;
  --line: #e3e6ea;
  --accent: #111214;
  --hl: #e0446a;
  --r-lg: 28px;
  --r-md: 20px;
  --r-sm: 14px;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { overflow-x: clip; margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; margin: 0; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.stack { max-width: 480px; margin: 0 auto; padding: 8px 0 calc(40px + env(safe-area-inset-bottom)); }
.leaf { margin: 0; }
.leaf-inner { padding: 16px 20px 32px; min-height: calc(100vh - 48px); }
.leaf-inner.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }

/* 버튼 */
.primary, .secondary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 0 24px; border-radius: 999px; font-size: 17px; font-weight: 700; text-decoration: none; transition: transform .12s ease; }
.primary { background: var(--accent); color: var(--paper); border: 0; }
.secondary { background: var(--card); color: var(--ink); border: 0; }
.primary:hover, .secondary:hover { transform: translateY(-1px); }
.primary:active, .secondary:active { transform: scale(.98); }
.primary:disabled { background: var(--card-deep); color: var(--mute); transform: none; cursor: default; }
.textbtn { background: none; border: 0; min-height: 44px; padding: 0 4px; font-size: 15px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px; }
.cta { margin-top: 24px; }
.note { margin-top: 12px; font-size: 13px; color: var(--ink-soft); text-align: center; }
.colophon { margin-top: 24px; font-size: 12px; color: var(--ink-soft); text-align: center; }

/* 0. 첫 화면 */
.title-block { text-align: center; padding-top: 8px; }
.title-col { display: inline-block; margin-bottom: 12px; padding: 4px 12px; border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 700; }
.hook { font-size: 32px; line-height: 1.25; }
.hook-sub { margin-top: 12px; font-size: 16px; color: var(--ink-soft); }
.dmgrid { list-style: none; margin: 24px -8px 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px 0; }
.dmgrid li { display: flex; flex-direction: column; align-items: center; }
.dmgrid img { width: 100%; height: auto; aspect-ratio: 1; animation: bob 3.2s ease-in-out infinite; }
.dmgrid span { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .dmgrid img, .load-char img { animation: none; } }
.invite { margin-top: 20px; padding: 12px 16px; border-radius: var(--r-md); background: var(--card); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; font-size: 15px; }

/* 메뉴 카드 */
.ledger { margin-top: 32px; }
.ledger-head { font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.ledger ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ledger li > a, .ledger li > button {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; min-height: 72px; padding: 12px 16px;
  background: var(--card); border: 0; border-radius: var(--r-md); text-align: left; color: var(--ink); text-decoration: none;
}
.ledger li > a:hover, .ledger li > button:hover { background: var(--card-deep); }
.ledger .num { width: 44px; height: 44px; border-radius: 50%; background: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; overflow: hidden; }
.ledger .num img { width: 44px; height: 44px; }
.ledger .entry b { display: block; font-size: 16px; font-weight: 700; }
.ledger .entry > span { display: block; font-size: 13px; color: var(--ink-soft); line-height: 1.5; }

.about { margin-top: 40px; font-size: 14px; color: var(--ink-soft); }
.about h2 { font-size: 18px; color: var(--ink); margin-bottom: 8px; }
.about > p { margin-top: 8px; }
.about h3 { font-size: 15px; color: var(--ink); margin: 20px 0 4px; }
.about details { border-bottom: 1px solid var(--line); }
.about summary { cursor: pointer; color: var(--ink); min-height: 48px; display: flex; align-items: center; font-weight: 700; }
.about details p { padding-bottom: 12px; }
.about details:not([open]) > p { display: none; }

/* 1. 질문 */
.qtop { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.back { background: none; border: 0; min-height: 44px; padding: 0 4px; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.progress-text { font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.pillars { margin-top: 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-size: 0; }
.pillar { height: 8px; border-radius: 999px; background: var(--card-deep); }
.pillar.done { background: var(--ink); }
.q { margin-top: 32px; }
.question { font-size: 26px; }
.field { margin-top: 24px; }
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.field input, .field select { width: 100%; min-height: 52px; margin-top: 8px; padding: 0 16px; font-family: var(--font); font-size: 18px; color: var(--ink); background: var(--card); border: 2px solid transparent; border-radius: var(--r-sm); }
.field input:focus, .field select:focus { border-color: var(--ink); outline: none; background: var(--paper); }
.field input::placeholder { color: var(--mute); }
.help { margin-top: 8px; font-size: 13px; color: var(--ink-soft); }
.seg { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--card); border-radius: 999px; }
.seg button { min-height: 44px; border: 0; border-radius: 999px; background: none; font-weight: 700; color: var(--ink-soft); }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px var(--shadow); }
.mbti { margin-top: 24px; display: grid; gap: 8px; }
.mbti > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mbti button { min-height: 52px; border: 0; border-radius: var(--r-md); background: var(--card); font-size: 22px; font-weight: 800; }
.mbti button.on { background: var(--ink); color: var(--paper); }
.input-actions { margin-top: 40px; }

/* 2. 로딩 */
.load-char { width: 160px; height: 160px; }
.load-char img { width: 160px; height: 160px; animation: bob 1s ease-in-out infinite; }
.load-text { font-size: 17px; font-weight: 700; text-align: center; }

/* 3. 결과: 캐릭터 카드 */
.hero-card { padding: 24px 20px; border-radius: var(--r-lg); background: var(--card); text-align: center; }
.hero-card .hero-char { display: block; width: 220px; height: 220px; margin: -8px auto 0; }
.hero-card .who { margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.hero-card .epithet { margin-top: 4px; font-size: 30px; }
.hero-card .oneline { margin-top: 12px; font-size: 16px; line-height: 1.7; }
.chips { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chips li { padding: 4px 12px; border-radius: 999px; background: var(--paper); font-size: 14px; font-weight: 700; }

.block { margin-top: 16px; padding: 20px; border-radius: var(--r-lg); background: var(--card); }
.block h2, .block h3 { font-size: 19px; }
.block p { margin-top: 8px; font-size: 15px; line-height: 1.75; }
.block .ilink { display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; font-size: 15px; font-weight: 700; text-underline-offset: 4px; }
.reading { width: 100%; margin-top: 8px; border-collapse: collapse; }
.reading th, .reading td { padding: 12px 0; vertical-align: top; text-align: left; font-size: 15px; line-height: 1.7; border-top: 1px solid var(--line); }
.reading tr:first-child th, .reading tr:first-child td { border-top: 0; }
.reading th { width: 84px; font-weight: 800; padding-right: 12px; }

/* 뱃지 */
.badges { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.badges li > button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 4px; border: 0; border-radius: var(--r-md); background: var(--paper); }
.badges li > button.on { outline: 3px solid var(--ink); outline-offset: -3px; }
.badges img { width: 72px; height: 72px; }
.badges b { font-size: 14px; font-weight: 800; }
.badges small { font-size: 12px; color: var(--ink-soft); }
.bdetail { margin-top: 12px; padding: 16px; border-radius: var(--r-md); background: var(--paper); }
.bdetail h3 { font-size: 17px; }
.bdetail p { font-size: 15px; }
.bdetail .bmine { font-weight: 700; color: var(--ink); }
.bdetail .bmeet { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.bdetail .bmeet b { font-weight: 800; }
.bempty { margin-top: 8px; font-size: 15px; color: var(--ink-soft); }
#bblock .secondary { margin-top: 12px; background: var(--paper); }
.bmeet-row { display: flex; flex-wrap: wrap; gap: 8px; }
.bmeet-row span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 700; }
.bmeet-row img { width: 40px; height: 40px; }
.bdetail .bceleb { font-size: 14px; color: var(--ink-soft); }
.bdetail .bceleb:empty { display: none; }
.chips .bmini img { width: 20px; height: 20px; }
.chips li { display: inline-flex; align-items: center; gap: 4px; }
.bpair { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.bpair p { margin: 0; }
.bpair .bmini img { width: 32px; height: 32px; }
.bmini { display: inline-flex; gap: 2px; vertical-align: middle; }
.bmini img { width: 22px; height: 22px; }

/* 오행: 둥근 막대 */
.wuxing { margin-top: 12px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.wx { display: grid; grid-template-rows: auto 88px auto; justify-items: center; gap: 4px; padding: 12px 0; border-radius: var(--r-sm); background: var(--paper); }
.wx-name { font-size: 15px; font-weight: 800; text-align: center; line-height: 1.2; }
.wx-name small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-soft); }
.rods { display: flex; flex-direction: column-reverse; justify-content: flex-start; align-items: center; gap: 4px; }
.rods i { width: 28px; height: 12px; border-radius: 6px; background: var(--ink); }
.wx-count { font-size: 14px; font-weight: 700; }
.wx.empty .wx-count { color: var(--ink-soft); font-weight: 400; }

.kv { margin: 8px 0 0; }
.kv div { display: grid; grid-template-columns: 112px minmax(0, 1fr); padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; }
.kv div:first-child { border-top: 0; }
.kv dt { font-weight: 800; }
.kv dd { margin: 0; }
.kv .mb { font-size: 18px; font-weight: 800; }
.names { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.names li { padding: 12px; border-radius: var(--r-sm); background: var(--paper); font-size: 15px; }
.names li b { display: block; font-weight: 800; }
.names li span { display: block; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.actions { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.more { margin-top: 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }

/* 사람 표시 */
.dmimg { flex: none; width: var(--s); height: var(--s); object-fit: contain; }
.hz { flex: none; display: inline-flex; align-items: center; justify-content: center; width: var(--s); height: var(--s); border-radius: 50%; background: var(--card-deep); font-size: calc(var(--s) * .4); font-weight: 800; }
.hz.ghost { background: var(--paper); color: var(--ink-soft); border: 2px dashed var(--line); }

/* 목록 (유명인, 근처, 방명록, 친구 순위) */
.list-title { margin-top: 8px; font-size: 26px; }
.list-sub { margin-top: 8px; font-size: 15px; color: var(--ink-soft); }
.sub-title { margin-top: 32px; font-size: 19px; }
.rank { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.rank li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; padding: 12px 16px; border-radius: var(--r-md); background: var(--card); }
.rank li > button.rowbtn { all: unset; display: contents; cursor: pointer; }
.rank .n { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--paper); font-size: 16px; font-weight: 800; overflow: hidden; }
.rank .n img { width: 40px; height: 40px; }
.rank .p { min-width: 0; }
.rank .p b { display: block; font-size: 16px; font-weight: 800; }
.rank .p small { display: block; font-size: 13px; line-height: 1.5; color: var(--ink-soft); }
.rank .p .txt { display: block; margin-top: 4px; font-size: 15px; color: var(--ink); }
.rank .s { display: flex; flex-direction: column; align-items: center; min-width: 52px; }
.rank .s strong { font-size: 24px; font-weight: 800; line-height: 1.1; }
.rank .s span { font-size: 12px; color: var(--ink-soft); }
.rank .act { grid-column: 2 / -1; display: flex; gap: 8px; }
.rank .act button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--paper); font-size: 14px; font-weight: 700; }
.rank .act button.primary-s { background: var(--ink); color: var(--paper); }
.rank .act button:disabled { color: var(--mute); }
.rank .empty { grid-column: 1 / -1; font-size: 14px; color: var(--ink-soft); }
.rank .p small.ctype, .names li span.ctype, .clist small.ctype { color: var(--ink); font-weight: 700; }

/* 4·6. 궁합 */
.pairhero { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; padding: 20px 8px; border-radius: var(--r-lg); background: var(--card); }
.pairhero figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.pairhero figcaption { font-size: 16px; font-weight: 800; line-height: 1.3; }
.pairhero figcaption small { display: block; font-size: 13px; font-weight: 400; color: var(--ink-soft); }
.pairhero .heart { font-size: 22px; font-weight: 800; color: var(--hl); }
.score { margin-top: 24px; font-size: 64px; font-weight: 800; line-height: 1; text-align: center; letter-spacing: -0.03em; }
.score small { font-size: 22px; font-weight: 700; margin-left: 4px; }
.plabel { margin-top: 8px; font-size: 22px; font-weight: 800; text-align: center; }
.tags { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.tags li { padding: 8px 16px; border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 700; }
.why1 { margin-top: 16px; font-size: 15px; line-height: 1.8; text-align: center; }
.bpair { margin-top: 16px; padding: 16px; border-radius: var(--r-md); background: var(--card); font-size: 15px; line-height: 1.7; }
.bpair b { font-weight: 800; }
.story { margin-top: 16px; padding: 20px; border-radius: var(--r-lg); background: var(--card); font-size: 15px; }
.story h3 { font-size: 17px; margin: 12px 0 4px; }
.story p { margin: 4px 0; }
.manual { margin-top: 24px; padding: 4px 16px 16px; border-radius: var(--r-md); background: var(--card); }
.manual summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-size: 15px; font-weight: 700; }
.agree { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; margin-top: 16px; font-size: 15px; }
.agree input { width: 20px; height: 20px; margin-top: 4px; accent-color: var(--ink); }

/* 8. 내 사주 페이지 */
.homecard { margin-top: 12px; padding: 20px; border-radius: var(--r-lg); background: var(--card); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; }
.homecard .htitle { font-size: 20px; font-weight: 800; }
.homecard .hsub { font-size: 14px; color: var(--ink-soft); }
.homecard .hone, .homecard .hbio, .homecard .hbadges { grid-column: 1 / -1; font-size: 15px; line-height: 1.75; }
.homecard .hbio { padding: 12px 16px; border-radius: var(--r-sm); background: var(--paper); color: var(--ink-soft); }
.gbin { width: 100%; min-height: 52px; margin-top: 12px; padding: 0 16px; font-family: var(--font); font-size: 17px; background: var(--card); border: 2px solid transparent; border-radius: var(--r-sm); color: var(--ink); }
.gbin:focus { border-color: var(--ink); outline: none; background: var(--paper); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px; font-size: 15px; font-weight: 700; max-width: 88vw; z-index: 9; text-align: center; }

/* 일주 해설 페이지 */
.article h1 { margin-top: 12px; font-size: 28px; }
.article h2 { margin-top: 28px; font-size: 19px; }
.article p { margin-top: 8px; font-size: 16px; line-height: 1.8; }
.article .primary { margin-top: 28px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); }
.crumbs a { min-height: 44px; display: inline-flex; align-items: center; }
.alead { font-size: 17px; }
.alist { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.alist li { padding: 12px 16px; border-radius: var(--r-sm); background: var(--card); font-size: 15px; }
.pzrow { margin-top: 12px; display: flex; gap: 8px; }
.pz { display: inline-flex; flex-direction: column; align-items: center; min-width: 56px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--card); font-size: 24px; font-weight: 800; line-height: 1.2; }
.pz small { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.clist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.clist li { padding: 12px; border-radius: var(--r-sm); background: var(--card); font-size: 15px; }
.clist li b { display: block; font-weight: 800; }
.clist small { display: block; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.anote { font-size: 13px; color: var(--ink-soft); }
.pn { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.pn a { min-height: 48px; display: flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 700; text-decoration: none; }
.igroup h2 { margin-top: 28px; font-size: 18px; }
.ilist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ilist a { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: var(--r-sm); background: var(--card); text-decoration: none; }
.ilist a:hover { background: var(--card-deep); }
.ilist b { font-size: 16px; font-weight: 800; }
.ilist small { font-size: 12px; color: var(--ink-soft); }
.ahero { margin: 16px auto 0; width: 200px; height: 200px; display: block; }
.afoot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 4px; font-size: 13px; color: var(--ink-soft); }
