/* 인생 강화 — 사주 화면
   오행 색: 목 초록 · 화 빨강 · 토 황토 · 금 은백 · 수 남흑 (만세력 관행). 간지 칸은 오행 색으로 채우고, 글자색은 대비 4.5:1 이상.
   점수 색 s0~s4: 낮음(붉은 주황) → 보통(금빛) → 높음(초록). 금빛 브랜드 톤은 영어 강화와 같다. */
:root {
  --el-wood: #3b8a57; --el-wood-ink: #2c6e44;
  --el-fire: #c4453a; --el-fire-ink: #a8372d;
  --el-earth: #b8862f; --el-earth-ink: #8a5f17;
  --el-metal: #e9ebee; --el-metal-ink: #5d6672; --el-metal-line: #b9c0c8;
  --el-water: #26314b; --el-water-ink: #2b3a5e;
  --s0: #c0443a; --s1: #d27a2c; --s2: #c99a45; --s3: #5f9e6e; --s4: #2f8a62;
  --me: color-mix(in srgb, var(--gold-2) 14%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --el-wood-ink: #7fcf98; --el-fire-ink: #f08a7e; --el-earth-ink: #e8c77e; --el-metal-ink: #c9d0d8; --el-water-ink: #9db4e8;
    --el-water: #2c3d66; --el-metal: #d9dde2;
  }
}
:root[data-theme="dark"] {
  --el-wood-ink: #7fcf98; --el-fire-ink: #f08a7e; --el-earth-ink: #e8c77e; --el-metal-ink: #c9d0d8; --el-water-ink: #9db4e8;
  --el-water: #2c3d66; --el-metal: #d9dde2;
}

