:root {
  --bg: #f6f1e7; --paper: #fffdf8; --ink: #2a2420; --muted: #7a6f63; --line: #e4dccd;
  --seal: #b5372b; --seal-ink: #fff;
  --wood: #3d8a57; --fire: #cf4436; --earth: #c08a24; --metal: #8d8f94; --water: #2d4677;
  --shadow: 0 2px 10px rgba(60, 40, 20, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1815; --paper: #25211d; --ink: #efe8dc; --muted: #a99d8e; --line: #3a342d;
    --seal: #d2584a; --shadow: none;
    --metal: #a5a7ad; --water: #4b6aa8;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1815; --paper: #25211d; --ink: #efe8dc; --muted: #a99d8e; --line: #3a342d;
  --seal: #d2584a; --shadow: none; --metal: #a5a7ad; --water: #4b6aa8;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 'Noto Sans KR', system-ui, sans-serif; word-break: keep-all;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3, .logo, .dm-title { font-family: 'Gowun Batang', serif; }
a { color: inherit; }

.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-size: 22px; font-weight: 700; text-decoration: none; }
.logo span { color: var(--seal); }
.top-note { font-size: 14px; color: var(--muted); }

.hero { padding: 32px 0 40px; }
.hero h1 { font-size: 34px; line-height: 1.3; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 0 0 24px; }

/* 10/13 몽환·신비 첫 화면 — 밤하늘 그림(img/hero.jpg) 위에 제목, 아래 입력 칸이 그림 끝에 살짝 걸침. 모바일 먼저 */
.top { background: #12143a; border-bottom-color: #2a2d63; }
.top .logo { color: #f6e7c1; } .top .logo span { color: #e8c46a; } .top .top-note { color: #b9b6d8; }
.hero { padding-top: 0; }
.hero-art { position: relative; margin: 0 -16px; aspect-ratio: 768 / 1080; background: #12143a url(img/hero.jpg) center 0 / cover no-repeat; border-radius: 0 0 26px 26px; overflow: hidden; }
.hero-art::after { content: ''; position: absolute; inset: auto 0 0 0; height: 22%; background: linear-gradient(rgba(18,20,58,0), rgba(18,20,58,.55)); }
.hero-title { position: absolute; inset: 0 0 auto 0; padding: 22px 20px 70px; text-align: center; z-index: 1;
  background: linear-gradient(rgba(14,15,48,.88) 0%, rgba(14,15,48,.6) 55%, rgba(14,15,48,0) 100%); }
.hero-title h1 { color: #f6dc93; font-size: 36px; text-shadow: 0 2px 14px rgba(0,0,0,.6), 0 0 22px rgba(246,220,147,.35); margin-bottom: 10px; }
.hero-title .lead { color: #efeaff; font-size: 17px; text-shadow: 0 1px 8px rgba(0,0,0,.7); margin: 0; }
#recentCard:not([hidden]), #recentCard[hidden] + #sajuForm { margin-top: -54px; position: relative; z-index: 2; }
.hero form, .hero .card { box-shadow: 0 10px 30px rgba(18,20,58,.18); }
@media (min-width: 700px) { .hero-art { margin: 0; border-radius: 0 0 26px 26px; aspect-ratio: 768 / 900; } }

/* 10/13 승상 "옆에 테두리 랑 밑에까지 꾸미시게" — 첫 화면(body.night)만 바탕 전체를 별 뜬 밤하늘로, 카드는 크림빛 + 금빛 테두리 */
body.night {
  background-color: #12143a;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255,240,200,.9), transparent 60%),
    radial-gradient(1px 1px at 78% 9%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1.2px 1.2px at 42% 33%, rgba(255,236,180,.7), transparent 60%),
    radial-gradient(1px 1px at 88% 46%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.6px 1.6px at 23% 62%, rgba(255,236,180,.8), transparent 60%),
    radial-gradient(1px 1px at 65% 74%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.3px 1.3px at 8% 88%, rgba(255,240,200,.8), transparent 60%),
    radial-gradient(1px 1px at 93% 92%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(ellipse at 50% 0%, #2a2470 0%, rgba(18,20,58,0) 60%),
    linear-gradient(#141640, #1c1550 45%, #12143a);
  background-size: 260px 260px, 300px 300px, 340px 340px, 280px 280px, 320px 320px, 360px 360px, 300px 300px, 330px 330px, 100% 100%, 100% 100%;
  background-attachment: fixed;
}
body.night .card { border: 1px solid #d9b968; box-shadow: 0 0 0 4px rgba(217,185,104,.12), 0 12px 32px rgba(0,0,0,.35); }
body.night .res-head, body.night .ny-head, body.night .foot, body.night main > section > h2, body.night main > section > p { color: #efeaff; }
body.night .res-head p, body.night .ny-head p, body.night .foot, body.night .foot a { color: #c9c3ea; }
body.night .ny-head h3, body.night .res-head h2 { color: #f6dc93; }
body.night .foot { border-top-color: #2f3170; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 14px; font-size: 21px; }
.card h3 small { font: 14px 'Noto Sans KR', sans-serif; color: var(--muted); margin-left: 6px; }

.form .field { display: block; margin-bottom: 18px; }
.form .field > span { display: block; font-weight: 700; margin-bottom: 8px; }
.form .field em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 14px; }
input[type=text], input:not([type]), select {
  width: 100%; height: 52px; padding: 0 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
select:disabled { opacity: .45; }
.row2, .row3 { display: grid; gap: 8px; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: 1.3fr 1fr 1fr; }
.seg { display: flex; gap: 8px; margin-bottom: 8px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg b { display: block; text-align: center; height: 48px; line-height: 48px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-weight: 500; cursor: pointer; }
.seg.small b { height: 42px; line-height: 42px; font-size: 15px; }
.seg input:checked + b { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg input:focus-visible + b { outline: 2px solid var(--seal); outline-offset: 2px; }
.more { margin: -4px 0 18px; color: var(--muted); font-size: 15px; }
.more summary { cursor: pointer; }
.check { display: flex; gap: 8px; align-items: center; margin-top: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; height: 50px; padding: 0 18px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 500 17px 'Noto Sans KR', sans-serif; cursor: pointer; }
.btn.primary { background: var(--seal); border-color: var(--seal); color: var(--seal-ink); font-weight: 700; }
.btn.big { width: 100%; height: 58px; font-size: 19px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .6; cursor: wait; }
.tiny { font-size: 13px; color: var(--muted); margin: 10px 0 0; text-align: center; }
.muted { color: var(--muted); }

.res-head { padding: 24px 0 8px; }
.res-head h2 { font-size: 28px; margin: 0; }
.res-head p { margin: 4px 0 0; font-size: 15px; }

.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pil { text-align: center; }
.pl { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.tg { font-size: 13px; color: var(--muted); height: 20px; }
.pc { border-radius: 10px; color: #fff; padding: 8px 0 6px; margin: 4px 0; }
.pc b { display: block; font: 700 34px/1.1 'Gowun Batang', serif; }
.pc i { display: block; font-style: normal; font-size: 13px; opacity: .9; }
.pc.sm { padding: 4px 0; font: 700 22px/1.2 'Gowun Batang', serif; margin: 2px 0; }
.pil.empty .pc { background: var(--line); color: var(--muted); font-size: 30px; padding: 22px 0; }
.hid { font-size: 13px; color: var(--muted); letter-spacing: 2px; }
.el-wood { background: var(--wood); } .el-fire { background: var(--fire); } .el-earth { background: var(--earth); }
.el-metal { background: var(--metal); } .el-water { background: var(--water); }
.el-t-wood { color: var(--wood); } .el-t-fire { color: var(--fire); } .el-t-earth { color: var(--earth); }
.el-t-metal { color: var(--metal); } .el-t-water { color: var(--water); }
.notes { margin: 14px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }

.dm { display: flex; gap: 16px; align-items: flex-start; }
.dm-badge { flex: none; width: 64px; height: 64px; border-radius: 50%; color: #fff; display: grid; place-items: center; font: 700 34px 'Gowun Batang', serif; }
.dm-title { margin: 0 0 4px; font-size: 20px; }
.body { margin: 0; }
.body p { margin: 0 0 12px; }
.body h4 { font: 700 19px 'Gowun Batang', serif; margin: 22px 0 8px; padding-left: 10px; border-left: 4px solid var(--seal); }
.body h4:first-child { margin-top: 0; }

.bars { margin-bottom: 14px; }
.bar { display: grid; grid-template-columns: 64px 1fr 24px; align-items: center; gap: 10px; margin-bottom: 8px; }
.bl { font-weight: 700; }
.bt { height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.bf { display: block; height: 100%; border-radius: 7px; }
.bn { text-align: right; font-weight: 700; }

.today { border-color: var(--seal); }

.dayun { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.dy { flex: none; width: 54px; text-align: center; border-radius: 10px; padding: 6px 0; }
.dy.on { background: var(--bg); outline: 2px solid var(--seal); }
.dy-age { font-size: 14px; font-weight: 700; }
.dy-yr { font-size: 12px; color: var(--muted); }
.dy-now { font-size: 12px; color: var(--seal); font-weight: 700; }

.locked { position: relative; }
.lock-list { margin: 0 0 14px; padding-left: 20px; columns: 2; column-gap: 20px; font-size: 15px; }
.blur-sample { filter: blur(5px); user-select: none; color: var(--muted); margin-bottom: 16px; }
.blur-sample p { margin: 0 0 8px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 32px; }

dialog { border: none; border-radius: 16px; padding: 0; width: min(420px, calc(100% - 32px)); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.pay { padding: 22px; }
.pay h3 { margin: 6px 0 2px; font-size: 22px; }
.test-badge { background: #fff4c2; color: #6b5300; font-size: 13px; padding: 6px 10px; border-radius: 8px; margin: 0; }
.pay-price { font-size: 28px; font-weight: 700; margin: 0 0 14px; }
.pay-methods { display: grid; gap: 8px; margin-bottom: 8px; }
.pay-methods input { position: absolute; opacity: 0; }
.pay-methods b { display: block; padding: 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; }
.pay-methods input:checked + b { border: 2px solid var(--seal); padding: 13px; }
.pay .row2 { margin-top: 16px; }

.foot { border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 13px; color: var(--muted); }
.foot p { margin: 0 0 6px; }

@media (max-width: 380px) {
  .pc b { font-size: 28px; }
  .lock-list { columns: 1; }
}

.stg { font-size: 13px; font-weight: 700; color: var(--seal); margin-top: 2px; }
.dy-tg { font-size: 12px; color: var(--ink); }
.dy { width: 58px; }
.tiny.left { text-align: left; }
.sal { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.sal:last-child { border-bottom: none; }
.sal b { font-size: 18px; }
.sal small { color: var(--muted); margin-left: 4px; }
.sal p { margin: 2px 0 0; font-size: 15px; }
.terms { display: grid; grid-template-columns: 64px 1fr; gap: 6px 10px; margin: 0; font-size: 15px; }
.terms dt { font-weight: 700; color: var(--muted); }
.terms dt.has { color: var(--seal); }
.terms dd { margin: 0; }
.terms dt.wide { grid-column: 1 / -1; margin-top: 8px; color: var(--ink); }
.terms dt.wide + dd { grid-column: 1 / -1; }
.lock-intro { text-align: center; margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }

.sub { font-size: 12px; color: var(--muted); }
.s12 { font-size: 13px; font-weight: 700; margin-top: 4px; }
.gm { display: inline-block; font-size: 11px; color: #fff; background: var(--muted); border-radius: 6px; padding: 0 6px; margin-top: 3px; }
.legend { font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.legend .stg-c { color: var(--seal); }
.tiny-seg { align-items: center; font-size: 13px; color: var(--muted); }
.tiny-seg button { font: 13px 'Noto Sans KR', sans-serif; padding: 4px 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; cursor: pointer; }
.tiny-seg button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.grp { font: 700 15px 'Noto Sans KR', sans-serif; color: var(--seal); margin: 16px 0 2px; }
.grp:first-child { margin-top: 0; }

.ny { margin: 28px 0 8px; }
.ny-head { padding: 0 2px 10px; }
.ny-kicker { display: inline-block; background: var(--seal); color: var(--seal-ink); font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 20px; margin: 0 0 6px; }
.ny-head h3 { font-size: 26px; margin: 0; }
.ny-head p { margin: 4px 0 0; font-size: 14px; }
.ny-main { display: flex; gap: 16px; align-items: flex-start; }
.ny-pil { flex: none; width: 72px; text-align: center; }
.ny-pil .pc i { font-size: 12px; }
.ny-txt { flex: 1; }
.ny-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.ny-tags span { font-size: 13px; padding: 2px 8px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.ny-tags span.good { border-color: var(--wood); color: var(--wood); font-weight: 700; }
.ny-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.nm { text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 2px; background: var(--bg); }
.nm-m { font-size: 14px; font-weight: 700; }
.nm-gz { font: 700 20px 'Gowun Batang', serif; }
.nm-w { font-size: 12px; line-height: 1.35; min-height: 32px; }
.nm-i { font-size: 13px; height: 18px; }

.teasers { display: grid; gap: 8px; margin-bottom: 16px; }
.tz { border: 1px solid var(--line); border-left: 4px solid var(--seal); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.tz-q { margin: 0; font-size: 16px; line-height: 1.5; }
.tz-q b { color: var(--seal); }
.tz-a { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.tz-a .lock { font-size: 12px; }

.gh-score { display: flex; gap: 16px; align-items: center; }
.gh-num { flex: none; width: 88px; height: 88px; border-radius: 50%; background: var(--seal); color: var(--seal-ink); display: grid; place-items: center; font: 700 34px 'Gowun Batang', serif; }
.gh-num small { font-size: 14px; }
.gh-reasons { margin: 14px 0 0; padding: 0; list-style: none; font-size: 15px; }
.gh-reasons li { padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; }
.gh-reasons li:last-child { border-bottom: none; }
.gh-reasons b { flex: none; width: 36px; text-align: right; }
.gh-reasons b.plus { color: var(--wood); } .gh-reasons b.minus { color: var(--fire); }
.gh-row { display: grid; grid-template-columns: 64px repeat(4, 1fr); gap: 4px; align-items: center; margin-bottom: 8px; }
.gh-row .who { font-size: 14px; font-weight: 700; }
.ghc { display: grid; gap: 2px; }
.ghc b { display: block; text-align: center; color: #fff; border-radius: 6px; font: 700 20px/1.6 'Gowun Batang', serif; }
.ghc b.none { background: var(--line); color: var(--muted); }

.tj-verse .hanja { font: 700 22px/1.7 'Gowun Batang', serif; letter-spacing: 3px; margin: 8px 0 4px; }

/* 결제 동의 */
.agree { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; cursor: pointer; }
.agree input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--seal); }
.agree b { color: var(--ink); }
#payOk:disabled { opacity: .45; cursor: not-allowed; }

/* 약관·환불·개인정보 문서 */
.doc { padding-top: 24px; padding-bottom: 32px; }
.doc h1 { font-size: 28px; margin: 0 0 4px; }
.doc h2 { font-size: 19px; margin: 28px 0 8px; }
.doc p, .doc li { font-size: 15px; }
.doc ol, .doc ul { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.doc-meta { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.doc-box { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.doc-box p { margin: 0 0 6px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--paper); margin: 8px 0; }
.doc-table th, .doc-table td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.doc-table th { background: var(--bg); font-weight: 500; white-space: nowrap; }
.doc a { color: var(--seal); }

/* 평생 풀이지 */
.premium { border: 2px solid var(--seal); }
.pm-tag { display: inline-block; background: var(--seal); color: var(--seal-ink); font-size: 13px; padding: 3px 10px; border-radius: 99px; margin: 0 0 8px; }
.pm-list { margin: 0 0 12px; padding-left: 20px; }
.pm-list li { margin-bottom: 4px; }
.pay-methods small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.bank-note { font-size: 14px; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 4px 0 8px; }
.sit { display: grid; gap: 8px; margin: 0 0 14px; }
.sit input { position: absolute; opacity: 0; }
.sit b { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 500; }
.sit b small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.sit input:checked + b { border: 2px solid var(--seal); padding: 11px 13px; }
/* 다시 온 손님(첫 화면 recentCard) — 10/11 */
.recent { list-style: none; padding: 0; margin: 0 0 12px; }
.recent li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.recent li a { color: inherit; text-decoration: none; }
.recent li small { color: var(--muted); margin-left: 6px; }
.recent-people { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.btn.small { width: auto; height: auto; padding: 10px 14px; font-size: 15px; }
