@import url('/ui-tokens.css?v=2-sitewide');

:root {
  --app-max-width: 448px;
  --app-gutter: 20px;
  --app-mobile-gutter: 16px;
  --paper: #f4efe7;
  --ink: #25221e;
  --muted: #8c8378;
  --line: #ddd4c8;
  --card: #fffdf9;
  --accent: #a6533e;
  --accent-soft: #f2dfd6;
  --wood: #4f8a68;
  --fire: #c75c45;
  --earth: #b59054;
  --metal: #8e918c;
  --water: #416985;
  --serif: 'Noto Serif KR', Georgia, 'Apple SD Gothic Neo', serif;
  --sans: 'Pretendard Variable', Pretendard, system-ui, 'Apple SD Gothic Neo', sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
/* 한지 배경 — 모든 화면에 깐다. 산은 아래쪽에 고정되고 스크롤해도 흐르지 않는다.
   높이는 inset:0 대신 lvh(주소창이 걷힌 상태의 최대 높이)로 못 박는다.
   inset:0 이면 모바일에서 스크롤할 때 주소창이 접혔다 펴지며 높이가 계속 변하는데,
   화면이 이미지(941x1672)보다 홀쭉하면 cover 가 높이 기준으로 배율을 잡기 때문에
   그때마다 배경이 다시 확대/축소돼 위아래로 덜컥거린다.
   높이를 고정하면 주소창이 걷힐 때 산 아랫부분이 드러날 뿐 배경은 움직이지 않는다.
   (min-aspect-ratio 로 background-size 를 바꾸던 분기는 없앴다.
    이미지보다 넓은 화면에서는 cover 가 이미 폭 기준이라 100% auto 와 같은 그림이었다.) */
body::before {
  content: ''; position: fixed; top: 0; right: 0; left: 0; z-index: -1; pointer-events: none;
  height: 100vh;
  height: 100lvh;
  background-image: url(/images/bg/paper.webp);
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  transform: translateZ(0); /* 스크롤 중 다시 그리지 않도록 별도 레이어로 올린다 */
}
body { margin: 0; color: var(--ink); background: transparent; font-family: var(--sans); word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
/* hidden 은 UA 스타일이라 display 를 지정한 작성자 규칙에 진다.
   그래서 .typing 처럼 display 가 걸린 요소는 hidden 을 달아도 계속 보인다.
   토글하는 자리마다 [hidden] 규칙을 따로 다는 대신 여기서 한 번 못 박는다. */
[hidden] { display: none !important; }

.shell { width: min(calc(100% - (var(--app-gutter) * 2)), calc(var(--app-max-width) - (var(--app-gutter) * 2))); margin: 0 auto; padding: 34px 0 70px; }
.site-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 54px; }
.eyebrow, .section-kicker { margin: 0 0 12px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font: 400 clamp(36px, 7.2vw, 58px)/1.08 var(--serif); letter-spacing: -.015em; }
h1 em { color: var(--accent); font-style: normal; }
h2 { margin-bottom: 10px; font: 400 30px/1.24 var(--serif); letter-spacing: -.01em; }
h3 { margin: 0; font: 400 21px/1.3 var(--serif); letter-spacing: -.01em; }
.header-mark { display: grid; width: 48px; height: 48px; place-items: center; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font: 25px var(--serif); }
.screen { display: none; }
.screen.active { display: block; animation: appear .35s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.intro-copy { max-width: 500px; margin-bottom: 26px; }
.intro-copy > p:last-child { color: var(--muted); font-size: 14px; line-height: 1.7; }
.card, .chat-card { border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,249,.6); box-shadow: 0 10px 30px rgba(74,55,35,.04); }
.form-card { display: grid; gap: 19px; padding: 24px; }
label { display: grid; gap: 8px; color: #6f665c; font-size: 12px; font-weight: 700; }
label .optional { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--ink); background: var(--card); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input, select { height: 45px; padding: 0 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.date-input-row, .time-input-row { display: flex; align-items: center; gap: 7px; height: 45px; color: var(--muted); line-height: 45px; }
.date-input-row .date-part { min-width: 0; height: 45px; padding: 0 8px; text-align: center; }
.date-input-row .year-part { flex: 1.35; }
.date-input-row .date-part:not(.year-part) { flex: 1; }
.time-input-row .time-part { width: 76px; height: 45px; padding: 0 8px; text-align: center; }
.calendar-choice, .leap-month-choice { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; border: 0; }
.calendar-choice legend, .leap-month-choice legend { margin-bottom: 8px; color: #6f665c; font-size: 12px; font-weight: 700; }
.calendar-choice legend, .leap-month-choice legend { float: left; width: 100%; }
.calendar-choice label, .leap-month-choice label { display: flex; align-items: center; gap: 6px; min-width: 74px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--card); cursor: pointer; font-size: 12px; font-weight: 600; }
.calendar-choice label:has(input:checked), .leap-month-choice label:has(input:checked) { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.calendar-choice input, .leap-month-choice input { width: auto; height: auto; margin: 0; accent-color: var(--accent); }
.leap-month-choice { margin-top: 12px; }
.toggle-line { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 4px 0; cursor: pointer; }
.toggle-line input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle { width: 35px; height: 21px; padding: 3px; border-radius: 30px; background: #c7c0b7; transition: .2s; flex: 0 0 auto; }
.toggle::after { display: block; width: 15px; height: 15px; border-radius: 50%; background: white; content: ''; transition: .2s; }
.toggle-line input:checked + .toggle { background: var(--accent); }
.toggle-line input:checked + .toggle::after { transform: translateX(14px); }
.toggle-line strong, .toggle-line small { display: block; }
.toggle-line strong { color: var(--ink); font-size: 13px; }
.toggle-line small { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.primary-button { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 18px; border: 0; border-radius: 10px; color: #fffaf4; background: var(--ink); font-size: 14px; font-weight: 800; transition: .2s; }
.primary-button:hover { background: var(--accent); transform: translateY(-1px); }
.primary-button:disabled, .primary-button:disabled:hover { cursor: wait; opacity: .55; background: var(--ink); transform: none; }
.primary-button span { font-size: 23px; font-weight: 400; }
.wide-button { width: 100%; margin-top: 4px; }
/* 테스트용 바로가기. 실제 결제 흐름이 붙으면 지운다. */
.dev-shortcut { display: block; width: 100%; margin-top: 10px; padding: 10px; border: 1px dashed rgba(126,106,82,.35); border-radius: 10px; color: var(--muted); font-size: 13px; text-align: center; }
.dev-shortcut:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.dev-shortcut:disabled { opacity: .55; cursor: default; }
.form-error { min-height: 17px; margin: -7px 0 0; color: var(--accent); font-size: 12px; }
.privacy-note, .chat-disclaimer { margin: 14px 2px; color: var(--muted); font-size: 11px; }
.screen-heading, .block-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.screen-heading { margin-bottom: 26px; }
.text-button { padding: 7px 0; border: 0; color: var(--muted); background: none; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.notice { margin: -7px 0 18px; padding: 12px 14px; border: 1px solid #e2c6b9; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-size: 12px; line-height: 1.5; }
#unknown-time-note { border: 0; color: var(--ink, #25221e); background: #f1ebdf; font-weight: 500; }
.chart-block { margin-bottom: 14px; padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,253,249,.7); }
.advanced-chart-details { margin: 24px 0 14px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,253,249,.62); }
.advanced-chart-details > summary { cursor: pointer; padding: 18px 21px; color: var(--accent); font: 600 16px/1.4 var(--serif); }
.advanced-chart-content { padding: 0 10px 10px; }
.advanced-chart-content .chart-block { margin: 10px 0; }
.orientation-details { margin: 20px 0 14px; border: 1px solid rgba(166,83,62,.2); border-radius: 17px; background: rgba(255,253,249,.82); }
.orientation-details-title { margin: 0; cursor: default; padding: 14px 17px; color: var(--accent); font: 600 14px/1.4 var(--serif); }
.orientation-content { padding: 4px 17px 17px; }
.orientation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.orientation-heading .section-kicker { margin-bottom: 7px; }
.orientation-heading h3 { font-size: 20px; }
.orientation-basic-values { display: grid; gap: 9px; margin-bottom: 15px; }
.orientation-value { padding: 11px 12px 12px; border: 1px solid rgba(126,106,82,.14); border-radius: 12px; background: rgba(255,255,255,.45); }
.orientation-value h4 { margin: 0 0 9px; color: var(--accent); font: 600 14px/1.4 var(--serif); }
.orientation-pillars { gap: 6px; margin-bottom: 12px; }
.orientation-value-palja .orientation-pillars { margin-bottom: 0; }
.orientation-pillar-caption { display: block; min-height: 15px; margin: -2px 0 5px; color: var(--muted); font-size: 9px; font-weight: 400; }
.orientation-pillar .pillar-label { margin-bottom: 2px; }
.orientation-pillar .pillar-box { min-height: 98px; }
.orientation-pillar-unknown { display: grid; place-items: center; color: var(--muted); font-size: 10px; line-height: 1.4; }
.orientation-copy { display: grid; gap: 8px; margin: 12px 0 14px; }
.orientation-copy p { margin: 0; color: var(--ink); font: 13px/1.8 var(--serif); }
.orientation-element-layers { display: grid; gap: 10px; }
.orientation-element-layer { padding: 8px 9px 2px; border-radius: 10px; background: rgba(255,255,255,.52); }
.orientation-hidden-element-layer { opacity: .82; }
.orientation-element-layer-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: var(--ink); font-size: 11px; }
.orientation-element-layer-heading small { color: var(--muted); font-size: 9px; font-weight: 400; }
.orientation-element-bars { gap: 7px; margin-bottom: 7px; }
.orientation-element-bars .element-row { grid-template-columns: 72px 1fr 18px; gap: 6px; font-size: 10px; }
.orientation-element-bars .element-name { font-size: 11px; }
.orientation-element-bars .bar-track { height: 7px; }
.orientation-element-bars .element-number { font-size: 10px; }
.orientation-ten-god-groups { display: grid; gap: 12px; }
.orientation-ten-god-group { display: grid; gap: 7px; }
.orientation-ten-god-heading { color: var(--accent); font: 600 11px/1.4 var(--serif); }
.orientation-ten-god-list { display: grid; gap: 5px; }
.orientation-ten-god-line { padding: 7px 9px; border-radius: 7px; color: var(--ink); background: rgba(255,255,255,.62); font: 12px/1.4 var(--serif); letter-spacing: .01em; }
.orientation-ten-god-line.muted { color: var(--muted); }
.orientation-table-wrap { overflow-x: auto; border: 1px solid rgba(126,106,82,.13); border-radius: 8px; background: rgba(255,255,255,.45); }
.orientation-data-table { width: 100%; border-collapse: collapse; color: var(--ink); font: 11px/1.4 var(--serif); }
.orientation-data-table th, .orientation-data-table td { padding: 7px 7px; border-bottom: 1px solid rgba(126,106,82,.1); text-align: left; vertical-align: top; white-space: nowrap; }
.orientation-data-table th { color: var(--muted); background: rgba(255,255,255,.4); font-size: 10px; font-weight: 600; }
.orientation-data-table tr:last-child td { border-bottom: 0; }
.orientation-data-table td:first-child { color: var(--accent); font-weight: 600; }
.orientation-data-table td.orientation-table-continuation { color: transparent; }
.orientation-data-table .muted { color: var(--muted); font-weight: 400; }
.orientation-value-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.orientation-value-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 5px 8px; border-radius: 999px; color: var(--ink); background: rgba(255,255,255,.72); font-size: 11px; line-height: 1.35; }
.orientation-value-chip.muted { color: var(--muted); }
.orientation-value-note { flex-basis: 100%; color: var(--muted); font-size: 10px; line-height: 1.5; }
.block-heading { margin-bottom: 18px; }
.micro-label { max-width: 230px; color: var(--muted); font-size: 10px; line-height: 1.5; text-align: right; }
.correction-list { display: flex; flex-wrap: wrap; gap: 6px; margin: -7px 0 18px; }
.correction-list span { padding: 5px 8px; border-radius: 99px; color: var(--accent); background: var(--accent-soft); font-size: 10px; }
.pillars-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.pillar { min-width: 0; text-align: center; }
.pillar-label { margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.pillar-god { min-height: 17px; margin-bottom: 4px; color: var(--accent); font-size: 10px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pillar-god-bottom { margin: 4px 0 0; }
.pillar-box { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.pillar.day .pillar-box { border: 2px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.character { display: grid; min-height: 49px; place-items: center; font: 30px/1 var(--serif); }
.character.gan { border-bottom: 1px solid var(--line); }
.character-reading { display: block; margin-top: 4px; color: var(--muted); font: 10px/1 var(--sans); }
.hidden-stems { min-height: 25px; padding: 5px 2px 4px; color: var(--muted); font: 11px/1.4 var(--serif); letter-spacing: -.01em; white-space: nowrap; }
.reading-note { margin: 15px 0 0; color: var(--muted); font-size: 10px; }
.wood { color: var(--wood); } .fire { color: var(--fire); } .earth { color: var(--earth); } .metal { color: var(--metal); } .water { color: var(--water); }
.strength-badge, .year-badge { padding: 6px 9px; border-radius: 99px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 800; }
.element-bars { display: grid; gap: 9px; margin-bottom: 22px; }
.structure-highlights-heading, .element-layer-heading, .strength-evidence-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; color: var(--ink); font-size: 12px; }
.structure-highlights-heading small, .element-layer-heading small, .strength-evidence-heading small { color: var(--muted); font-size: 10px; font-weight: 400; }
.structure-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 22px; }
.structure-highlight-card { display: grid; gap: 4px; min-width: 0; padding: 11px 12px; border: 1px solid rgba(126,106,82,.15); border-radius: 11px; background: rgba(255,255,255,.48); }
.structure-highlight-card small { color: var(--accent); font-size: 10px; font-weight: 800; }
.structure-highlight-card strong { color: var(--ink); font: 500 18px/1.25 var(--serif); }
.structure-highlight-card p { margin: 0; color: var(--muted); font: 12px/1.55 var(--serif); }
.hidden-layer-heading { margin-top: 18px; }
.hidden-element-bars { margin-bottom: 18px; opacity: .82; }
.strength-evidence { display: grid; gap: 10px; margin: 3px 0 22px; padding: 14px 0 0; border-top: 1px solid rgba(126,106,82,.13); }
.strength-criteria { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.strength-criterion { display: grid; gap: 5px; padding: 9px; border: 1px solid rgba(126,106,82,.15); border-radius: 9px; background: rgba(255,255,255,.42); }
.strength-criterion.yes { border-color: rgba(108,146,118,.4); background: #f4f8f2; }
.strength-criterion.no { border-color: rgba(183,108,78,.25); background: #fff8f2; }
.strength-criterion strong { color: var(--ink); font-size: 11px; }
.strength-criterion p, .strength-evidence-line, .strength-caveat { margin: 0; color: var(--muted); font: 11px/1.55 var(--serif); }
.strength-evidence-line { color: var(--ink); }
.strength-caveat { padding-top: 8px; border-top: 1px solid rgba(126,106,82,.1); font-size: 10px; }
.candidate-notes { display: grid; gap: 8px; margin: 0 0 22px; padding: 13px 0 0; border-top: 1px solid rgba(126,106,82,.13); }
.candidate-notes > strong { color: var(--accent); font-size: 11px; }
.candidate-notes article { padding: 9px 11px; border: 1px solid rgba(166,83,62,.2); border-radius: 8px; background: rgba(255,255,255,.34); }
.candidate-notes h4 { margin: 0 0 4px; color: var(--ink); font: 500 14px/1.4 var(--serif); }
.candidate-notes p, .candidate-notes > small { margin: 0; color: var(--muted); font: 11px/1.6 var(--serif); }
.candidate-notes > small { padding-top: 3px; }
.hidden-stems-details { margin-top: 13px; border-top: 1px solid rgba(126,106,82,.12); padding-top: 11px; }
.hidden-stems-details summary { cursor: pointer; color: var(--accent); font-size: 11px; font-weight: 800; }
.hidden-stems-expanded { display: grid; gap: 7px; margin-top: 10px; }
.hidden-stems-row { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; align-items: center; }
.hidden-stems-row > strong { color: var(--muted); font-size: 10px; }
.hidden-stems-gods { display: flex; flex-wrap: wrap; gap: 5px; }
.hidden-stems-gods span, .hidden-stems-gods small { padding: 4px 7px; border-radius: 6px; color: var(--ink); background: #f1ece5; font: 11px var(--serif); }
.element-row { display: grid; grid-template-columns: 20px 1fr 22px; align-items: center; gap: 8px; font-size: 12px; }
.element-name { font-family: var(--serif); font-size: 15px; }
.bar-track { height: 8px; overflow: hidden; border-radius: 9px; background: #e8e2da; }
.bar-fill { height: 100%; min-width: 0; border-radius: inherit; transition: width .5s ease; }
.bar-fill.zero { width: 0 !important; }
.element-number { color: var(--muted); text-align: right; font-size: 11px; }
.luck-meta { display: flex; gap: 15px; margin: -7px 0 12px; color: var(--muted); font-size: 12px; }
.luck-meta strong { color: var(--ink); }
.luck-timeline { display: flex; gap: 7px; overflow-x: auto; margin: 0 -5px; padding: 5px; scrollbar-width: thin; }
.luck-chip { min-width: 74px; padding: 10px 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--card); text-align: center; }
.luck-chip.current { border: 2px solid var(--accent); padding: 9px 6px; color: var(--accent); box-shadow: 0 4px 12px rgba(166,83,62,.12); }
.luck-chip small, .luck-chip strong { display: block; }
.luck-chip small { margin-bottom: 5px; font-size: 10px; }
.luck-chip strong { font: 18px var(--serif); }
.screen-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sinsal-list { display: flex; flex-wrap: wrap; gap: 7px; }
.sinsal-chip { position: relative; display: grid; gap: 3px; padding: 9px 34px 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--card); text-align: left; cursor: pointer; }
.sinsal-chip:not(.absent)::after { content: "?"; position: absolute; top: 50%; right: 10px; display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid currentColor; border-radius: 50%; opacity: .48; font: 700 10px/1 var(--sans); transform: translateY(-50%); }
.sinsal-chip strong { font: 400 16px/1.2 var(--serif); }
.sinsal-chip small { color: var(--muted); font-size: 10px; }
.sinsal-chip.auspicious { border-color: #b8d1ba; background: #f1f7f0; }
.sinsal-chip.auspicious strong { color: #4e7958; }
.sinsal-chip.neutral { border-color: #ccd4dd; background: #f3f6f8; }
.sinsal-chip.neutral strong { color: #5d7080; }
.empty-deterministic { margin: 0; color: var(--muted); font: 14px/1.7 var(--serif); }
.gongmang-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 12px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.gongmang-summary strong { color: var(--accent); font-size: 12px; }
.gongmang-summary span { color: var(--ink); }
.gongmang-summary small { flex-basis: 100%; color: var(--muted); }
.deterministic-reading { display: grid; gap: 7px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(126,106,82,.13); }
.deterministic-reading p { margin: 0; color: var(--ink); font: 14px/1.75 var(--serif); }
.deterministic-reading p::first-letter { color: var(--accent); }
.ji-cell { position: relative; gap: 2px; }
.ji-cell.gongmang-hit { background: #fff0e9; }
.ji-cell.gongmang-hit > small { color: var(--accent); font: 9px var(--sans); }
.yearly-luck { display: flex; gap: 7px; overflow-x: auto; margin: 0 -5px; padding: 5px; scrollbar-width: thin; }
.yearly-chip { min-width: 95px; padding: 9px 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--card); text-align: center; }
.yearly-chip.current { border: 2px solid var(--accent); padding: 8px 6px; color: var(--accent); box-shadow: 0 4px 12px rgba(166,83,62,.12); }
.yearly-chip small, .yearly-chip strong, .yearly-chip span, .yearly-chip em { display: block; }
.yearly-chip small { margin-bottom: 5px; font-size: 10px; }
.yearly-chip strong { font: 18px var(--serif); }
.yearly-chip span { margin-top: 4px; color: var(--ink); font-size: 10px; line-height: 1.35; }
.yearly-chip em { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.calendar-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,253,249,.7); }
.calendar-toolbar { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; margin-bottom: 14px; text-align: center; }
.calendar-toolbar strong { font: 20px var(--serif); }
.calendar-nav { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--card); }
.calendar-nav:hover { border-color: var(--accent); color: var(--accent); }
.iljin-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.iljin-weekday { padding: 3px 0 5px; color: var(--muted); font-size: 10px; text-align: center; }
.iljin-weekday:first-child { color: var(--accent); }
.iljin-day { display: grid; min-height: 72px; align-content: start; gap: 3px; padding: 7px 4px 5px; border: 1px solid rgba(126,106,82,.14); border-radius: 8px; color: var(--ink); background: #f1eee8; text-align: center; transition: .15s; }
.iljin-day:hover, .iljin-day.selected { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 3px 9px rgba(166,83,62,.12); }
.iljin-day.iljin-empty { border-color: transparent; background: transparent; pointer-events: none; }
.iljin-day small { color: var(--muted); font-size: 10px; text-align: left; }
.iljin-day strong { font: 16px var(--serif); }
.iljin-mark { min-height: 12px; overflow: hidden; color: var(--accent); font-size: 8px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.iljin-level-0, .iljin-level-1 { background: #f3e5df; }
.iljin-level-2 { background: #f4ebe5; }
.iljin-level-3 { background: #f1eee8; }
.iljin-level-4 { background: #edf2e9; }
.iljin-level-5, .iljin-level-6 { background: #e3f0e4; }
.iljin-detail { margin-top: 14px; padding: 14px 15px; border: 1px solid rgba(126,106,82,.16); border-radius: 11px; background: #fff9ef; }
.iljin-detail h3 { margin-bottom: 8px; color: var(--accent); font-size: 19px; }
.iljin-detail p { margin: 5px 0 0; color: var(--ink); font: 13px/1.65 var(--serif); }
.reading-block { margin-top: 20px; }
.reading-day-master { margin: -2px 0 17px; padding: 15px 16px 14px; border: 1px solid rgba(166,83,62,.2); border-radius: 13px; background: rgba(255,249,239,.82); }
.reading-day-master-title { color: var(--accent); font: 500 28px/1.25 var(--serif); letter-spacing: .01em; }
.reading-day-master-description { margin: 7px 0 0; color: var(--muted); font: 13px/1.65 var(--serif); }
.reading-day-master-basics { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid rgba(126,106,82,.13); color: var(--ink); font: 13px/1.7 var(--serif); }
.reading-day-master-meanings { display: grid; gap: 5px; margin-top: 8px; }
.reading-day-master-meanings p { margin: 0; color: var(--muted); font: 12px/1.7 var(--serif); }
.reading-loading { color: var(--muted); font: 15px/1.8 var(--serif); }
.reading-toc { display: flex; gap: 6px; overflow-x: auto; margin: 0 -5px 15px; padding: 4px 5px 7px; scrollbar-width: thin; position: sticky; top: 8px; z-index: 2; background: rgba(255,253,249,.92); }
.reading-toc-item { flex: 0 0 auto; padding: 7px 10px; border: 1px solid rgba(126,106,82,.16); border-radius: 99px; color: var(--muted); background: rgba(255,255,255,.72); font-size: 11px; white-space: nowrap; }
.reading-toc-item.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 800; }
.reading-toc-item:disabled { cursor: default; opacity: .38; }
.reading-stack { display: grid; gap: 14px; }
.reading-section { overflow: hidden; border: 1px solid rgba(126,106,82,.16); border-radius: 15px; background: #fff9ef; box-shadow: 0 7px 18px rgba(74,55,35,.035); }
.reading-section.reading-fire { background: #fff3ed; }
.reading-section.reading-structure { background: #f6f3eb; }
.reading-section.reading-elements { background: #eef5ef; }
.reading-section.reading-life { background: #f8f0ed; }
.reading-section.reading-luck { background: #eef1f5; }
.reading-section.reading-practice { background: #f4f2e8; }
.reading-section.reading-wealth { background: #fbf2e5; }
.reading-section.reading-relationships { background: #fbefec; }
.reading-section.reading-work { background: #eef1f6; }
.reading-section.reading-health { background: #eef5ef; }
.reading-visual { aspect-ratio: 3 / 1; overflow: hidden; background: #e9dfd0; }
.reading-visual img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reading-body { padding: 18px 19px 20px; }
.reading-body h4 { margin: 0 0 13px; color: var(--accent); font: 500 21px/1.35 var(--serif); letter-spacing: -.01em; }
.reading-body p { margin: 0 0 12px; color: var(--ink); font: 15px/1.85 var(--serif); }
.reading-body p:last-child { margin-bottom: 0; }
.reading-subcards { display: grid; gap: 12px; margin-top: 18px; }
.reading-subsection { overflow: hidden; border: 1px solid rgba(126,106,82,.13); border-radius: 12px; background: rgba(255,255,255,.32); }
.reading-subsection.reading-work { background: #fbf2e5; }
.reading-subsection.reading-wealth { background: #edf5ee; }
.reading-subsection.reading-relationships { background: #fbefec; }
.reading-subsection.reading-current-flow { background: #eef1f6; }
.reading-subvisual { min-height: 100%; background: #e9dfd0; }
.reading-subvisual img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reading-subbody { padding: 14px 15px 15px; }
.reading-subbody h5 { margin: 0 0 8px; color: var(--accent); font: 400 17px/1.3 var(--serif); }
.reading-subbody p { margin: 0 0 8px; color: var(--ink); font: 14px/1.75 var(--serif); }
.reading-subbody p:last-child { margin-bottom: 0; }
.structured-domain-flow { display: grid; gap: 10px; margin-top: 16px; }
.domain-flow-card, .domain-upcoming { padding: 13px 14px; border: 1px solid rgba(166,83,62,.25); border-radius: 10px; background: rgba(255,255,255,.35); }
.domain-flow-card h5, .domain-upcoming h5 { margin: 0 0 6px; color: var(--accent); font: 600 14px/1.4 var(--serif); }
.domain-flow-card p, .domain-upcoming-card p { margin: 0 !important; color: var(--ink); font-size: 13px !important; line-height: 1.78 !important; }
.domain-upcoming { display: grid; gap: 8px; border-left-color: rgba(65,105,133,.42); }
.domain-upcoming h5 { margin-bottom: 1px; }
.domain-upcoming-card { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 9px; align-items: start; padding-top: 8px; border-top: 1px solid rgba(126,106,82,.12); }
.domain-upcoming-card strong { color: var(--accent); font: 500 15px/1.5 var(--serif); }
.fortune-board { margin-top: 7px; }
.fortune-board-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px 16px; margin-bottom: 13px; }
.fortune-board-heading h5 { margin: 0; color: var(--accent); font: 400 20px/1.25 var(--serif); }
.fortune-board-heading p { grid-column: 1 / -1; margin: -2px 0 0; color: var(--muted); font: 13px/1.6 var(--serif); }
.fortune-board-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px 10px; color: var(--muted); font-size: 11px; }
.fortune-board-meta strong { color: var(--ink); font: 16px var(--serif); }
.fortune-table { overflow: hidden; border: 1px solid rgba(126,106,82,.16); border-radius: 12px; background: rgba(255,255,255,.4); }
.fortune-row { display: grid; grid-template-columns: 142px minmax(0, 1fr); border-top: 1px solid rgba(126,106,82,.12); }
.fortune-row:first-child { border-top: 0; }
.fortune-row-label { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 15px 13px; background: rgba(255,255,255,.3); }
.fortune-row-label small { color: var(--accent); font-size: 10px; letter-spacing: .1em; }
.fortune-row-label strong { color: var(--ink); font: 400 16px/1.35 var(--serif); }
.fortune-row-content { min-width: 0; padding: 15px 16px; }
.fortune-row-copy { margin: 0 0 9px; color: var(--ink); font: 14px/1.75 var(--serif); }
.fortune-row-copy:last-child { margin-bottom: 0; }
.fortune-row-1 .fortune-row-label { box-shadow: inset 3px 0 #b76c4e; }
.fortune-row-2 .fortune-row-label { box-shadow: inset 3px 0 #6c9276; }
.fortune-row-3 .fortune-row-label { box-shadow: inset 3px 0 #ba7b7e; }
.fortune-row-4 .fortune-row-label { box-shadow: inset 3px 0 #71829a; }
.axis-intro, .fortune-timeline-note { margin: -5px 0 14px; color: var(--muted); font: 13px/1.65 var(--serif); }
.fortune-timeline-note { margin: 13px 0 0; padding-top: 12px; border-top: 1px solid rgba(126,106,82,.13); font-size: 11px; }
.fortune-natal-markers { margin-top: 17px; padding-top: 15px; border-top: 1px solid rgba(126,106,82,.13); }
.fortune-natal-markers h4 { margin: 0 0 10px; color: var(--accent); font: 500 17px/1.35 var(--serif); }
.fortune-natal-sinsal { display: flex; flex-wrap: wrap; gap: 7px; }
.fortune-natal-gongmang { margin: 13px 0 0; color: var(--muted); font: 12px/1.6 var(--serif); }
.fortune-timeline { display: flex; gap: 8px; overflow-x: auto; margin: 0 -5px; padding: 5px; scrollbar-width: thin; }
.time-axis-card { display: grid; min-width: 174px; gap: 5px; padding: 11px 10px; border: 1px solid rgba(126,106,82,.17); border-radius: 12px; color: var(--muted); background: rgba(255,255,255,.52); text-align: left; cursor: pointer; transition: .15s; }
.time-axis-card:hover, .time-axis-card.current { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(166,83,62,.1); }
.time-axis-card.current { background: #fff4ed; }
.time-axis-card small { font-size: 10px; }
.time-axis-card strong { color: var(--ink); font: 19px/1.2 var(--serif); }
.time-axis-card > span { color: var(--accent); font-size: 11px; font-weight: 800; }
.time-axis-relations { min-height: 25px; margin: 0; color: var(--ink); font-size: 9px; line-height: 1.45; }
.time-axis-meaning { min-height: 25px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.reading-error { margin: 10px 0 0; color: var(--accent); font-size: 12px; line-height: 1.6; }
.reading-skeleton { min-height: 360px; }
.reading-skeleton .reading-visual { display: grid; place-items: center; background: #eee8df; }
.skeleton-shimmer { border-radius: 8px; background: linear-gradient(100deg, rgba(255,255,255,.18) 30%, rgba(255,255,255,.62) 50%, rgba(255,255,255,.18) 70%); background-size: 220% 100%; animation: skeleton-shimmer 1.6s infinite; }
.skeleton-visual-line { width: 28%; height: 18px; }
.skeleton-title { width: 32%; height: 24px; margin-bottom: 19px; }
.skeleton-line { width: 94%; height: 13px; margin-bottom: 12px; }
.skeleton-line.short { width: 68%; }
@keyframes skeleton-shimmer { from { background-position: 180% 0; } to { background-position: -40% 0; } }
.structured-headline { margin: 0 0 15px; color: var(--accent); font-size: 17px; font-weight: 600; line-height: 1.65; }
.reading-body-copy { display: grid; gap: 9px; }
.reading-body-copy p { margin: 0; color: var(--ink); font: 15px/1.85 var(--serif); }
.reading-why { margin-top: 20px; padding: 13px 15px; border: 1px solid rgba(126,106,82,.18); border-radius: 12px; background: rgba(255,255,255,.55); }
.reading-why > summary { cursor: pointer; color: var(--accent); font: 600 14px/1.5 var(--serif); }
.reading-why-explanation { margin: 12px 0 13px; color: var(--muted); font: 13px/1.75 var(--serif); }
.reading-why h5 { margin: 0 0 8px; color: var(--muted); font: 400 12px/1.4 var(--sans); }
.structured-points { display: grid; gap: 8px; margin: 0 0 17px; padding: 0; list-style: none; }
.structured-points li { position: relative; padding: 10px 12px 10px 25px; border-radius: 9px; color: var(--ink); background: rgba(255,255,255,.42); font: 14px/1.65 var(--serif); }
.structured-points li::before { position: absolute; top: 10px; left: 11px; color: var(--accent); content: '•'; font-weight: 700; }
.structured-terms h5 { margin: 0 0 10px; color: var(--accent); font: 400 16px/1.35 var(--serif); }
.structured-deep { margin-top: 16px; }
.deep-cards { display: grid; gap: 9px; }
.deep-card { padding: 13px 14px; border: 1px solid rgba(166,83,62,.25); border-radius: 10px; background: rgba(255,255,255,.35); }
.deep-card h5 { margin: 0 0 6px; color: var(--ink); font: 600 14px/1.4 var(--serif); }
.deep-card p { margin: 0 !important; color: var(--ink); font-size: 13px !important; line-height: 1.78 !important; }
.structured-character-example { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 11px; margin-top: 18px; padding: 13px 14px; border: 1px solid rgba(126,106,82,.16); border-radius: 12px; background: rgba(255,255,255,.62); }
.reading-character-avatar { display: grid; width: 48px; height: 48px; place-items: center; overflow: hidden; border-radius: 50%; color: var(--accent); background: var(--accent-soft); font: 23px var(--serif); }
.reading-character-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.character-example-copy { min-width: 0; }
.character-example-copy h5 { margin: 0 0 5px; color: var(--accent); font: 500 15px/1.35 var(--serif); }
.character-example-copy p { margin: 0 !important; color: var(--ink); font-size: 13px !important; line-height: 1.75 !important; }
.reading-preset-hero .structured-character-example { grid-template-columns: 64px minmax(0, 1fr); }
.reading-preset-hero .reading-character-avatar { width: 64px; height: 64px; font-size: 28px; }
.reading-preset-compact .structured-character-example { grid-template-columns: 40px minmax(0, 1fr); gap: 9px; padding: 10px 12px; }
.reading-preset-compact .reading-character-avatar { width: 40px; height: 40px; font-size: 19px; }
.structured-terms { margin-top: 17px; }
.term-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.term-chip { padding: 6px 10px; border: 1px solid rgba(126,106,82,.18); border-radius: 999px; color: var(--ink); background: rgba(255,255,255,.5); font-size: 11px; }
.term-chip:hover, .term-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.term-chip-repeated { cursor: default; border-style: dotted; color: var(--muted); background: transparent; }
.term-chip-repeated:disabled { opacity: 1; }
.term-card { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 13px; margin-top: 10px; padding: 11px; border: 1px solid rgba(126,106,82,.16); border-radius: 12px; background: rgba(255,255,255,.58); }
.term-image-wrap { display: grid; min-width: 0; aspect-ratio: 1; overflow: hidden; place-items: center; border-radius: 9px; }
.term-image-wrap.wood { background: #dcebd9; }
.term-image-wrap.fire { background: #f4dcd0; }
.term-image-wrap.earth { background: #eee2c8; }
.term-image-wrap.metal { background: #e6e6e0; }
.term-image-wrap.water { background: #dce8f0; }
.term-image-wrap.neutral { background: #e8e1da; }
.term-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.term-image-fallback { display: grid; width: 100%; height: 100%; place-content: center; gap: 4px; color: var(--ink); text-align: center; }
.term-image-fallback strong { font: 28px/1 var(--serif); }
.term-image-fallback span { font-size: 10px; }
.term-card-body { min-width: 0; }
.term-card-body h5 { margin: 0 0 4px; color: var(--accent); font: 400 17px/1.3 var(--serif); }
.term-one-liner { display: block; margin-bottom: 6px; color: var(--ink); font: 13px/1.5 var(--serif); }
.term-card-body p { margin: 0 0 7px !important; font-size: 12px !important; line-height: 1.7 !important; }
.term-caveat { display: block; margin-bottom: 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.term-ask { padding: 6px 9px; border: 1px solid var(--accent); border-radius: 6px; color: var(--accent); background: transparent; font-size: 10px; }
.term-ask:disabled { opacity: .45; }
.structured-error { border-color: rgba(166,83,62,.25); background: #fff5ef; }
.structured-error .reading-body { min-height: 180px; }
.structured-error .primary-button.small { width: auto; margin-top: 4px; padding: 9px 12px; font-size: 12px; }
.persona-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 12px; }
.persona-tab { display: grid; justify-items: center; gap: 5px; padding: 9px 5px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: transparent; text-align: center; }
.persona-tab.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.persona-tab strong, .persona-tab small { display: block; }
.persona-tab strong { font: 18px var(--serif); }
.persona-tab small { margin-top: 3px; font-size: 10px; }
.persona-avatar { display: grid; width: 56px; height: 56px; place-items: center; overflow: hidden; border-radius: 50%; color: #fff; background: var(--accent); font: 23px var(--serif); }
.persona-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.chat-card { min-height: 430px; padding: 17px; }
.chat-stage { display: flex; align-items: center; gap: 13px; margin: -2px -3px 14px; padding: 10px 11px; border-bottom: 1px solid var(--line); background: rgba(255,253,249,.92); position: sticky; top: 0; z-index: 1; }
.chat-stage-avatar { display: grid; width: 96px; height: 96px; flex: 0 0 96px; place-items: center; overflow: hidden; border-radius: 50%; color: #fff; background: var(--accent); font: 38px var(--serif); box-shadow: 0 4px 12px rgba(74,55,35,.12); }
.chat-stage-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.chat-stage-copy { display: grid; gap: 3px; }
.chat-stage-copy strong { color: var(--accent); font: 500 20px/1.3 var(--serif); }
.chat-stage-copy span { color: var(--muted); font-size: 11px; }
.chat-messages { display: grid; gap: 12px; min-height: 320px; max-height: 54vh; overflow-y: auto; padding: 4px 1px 16px; }
.message { display: flex; gap: 8px; max-width: 88%; }
.message.user { justify-self: end; flex-direction: row-reverse; }
.avatar { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; overflow: hidden; border-radius: 50%; color: #fff; background: var(--accent); font: 16px var(--serif); }
.avatar-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.message.user .avatar { color: var(--ink); background: #e3ddd4; }
.message.grouped .message-avatar { visibility: hidden; }
.bubble { padding: 10px 12px; border-radius: 5px 13px 13px 13px; color: var(--ink); background: #f0ebe4; font-size: 13px; line-height: 1.65; white-space: pre-wrap; }
.message.user .bubble { border-radius: 13px 5px 13px 13px; background: var(--ink); color: #fffaf4; }
.empty-chat { align-self: center; color: var(--muted); font: 16px/1.6 var(--serif); text-align: center; }
.typing { display: flex; align-items: center; gap: 3px; height: 26px; color: var(--muted); }
.typing span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
.typing em { margin-left: 6px; font-size: 10px; font-style: normal; }
@keyframes blink { 0%, 70%, 100% { opacity: .3; } 35% { opacity: 1; } }
.chat-form { display: flex; align-items: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 13px; }
.chat-form textarea { resize: none; min-height: 43px; max-height: 110px; padding: 11px 12px; line-height: 1.45; }
.chat-form button { width: 43px; height: 43px; flex: 0 0 auto; border: 0; border-radius: 50%; color: #fffaf4; background: var(--accent); font-size: 22px; }
.chat-form button:disabled { opacity: .45; }

/* SPEC_05: 고급 입력은 기본으로 접고, 미성립 표시는 성립 표기와 분리한다. */
.advanced-settings { border-top: 1px solid var(--line); padding-top: 14px; }
.advanced-settings summary { cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 800; }
.advanced-settings summary::marker { color: var(--accent); }
.advanced-settings-body { display: grid; gap: 17px; margin-top: 16px; }
.sinsal-absent { display: grid; gap: 7px; margin-top: 14px; }
.sinsal-absent-label { color: var(--muted); font-size: 10px; font-weight: 800; }
.sinsal-absent-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sinsal-chip.absent { padding: 6px 9px; border-style: dashed; border-color: #cbd0d3; color: #7d858b; background: transparent; font-size: 11px; }
.sinsal-not-evaluated { margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.term-inline { padding: 0 1px; border: 0; border-bottom: 1px dotted var(--accent); color: inherit; background: transparent; font: inherit; }
.term-inline:hover, .term-inline.active { color: var(--accent); border-bottom-style: solid; }
.reading-preset-hero .reading-body h4 { font-size: 25px; }
.reading-preset-hero .reading-visual { aspect-ratio: 2.45 / 1; }
.reading-preset-compact .reading-body { padding-top: 15px; padding-bottom: 16px; }
.reading-preset-compact .structured-points { margin-bottom: 8px; }
.reading-preset-compact .structured-deep { margin-top: 10px; }
.reading-preset-closing .structured-points li { border-left: 3px solid var(--accent); padding-left: 22px; }

@media (max-width: 430px) {
  .shell { width: min(calc(100% - (var(--app-mobile-gutter) * 2)), calc(var(--app-max-width) - (var(--app-mobile-gutter) * 2))); padding-top: 24px; }
  .site-header { margin-bottom: 38px; }
  .header-mark { width: 40px; height: 40px; font-size: 21px; }
  h1 { font-size: 42px; }
  h2 { font-size: 29px; }
  .chart-block { padding: 17px 13px; }
  .form-card { padding: 18px; }
  .micro-label { max-width: 140px; }
  .chat-card { padding: 12px; }
  .message { max-width: 94%; }
  .reading-subsection { grid-template-columns: 1fr; }
  .reading-day-master-title { font-size: 24px; }
  .reading-subvisual { aspect-ratio: 3 / 1; min-height: 0; }
  .reading-subbody { padding: 13px 14px 15px; }
  .term-card { grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 9px; }
  .term-image-fallback strong { font-size: 22px; }
  .fortune-board-heading { grid-template-columns: 1fr; align-items: start; }
  .fortune-board-meta { justify-content: flex-start; }
  .fortune-row { grid-template-columns: 1fr; }
  .fortune-row-label { padding: 12px 14px 8px; }
  .fortune-row-content { padding: 0 14px 14px; }
  .screen-actions { align-items: flex-end; flex-direction: column; gap: 2px; }
  .calendar-card { padding: 12px; }
  .iljin-calendar { gap: 3px; }
  .iljin-day { min-height: 61px; padding: 5px 2px 4px; }
  .iljin-day strong { font-size: 14px; }
  .iljin-mark { font-size: 7px; }
  .deterministic-reading p { font-size: 13px; }
  .structure-highlights { grid-template-columns: 1fr; }
  .strength-criteria { grid-template-columns: 1fr; }
  .time-axis-card { min-width: 133px; }
  .domain-upcoming-card { grid-template-columns: 52px minmax(0, 1fr); }
}

/* --- 한글 타이포 보정 (2026-09-07) --- */
/* 간지·연도·나이가 들어가는 칩은 숫자 폭을 고정해야 세로 정렬이 흔들리지 않는다. */
.luck-chip, .yearly-chip, .iljin-day, .fortune-board-meta, .element-number, .calendar-toolbar strong {
  font-variant-numeric: tabular-nums;
}
/* 한자 단독 글리프는 명조로 고정한다. Pretendard의 한자 폴백은 본문과 톤이 어긋난다. */
.pillar-gan, .pillar-ji, .gan, .ji-cell, .element-name, .hidden-stems, .luck-chip strong,
.yearly-chip strong, .sinsal-chip strong, .iljin-day strong, .avatar, .persona-tab strong {
  font-family: var(--serif);
}
/* 긴 본문은 문장 단위로 끊기게 두되, 표·칩 안에서는 줄바꿈을 허용해 넘침을 막는다. */
.structured-points li, .deep-card p, .term-card-body p, .character-example-copy p, .bubble {
  word-break: keep-all;
  overflow-wrap: anywhere;
}


/* 계산 대기 화면. 첫 풀이가 오기까지 20~40초를 채운다.
   소리는 쓰지 않는다. 자동재생 조건이기도 하고, 예상 못 한 소리는 사용자를 놀라게 한다.
   배치는 브랜드 랜딩과 맞춘다. 영상은 위를 비워 두고, 글과 버튼은 아래에 모은다. */
/* 등장할 때 투명에서 시작하면 아래 결과지가 비친다. 처음부터 불투명하게 덮는다. */
@keyframes calc-fade { from { opacity: 0 } to { opacity: 1 } }
.calc-overlay { position: fixed; top: 0; bottom: 0; left: 50%; z-index: 60; width: min(100%, var(--app-max-width)); transform: translateX(-50%); display: flex; flex-direction: column; justify-content: center; background: var(--paper) url(/images/bg/paper.webp) center bottom / cover no-repeat; }
.calc-overlay[hidden] { display: none; }
.calc-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.calc-video.ready { opacity: 1; }
/* 글씨가 앉는 아래쪽만 어둡게. 배경 상자는 두지 않는다. */
.calc-scrim { position: absolute; inset: 0; opacity: 0; background: linear-gradient(180deg, rgba(20,23,30,.10) 0%, rgba(20,23,30,0) 34%, rgba(20,23,30,.42) 62%, rgba(20,23,30,.88) 100%); transition: opacity .6s ease; }
.calc-video.ready ~ .calc-scrim { opacity: 1; }
.calc-copy { position: relative; display: grid; gap: 16px; width: min(88%, 460px); margin: 0 auto; padding-bottom: 4px; text-align: center; }
.calc-step { margin: 0; color: var(--ink); font: 700 22px/1.5 var(--sans); letter-spacing: -.035em; transition: opacity .35s ease, color .6s ease, text-shadow .6s ease; }
.calc-step.fading { opacity: 0; }
.calc-cards { display: flex; justify-content: center; gap: 8px; }
.calc-cards[hidden] { display: none; }
.calc-card { display: grid; justify-items: center; gap: 0; width: 62px; padding: 8px 0 10px; border: 1px solid #dfd3c1; border-radius: 10px; background: #fffdf8; box-shadow: 0 6px 16px #40302014; color: #6a3028; animation: calc-card-deal .5s cubic-bezier(.2,.8,.2,1) both; }
.calc-card:nth-child(2) { animation-delay: .1s; } .calc-card:nth-child(3) { animation-delay: .2s; } .calc-card:nth-child(4) { animation-delay: .3s; }
.calc-card small { color: #8b806f; font: 10px/1.6 var(--sans); }
.calc-card b { font: 600 24px/1.25 var(--serif); }
@keyframes calc-card-deal { from { opacity: 0; transform: translate(-90px, 18px) rotate(-14deg) scale(.86); } to { opacity: 1; transform: none; } }
.calc-note.calc-note-final { color: #6a3028; font-size: 15px; animation: calc-fade .5s ease both; }
@media (prefers-reduced-motion: reduce) { .calc-card { animation: none; } }
.calc-note { margin: 0; color: var(--muted); font: 13px/1.6 var(--sans); letter-spacing: .02em; transition: color .6s ease, text-shadow .6s ease; }
.calc-video.ready ~ .calc-copy .calc-step { color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,.6); }
.calc-video.ready ~ .calc-copy .calc-note { color: rgba(255,255,255,.75); text-shadow: 0 1px 10px rgba(0,0,0,.55); }
/* 로딩 중에는 결과지의 채팅 아바타가 같은 z-index 위로 비치지 않게 한다. */
body:has(.calc-overlay:not([hidden])) .ov-floats { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  .calc-video { display: none; }
}


/* 사이트 공용 우측 햄버거 메뉴. 마크업은 nav.js 가 만든다. */
/* 공용 고정 헤더. 본문 공간도 확보해 첫 제목을 가리지 않는다. */
:root { --site-header-height: calc(64px + env(safe-area-inset-top, 0px)); }
body.has-site-header { padding-top: var(--site-header-height); }
.site-header { position: fixed; top: 0; left: 50%; z-index: 80; width: min(100%, var(--app-max-width)); height: var(--site-header-height); transform: translateX(-50%); padding: env(safe-area-inset-top, 0px) var(--app-mobile-gutter) 0; display: flex; align-items: center; justify-content: space-between; background: rgba(244,238,227,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(58,51,42,.08); }
.site-header .site-menu-button { position: static; flex-shrink: 0; }
body.has-site-header #chat-screen .chat-stage { top: var(--site-header-height); }
.site-logo { display: inline-block; margin: 0; padding: 2px; line-height: 0; border-radius: 8px; }
.site-logo img { display: block; width: auto; height: 52px; }
.site-logo:focus-visible { outline: 2px solid rgba(69,90,118,.4); outline-offset: 2px; }
/* 메뉴 안에서는 조금 더 작게 */
.site-menu-panel .site-menu-brand { display: block; margin: 0 0 18px; padding: 0; line-height: 0; }
.site-menu-panel .site-menu-brand img { display: block; width: auto; height: 26px; }
.site-menu-auth { margin: 0 0 10px; padding: 0 0 14px; border-bottom: 1px solid rgba(58,51,42,.09); }
.site-menu-kakao-login { display: block; width: 100%; padding: 13px 14px; border-radius: 10px; color: #191919; background: #fee500; font: 700 15px/1.3 var(--sans); text-align: center; text-decoration: none; }
.site-menu-kakao-login:hover { background: #f5d900; }
.site-menu-auth-user { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; }
.site-menu-auth-user[hidden], .site-menu-kakao-login[hidden] { display: none; }
.site-menu-auth-user strong { min-width: 0; overflow: hidden; color: #2f2a23; font: 600 15px/1.4 var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.site-menu-auth-user button { flex: 0 0 auto; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; color: var(--ui-muted); background: #f5efe5; font: 500 12px/1 var(--sans); cursor: pointer; }
.site-menu-auth-user button:hover { background: #eee5d8; }

/* 공용 푸터. 마크업은 nav.js 가 만든다.
   본문 바깥(body 직계)에 있어서 폭은 .shell 과 같은 값으로 스스로 맞춘다. */
.site-footer { margin-top: 60px; padding: 24px 20px calc(28px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(58,51,42,.09); }
.site-footer > div { width: min(100%, var(--app-max-width)); margin: 0 auto; }
.site-footer p { margin: 0; color: #8c8378; font: 400 12px/1.9 var(--sans); letter-spacing: -.01em; }
.site-footer-business { margin-top: 12px !important; }
.site-footer-business strong { color: #5f574c; font-weight: 600; }
.site-footer-sep { margin: 0 7px; color: #c4bcb0; }
.site-footer-contact a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(140,131,120,.35); }
.site-footer-contact a:hover { color: #5f574c; border-bottom-color: currentColor; }
.site-footer-copyright { margin-top: 12px !important; color: #a89e91; }
/* 약관 링크. 사업자 정보보다 먼저 오고, 그보다 조금 더 진하게 둔다. */
.site-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: #5f574c; font: 500 12.5px/1.9 var(--sans); letter-spacing: -.01em; text-decoration: none; }
.site-footer-links a:hover { text-decoration: underline; }
.site-footer-links a[aria-current="page"] { color: #a89e91; text-decoration: none; cursor: default; }
/* 대화는 한 화면 안에서 주고받는 자리다. 그 아래 사업자 정보는 끼어들 자리가 아니다. */
body:has(#chat-screen.active) .site-footer { display: none; }
/* 흰 바탕(입력·리포트)에서는 선과 글자를 그 톤에 맞춘다. */
body:has(#input-screen.active) .site-footer,
body:has(#home-screen.active) .site-footer,
body:has(#chart-screen.active) .site-footer,
body.premium-body .site-footer { border-top-color: #eceff3; }
body:has(#input-screen.active) .site-footer p,
body:has(#home-screen.active) .site-footer p,
body:has(#chart-screen.active) .site-footer p,
body.premium-body .site-footer p { color: var(--report-meta); }
body:has(#input-screen.active) .site-footer-business strong,
body:has(#home-screen.active) .site-footer-business strong,
body:has(#chart-screen.active) .site-footer-business strong,
body.premium-body .site-footer-business strong { color: var(--report-ink); }
body:has(#input-screen.active) .site-footer-links a,
body:has(#home-screen.active) .site-footer-links a,
body:has(#chart-screen.active) .site-footer-links a,
body.premium-body .site-footer-links a,
body.legal-body .site-footer-links a { color: var(--report-ink); }
/* 약관 문서 자신에게도 같은 푸터가 붙는다. */
body.legal-body .site-footer { border-top-color: #eceff3; }
/* 약관 문서는 본문 폭이 좁다. 푸터도 같은 선에 맞춘다. */
body.legal-body .site-footer > div { width: min(100%, var(--app-max-width)); }
body.legal-body .site-footer p { color: var(--report-meta); }
body.legal-body .site-footer-business strong { color: var(--report-ink); }
body.legal-body .site-footer-links a[aria-current="page"] { color: var(--report-meta); }

.site-menu-button { position: fixed; top: 14px; right: 14px; z-index: 80; display: grid; gap: 5px; width: 44px; height: 44px; padding: 13px 11px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; }
.site-menu-button span { display: block; height: 2px; border-radius: 2px; background: #3a332a; filter: drop-shadow(0 1px 2px rgba(255,255,255,.75)); transition: transform .22s ease, opacity .18s ease; }
.site-menu-button-open span { background: #2f2a23; }
.site-menu-button-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-menu-button-open span:nth-child(2) { opacity: 0; }
.site-menu-button-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-menu-backdrop { position: fixed; inset: 0; z-index: 78; background: rgba(24,21,17,.42); }
.site-menu-backdrop[hidden] { display: none; }
.site-menu-panel { position: fixed; top: 0; right: max(0px, calc((100% - var(--app-max-width)) / 2)); bottom: 0; z-index: 79; width: min(78vw, 300px); padding: calc(var(--site-header-height) + 24px) 20px 28px; background: var(--ui-surface); border-left: 1px solid var(--ui-line); box-shadow: -12px 0 40px #302b2614; overflow-y: auto; overscroll-behavior: contain; }
.site-menu-panel[hidden] { display: none; }
.site-menu-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.site-menu-item { display: grid; gap: 5px; width: 100%; padding: 14px 16px; border: 1px solid transparent; border-radius: var(--ui-control-radius); background: transparent; text-align: left; cursor: pointer; }
.site-menu-item strong { color: var(--ui-ink); font: 600 16px/1.4 var(--sans); letter-spacing: -.025em; }
.site-menu-item small { color: var(--ui-muted); font: 400 12px/1.6 var(--sans); }
.site-menu-item:hover:not(:disabled), .site-menu-item[aria-current="page"] { border-color: var(--ui-line); background: var(--ui-soft); }
.site-menu-item[aria-current="page"] strong { color: var(--ui-action); }
/* 더미는 눌리지 않는다는 것을 형태로 보여 준다. 눌렀는데 아무 일도 없으면 고장으로 읽힌다. */
.site-menu-item-dummy { cursor: default; opacity: .48; }
.site-menu-locked { overflow: hidden; }
/* 결과 리포트는 흰 바탕이라 버튼도 그 위에서 읽히게 한다. */


/* 로딩 영상 → 리포트. 영상이 옅어지며 아래 종이가 드러난다. */
.calc-overlay.is-leaving { animation: calc-leave .46s cubic-bezier(.4,0,.2,1) both; pointer-events: none; }
@keyframes calc-leave {
  from { opacity: 1; transform: translateX(-50%) scale(1); }
  to   { opacity: 0; transform: translateX(-50%) scale(1.04); }
}
.calc-overlay.is-leaving .calc-copy { animation: calc-copy-leave .22s ease both; }
@keyframes calc-copy-leave { to { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) {
  .calc-overlay.is-leaving, .calc-overlay.is-leaving .calc-copy { animation: none; }
}

/* 상단바는 한지에 녹인다. 흰 띠를 없애고, 로딩 화면은 상단바 없이 한지 전체를 채운다. */
body:has(.calc-overlay:not([hidden])) .site-header { display: none; }
.site-header .home-notice-roll { align-items: center; justify-content: center; }
.site-header .home-notice-roll button { color: #86796a; font-size: 14px; font-weight: 500; letter-spacing: -.02em; }
.site-header .home-notice-title { display: block; height: 44px; min-height: 44px; padding: 0; line-height: 44px; text-align: center; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
body:has(#input-screen.active) .site-header .home-notice-roll { visibility: hidden; }
/* 글자색은 먹색 하나, 강조는 갈색 하나로. */
.calc-step { color: #2b231e; }
.calc-note, .calc-note.calc-note-final { color: #55312d; }
.calc-card { color: #55312d; }

/* 메뉴 패널 자체의 스크롤바가 오른쪽 가장자리에 막대로 보이지 않게 한다(스크롤은 그대로 된다). */
.site-menu-panel { scrollbar-width: none; -ms-overflow-style: none; }
.site-menu-panel::-webkit-scrollbar { display: none; }
/* 카드 다음 박자: 여덟 글자가 같은 사람 수가 좁혀진다. */
.calc-note.calc-count { color: #55312d; font: 800 34px/1.2 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.calc-step { text-wrap: balance; }
