/* 소문만복 간판 — 한지 바탕 + 붉은 도장 + 금색 테. 중장년이 읽기 쉽게 큰 글자 */
:root {
  --paper: #f3ead6;
  --card: #fbf6ea;
  --ink: #2a2118;
  --muted: #6e6152;
  --seal: #c3211f;
  --seal-dark: #9a1715;
  --gold: #c39a52;
  --line: #e3d5b8;
  --e-wood: #2f7d4f;
  --e-fire: #c3211f;
  --e-earth: #b07d1f;
  --e-metal: #7a7a7a;
  --e-water: #24364f;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* .check·.order 같은 display 규칙이 hidden을 덮지 않게 */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 18px/1.7 'Noto Sans KR', system-ui, sans-serif;
  word-break: keep-all; overflow-wrap: break-word; /* 낱말 중간에서 줄 안 끊기 */
}
h1, h2, h3 { font-family: 'Gowun Batang', serif; line-height: 1.35; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.4rem; text-align: center; }
h3 { font-size: 1.2rem; color: var(--seal-dark); }
p { margin: 0 0 .6em; }
b { color: var(--seal-dark); }
a { color: var(--seal-dark); }

.top {
  display: flex; align-items: center; gap: 14px;
  max-width: 560px; margin: 0 auto; padding: 20px 16px 8px;
}
.seal { width: 64px; height: 64px; border-radius: 50%; }
/* 첫 화면 대표 그림: 위쪽 빈 하늘 자리에 제목을 얹는다 */
.hero { position: relative; max-width: 560px; margin: 0 auto; }
.hero-img { display: block; width: 100%; height: auto; }
.hero-text { position: absolute; top: 0; left: 0; right: 0; padding: 18px 16px 0; text-align: center; }
.hero h1 { font-size: clamp(1.5rem, 6.6vw, 2.1rem); color: #1f2a4d; margin: 2px 0 4px; letter-spacing: -.01em; }
.hero-sub { margin: 0; font-size: clamp(.82rem, 3.6vw, 1rem); color: var(--seal-dark); font-weight: 500; }
.hero .kicker { display: inline-flex; align-items: center; gap: 6px; }
.seal-mini { width: 22px; height: 22px; border-radius: 50%; }
.kicker { margin: 0; color: var(--muted); font-size: .95rem; letter-spacing: .1em; }

main { max-width: 560px; margin: 0 auto; padding: 0 16px 24px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px 18px; margin: 14px 0;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.intro { border-top: 4px solid var(--seal); }
.muted, .hint { color: var(--muted); font-size: .92rem; }
.hint { margin-top: .5em; }
.center { text-align: center; }

fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; padding: 0; }
select {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 12px 10px;
  border: 1px solid var(--gold); border-radius: 10px; background: #fff; color: var(--ink);
}
select:disabled { background: #eee6d6; color: var(--muted); }
.row3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.row2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg input { position: absolute; opacity: 0; }
.seg span {
  display: block; text-align: center; padding: 12px; border: 1px solid var(--gold);
  border-radius: 10px; background: #fff; font-weight: 500; cursor: pointer;
}
.seg input:checked + span { background: var(--seal); border-color: var(--seal); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--gold); }
.check { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.check input { width: 22px; height: 22px; }
.error { color: var(--seal); font-weight: 700; min-height: 1.2em; }

.btn-main {
  width: 100%; font: inherit; font-size: 1.2rem; font-weight: 700; color: #fff;
  background: var(--seal); border: 0; border-radius: 12px; padding: 16px; cursor: pointer;
  box-shadow: 0 3px 0 var(--seal-dark);
}
.btn-main:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--seal-dark); }

