/* ============================================================
 *  오행 · 사주 오행 분석 — Toss-inspired 디자인
 *  (seed 프로젝트 디자인 토큰 상속: 흰 배경 + 토스 블루)
 * ============================================================ */
:root {
  --bg:          #F2F4F6;
  --surface:     #FFFFFF;
  --surface-2:   #F7F8FA;
  --surface-3:   #EEF1F4;
  --border:      #E5E8EB;
  --border-soft: #EFF1F4;

  --ink:    #191F28;
  --ink-2:  #333D4B;
  --ink-3:  #5B6573;  /* AA 통과 본문 보조 (≈6.0:1) */
  --ink-4:  #6B7480;  /* AA 통과 (≈4.8:1) — 소체 본문 가독 확보 */
  --ink-5:  #9099A4;  /* 장식·placeholder 전용 (가독 텍스트 사용 금지) */

  --accent:      #3182F6;
  --accent-2:    #1B64DA;
  --accent-soft: #E8F3FF;
  --accent-ink:  #0E4CA6;

  /* 오행 색 (전통 오색 → 모던) */
  --mok: #0AC17B;  --mok-soft: #DEF7EC;
  --hwa: #F04452;  --hwa-soft: #FFE9EC;
  --to:  #C7903F;  --to-soft:  #F8EFE0;
  --geum:#8B97A6;  --geum-soft:#EEF1F4;
  --su:  #3182F6;  --su-soft:  #E8F3FF;

  --good: #0AC17B;
  --warn: #F7A53B;

  --shadow-sm: 0 1px 2px rgba(17,24,39,.04);
  --shadow-md: 0 6px 20px rgba(17,24,39,.06);
  --shadow-lg: 0 14px 40px rgba(17,24,39,.10);

  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 22px; --r-pill: 999px;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --maxw: 540px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { min-height: 100dvh; }

/* ── 상단바 (전폭 blur + 내부 컨테이너 max-width) ── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--maxw); margin: 0 auto; padding: 13px 20px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 16px;
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand-sub { font-size: 12px; color: var(--ink-4); font-weight: 600; }
.icon-btn {
  width: 38px; height: 38px; border: none; border-radius: 11px;
  background: var(--surface); box-shadow: var(--shadow-sm);
  font-size: 18px; color: var(--ink-2);
}
.icon-btn:active { transform: scale(.94); }

.main { max-width: var(--maxw); margin: 0 auto; padding: 8px 16px 120px; }
.view.hidden { display: none; }

/* ── 히어로 ── */
.hero { padding: 18px 6px 22px; }
.hero-title { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1.28; margin: 0 0 12px; }
.hero-desc { font-size: 15px; color: var(--ink-3); margin: 0; line-height: 1.6; }

/* ── 카드 ── */
.card {
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-md); padding: 20px;
}
.card + .card { margin-top: 14px; }

/* ── 폼 ── */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field.inline { gap: 9px; }
.field-label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.field-label.sm { font-size: 13px; color: var(--ink-3); }
.opt { font-size: 11px; font-weight: 600; color: var(--ink-5); background: var(--surface-3); padding: 1px 6px; border-radius: 6px; margin-left: 4px; }