.c-wood { color: var(--el-wood-ink); } .c-fire { color: var(--el-fire-ink); } .c-earth { color: var(--el-earth-ink); }
.c-metal { color: var(--el-metal-ink); } .c-water { color: var(--el-water-ink); }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.tiny { font-size: 12px; }
.card-title { font-size: 19px; margin-bottom: 14px; }
.eyebrow { font-size: 13px; font-weight: 700; color: var(--brand-ink); letter-spacing: 0.02em; margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2 > .card { min-width: 0; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; vertical-align: -3px; margin-right: 6px; }

/* ---------------------------------------------------------------- 간지 칸 */
.gz {
  display: inline-grid; place-items: center; align-content: center; width: 52px; height: 58px; border-radius: 12px; gap: 0;
  color: #fff; line-height: 1.05; flex-shrink: 0; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.gz b { font-family: var(--serif); font-size: 26px; font-weight: 700; }
.gz small { font-size: 11px; font-weight: 700; opacity: 0.9; }
.gz.xs { width: 30px; height: 32px; border-radius: 8px; }
.gz.xs b { font-size: 15px; } .gz.xs small { display: none; }
.gz.sm { width: 38px; height: 42px; border-radius: 10px; }
.gz.sm b { font-size: 19px; } .gz.sm small { font-size: 9px; }
.gz.lg { width: 64px; height: 72px; border-radius: 14px; }
.gz.lg b { font-size: 34px; } .gz.lg small { font-size: 12px; }
.gz.xl { width: 88px; height: 96px; border-radius: 20px; }
.gz.xl b { font-size: 48px; } .gz.xl small { font-size: 14px; }
.gz.el-wood { background: var(--el-wood); }
.gz.el-fire { background: var(--el-fire); }
.gz.el-earth { background: var(--el-earth); }
.gz.el-metal { background: var(--el-metal); color: #2f3640; box-shadow: inset 0 0 0 1.5px var(--el-metal-line), inset 0 -3px 0 rgba(0, 0, 0, 0.08); }
.gz.el-water { background: var(--el-water); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, #9db4e8 35%, transparent), inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.gz-pair { display: inline-flex; flex-direction: column; gap: 3px; align-items: center; }
.el-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: 0; flex-shrink: 0; }
.el-dot.el-wood { background: var(--el-wood); } .el-dot.el-fire { background: var(--el-fire); } .el-dot.el-earth { background: var(--el-earth); }
.el-dot.el-metal { background: var(--el-metal); box-shadow: inset 0 0 0 1.5px var(--el-metal-line); } .el-dot.el-water { background: var(--el-water); box-shadow: inset 0 0 0 1px #6f86b8; }
.el-name { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; }

/* ---------------------------------------------------------------- 머리 · 사람 고르기 */
.saju-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.person-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.person-select { width: auto; min-width: 150px; padding: 9px 12px; font-weight: 700; }
.person-chip { display: inline-flex; align-items: center; gap: 8px; }
.birth-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.time-chip { font-size: 12px; }

/* ---------------------------------------------------------------- 일간 히어로 */
.dm-hero { display: flex; gap: 22px; align-items: center; background: linear-gradient(120deg, color-mix(in srgb, var(--gold-2) 14%, var(--surface)), var(--surface) 70%); }
.dm-hero h2 { font-size: 24px; margin-bottom: 6px; }
.dm-hero .dm-text { display: grid; gap: 6px; }
.dm-hero .chips { margin-top: 4px; }
@media (max-width: 560px) { .dm-hero { flex-direction: column; align-items: flex-start; } }

/* ---------------------------------------------------------------- 명식표 */
.pillar-wrap { overflow-x: auto; }
.pillar-table { display: grid; min-width: 330px; }
.pt-row { display: grid; grid-template-columns: 56px repeat(4, minmax(64px, 1fr)); align-items: center; }
.pt-row + .pt-row { border-top: 1px dashed color-mix(in srgb, var(--line) 80%, transparent); }
.pt-row.char-row + .pt-row.char-row { border-top: 0; }
.pt-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.pt-cell { display: flex; justify-content: center; align-items: center; text-align: center; padding: 8px 4px; font-size: 14px; font-weight: 600; min-height: 38px; }
.pt-cell.me { background: var(--me); }
.pt-head .pt-cell { font-family: var(--serif); font-weight: 700; color: var(--ink-2); border-radius: 12px 12px 0 0; }
.pillar-table .pt-row:last-child .pt-cell.me { border-radius: 0 0 12px 12px; }
.char-row .pt-cell { padding: 5px 4px; }
.god { font-size: 13px; font-weight: 700; color: var(--ink-2); padding: 2px 8px; border-radius: 99px; background: var(--surface-2); }
.god.me { background: var(--accent-strong); color: var(--on-accent); }
.hidden-stems { display: inline-flex; gap: 6px; font-family: var(--serif); font-weight: 700; font-size: 17px; }
.pt-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.calc-notes { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: grid; gap: 4px; }

/* ---------------------------------------------------------------- 오행 순환도 */
.el-wheel-wrap { display: grid; gap: 10px; justify-items: center; margin-bottom: 12px; }
.el-wheel { width: 100%; max-width: 300px; height: auto; }
.wheel-ke { stroke: var(--line); stroke-width: 1.2; stroke-dasharray: 3 4; }
.wheel-sheng { fill: none; stroke: color-mix(in srgb, var(--gold-2) 70%, transparent); stroke-width: 2; }
.wheel-arrow { fill: color-mix(in srgb, var(--gold-2) 80%, transparent); }
.wheel-circle { stroke: rgba(0, 0, 0, 0.12); stroke-width: 1; }
.wheel-node.el-wood .wheel-circle { fill: var(--el-wood); } .wheel-node.el-fire .wheel-circle { fill: var(--el-fire); }
.wheel-node.el-earth .wheel-circle { fill: var(--el-earth); } .wheel-node.el-metal .wheel-circle { fill: var(--el-metal); stroke: var(--el-metal-line); stroke-width: 1.5; }
.wheel-node.el-water .wheel-circle { fill: var(--el-water); stroke: #6f86b8; }
.wheel-node.yong .wheel-circle { stroke: var(--gold-2); stroke-width: 3.5; }
.wheel-char { font-family: var(--serif); font-size: 17px; font-weight: 700; text-anchor: middle; fill: #fff; }
.wheel-pct { font-size: 11px; font-weight: 800; text-anchor: middle; fill: #fff; }
.wheel-node.el-metal text { fill: #2f3640; }
.el-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
.el-leg { display: inline-flex; align-items: center; gap: 5px; }
.el-leg.zero { opacity: 0.55; }

/* ---------------------------------------------------------------- 신강·신약 · 용신 */
.gauge { display: grid; gap: 10px; }
.gauge-track { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); border-radius: 99px; overflow: hidden; background: var(--surface-2); }
.gauge-band { text-align: center; font-size: 12px; font-weight: 700; padding: 8px 2px; color: var(--muted); border-left: 1px solid var(--surface); }
.gauge-band:first-child { border-left: 0; }
.gauge-band.on { background: var(--accent-strong); color: var(--on-accent); }
.gauge-mark { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.gauge-checks { display: flex; gap: 8px; flex-wrap: wrap; }
.gauge-check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); padding: 3px 10px; border-radius: 99px; background: var(--surface-2); }
.gauge-check.ok { color: var(--ok-ink); background: var(--ok-bg); }
.yong { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.yong h3 { font-size: 16px; }
.yong-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.yong-item { display: grid; gap: 2px; justify-items: center; padding: 10px 6px; border-radius: 12px; background: var(--surface-2); }
.yong-item.main { background: color-mix(in srgb, var(--gold-2) 18%, var(--surface)); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--gold) 40%, transparent); }
.yong-item small { font-size: 12px; font-weight: 700; color: var(--muted); }

/* ---------------------------------------------------------------- 십성 묶음 */
.group-bars { display: grid; gap: 8px; }
.group-row { display: grid; grid-template-columns: 42px 150px 1fr 24px; align-items: center; gap: 10px; }
.group-track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.group-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.group-n { font-weight: 800; text-align: right; }
.group-notes { margin-top: 12px; }
@media (max-width: 560px) { .group-row { grid-template-columns: 42px 1fr 24px; } .group-mean { display: none; } }

/* ---------------------------------------------------------------- 신살 · 합충 */
.tag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tag-list li p { margin-top: 2px; }
.tone { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 6px; margin-right: 6px; vertical-align: 1px; }
.tone-good { background: var(--ok-bg); color: var(--ok-ink); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-mixed { background: var(--warn-bg); color: var(--warn-ink); }

/* ---------------------------------------------------------------- 대운 · 세운 · 월운 */
.daeun-strip { position: relative; display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x proximity; }
.luck-cell {
  position: relative; display: grid; justify-items: center; gap: 3px; padding: 10px 8px; border-radius: 14px; min-width: 74px; scroll-snap-align: center;
  background: var(--surface); border: 1.5px solid var(--line); color: inherit; font: inherit;
}
button.luck-cell:hover { border-color: var(--gold-2); }
.luck-cell.now { background: var(--me); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.luck-cell.on { border-color: var(--gold-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-2) 25%, transparent); }
.luck-age { font-weight: 800; }
.luck-god { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.luck-year { font-size: 11px; }
.luck-cell .now-badge { position: absolute; top: -8px; right: -4px; }
.now-badge { background: var(--accent-strong); color: var(--on-accent); font-weight: 800; }
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.year-cell, .month-cell { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); color: inherit; font: inherit; text-align: center; }
.year-cell:hover { border-color: var(--gold-2); }
.year-cell.now, .month-cell.now { background: var(--me); }
.year-cell.on { border-color: var(--gold-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-2) 25%, transparent); }
.year-cell .gz-pair, .month-cell .gz-pair { flex-direction: row; }
.tags { font-size: 11px; color: var(--muted); line-height: 1.3; }
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; }
.meter { display: block; width: 100%; max-width: 70px; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; }
.meter.s0 i, .mc-bar i.s0 { background: var(--s0); } .meter.s1 i, .mc-bar i.s1 { background: var(--s1); } .meter.s2 i, .mc-bar i.s2 { background: var(--s2); }
.meter.s3 i, .mc-bar i.s3 { background: var(--s3); } .meter.s4 i, .mc-bar i.s4 { background: var(--s4); }
.score-pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 800; color: #fff; }
.score-pill.s0 { background: var(--s0); } .score-pill.s1 { background: var(--s1); } .score-pill.s2 { background: var(--s2); color: #2a1a08; }
.score-pill.s3 { background: var(--s3); } .score-pill.s4 { background: var(--s4); }

/* 일진 달력 */
.cal-nav { margin-bottom: 8px; }
.cal-nav h3 { font-size: 18px; }
.jin-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 8px 0; }
.jin-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.jin-cell { display: grid; justify-items: center; gap: 1px; padding: 6px 2px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; }
.jin-cell:hover { border-color: var(--gold-2); }
.jin-cell.today { box-shadow: inset 0 0 0 2px var(--gold-2); }
.jin-cell b { font-size: 13px; }
.jin-gz { font-family: var(--serif); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.jin-dot { width: 8px; height: 8px; border-radius: 50%; }
.jin-cell.s0 .jin-dot { background: var(--s0); } .jin-cell.s1 .jin-dot { background: var(--s1); } .jin-cell.s2 .jin-dot { background: var(--s2); }
.jin-cell.s3 .jin-dot { background: var(--s3); } .jin-cell.s4 .jin-dot { background: var(--s4); }
.day-detail { margin-top: 10px; }
.day-card { display: grid; gap: 6px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
@media (max-width: 560px) { .jin-gz { font-size: 11px; } .jin-cell { padding: 4px 1px 6px; } }

/* ---------------------------------------------------------------- 바로 가기 */
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.quick { display: flex; align-items: center; gap: 12px; text-decoration: none; text-align: left; padding: 14px 16px; color: inherit; font: inherit; cursor: pointer; transition: transform 0.12s, border-color 0.15s; }
.quick:hover { transform: translateY(-2px); border-color: var(--gold-2); }
.quick > span:last-child { display: grid; gap: 2px; }
.quick .stat-icon { background: color-mix(in srgb, var(--gold-2) 16%, transparent); color: var(--brand-ink); width: 40px; height: 40px; }
.export-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5; resize: vertical; }

/* ---------------------------------------------------------------- 올해 운세 */
.year-tabs { margin-bottom: 16px; }
.year-tabs .seg { text-decoration: none; }
.year-hero { display: flex; gap: 22px; align-items: center; margin-bottom: 14px; }
.year-hero h2 { font-size: 24px; margin-bottom: 6px; }
.year-hero > div:last-child { display: grid; gap: 6px; }
.month-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; }
.mc-col { display: grid; justify-items: center; gap: 3px; font-size: 12px; }
.mc-n { font-size: 11px; font-weight: 800; color: var(--ink-2); }
.mc-bar { display: flex; align-items: flex-end; width: 100%; max-width: 26px; height: 110px; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.mc-bar i { display: block; width: 100%; border-radius: 8px 8px 0 0; }
.mc-gz { font-family: var(--serif); font-size: 11px; }
@media (max-width: 560px) { .mc-gz { display: none; } .month-chart { gap: 3px; } .mc-bar { height: 90px; } }

/* ---------------------------------------------------------------- AI 풀이 */
.page-reading { max-width: 860px; }
.reading { margin: 14px 0; }
.reading-head h2 { font-size: 20px; display: inline-flex; align-items: center; gap: 4px; }
.reading-body { display: grid; gap: 14px; margin-top: 10px; }
.reading-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.md { font-size: 16px; line-height: 1.8; }
.md h3 { font-size: 19px; margin: 26px 0 8px; color: var(--brand-ink); padding-bottom: 6px; border-bottom: 1px solid color-mix(in srgb, var(--gold) 25%, var(--line)); }
.md h3:first-child { margin-top: 0; }
.md p { margin: 0 0 12px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 4px; }
.md b { color: var(--ink); }
.streaming .md > :last-child::after { content: "▍"; color: var(--gold-2); animation: pulse 1s infinite; margin-left: 2px; }
.thinking { display: flex; align-items: center; }

/* ---------------------------------------------------------------- 오늘 */
.today-hero { display: flex; gap: 26px; align-items: center; background: linear-gradient(120deg, color-mix(in srgb, var(--gold-2) 14%, var(--surface)), var(--surface) 70%); }
.today-hero h2 { font-size: 26px; margin-bottom: 6px; }
.today-main { display: grid; gap: 6px; }
.today-score { display: grid; justify-items: center; gap: 6px; flex-shrink: 0; }
.today-score .ring-label { font-size: 32px; font-family: var(--serif); }
.today-hero.s0 .ring, .match-hero.s0 .ring { color: var(--s0); } .today-hero.s1 .ring, .match-hero.s1 .ring { color: var(--s1); }
.today-hero.s2 .ring, .match-hero.s2 .ring { color: var(--s2); } .today-hero.s3 .ring, .match-hero.s3 .ring { color: var(--s3); }
.today-hero.s4 .ring, .match-hero.s4 .ring { color: var(--s4); }
.advice { font-weight: 700; color: var(--ink-2); }
@media (max-width: 560px) { .today-hero { flex-direction: column; align-items: flex-start; } .today-score { align-self: center; } }
.areas { display: grid; gap: 12px; }
.area { display: grid; grid-template-columns: 96px 1fr 30px; align-items: center; gap: 10px; }
.area-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
.area-track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.area-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.area b { text-align: right; }
.mission-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; cursor: pointer;
  background: color-mix(in srgb, var(--gold-2) 12%, var(--surface)); border: 1.5px dashed color-mix(in srgb, var(--gold) 45%, transparent); }
.mission-card input { width: 22px; height: 22px; accent-color: var(--gold-2); margin-top: 2px; flex-shrink: 0; }
.mission-card > span { display: grid; gap: 2px; }
.mission-card.done { border-style: solid; background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.mission-card.done .mission-text { text-decoration: line-through; opacity: 0.7; }
.small-title { font-size: 15px; margin-top: 6px; }
.lucky { display: flex; flex-wrap: wrap; gap: 6px; }
.why-row { display: flex; gap: 18px; align-items: flex-start; }
.why-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.week-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.week-cell { display: grid; justify-items: center; gap: 3px; padding: 10px 4px; border-radius: 14px; background: var(--surface-2); text-align: center; border-top: 4px solid var(--s2); }
.week-cell.s0 { border-top-color: var(--s0); } .week-cell.s1 { border-top-color: var(--s1); } .week-cell.s3 { border-top-color: var(--s3); } .week-cell.s4 { border-top-color: var(--s4); }
.week-gz { font-family: var(--serif); font-size: 18px; }
.week-score { font-weight: 800; font-size: 15px; }
.week-cell small:last-child { font-size: 11px; line-height: 1.3; }
@media (max-width: 640px) { .week-strip { grid-template-columns: repeat(3, 1fr); } }

/* ---------------------------------------------------------------- 궁합 */
.match-pick { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.match-pick select { flex: 1; min-width: 0; }
.match-heart { color: var(--fire, var(--el-fire)); flex-shrink: 0; }
.match-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; }
.match-side { display: grid; justify-items: center; gap: 4px; text-align: center; }
.match-score { display: grid; justify-items: center; gap: 6px; }
.match-score .ring-label { font-size: 30px; font-family: var(--serif); }
.match-score > b { font-family: var(--serif); font-size: 18px; color: var(--brand-ink); }
.match-items { display: grid; gap: 14px; }
.match-item .area { grid-template-columns: 150px 1fr 30px; }
.el-compare { display: grid; gap: 8px; margin-bottom: 10px; }
.elc-row { display: grid; grid-template-columns: 1fr 70px 1fr; align-items: center; gap: 8px; }
.elc-a, .elc-b { display: flex; align-items: center; gap: 6px; height: 14px; }
.elc-a { flex-direction: row-reverse; }
.elc-a i, .elc-b i { display: block; height: 12px; border-radius: 6px; max-width: 85%; }
.elc-a i.el-wood, .elc-b i.el-wood { background: var(--el-wood); } .elc-a i.el-fire, .elc-b i.el-fire { background: var(--el-fire); }
.elc-a i.el-earth, .elc-b i.el-earth { background: var(--el-earth); } .elc-a i.el-metal, .elc-b i.el-metal { background: var(--el-metal); box-shadow: inset 0 0 0 1.5px var(--el-metal-line); }
.elc-a i.el-water, .elc-b i.el-water { background: var(--el-water); }
.elc-name { display: inline-flex; justify-content: center; align-items: center; gap: 4px; }
@media (max-width: 560px) { .match-hero { grid-template-columns: 1fr 1fr; } .match-score { grid-column: 1 / -1; grid-row: 1; } .match-item .area { grid-template-columns: 1fr 1fr 30px; } }

/* ---------------------------------------------------------------- 상담 */
.chat-layout { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: start; }
.chat-side { display: grid; gap: 10px; padding: 14px; }
.chat-history { display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; }
.chat-h { display: flex; align-items: center; gap: 4px; border-radius: 10px; }
.chat-h a { flex: 1; min-width: 0; padding: 8px 10px; text-decoration: none; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-h.on, .chat-h:hover { background: var(--surface-2); }
.chat-h .icon-btn { width: 30px; height: 30px; color: var(--muted); }
.chat-main { display: flex; flex-direction: column; gap: 10px; min-height: 60vh; padding: 16px; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 64vh; padding: 4px; }
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble { max-width: 86%; padding: 12px 16px; border-radius: 18px; line-height: 1.7; }
.chat-msg.user .chat-bubble { background: var(--accent-strong); color: var(--on-accent); border-radius: 18px 4px 18px 18px; white-space: pre-wrap; }
.chat-msg.assistant .chat-bubble { background: var(--surface-2); border-radius: 4px 18px 18px 18px; }
.chat-bubble .md { font-size: 15px; }
.chat-bubble .md p:last-child, .chat-bubble .md ul:last-child { margin-bottom: 0; }
.chat-empty { display: grid; justify-items: center; gap: 12px; text-align: center; margin: auto; padding: 24px 8px; color: var(--ink-2); }
.chat-empty .choice-chips { justify-content: center; }
.chat-empty .choice-chip { font-size: 14px; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; }
.chat-input { flex: 1; resize: none; min-height: 52px; max-height: 160px; }
.chat-compose .send { width: 52px; height: 52px; padding: 0; flex-shrink: 0; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: pulse 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; } .typing i:nth-child(3) { animation-delay: 0.4s; }
@media (max-width: 820px) { .chat-layout { grid-template-columns: 1fr; } .chat-side { order: 2; } .chat-log { max-height: none; } }

/* ---------------------------------------------------------------- 사람들 */
.people-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.person-card { display: grid; gap: 10px; }
.person-top { display: flex; gap: 14px; align-items: center; }
.person-meta { display: grid; gap: 2px; min-width: 0; }
.person-meta h3 { font-size: 19px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mini-pillars { display: flex; gap: 3px; flex-shrink: 0; }
.mini-gz { display: grid; justify-items: center; font-family: var(--serif); font-weight: 700; font-size: 17px; line-height: 1.25; padding: 6px 5px; border-radius: 8px; background: var(--surface-2); }
.self-chip { background: var(--accent-strong); color: var(--on-accent); }
.memo { border-left: 3px solid var(--line); padding-left: 10px; }
.person-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.person-actions .btn { padding: 7px 11px; }
@media (max-width: 420px) { .people-list { grid-template-columns: 1fr; } }

/* 입력 화면 */
.profile-form { gap: 18px; }
.date-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.check-row { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check-row input { width: 18px; height: 18px; accent-color: var(--gold-2); }
.radio-list { display: grid; gap: 8px; }
.radio-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); cursor: pointer; font-weight: 500; }
.radio-row:has(input:checked) { border-color: var(--gold-2); background: var(--me); }
.radio-row input { margin-top: 4px; accent-color: var(--gold-2); }
.radio-row span { display: grid; gap: 2px; }
.advanced summary { cursor: pointer; font-weight: 700; color: var(--ink-2); padding: 6px 0; }
.advanced[open] summary { margin-bottom: 10px; }
.preview-box { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed color-mix(in srgb, var(--gold) 35%, var(--line)); }
.preview-pillars { display: flex; gap: 10px; justify-content: center; }
.pv-col { display: grid; justify-items: center; gap: 4px; padding: 6px; border-radius: 12px; }
.pv-col.me { background: var(--me); }
.notice-line { display: flex; gap: 6px; align-items: flex-start; color: var(--warn-ink); }

/* ---------------------------------------------------------------- 인쇄 (명식 PDF) */
@media print {
  .sidenav, .tabbar, .mobile-subnav, .verify-banner, .person-pick, .quick-links, .pt-foot, .reading-foot button, .theme-toggle { display: none !important; }
  body { background: #fff !important; color: #000; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ccc; }
  .gz { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.field .segmented { justify-self: start; }

/* 휴대폰: 명식표 네 기둥이 가로 스크롤 없이 들어가게 */
@media (max-width: 560px) {
  .pt-row { grid-template-columns: 34px repeat(4, minmax(0, 1fr)); }
  .pt-cell { padding: 6px 2px; font-size: 13px; }
  .pillar-table { min-width: 0; }
  .pillar-table .gz.lg { width: 52px; height: 60px; }
  .pillar-table .gz.lg b { font-size: 28px; }
  .god { font-size: 12px; padding: 2px 6px; white-space: nowrap; }
  .hidden-stems { gap: 3px; font-size: 15px; }
  .pt-foot .link-btn { font-size: 12px; }
}
.page-head .btn { white-space: nowrap; flex-shrink: 0; }