/* 사주표: 오른쪽부터 해·달·날·시 순서로 읽는 전통 배치 */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.pillar { text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 2px; background: #fff; }
.pillar.empty { display: flex; flex-direction: column; justify-content: flex-start; }
.p-label { font-size: .8rem; color: var(--muted); }
.p-god { font-size: .8rem; color: var(--muted); min-height: 1.3em; }
.p-god.me { color: #fff; background: var(--seal); border-radius: 6px; margin: 0 14px; font-weight: 700; }
.p-char { font-family: 'Gowun Batang', serif; font-size: 2rem; font-weight: 700; line-height: 1.1; margin: 4px 0; }
.p-char small { display: block; font: 500 .75rem 'Noto Sans KR', sans-serif; margin-top: 2px; }
.p-unknown { margin-top: 30px; color: var(--muted); font-size: .9rem; }
.e-wood { color: var(--e-wood); } .e-fire { color: var(--e-fire); } .e-earth { color: var(--e-earth); }
.e-metal { color: var(--e-metal); } .e-water { color: var(--e-water); }

.elements { display: grid; gap: 8px; }
.el-row { display: grid; grid-template-columns: 2em 1fr 1.5em; align-items: center; gap: 8px; }
.el-name { font-weight: 700; }
.el-bar { height: 14px; background: #efe5cf; border-radius: 7px; overflow: hidden; }
.el-bar i { display: block; height: 100%; background: currentColor; border-radius: 7px; }
.el-n { text-align: right; }

.year { border-left: 4px solid var(--gold); }

.chart-wrap { position: relative; }
.chart {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end;
  height: 160px; filter: blur(5px); user-select: none; pointer-events: none;
}
.bar { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.bar i { display: block; background: var(--gold); border-radius: 4px 4px 0 0; }
.bar span { font-size: .7rem; color: var(--muted); }
.lock {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  text-align: center; background: rgba(251, 246, 234, .55);
}

.cta { border: 2px solid var(--seal); }
.cta ul { margin: 0 0 12px; padding-left: 1.2em; }
.cta li { margin: 2px 0; }
.price { text-align: center; font-size: 1.05rem; }

/* ── 상품 고르기 ── */
.offers { display: grid; gap: 8px; margin: 12px 0; }
.offer { display: grid; grid-template-columns: 26px 1fr auto; grid-template-areas: "r n p" "r t p"; gap: 0 8px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; cursor: pointer; }
.offer input { grid-area: r; width: 20px; height: 20px; accent-color: var(--seal); }
.o-name { grid-area: n; font-weight: 700; }
.o-name em { font-style: normal; font-size: .72rem; color: #fff; background: var(--gold); border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }
.o-pitch { grid-area: t; font-size: .82rem; color: var(--muted); }
.o-price { grid-area: p; text-align: right; font-weight: 700; color: var(--seal-dark); white-space: nowrap; }
.o-price s { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.offer:has(input:checked) { border: 2px solid var(--seal); background: #fff8f2; }
.offer.pkg { border-style: dashed; }
.offer-detail { background: #fffdf8; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: .9rem; }
.od + .od { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.od ul { margin: 4px 0 0; padding-left: 1.2em; }
.child-box { border: 1px solid var(--gold); border-radius: 12px; padding: 12px; margin-bottom: 12px; display: grid; gap: 8px; }
.child-box h4 { margin: 0; font-size: 1rem; }

/* ── 주문·입금 안내 ── */
.order { margin-top: 16px; display: grid; gap: 8px; }
.o-label { font-weight: 700; }
input[type=tel], input[type=password], input[type=text] {
  width: 100%; font: inherit; font-size: 1.15rem; padding: 12px; border: 1px solid var(--gold); border-radius: 10px; background: #fff;
}
.order .check { align-items: flex-start; margin: 4px 0 0; }
.order .check input { flex: none; margin-top: 4px; }
.hint.small { margin: -4px 0 4px 30px; font-size: .82rem; }
.pay { border: 2px solid var(--gold); }
.pay dl { display: grid; grid-template-columns: 5em 1fr; gap: 6px 10px; margin: 0 0 12px; }
.pay dt { color: var(--muted); }
.pay dd { margin: 0; }
.code { font-size: 1.3rem; color: var(--seal); letter-spacing: .05em; }
.btn-sub { font: inherit; font-size: .9rem; padding: 6px 12px; border: 1px solid var(--seal); color: var(--seal-dark); background: #fff; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-sub.ghost { border-color: var(--line); color: var(--muted); }
.btn-line { display: block; text-align: center; padding: 12px; border: 1px solid var(--seal); border-radius: 12px; text-decoration: none; font-weight: 700; }
.btn-link { display: block; text-decoration: none; margin-top: 12px; }
.links { margin-top: 6px; }

/* ── 관리 화면 ── */
.admin main { padding-top: 16px; }
#ping.ok { color: var(--e-wood); font-weight: 700; } #ping.warn { color: var(--seal); font-weight: 700; }
.adm-order { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-size: .92rem; }
.adm-order.st-review, .adm-order.st-failed { border: 2px solid var(--seal); }
.adm-order.focus { box-shadow: 0 0 0 3px var(--gold); }
.adm-order header { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.adm-st { font-weight: 700; color: var(--seal-dark); }
.adm-order p { margin: 4px 0; }
.adm-dep { font-size: .85rem; background: #f6f0e2; padding: 4px 6px; border-radius: 6px; }
.adm-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.adm-phone { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.adm-phone b { font-size: 1.05rem; }
.adm-events { font-size: .78rem; color: var(--muted); padding-left: 1.2em; word-break: break-all; }

/* ── 약관·개인정보처리방침 ── */
.legal { padding-top: 16px; font-size: 1rem; }
.legal h1 { font-size: 1.5rem; }
.legal h2 { font-size: 1.1rem; text-align: left; margin-top: 1.6em; color: var(--seal-dark); }
.legal ol, .legal ul { padding-left: 1.3em; }
.legal li { margin: .3em 0; }
.legal .summary { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--seal); border-radius: 8px; padding: 12px 14px; }
.legal table { width: 100%; border-collapse: collapse; font-size: .85rem; margin: .6em 0 1em; background: #fff; }
.legal th, .legal td { border: 1px solid var(--line); padding: 6px 7px; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.legal th { background: #f3ead6; }
.legal small { color: var(--muted); }
.legal footer { border-top: 1px solid var(--line); margin-top: 2em; }

/* ── 결과(유료) 페이지 ── */
.report-page main { padding-top: 16px; }
.cover { text-align: center; border-top: 6px solid var(--seal); }
.seal-big { width: 96px; height: 96px; border-radius: 50%; }
.cover-img { display: block; width: min(78%, 320px); height: auto; margin: -6px auto 2px; border-radius: 50%; }
.cover h1 { margin-top: 4px; }
.cover-name { font: 700 1.3rem 'Gowun Batang', serif; color: var(--seal-dark); margin: 8px 0 2px; }
.cover .elements { margin: 14px 0 6px; text-align: left; }
.actions { margin-top: 18px; }
.sec-no { text-align: center; color: var(--gold); font: 700 .9rem 'Gowun Batang', serif; letter-spacing: .3em; margin: 0; }
.report-page h2 { color: var(--ink); }
.report-page section > div > p, .report-page #s-body p { text-indent: 0; margin-bottom: .9em; }
#s-title { margin-top: -4px; }

.chart.open { filter: none; height: 170px; }
.bar.best i { background: var(--seal); }
.bar.caution i { background: var(--e-water); }
.bar.best span, .bar.caution span { font-weight: 700; color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.tag { display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.tag.best { background: var(--seal); color: #fff; }
.tag.caution { background: var(--e-water); color: #fff; }

.months { display: grid; gap: 10px; }
.month { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; break-inside: avoid; }
.month.best { border: 2px solid var(--seal); }
.month.caution { border: 2px solid var(--e-water); }
.month header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.month header b { font: 700 1.2rem 'Gowun Batang', serif; }
.m-key { color: var(--seal-dark); font-weight: 700; }
.m-from { color: var(--muted); font-size: .85rem; margin: 2px 0 6px; }
.month p:last-child { margin: 0; }
.m-days { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 0 0 8px; }
.m-days span { font-size: .8rem; color: var(--muted); margin-right: 2px; }
.m-days b { font-size: .85rem; background: #fbeee0; color: var(--seal-dark); border: 1px solid #f0d2b5; border-radius: 999px; padding: 1px 9px; }
.toc ol { columns: 2; column-gap: 18px; margin: 0; padding-left: 1.4em; font-size: .92rem; }
.toc li { break-inside: avoid; margin: 2px 0; }
.toc a { text-decoration: none; color: var(--ink); }
.toc li.sub { font-size: .86rem; }
.toc li:not(.sub) { font-weight: 700; }
.product-head { text-align: center; border-top: 6px solid var(--gold); }
.product-head h2 { font-size: 1.5rem; margin-bottom: .3em; }
.tbl-wrap { overflow-x: auto; margin: 4px 0 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; background: #fff; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 5px 6px; text-align: center; white-space: nowrap; }
.tbl th { background: #f3ead6; font-weight: 700; }
.tbl tr.now td { background: #fff3e6; font-weight: 700; }
.tbl tr.hit td { background: #fdecea; color: var(--seal-dark); font-weight: 700; }
.tbl td.stars { color: var(--gold); letter-spacing: -1px; }
.callout { text-align: center; font-size: 1.1rem; background: #fff3e6; border: 1px solid #f0d2b5; border-radius: 10px; padding: 10px; }
.callout b { color: var(--seal); font-size: 1.4rem; }
.compat { background: #fffdf8; border: 1px solid var(--line); border-radius: 10px; padding: 10px 10px 10px 2em; margin: 0 0 12px; }
.advice { padding-left: 1.6em; margin: 0; }
.advice li { margin: 6px 0; padding-left: 4px; }
.advice li::marker { color: var(--seal); font-weight: 700; }

.lucky { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; text-align: center; }
.lucky div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 4px; }
.lucky small { display: block; color: var(--muted); font-size: .8rem; }
.lucky b { font-family: 'Gowun Batang', serif; font-size: 1.05rem; }
.closing { border-left: 4px solid var(--gold); }
.sign { text-align: right; font: 700 1rem 'Gowun Batang', serif; color: var(--seal-dark); margin: 0; }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 12pt; }
  .no-print { display: none !important; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid-page; background: #fff; }
  .page-break { break-before: page; }
  .card.page-break:has(#months), .card:has(#months) { break-inside: auto; }
  .chart.open { height: 140px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

footer {
  max-width: 560px; margin: 0 auto; padding: 16px 16px 40px;
  color: var(--muted); font-size: .8rem; text-align: center; border-top: 1px solid var(--line);
}
footer p { margin: 0 0 .4em; }

/* ── 첫 화면: 강점 · 견본 · 주문서 ── */
.strengths h2 { margin-bottom: .4em; }
.pluses { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pluses li { display: grid; gap: 2px; padding: 10px 12px 10px 44px; background: #fff; border: 1px solid var(--line); border-radius: 10px; position: relative; }
.pluses li::before { content: attr(data-i); position: absolute; left: 10px; top: calc(10px + (1.02rem * 1.7 - 24px) / 2); width: 24px; height: 24px; border-radius: 6px; background: var(--seal); color: #fff; font: 700 .85rem/24px 'Gowun Batang', serif; text-align: center; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.pluses b { font-size: 1.02rem; }
.pluses span { font-size: .9rem; color: var(--muted); }
.samples .sample-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.order-box { border: 2px solid var(--seal); }
.order-box h2 { font-size: 1.25rem; }
.order-box .form { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.order-box .btn-line { width: 100%; font: inherit; font-weight: 700; color: var(--seal-dark); background: #fff; cursor: pointer; }
.sample-note { background: #fff8e6; border: 1px solid var(--gold); }

/* 관리 화면 — 링크별 방문 표 */
.adm-range { display: flex; gap: 6px; margin: 4px 0 8px; }
.adm-visits { overflow-x: auto; }
.adm-visits table { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; }
.adm-visits th, .adm-visits td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.adm-visits th:first-child, .adm-visits td:first-child { text-align: left; white-space: normal; }
.adm-visits td small { color: var(--muted); }
.adm-visits tr.sum td { font-weight: 700; border-top: 2px solid var(--line); }