.input {
  width: 100%; border: 1.5px solid var(--border); background: var(--surface-2);
  border-radius: var(--r-md); padding: 14px 14px; font-size: 16px; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.input::placeholder { color: var(--ink-5); }
.input:focus { border-color: var(--accent); background: #fff; }
.input:focus:not(:focus-visible) { outline: none; }
.input:focus-visible { border-color: var(--accent); background: #fff; outline: 2px solid var(--accent); outline-offset: 2px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%238B95A1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.row3 .input { padding: 14px 30px 14px 11px; font-size: 15px; }

/* ── 세그먼트 컨트롤 ── */
.segmented { display: flex; gap: 4px; background: var(--surface-3); padding: 4px; border-radius: var(--r-md); }
.seg {
  flex: 1; border: none; background: transparent; border-radius: 10px;
  padding: 11px 8px; font-size: 14px; font-weight: 700; color: var(--ink-4);
  transition: all .18s;
}
.seg.active { background: #fff; color: var(--accent); box-shadow: var(--shadow-sm); }
.segmented.small .seg { font-size: 12.5px; padding: 9px 6px; }

/* ── 체크/스위치 ── */
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-3); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check em { color: var(--accent); font-style: normal; font-weight: 700; }

.advanced { border-top: 1px solid var(--border-soft); padding-top: 6px; }
.advanced > summary { list-style: none; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::after { content: "⌄"; margin-left: auto; color: var(--ink-4); font-size: 18px; transition: transform .2s; }
.advanced[open] > summary::after { transform: rotate(180deg); }
.adv-hint { font-size: 12px; font-weight: 600; color: var(--ink-5); }
.adv-body { display: flex; flex-direction: column; gap: 16px; padding: 10px 2px 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch-row span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.switch-row small { font-size: 12px; font-weight: 500; color: var(--ink-4); }
.switch { appearance: none; width: 48px; height: 28px; border-radius: 999px; background: var(--ink-5); position: relative; transition: background .2s; flex: none; }
.switch:checked { background: var(--accent); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: var(--shadow-sm); }
.switch:checked::after { transform: translateX(20px); }

/* ── CTA ── */
.cta {
  width: 100%; border: none; border-radius: var(--r-md);
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 800;
  padding: 17px; box-shadow: 0 8px 20px rgba(49,130,246,.28);
  transition: transform .12s, background .15s;
}
.cta:active { transform: scale(.985); background: var(--accent-2); }
.cta[disabled] { background: var(--ink-5); box-shadow: none; }
.disclaimer { font-size: 12px; color: var(--ink-4); text-align: center; margin: 2px 0 0; line-height: 1.5; }

/* ============ 결과 화면 ============ */
.result-head { padding: 14px 4px 18px; }
.result-name { font-size: 14px; color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.result-type { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.34; }
.result-type b { color: var(--accent); }
.result-birth { font-size: 13px; color: var(--ink-4); margin-top: 8px; }

.sec-title { font-size: 13px; font-weight: 800; color: var(--ink-4); letter-spacing: .02em; margin: 0 0 12px; text-transform: uppercase; }

/* 만세력 4기둥 */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pcol { text-align: center; }
.pcol-label { font-size: 12px; font-weight: 700; color: var(--ink-4); margin-bottom: 8px; }
.pcol.me .pcol-label { color: var(--accent); }
.gan, .ji {
  border-radius: var(--r-md); padding: 12px 4px; margin-bottom: 6px;
  position: relative; border: 1.5px solid transparent;
}
.gan .han, .ji .han { font-size: 30px; font-weight: 800; line-height: 1; }
.gan .kor, .ji .kor { font-size: 12px; font-weight: 600; opacity: .85; margin-top: 4px; }
.pcol.me .gan { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sipseong-tag { font-size: 10.5px; font-weight: 700; color: var(--ink-4); margin-top: 5px; min-height: 14px; }
.el-목 { background: var(--mok-soft); color: #066b45; }
.el-화 { background: var(--hwa-soft); color: #b51f2c; }
.el-토 { background: var(--to-soft); color: #8a5d18; }
.el-금 { background: var(--geum-soft); color: #515c6b; }
.el-수 { background: var(--su-soft); color: #1659c4; }

.corr-note { font-size: 11.5px; color: var(--ink-4); margin-top: 12px; line-height: 1.6; background: var(--surface-2); border-radius: 10px; padding: 9px 11px; }
.corr-note b { color: var(--ink-3); }

/* 오행 분포 바 */
.ohaeng-list { display: flex; flex-direction: column; gap: 11px; }
.ohaeng-row { display: grid; grid-template-columns: 30px 1fr 42px; align-items: center; gap: 10px; }
.ohaeng-name { font-size: 14px; font-weight: 800; }
.ohaeng-bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ohaeng-bar > i { display: block; height: 100%; border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.ohaeng-val { font-size: 12.5px; font-weight: 700; color: var(--ink-3); text-align: right; }
.bar-목 { background: var(--mok); } .bar-화 { background: var(--hwa); } .bar-토 { background: var(--to); } .bar-금 { background: var(--geum); } .bar-수 { background: var(--su); }
/* 작은 본문/라벨용 — 흰 배경 AA 통과 어두운 변형 (바 채움은 --mok 등 밝은색 유지) */
.txt-목 { color: #057a4a; } .txt-화 { color: #cf2a3a; } .txt-토 { color: #8a5e16; } .txt-금 { color: #515c6b; } .txt-수 { color: #1f63c4; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.chip { font-size: 12.5px; font-weight: 700; padding: 6px 11px; border-radius: 999px; background: var(--surface-3); color: var(--ink-3); }
.chip.on { background: var(--accent-soft); color: var(--accent-ink); }

/* KPI 행 */
.kpi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--surface-2); border-radius: var(--r-md); padding: 14px; }
.kpi-lab { font-size: 12px; color: var(--ink-4); font-weight: 600; }
.kpi-val { font-size: 18px; font-weight: 800; margin-top: 3px; }
.kpi-sub { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }

/* 게이지 */
.gauge { display: flex; align-items: center; gap: 14px; }
.gauge-ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; flex: none; position: relative;
  background: conic-gradient(var(--accent) calc(var(--p)*1%), var(--surface-3) 0);
  display: grid; place-items: center; }
.gauge-ring::after { content: ""; width: 58px; height: 58px; border-radius: 50%; background: var(--surface); position: absolute; }
.gauge-ring span { position: relative; font-size: 19px; font-weight: 800; color: var(--accent); }
.gauge-txt b { font-size: 15px; font-weight: 800; }
.gauge-txt p { font-size: 12.5px; color: var(--ink-3); margin: 3px 0 0; }

/* 지표 카드 */
.ind-card { border: 1px solid var(--border-soft); border-radius: var(--r-md); padding: 14px; }
.ind-card + .ind-card { margin-top: 10px; }
.ind-card.on { border-color: var(--accent-soft); background: var(--accent-soft); }
.ind-head { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; }
.ind-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-5); flex: none; }
.ind-card.on .ind-dot { background: var(--accent); }
.ind-evi { font-size: 12.5px; color: var(--ink-3); margin: 8px 0 0; line-height: 1.55; }
.ind-mean { font-size: 13px; color: var(--ink-2); margin: 7px 0 0; line-height: 1.6; }

.combo { background: linear-gradient(135deg, #EEF5FF, #F4F0FF); border-radius: var(--r-md); padding: 13px 15px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); line-height: 1.55; }
.combo + .combo { margin-top: 8px; }
.combo b { color: var(--accent-ink); }

/* 대운 타임라인 (가로 스크롤) */
.daewoon { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.dw-cell { flex: 0 0 62px; text-align: center; border-radius: 14px; padding: 9px 4px; background: var(--surface-2); }
.dw-cell.now { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.dw-age { font-size: 11px; font-weight: 700; color: var(--ink-4); margin-bottom: 7px; white-space: nowrap; }
.dw-cell.now .dw-age { color: var(--accent-ink); }
.dw-gan, .dw-ji { font-size: 24px; font-weight: 800; line-height: 1.18; border-radius: 9px; padding: 2px 0; }
.dw-ji { margin-top: 3px; }
.dw-kor { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-top: 5px; }
.dw-sip { font-size: 10.5px; font-weight: 700; color: var(--ink-4); }

/* 세운 표 */
.sewoon { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sw-cell { text-align: center; border-radius: 11px; padding: 8px 2px; background: var(--surface-2); }
.sw-cell.now { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.sw-year { font-size: 10.5px; font-weight: 700; color: var(--ink-4); white-space: nowrap; }
.sw-cell.now .sw-year { color: var(--accent-ink); }
.sw-gan { font-size: 16px; font-weight: 800; margin: 2px 0; }
.sw-sip { font-size: 9.5px; font-weight: 600; color: var(--ink-4); line-height: 1.25; }

/* 액션 행 (저장·공유) */
.actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions-row .btn-ghost:only-child { grid-column: 1 / -1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 풀이 (마크다운) */
.reading-card { padding: 20px; }
.reading-sec { border-top: 1px solid var(--border-soft); padding: 18px 0 4px; }
.reading-sec:first-child { border-top: none; padding-top: 2px; }
.reading-sec h3.r-title { font-size: 17px; font-weight: 800; margin: 0 0 12px; letter-spacing: -.01em; }
.md p { font-size: 14.5px; line-height: 1.72; color: var(--ink-2); margin: 0 0 11px; }
.md h3 { font-size: 14.5px; font-weight: 800; margin: 16px 0 8px; color: var(--ink); }
.md strong { font-weight: 800; color: var(--ink); }
.md em { font-style: normal; color: var(--ink-4); font-size: 13px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 20px; }
.md li { font-size: 14px; line-height: 1.66; color: var(--ink-2); margin-bottom: 6px; }
.md blockquote { margin: 0 0 12px; padding: 13px 16px; background: var(--accent-soft); border-radius: 12px; font-size: 15px; font-weight: 700; color: var(--accent-ink); line-height: 1.55; }
.md table { width: 100%; border-collapse: collapse; margin: 0 0 12px; font-size: 13.5px; }
.md th, .md td { border: 1px solid var(--border); padding: 9px 10px; text-align: left; }
.md th { background: var(--surface-2); font-weight: 700; color: var(--ink-3); }

/* 액션 버튼 */
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btn-prompt {
  width: 100%; border: none; border-radius: var(--r-md); padding: 16px;
  background: var(--ink); color: #fff; font-size: 15.5px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s;
}
.btn-prompt:active { transform: scale(.985); }
.btn-ghost { width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 15px; background: var(--surface); color: var(--ink-2); font-size: 15px; font-weight: 700; }

.section-gap { height: 14px; }

/* 용어(클릭 설명) */
.term { border: none; background: transparent; font: inherit; color: inherit; padding: 0; cursor: pointer;
  border-bottom: 1px dashed currentColor; line-height: inherit; }
.term::after { content: 'ⓘ'; font-size: .68em; color: var(--accent); margin-left: 1px; vertical-align: top; opacity: .85; }
.term:active { opacity: .6; }
.term-hint { font-size: 11.5px; color: var(--ink-4); margin: 0 0 10px; }
.term-hint b { color: var(--accent); }

/* 용어 팝오버 */
.term-pop { position: fixed; inset: 0; z-index: 95; background: rgba(17,24,39,.14); }
.term-pop[hidden] { display: none; }
.tp-card { position: fixed; max-width: 300px; background: var(--surface); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 14px 16px; animation: fade .18s ease both; }
.tp-title { font-size: 15px; font-weight: 800; color: var(--accent-ink); margin-bottom: 6px; }
.tp-def { font-size: 13.5px; line-height: 1.62; color: var(--ink-2); }

/* 맨 위로 버튼 */
.to-top { position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 80;
  width: 46px; height: 46px; border-radius: 50%; border: none; background: var(--surface);
  color: var(--accent); font-size: 22px; font-weight: 800; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: all .25s cubic-bezier(.2,.8,.2,1); }
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:active { transform: scale(.92); }
@media (min-width: 580px) { .to-top { right: calc(50% - var(--maxw) / 2 + 16px); } }

/* 한눈에 보기 요약 카드 */
.summary-card { background: linear-gradient(160deg, #EAF3FF 0%, #F5F0FF 100%); border-radius: var(--r-xl); padding: 20px; box-shadow: var(--shadow-md); }
.summary-head { font-size: 18px; font-weight: 800; line-height: 1.45; letter-spacing: -.01em; color: var(--ink); margin-bottom: 14px; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.summary-chips .chip { background: rgba(255,255,255,.7); color: var(--accent-ink); }
.summary-lines { display: flex; flex-direction: column; gap: 10px; }
.summary-lines p { font-size: 14.5px; line-height: 1.62; color: var(--ink-2); margin: 0; }
.summary-lines strong { font-weight: 800; color: var(--ink); }

/* 부족한 기운 풀이 (뜻 먼저 + '자세히 보기' 펼침) */
.el-card { border: 1px solid var(--border-soft); border-radius: var(--r-md); background: var(--surface-2); padding: 15px 16px; }
.el-card + .el-card { margin-top: 10px; }
.el-card-head { font-size: 15.5px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.el-card-head b { font-weight: 800; }
.el-emoji { font-size: 18px; }
.el-meaning { font-size: 13.5px; color: var(--ink-2); line-height: 1.62; margin: 11px 0 0; padding: 10px 12px; background: var(--accent-soft); border-radius: 10px; }
.el-meaning b { color: var(--accent-ink); }
.el-tag { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; background: var(--accent); border-radius: 6px; padding: 1px 7px; margin-right: 7px; vertical-align: middle; }
.el-brief { font-size: 13.5px; line-height: 1.66; color: var(--ink-2); margin: 11px 0 0; }
.el-more { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 11px; }
.el-more > summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 800; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; }
.el-more > summary::-webkit-details-marker { display: none; }
.el-more > summary::after { content: '＋'; font-size: 13px; font-weight: 800; }
.el-more[open] > summary { margin-bottom: 4px; }
.el-more[open] > summary::after { content: '－'; }
.el-body { padding: 4px 0 2px; }
.el-sub { font-size: 12.5px; font-weight: 800; color: var(--ink-3); margin: 12px 0 6px; }
.el-body ul { margin: 0; padding-left: 18px; }
.el-body li { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); margin-bottom: 5px; }
.el-combined { background: linear-gradient(135deg, #FFF3E8, #FFECEC); border-radius: var(--r-md); padding: 13px 15px; font-size: 13px; line-height: 1.62; color: var(--ink-2); }
.el-combined + .el-combined { margin-top: 8px; }

/* 잘 맞는 사주 (궁합) */
.compat-lead { font-size: 14px; line-height: 1.66; color: var(--ink-2); margin: 0 0 16px; }
.compat-sub { font-size: 13px; font-weight: 800; color: var(--ink-3); margin: 0 0 10px; }
.compat-list { display: flex; flex-direction: column; gap: 9px; }
.compat-row { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; }
.compat-el { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; align-content: center; font-size: 16px; font-weight: 800; line-height: 1; }
.compat-el i { display: block; font-size: 10px; font-weight: 700; font-style: normal; opacity: .8; margin-top: 2px; }
.compat-rt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.compat-rt b { font-size: 13.5px; font-weight: 800; color: var(--ink); line-height: 1.45; }
.compat-rt span { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }
.compat-balanced { font-size: 13.5px; line-height: 1.66; color: var(--ink-2); background: var(--surface-2); border-radius: var(--r-md); padding: 13px 15px; margin: 0; }

.compat-hap { margin-top: 14px; background: linear-gradient(135deg, #EEF5FF, #F4F0FF); border-radius: var(--r-md); padding: 14px 15px; }
.compat-hap-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.compat-hap-badge { font-size: 13px; font-weight: 800; color: var(--accent-ink); }
.compat-hap-q { font-size: 11px; font-weight: 700; color: var(--accent); background: rgba(255,255,255,.7); border-radius: 999px; padding: 2px 9px; }
.compat-hap-text { font-size: 13.5px; line-height: 1.62; color: var(--ink-2); margin: 0; }
.compat-hap-text b { color: var(--accent-ink); }

.compat-note { font-size: 13px; line-height: 1.62; color: var(--ink-2); margin: 12px 0 0; }
.compat-note b { color: var(--ink); font-weight: 800; }
.compat-note.warn { color: var(--ink-3); }

/* 공유 바텀시트 */
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(17,24,39,.42); display: flex; align-items: flex-end; justify-content: center; animation: fadeBg .2s ease; }
.sheet-backdrop[hidden] { display: none; }
@keyframes fadeBg { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: 100%; max-width: var(--maxw); background: var(--surface); border-radius: 22px 22px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0,0,0,.18); animation: sheetUp .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-grab { width: 40px; height: 4px; border-radius: 999px; background: var(--ink-5); margin: 6px auto 12px; }
.sheet-title { font-size: 17px; font-weight: 800; text-align: center; margin: 0 0 16px; }
.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px; margin-bottom: 14px; }
.share-opt { display: flex; flex-direction: column; align-items: center; gap: 8px; border: none; background: transparent; font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding: 4px; }
.share-opt:active { transform: scale(.95); }
.si { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; font-weight: 800; box-shadow: var(--shadow-sm); }
.sheet-close { width: 100%; border: none; background: var(--surface-3); color: var(--ink-2); font-size: 15px; font-weight: 700; border-radius: var(--r-md); padding: 14px; margin-top: 4px; }
.sheet-close:active { background: var(--border); }

/* 토스트 */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 600;
  padding: 13px 20px; border-radius: var(--r-pill); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: all .28s cubic-bezier(.2,.8,.2,1); z-index: 100;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 로딩 */
.loading { display: grid; place-items: center; padding: 80px 0; gap: 16px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { font-size: 14px; color: var(--ink-3); font-weight: 600; }

.error-box { background: var(--hwa-soft); color: #b51f2c; border-radius: var(--r-md); padding: 16px; font-size: 14px; font-weight: 600; line-height: 1.6; }

@media (min-width: 600px) {
  .hero-title { font-size: 32px; }
  .gan .han, .ji .han { font-size: 32px; }
}
.fade-in { animation: fade .4s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
 *  궁합(宮合) · 명리 이론 계층 — 라운드 6
 * ============================================================ */

/* -- 입력: 사람 블록 -- */
.person-block { border-radius: var(--r-lg); }
.person-block.partner {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  padding: 16px 14px 4px; margin-top: 6px;
}
.person-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 800; color: var(--ink-2); margin-bottom: 12px;
}
.person-head em { font-style: normal; font-weight: 600; color: var(--ink-4); font-size: 12.5px; }
.person-badge {
  width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 800;
}
.person-badge.alt { background: #7B5BF0; }
.adv-note { font-size: 11.5px; color: var(--ink-4); margin: 10px 0 0; line-height: 1.55; }

/* -- 결과 헤더 -- */
.x-mark { color: var(--ink-5); font-weight: 700; margin: 0 3px; }

/* -- 궁합 총점 -- */
.cscore { display: flex; align-items: center; gap: 18px; }
.cscore-ring {
  --p: 0;
  flex: none; width: 104px; height: 104px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0);
  display: grid; place-items: center; position: relative;
}
.cscore-ring::after {
  content: ""; position: absolute; inset: 9px; background: var(--surface); border-radius: 50%;
}
.cscore-ring span {
  position: relative; z-index: 1; font-size: 30px; font-weight: 800;
  color: var(--accent-ink); letter-spacing: -.03em; line-height: 1;
}
.cscore-ring i {
  position: relative; z-index: 1; font-style: normal; font-size: 11px;
  font-weight: 700; color: var(--ink-4); margin-left: 2px; align-self: flex-end; margin-bottom: 34px;
}
.cscore-txt { min-width: 0; }
.cscore-grade { font-size: 17px; font-weight: 800; line-height: 1.4; letter-spacing: -.02em; }
.cscore-txt p { font-size: 13px; color: var(--ink-3); line-height: 1.6; margin: 6px 0 0; }

/* -- 축별 막대 -- */
.cbars { display: flex; flex-direction: column; gap: 9px; }
.cbar-row { display: grid; grid-template-columns: 92px 1fr 54px; align-items: center; gap: 9px; }
.cbar-lab { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.cbar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.cbar i { display: block; height: 100%; border-radius: 999px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.cbar-val { font-size: 12px; font-weight: 800; color: var(--ink-2); text-align: right; }
.cbar-val em { font-style: normal; font-weight: 600; color: var(--ink-5); font-size: 10.5px; }

.tone-good   { background: var(--good); }
.tone-mixed  { background: var(--warn); }
.tone-tense  { background: #F0865A; }
.tone-neutral{ background: var(--geum); }

/* -- 두 사람 원국 나란히 -- */
.two-pillars { display: flex; flex-direction: column; gap: 12px; }
.tp-person { background: var(--surface-2); border-radius: var(--r-md); padding: 13px 14px; }
.tp-person.p2 { background: #F6F4FF; }
.tp-name { font-size: 13.5px; font-weight: 800; color: var(--ink); margin-bottom: 10px; }
.tp-name em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--ink-4); margin-left: 5px; }
.tp-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.tp-cell {
  background: var(--surface); border-radius: 11px; padding: 8px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tp-cell.me { box-shadow: inset 0 0 0 1.5px var(--accent); }
.tp-lab { font-size: 10.5px; font-weight: 700; color: var(--ink-5); }
.tp-gz { display: flex; gap: 1px; font-size: 19px; font-weight: 800; line-height: 1.1; }
.tp-gz.muted { font-size: 12px; color: var(--ink-5); font-weight: 600; }
.tp-kor { font-size: 10.5px; color: var(--ink-4); font-weight: 600; }
.tp-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tp-meta span {
  font-size: 11px; font-weight: 700; color: var(--ink-3);
  background: rgba(255,255,255,.75); border-radius: 999px; padding: 3px 9px;
}

/* -- 서로에게 어떤 사람인가 -- */
.lens-wrap { display: flex; flex-direction: column; gap: 10px; }
.lens-card { border-radius: var(--r-md); padding: 14px 15px; }
.lens-card.l1 { background: linear-gradient(135deg, #EEF5FF, #F5F9FF); }
.lens-card.l2 { background: linear-gradient(135deg, #F4F0FF, #FAF7FF); }
.lens-top { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.lens-top b { color: var(--ink); font-weight: 800; }
.lens-tag {
  font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.02em;
  margin: 5px 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.lens-sip {
  font-size: 11px; font-weight: 700; color: var(--accent-ink);
  background: rgba(255,255,255,.8); border-radius: 999px; padding: 3px 9px;
}
.lens-desc { font-size: 13px; line-height: 1.62; color: var(--ink-2); margin: 0; }

/* -- 항목별 카드 -- */
.axis-card {
  background: var(--surface-2); border-radius: var(--r-md);
  padding: 14px 15px; margin-bottom: 11px; border-left: 3px solid var(--geum);
}
.axis-card.tone-good  { border-left-color: var(--good); }
.axis-card.tone-mixed { border-left-color: var(--warn); }
.axis-card.tone-tense { border-left-color: #F0865A; }
.axis-card.tone-neutral { border-left-color: var(--geum); }
.axis-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.axis-title { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.axis-score { font-size: 15px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.axis-score em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-5); }
.axis-meter { height: 5px; background: var(--surface-3); border-radius: 999px; overflow: hidden; margin: 9px 0 10px; }
.axis-meter i { display: block; height: 100%; border-radius: 999px; }
.axis-headline { font-size: 14px; font-weight: 800; color: var(--ink); line-height: 1.5; margin: 0 0 8px; letter-spacing: -.01em; }
.axis-detail { margin: 0; padding-left: 17px; display: flex; flex-direction: column; gap: 5px; }
.axis-detail li { font-size: 13px; line-height: 1.62; color: var(--ink-2); }
.axis-basis { font-size: 11px; color: var(--ink-4); margin: 9px 0 0; line-height: 1.55; }

/* -- 네 기둥 대조표 -- */
.cmatrix { border: 1px solid var(--border-soft); border-radius: var(--r-md); overflow: hidden; }
.cm-head, .cm-row { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1.2fr; align-items: center; }
.cm-head { background: var(--surface-2); }
.cm-head span { font-size: 11px; font-weight: 800; color: var(--ink-4); padding: 9px 8px; text-align: center; }
.cm-head span:first-child { text-align: left; }
.cm-row { border-top: 1px solid var(--border-soft); }
.cm-row > span { padding: 10px 8px; text-align: center; }
.cm-pos { text-align: left !important; font-size: 12.5px; font-weight: 800; color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.cm-pos em { font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--ink-5); }
.cm-gz { font-size: 16px; font-weight: 800; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 1px; }
.cm-gz i { font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--ink-4); }
.cm-rel { font-size: 11.5px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.cm-rel b { font-weight: 800; border-radius: 999px; padding: 2px 8px; }
.rel-good  { background: var(--mok-soft); color: #057a4a; }
.rel-tense { background: #FFEDE4; color: #B24A1E; }
.muted { color: var(--ink-5); }

/* -- 정리 목록 -- */
.sum-list { margin: 0; padding-left: 17px; display: flex; flex-direction: column; gap: 6px; }
.sum-list li { font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.sum-list li b { font-weight: 800; }
.sum-list.good li::marker  { color: var(--good); }
.sum-list.mixed li::marker { color: var(--warn); }
.sum-list.tense li::marker { color: #F0865A; }
.advice-list { margin: 0; padding-left: 17px; display: flex; flex-direction: column; gap: 6px; }
.advice-list li { font-size: 13px; line-height: 1.62; color: var(--ink-2); }

/* -- 사주 깊이 보기(이론 계층) -- */
.th-block { background: var(--surface-2); border-radius: var(--r-md); padding: 13px 14px; margin-bottom: 10px; }
.th-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 7px; }
.th-key { font-size: 11.5px; font-weight: 800; color: var(--ink-4); }
.th-head b { font-size: 14.5px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.th-desc { font-size: 13px; line-height: 1.62; color: var(--ink-2); margin: 0 0 5px; }
.th-basis { font-size: 11px; color: var(--ink-4); line-height: 1.55; margin: 7px 0 0; }
.th-list { margin: 0; padding-left: 17px; display: flex; flex-direction: column; gap: 4px; }
.th-list li { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }

.unseong-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.us-cell {
  background: var(--surface); border-radius: 10px; padding: 9px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.us-pos { font-size: 10.5px; color: var(--ink-5); font-weight: 700; }
.us-cell b { font-size: 13.5px; font-weight: 800; color: var(--ink); }

.sinsal-wrap { display: flex; flex-direction: column; gap: 8px; }
.sinsal-card { background: var(--surface); border-radius: 11px; padding: 10px 12px; }
.sinsal-name { font-size: 13px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sinsal-name em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-5); }
.sinsal-name span { font-size: 10.5px; font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; }
.sinsal-card p { font-size: 12.5px; line-height: 1.6; color: var(--ink-3); margin: 4px 0 0; }

.rel-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rel-chip {
  font-size: 11.5px; font-weight: 700; border-radius: 10px; padding: 5px 10px;
  display: flex; align-items: center; gap: 5px;
}
.rel-chip.rel-good  { background: var(--mok-soft); color: #057a4a; }
.rel-chip.rel-tense { background: #FFEDE4; color: #B24A1E; }
.rel-chip em { font-style: normal; font-size: 10px; opacity: .75; font-weight: 600; }

/* -- 반응형 -- */
@media (min-width: 560px) {
  .two-pillars { flex-direction: row; }
  .tp-person { flex: 1; min-width: 0; }
  .lens-wrap { flex-direction: row; }
  .lens-card { flex: 1; min-width: 0; }
}
@media (max-width: 380px) {
  .cscore { gap: 13px; }
  .cscore-ring { width: 88px; height: 88px; }
  .cscore-ring span { font-size: 25px; }
  .cscore-ring i { margin-bottom: 28px; }
  .cbar-row { grid-template-columns: 74px 1fr 48px; gap: 7px; }
  .cbar-lab { font-size: 11px; }
  .cm-head, .cm-row { grid-template-columns: 1.2fr .9fr .9fr 1.1fr; }
  .cm-gz { font-size: 14px; }
  .unseong-row { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .cbar i, .axis-meter i { transition: none; }
}

/* ============================================================
 *  라우트 셸 + 메뉴 (라운드 7 — 사주 / 타로 두 갈래)
 * ============================================================ */
.route[hidden] { display: none; }

/* 상단바 왼쪽 뒤로가기 — 브랜드 앞에 붙는다 */
.brand-home {
  width: 32px; height: 32px; border-radius: 10px;
  font-size: 17px; line-height: 1; margin-right: 2px;
}
.brand-home[hidden] { display: none; }

/* ── 메뉴: 전체 화면 두 타일 ── */
.menu {
  /* 상단바(약 57px)를 뺀 나머지를 꽉 채운다 */
  min-height: calc(100dvh - 57px);
  display: flex; flex-direction: column; justify-content: center;
  gap: 22px; padding: 24px 0 40px;
}
.menu-head { text-align: center; padding: 0 6px; }
.menu-title {
  font-size: 26px; font-weight: 800; letter-spacing: -.03em;
  margin: 0 0 8px; line-height: 1.3;
}
.menu-desc { font-size: 14px; color: var(--ink-3); margin: 0; line-height: 1.6; }

.menu-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

.menu-tile {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  border: none; border-radius: var(--r-xl);
  padding: 26px 22px 22px;
  text-align: left;
  transition: transform .18s cubic-bezier(.16,1,.3,1), box-shadow .18s ease;
}
.menu-tile:active { transform: scale(.985); }

/* 사주 타일 — 라이트(사주 라우트의 테마를 예고) */
.menu-tile.saju {
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-md);
}
.menu-tile.saju:hover { box-shadow: var(--shadow-lg); }
.menu-tile.saju .mt-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center; margin-bottom: 6px;
  background: var(--ink); color: #fff; font-size: 21px; font-weight: 800;
}
.menu-tile.saju .mt-go { color: var(--accent-2); }

/* 타로 타일 — 딥블랙(타로 라우트의 테마를 예고) */
.menu-tile.tarot {
  background: #0B0B10; color: #F4F1E8;
  box-shadow: 0 14px 40px rgba(11,11,16,.28);
}
.menu-tile.tarot .mt-desc { color: #A9A395; }
.menu-tile.tarot .mt-go { color: #E8B84B; }

/* 카드 세 장이 부채꼴로 겹친 미니 마크 */
.mt-fan { position: relative; display: block; width: 52px; height: 42px; margin-bottom: 6px; }
.mt-fan i {
  position: absolute; left: 14px; top: 2px;
  width: 24px; height: 36px; border-radius: 4px;
  background: linear-gradient(160deg, #2A2740, #14131F);
  border: 1px solid rgba(232,184,75,.55);
  transform-origin: 50% 100%;
}
.mt-fan i:nth-child(1) { transform: rotate(-20deg) translateX(-3px); }
.mt-fan i:nth-child(3) { transform: rotate(20deg) translateX(3px); }
.mt-fan i:nth-child(2) { box-shadow: 0 2px 8px rgba(0,0,0,.4); }

.mt-name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.mt-desc { font-size: 13.5px; line-height: 1.6; color: var(--ink-3); font-weight: 500; }
.mt-go { font-size: 13px; font-weight: 700; margin-top: 8px; }
.mt-go::after { content: ' →'; }

.menu-foot {
  text-align: center; font-size: 12.5px; color: var(--ink-4);
  margin: 4px 0 0; line-height: 1.6;
}

@media (min-width: 620px) {
  .menu-grid { grid-template-columns: 1fr 1fr; }
  .menu-tile { min-height: 232px; justify-content: flex-start; }
  .menu-title { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-tile { transition: none; }
  .menu-tile:active { transform: none; }
}

/* ============================================================
 *  이미지 저장 폴백 시트 (라운드 8)
 *  아이폰 사파리는 a[download] 를 자주 무시한다. 공유 시트마저 막히면
 *  이미지를 띄워 길게 눌러 저장하게 한다 — 이 경로는 항상 통한다.
 *  사주·타로 두 라우트에서 함께 쓰므로 라우트 스코프 밖에 둔다.
 * ============================================================ */
.img-sheet {
  position: fixed; inset: 0; z-index: 1300;
  background: rgba(8,8,12,.82);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow: auto;
}
.img-sheet-panel {
  width: 100%; max-width: 360px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.img-sheet-tip {
  margin: 0; text-align: center; color: #F4F1E8;
  font-size: 14px; line-height: 1.6; font-weight: 600;
}
.img-sheet-tip b { color: #E8B84B; }
.img-sheet-img {
  width: 100%; height: auto; border-radius: 14px; display: block;
  box-shadow: 0 18px 44px rgba(0,0,0,.6);
  -webkit-touch-callout: default;   /* 길게 누르기 메뉴를 반드시 살려 둔다 */
}
.img-sheet-close {
  padding: 13px 26px; border-radius: 12px; border: none;
  font-family: inherit; font-size: 15px; font-weight: 700;
  background: rgba(255,255,255,.14); color: #fff;
}

/* ============================================================
 *  약관 · 개인정보처리방침 (라운드 8)
 *  라우트 스코프를 타지 않는 기본(라이트) 테마를 그대로 쓴다.
 * ============================================================ */
.legal { padding: 24px 2px 8px; }
.legal-title {
  font-size: 26px; font-weight: 800; letter-spacing: -.03em;
  margin: 0 0 6px; color: var(--ink);
}
.legal-updated { font-size: 12.5px; color: var(--ink-4); margin: 0 0 22px; }
.legal h2 {
  font-size: 16px; font-weight: 800; letter-spacing: -.02em;
  margin: 26px 0 9px; color: var(--ink);
}
.legal p { font-size: 14.5px; line-height: 1.75; color: var(--ink-2); margin: 0 0 10px; }
.legal ul { margin: 0 0 10px; padding-left: 18px; }
.legal li { font-size: 14.5px; line-height: 1.75; color: var(--ink-2); margin-bottom: 6px; }
.legal b { font-weight: 700; color: var(--ink); }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.legal-callout {
  background: var(--accent-soft); border: 1px solid rgba(49,130,246,.22);
  border-radius: 15px; padding: 16px 17px; margin: 0 0 8px;
}
.legal-callout b { display: block; font-size: 13.5px; color: var(--accent); margin-bottom: 6px; }
.legal-callout p { margin: 0; font-size: 14px; }

.legal-table {
  width: 100%; border-collapse: collapse; margin: 4px 0 12px;
  font-size: 13.5px; line-height: 1.65;
}
.legal-table th, .legal-table td {
  border: 1px solid var(--border); padding: 10px 11px; text-align: left; vertical-align: top;
}
.legal-table th { background: var(--surface-2); font-weight: 700; color: var(--ink-2); font-size: 13px; }
.legal-table td { color: var(--ink-2); }

.legal-actions { display: flex; gap: 10px; margin: 30px 0 10px; }
.legal-btn {
  flex: 1; padding: 15px 12px; border-radius: 14px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  border: 1px solid var(--border); background: #fff; color: var(--ink-2);
}
.legal-btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── 전역 푸터 ─────────────────────────────────────────── */
.site-foot {
  max-width: 540px; margin: 0 auto; padding: 26px 16px 34px;
  text-align: center;
}
.foot-links { display: flex; align-items: center; justify-content: center; gap: 8px; }
.foot-link {
  border: none; background: none; padding: 4px 2px;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.foot-dot { color: var(--ink-5); font-size: 12px; }
.foot-note {
  margin: 8px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--ink-4);
}
/* 타로(다크) 라우트에서도 푸터가 배경에 묻히지 않게 */
body[data-route="tarot"] .site-foot { background: #0B0B10; }
body[data-route="tarot"] .foot-link { color: #9A9486; }
body[data-route="tarot"] .foot-note { color: #6E6A61; }
body[data-route="tarot"] .foot-dot { color: #4A4654; }

/* ============================================================
 *  생년월일 유형 카드 (라운드 8) — 일간 물상 × 계절
 * ============================================================ */
.persona-card {
  background: linear-gradient(160deg, #FFFFFF, #F7F9FC);
  border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 22px 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
}
.persona-top { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.persona-emoji {
  flex: none; width: 52px; height: 52px; border-radius: 16px;
  display: grid; place-items: center; font-size: 27px;
  background: var(--surface-3);
}
.persona-label b {
  display: block; font-size: 21px; font-weight: 800;
  letter-spacing: -.03em; color: var(--ink); line-height: 1.25;
}
.persona-label small { display: block; font-size: 12px; color: var(--ink-4); margin-top: 4px; }
.persona-tagline {
  margin: 0 0 13px; font-size: 16px; font-weight: 700; line-height: 1.55;
  letter-spacing: -.02em; color: var(--accent-ink);
}
.persona-traits { margin-bottom: 13px; }
.persona-desc { margin: 0 0 14px; font-size: 14.5px; line-height: 1.75; color: var(--ink-2); }
.persona-stance {
  background: var(--surface-2); border-radius: var(--r-md);
  padding: 14px 15px; margin-bottom: 12px;
}
.persona-stance b { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 5px; }
.persona-stance p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-3); }
.persona-more { margin-bottom: 12px; }
.persona-more summary {
  font-size: 13.5px; font-weight: 700; color: var(--ink-3);
  cursor: pointer; padding: 9px 0; list-style: none;
}
.persona-more summary::-webkit-details-marker { display: none; }
.persona-more summary::after { content: ' ▾'; font-size: 11px; }
.persona-more[open] summary::after { content: ' ▴'; }
.persona-more p {
  margin: 0; font-size: 13.5px; line-height: 1.75; color: var(--ink-3);
  padding: 2px 0 6px;
}
.persona-note { margin: 0; font-size: 12px; line-height: 1.65; color: var(--ink-4); }

/* ============================================================
 *  귀인 지도 (라운드 8)
 * ============================================================ */
.gm-hero { padding: 24px 2px 18px; }
.gm-badge {
  display: inline-block; font-size: 11.5px; font-weight: 800; letter-spacing: .04em;
  color: var(--accent-ink); background: var(--accent-soft);
  padding: 5px 11px; border-radius: var(--r-pill); margin-bottom: 12px;
}
.gm-title {
  font-size: 26px; font-weight: 800; letter-spacing: -.03em;
  line-height: 1.32; margin: 0 0 14px; color: var(--ink);
}
.gm-desc { font-size: 14.5px; line-height: 1.7; color: var(--ink-3); margin: 0; }

/* 방장 유형 카드 */
.gm-host-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 14px 15px;
  box-shadow: var(--shadow-sm);
}
.gm-host-card.inline { box-shadow: none; background: var(--surface-2); margin-bottom: 12px; }
.gm-host-emoji {
  flex: none; width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center; font-size: 23px; background: var(--surface-3);
}
.gm-host-card b { display: block; font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.gm-host-card small { display: block; font-size: 12.5px; color: var(--ink-4); margin-top: 3px; line-height: 1.5; }
.gm-host-hint {
  margin: 12px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-3);
  background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px;
}

/* 유형 소개 칩 */
.gm-types { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.gm-type-chip {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 13px;
}
.gm-type-chip span { font-size: 18px; }
.gm-type-chip b { display: block; font-size: 13.5px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.gm-type-chip small { display: block; font-size: 11.5px; color: var(--ink-4); margin-top: 3px; line-height: 1.5; }

/* 입력 폼 */
.gm-form { display: flex; flex-direction: column; gap: 16px; }
.gm-form-title { margin: 0; font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.gm-form-sub { margin: -10px 0 0; font-size: 13px; line-height: 1.65; color: var(--ink-4); }
.gm-field { display: flex; flex-direction: column; gap: 8px; }
.gm-field > span { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.gm-field em { font-style: normal; font-weight: 500; color: var(--ink-4); font-size: 12.5px; }
.gm-row { display: flex; gap: 8px; }
.gm-row .select { flex: 1; min-width: 0; }
.gm-check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-3); }
.gm-more summary {
  font-size: 13.5px; font-weight: 700; color: var(--ink-3);
  cursor: pointer; padding: 6px 0; list-style: none;
}
.gm-more summary::-webkit-details-marker { display: none; }
.gm-more summary::after { content: ' ▾'; font-size: 11px; }
.gm-more[open] summary::after { content: ' ▴'; }
.gm-more .gm-row { margin-top: 8px; }
.gm-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.6; color: var(--ink-4); }
.gm-privacy { margin: 0; font-size: 11.5px; line-height: 1.65; color: var(--ink-4); }
.gm-inline-link {
  border: none; background: none; padding: 0; font-family: inherit; font-size: 11.5px;
  color: var(--accent); text-decoration: underline; cursor: pointer;
}

/* 참여 결과 */
.gm-result { text-align: center; padding: 30px 10px 22px; }
.gm-result-lead { margin: 0 0 12px; font-size: 15px; color: var(--ink-3); }
.gm-result-lead b { color: var(--ink); font-weight: 700; }
.gm-result-type { display: flex; align-items: center; justify-content: center; gap: 10px; }
.gm-result-emoji { font-size: 38px; }
.gm-result-type b { font-size: 32px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.gm-result-line { margin: 10px 0 0; font-size: 15px; font-weight: 600; color: var(--accent-ink); }

.gm-reasons { margin: 0 0 14px; padding-left: 18px; }
.gm-reasons li { font-size: 14px; line-height: 1.75; color: var(--ink-2); margin-bottom: 6px; }
.gm-type-desc { margin: 0 0 12px; font-size: 14px; line-height: 1.75; color: var(--ink-2); }
.gm-type-tip {
  margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-3);
  background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px;
}
.gm-type-tip b { display: block; color: var(--ink); margin-bottom: 4px; font-size: 13px; }
.gm-mypersona { margin: 0 0 14px; font-size: 14px; line-height: 1.75; color: var(--ink-2); }

.gm-send, .gm-share {
  background: var(--accent-soft); border: 1px solid rgba(49,130,246,.2);
  border-radius: var(--r-xl); padding: 19px 18px; margin: 14px 0;
}
.gm-send > b, .gm-share > b { display: block; font-size: 15px; color: var(--accent-ink); margin-bottom: 7px; }
.gm-send > p, .gm-share > p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.gm-send .gm-privacy { margin-top: 12px; margin-bottom: 0; }

/* 유형별 집계 */
.gm-tally { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 14px; }
.gm-tally-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 4px; text-align: center;
}
.gm-tally-item.on { border-color: var(--accent); background: var(--accent-soft); }
.gm-tally-item b { display: block; font-size: 20px; font-weight: 800; color: var(--ink-4); }
.gm-tally-item.on b { color: var(--accent-ink); }
.gm-tally-item span { display: block; font-size: 10px; color: var(--ink-4); margin-top: 3px; line-height: 1.4; }

/* 지도 목록 */
.gm-entries { list-style: none; margin: 0; padding: 0; }
.gm-entry {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 0; border-bottom: 1px solid var(--border-soft);
}
.gm-entry:last-child { border-bottom: none; }
.gm-entry-emoji { font-size: 22px; flex: none; }
.gm-entry-body { flex: 1; min-width: 0; }
.gm-entry-body b { display: block; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.gm-entry-body small { display: block; font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.gm-entry-del {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  border: none; background: var(--surface-3); color: var(--ink-4);
  font-size: 13px; cursor: pointer;
}
.gm-empty { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink-4); }

.gm-note { margin: 16px 0 0; font-size: 12px; line-height: 1.65; color: var(--ink-4); text-align: center; }

.gm-actions { display: flex; gap: 10px; margin: 14px 0; }
.gm-btn {
  flex: 1; padding: 15px 12px; border-radius: var(--r-md);
  font-family: inherit; font-size: 15px; font-weight: 700;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  cursor: pointer;
}
.gm-btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.gm-btn.wide { flex: 1 1 100%; }

.gm-error {
  background: #FFE9EC; border: 1px solid rgba(240,68,82,.25); color: #B3202E;
  border-radius: var(--r-lg); padding: 16px; font-size: 14px; line-height: 1.7;
  margin-top: 20px;
}

@media (max-width: 360px) {
  .gm-tally { grid-template-columns: repeat(3, 1fr); }
  .gm-types { grid-template-columns: 1fr; }
}
