/* 우물 — 어두운 수면, 성긴 별. 꿈 입력창은 스프링 노트가 시그니처. barotong 금색 없음. */
:root {
  color-scheme: dark;
  --bg: #05070a;
  --water: #0a1620;
  --text: #e8f0f6;
  --muted: #8aa0b0;
  --accent: #d7e6f0;
  --wood: #8fbf9a;
  --fire: #d4a08c;
  --earth: #c4b48a;
  --water-el: #7ea8c4;
  --rim: rgba(215, 230, 240, 0.42); /* 비텍스트 ≥3:1 vs --bg */
  --star: #e8f2fa;
  --error-bg: #2a1618;
  --error-text: #e7b8b0;
  --ok: #b4d2c8;
  --focus: #d7e6f0;
  --font: "IBM Plex Sans KR", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  --display: "Gowun Batang", "Apple Myungjo", "Nanum Myeongjo", serif;
}

@font-face {
  font-family: "Gowun Batang";
  src: url("/fonts/gowun-batang-ko-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+AC00-D7A3, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
}
@font-face {
  font-family: "Gowun Batang";
  src: url("/fonts/gowun-batang-la-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/fonts/plex-ko-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+AC00-D7A3, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF;
}
@font-face {
  font-family: "IBM Plex Sans KR";
  src: url("/fonts/plex-la-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Astro Glyphs";
  src: url("/fonts/NotoSansSymbols-astro-subset.woff2") format("woff2");
  unicode-range: U+2648-2653, U+263D-2647, U+260A-260D, U+26B3-26BC;
  font-display: swap;
}
@font-face {
  font-family: "Astro Glyphs";
  src: url("/fonts/NotoSansSymbols2-astro-subset.woff2") format("woff2");
  unicode-range: U+2609, U+25A1, U+25B3, U+1F774, U+2BD3-2BDF;
  font-display: swap;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { background: var(--bg); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 80% 52% at 50% 24%, rgba(40, 80, 110, 0.24), transparent 70%);
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 별 */
.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.stars i {
  position: absolute;
  width: var(--s, 3.5px);
  height: var(--s, 3.5px);
  border-radius: 50%;
  background: var(--star);
  box-shadow: 0 0 5.6px 1.4px rgba(232, 242, 250, 0.55);
  animation: twinkle var(--d, 5s) ease-in-out var(--t, 0s) infinite;
}
.stars i:nth-child(odd) { --s: 2.8px; }
.stars i:nth-child(3n) { --s: 4.2px; }
@keyframes twinkle {
  0%, 100% { opacity: 0.18; }
  50% { opacity: 1; }
}

/* 헤더 */
.site-header { background: transparent; border: 0; position: relative; z-index: 1; }
.site-header-inner {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.6rem 1.2rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}
.brand {
  font-size: 1.1rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-decoration: none;
}
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.85rem 1rem; }
.tabs a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.15rem;
  border-bottom: 1px solid transparent;
}
.tabs a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

main {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.2rem 1.2rem 3.5rem;
  position: relative;
  z-index: 1;
  text-align: center;
}
body.admin main { text-align: left; max-width: none; }
body.admin .field, body.admin .field > label { text-align: left; }
body.admin textarea, body.admin input, body.admin select { text-align: left; }

h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.35rem;
  margin: 0.4rem 0 1.1rem;
}
.site-header ~ * h1,
main > h1 {
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  color: var(--accent);
}
body.admin h1 { font-size: 1.35rem; letter-spacing: 0; color: var(--text); }
body.admin .admin-note { color: var(--muted); font-size: 0.9rem; }
body.admin .admin-ok { color: var(--ok); }
body.admin .admin-err { color: var(--error-text); }
body.admin .admin-tabs { display: flex; gap: 1.25rem; border-bottom: 1px solid var(--rim); margin: 0 0 1.1rem; }
body.admin .admin-tabs a { color: var(--muted); text-decoration: none; padding: 0 0 0.4rem; }
body.admin .admin-tabs a[aria-current="page"] { color: var(--text); border-bottom: 2px solid var(--accent); }
body.admin .admin-kpis { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 0 0 0.9rem; }
body.admin .admin-kpi { flex: 1; min-width: 7rem; border: 1px solid var(--rim); border-radius: 6px; padding: 0.55rem 0.7rem; }
body.admin .admin-kpi .n { font-size: 1.15rem; }
body.admin .admin-kpi .l { font-size: 0.75rem; color: var(--muted); }
body.admin .admin-bar { height: 6px; background: rgba(215,230,240,0.12); border-radius: 99px; margin: 0 0 1rem; overflow: hidden; }
body.admin .admin-bar > i { display: block; height: 100%; background: var(--ok); }
body.admin table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin: 0 0 1.25rem; }
body.admin table.admin-table th { text-align: left; color: var(--muted); font-weight: 400; padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--rim); }
body.admin table.admin-table td { padding: 0.3rem 0.4rem; border-bottom: 1px solid rgba(215,230,240,0.08); }
body.admin table.admin-table tr.sel td { background: rgba(215,230,240,0.08); }
body.admin table.admin-table tr.tot td { font-weight: 600; border-top: 1px solid var(--rim); }
body.admin .admin-sec { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.04em; margin: 1rem 0 0.35rem; }
.lede {
  color: var(--muted);
  font-size: 0.88rem;
  margin: -0.4rem 0 2.4rem;
}

.card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0 0 1rem;
}

form[data-page] { margin-bottom: 0; }
.entry {
  max-width: 22rem;
  margin-inline: auto;
  padding: 1.15rem 1.05rem 1.05rem;
  border: 1px solid var(--rim);
  background: var(--water);
}
.entry .field:last-child { margin-bottom: 0; }
.entry .check {
  display: block;
  max-width: 100%;
  text-align: left;
  white-space: normal;
}

.field { margin-bottom: 0.85rem; border: 0; padding: 0; min-width: 0; text-align: center; }
.field > label, .field > legend {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 0.3rem;
  padding: 0;
}
textarea, input[type="date"], input[type="time"], input[type="password"], select {
  width: 100%;
  padding: 0.4rem 0;
  border: 0;
  border-bottom: 1px solid var(--rim);
  border-radius: 0;
  font: inherit;
  background: transparent;
  color: inherit;
  text-align: center;
}
textarea { resize: vertical; text-align: left; }
/* 드롭다운 팝업은 transparent가 안 통해 시스템 흰 배경이 깔린다 — 명시 지정 */
option { background: var(--water); color: var(--text); }
::placeholder { color: var(--muted); opacity: 1; }
input:disabled, select:disabled { color: var(--muted); opacity: 0.55; }
button[type="submit"]:disabled { opacity: 0.55; cursor: default; }

.radio-row { display: flex; justify-content: center; gap: 1.15rem; }
.radio-row label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--muted);
  font-weight: 400;
  padding: 0.25rem 0;
}
.radio-row label:has(:checked) {
  color: var(--text);
  border-bottom: 1px solid var(--accent);
}
.radio-row input {
  accent-color: var(--accent);
  width: 0.9em;
  height: 0.9em;
  margin: 0;
}
.radio-row label:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.88rem;
}

button[type="submit"] {
  display: block;
  width: auto;
  margin: 1.45rem auto 0;
  padding: 0 0 0.15rem;
  border: 0;
  border-bottom: 1px solid var(--accent);
  border-radius: 0;
  background: none;
  color: var(--accent);
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
}

/* 색은 여기서만 준다 — .pad-foot 등에서 다시 주면 .char-count--warn(0,1,0)이 밀려 경고가 죽는다 */
.char-count { font-size: 0.72rem; letter-spacing: 0; color: var(--muted); }

/* 꿈 노트 — 스프링 제본. 링이 위 테두리를 넘어가므로 overflow를 숨기지 않는다.
   폭은 88vw가 아니라 100% — main의 padding 안쪽 기준이라 큰 글꼴에서도 안 넘친다. */
.pad {
  --ring-h: 26px;
  position: relative;
  width: min(22rem, 100%);
  margin: 1.1rem auto 0;
  padding: 2.5rem 1.35rem 1rem;
  border: 1px solid var(--rim);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(190, 220, 240, 0.07), transparent 30%),
    var(--water);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    0 0 70px rgba(80, 130, 170, 0.08);
  text-align: left;
}
.pad-rings {
  position: absolute;
  top: calc(var(--ring-h) / -2); left: 1.5rem; right: 1.5rem;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.pad-rings i {
  flex: none;
  width: 9px;
  height: var(--ring-h);
  border: 2px solid var(--rim);
  border-radius: 5px;
  /* 링은 종이 위 테두리에 정확히 반씩 걸친다. 위 절반을 --bg로 칠하면 배경 글로우에
     검은 구멍이 뚫리므로 비워 두고, 아래 절반만 종이 위 금속으로 살짝 밝힌다. */
  background: linear-gradient(180deg, transparent 50%, rgba(215, 230, 240, 0.12) 50%);
}
.pad .field { margin: 0; text-align: left; }
.pad .field > label {
  font-family: var(--display);
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  color: var(--text);
  text-align: center;
  margin-bottom: 0.9rem;
}
/* 높이 권한은 dream.php의 rows 하나 — min-height를 같이 두면 둘 중 뭐가 이기는지
   알 수 없어진다(rows 9 × line-height 1.7 = 15.3em > 어떤 rem 바닥값이든). */
.pad textarea { border: 0; padding: 0; line-height: 1.7; }
.pad-foot { display: flex; align-items: flex-end; justify-content: flex-end; gap: 0.5rem; margin-top: 0.6rem; }
.quill { width: 1.75rem; height: 1.75rem; opacity: 0.45; flex: none; }

/* 꿈해몽 제출만 박스형 — 노트에 딸린 버튼이라는 뜻이라 .pad 기준으로 잡는다.
   data-page는 app.js의 동작 계약이지 겉모습 이름이 아니다.
   아래 dream_days 폼과 다른 탭은 밑줄 문장 그대로. */
.pad + button[type="submit"] {
  width: min(22rem, 100%);
  margin: 1.1rem auto 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--rim);
  border-radius: 12px;
  background: rgba(215, 230, 240, 0.05);
}
@media (hover: hover) {
  .pad + button[type="submit"]:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(215, 230, 240, 0.09);
  }
}

/* 결과 */
.result { text-align: center; margin-top: 2.8rem; }
.result form.card { margin-top: 1.6rem; }
.result-section { margin-top: 1.6rem; }
.result-section > h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.15rem;
  color: var(--accent);
  margin: 2.1rem 0 0.9rem;
}
.result-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.2rem 0;
  color: var(--muted);
}
.spinner {
  width: 2.2rem;
  height: 2.2rem;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--rim);
  box-shadow: 0 0 0 5px var(--bg), 0 0 0 6px var(--rim);
  animation: pulse 1.8s ease-in-out infinite;
  background: none;
}
@keyframes pulse { 50% { opacity: 0.35; transform: scale(0.92); } }
.loading-msg { margin: 0; }
.cancel-btn {
  margin: 0.6rem auto 0;
  padding: 0 0 0.1rem;
  border: 0;
  border-bottom: 1px solid var(--rim);
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.result-error {
  background: var(--error-bg);
  color: var(--error-text);
  border-radius: 0;
  padding: 0.7rem 0;
  margin: 0.8rem 0;
}
.result-reading { text-align: left; }
.result-reading h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--text);
  margin: 1.15rem 0 0.3rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--accent);
}
.result-reading h3:first-child { margin-top: 0; }
.result-reading p { margin: 0 0 0.7rem; }
.reading-tags, .reading-toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0 0.8rem; }
.chip {
  font-size: 0.78rem;
  color: var(--muted);
  border-bottom: 1px solid var(--rim);
  padding: 0;
}
.chip--toc {
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rim);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
}
.retry-btn {
  display: inline-block;
  margin-top: 0.6rem;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--display);
  cursor: pointer;
}
.char-count--warn { color: var(--error-text); }
.reading-meta { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.6rem; text-align: left; }

/* 사주판 — 명식 */
.saju-myung {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 0.15rem;
  padding: 0.35rem 0 0.15rem;
}
.saju-myung--pair {
  grid-template-columns: 1fr 1fr;
  max-width: 14rem;
  margin-inline: auto;
}
.saju-myung--pair .sm-cap { letter-spacing: 0; max-width: 100%; }
.saju-myung-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.45rem 0.1rem 0.55rem;
}
.saju-myung-col.is-self {
  background: radial-gradient(ellipse 90% 72% at 50% 42%, rgba(90,150,190,0.28), transparent 72%);
}
.sm-cap { color: var(--muted); font-size: 0.62rem; letter-spacing: 0.16em; }
.sm-god { font-size: 0.7rem; color: var(--muted); margin: 0.2rem 0 0.15rem; }
.saju-myung-col.is-self .sm-god { color: var(--accent); }
.saju-myung .sc-stemHanja, .saju-myung .sc-branchHanja {
  font-size: 2.15rem;
  line-height: 1.05;
}
.sm-yin { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.04em; }
.sm-heaven {
  width: 46%;
  height: 1px;
  background: rgba(215, 230, 240, 0.38);
  margin: 0.38rem 0 0.32rem;
  border: 0;
}
.wuxing-dots {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  margin: 0.85rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(215,230,240,0.14);
}
.wuxing-dots span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.62rem;
}
.wuxing-dots b { display: flex; gap: 2px; height: 0.55rem; align-items: end; }
.wuxing-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: 0.9;
}
.wuxing-dots i.ghost {
  background: transparent;
  box-shadow: 0 0 0 1px var(--rim);
  opacity: 0.7;
}

.sc-label { color: var(--muted); font-size: 0.62rem; letter-spacing: 0.08em; }
.sc-stemHanja, .sc-branchHanja, .sc-hanja {
  font-family: "Apple Myungjo", "Nanum Myeongjo", "Noto Serif CJK KR", serif;
  line-height: 1.15;
  color: var(--text);
}
.sc-stemHanja, .sc-branchHanja { font-size: 1.15rem; }
.sc-hanja { font-size: 1.45rem; }
.sc-kor { color: var(--muted); font-size: 0.68rem; }
.notice { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.85rem; }
/* after .sc-* color so pillar/지장간 el-* wins equal specificity */
.el-wood { color: var(--wood); }
.el-fire { color: var(--fire); }
.el-earth { color: var(--earth); }
.el-metal { color: var(--text); }
.el-water { color: var(--water-el); }

.astro-glyph { font-family: "Astro Glyphs", sans-serif; }
.astro-wheel .planet-label .rx { font-size: 9px; fill: var(--accent); }

/* 점성 휠 */
.astro-wheel-box {
  width: min(22rem, 88vw, 70vh);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  padding: 4%;
  box-shadow: 0 0 0 1px var(--rim), 0 0 0 10px var(--bg), 0 0 0 11px var(--rim);
  background: var(--water);
}
.astro-wheel { width: 100%; height: auto; display: block; }
.astro-wheel .ring { fill: none; stroke: var(--rim); stroke-width: 1; }
.astro-wheel .ring--out { stroke: var(--rim); }
.astro-wheel .ring--inner { stroke-dasharray: 2 4; }
.astro-wheel .sign-line { stroke: var(--rim); stroke-width: 1; }
.astro-wheel .sign-label { font-size: 13px; fill: var(--muted); font-family: "Astro Glyphs", sans-serif; }
.astro-wheel .house-line { stroke: var(--rim); stroke-width: 1; }
.astro-wheel .house-line.is-asc { stroke: var(--accent); stroke-width: 1.6; }
.astro-wheel .house-label { fill: var(--muted); font-size: 10px; }
.astro-wheel .planet-tick { stroke: var(--muted); stroke-width: 1; }
.astro-wheel .planet-label { font-size: 14px; fill: var(--text); font-family: "Astro Glyphs", sans-serif; }
.astro-wheel .aspect { fill: none; stroke-width: 1; }
.astro-wheel .aspect--hard { stroke: var(--accent); stroke-opacity: 0.38; }
.astro-wheel .aspect--soft { stroke: var(--text); stroke-opacity: 0.16; }
.astro-wheel .aspect.is-exact { stroke-opacity: 0.72; stroke-width: 1.4; }
.astro-wheel.is-unsure .house-line { stroke-dasharray: 2 3; }
.astro-wheel.is-unsure .house-line.is-asc { stroke-width: 1.4; stroke-opacity: 0.5; stroke-dasharray: 3 3; }
.astro-wheel.is-unsure .house-label { fill-opacity: 0.55; }

.astro-place { margin: 0.55rem 0 0; color: var(--muted); font-size: 0.82rem; }
.astro-angles { margin: 0.15rem 0 0.7rem; color: var(--accent); }
.astro-details { border-top: 1px solid var(--rim); padding: 0.6rem 0 0; text-align: left; }
.astro-details summary { cursor: pointer; color: var(--muted); font-size: 0.88rem; text-align: center; }
.astro-details[open] summary { margin-bottom: 0.5rem; }
.astro-table-wrap { overflow-x: auto; }
.astro-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.astro-table caption { caption-side: top; text-align: left; color: var(--muted); font-size: 0.8rem; padding: 0 0 0.4rem; }
.astro-table th, .astro-table td {
  padding: 0.35rem 0.3rem;
  border-bottom: 1px solid var(--rim);
  text-align: left;
  white-space: nowrap;
}
.astro-table thead th { color: var(--muted); font-weight: 400; font-size: 0.75rem; }
.astro-table tbody th { font-weight: 400; }
.astro-table tbody td { color: var(--muted); }
.astro-table .astro-glyph { font-family: "Astro Glyphs", sans-serif; font-size: 1.05rem; margin-right: 0.2rem; }
.astro-table tr.is-exact th, .astro-table tr.is-exact td { color: var(--accent); }

/* 안내 · 크로스링크 · 푸터 */
.guide { margin-top: 0; padding-top: 5rem; text-align: left; }
.guide h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 2rem;
  letter-spacing: 0.04em;
}
.guide h2:first-child { margin-top: 0; }
.guide h3 { font-size: 0.88rem; margin: 1.3rem 0 0.3rem; color: var(--muted); }
.guide p { color: var(--muted); }
.guide strong { color: var(--text); font-weight: 400; }
.guide ul, .guide ol { color: var(--muted); padding-left: 1.25rem; }
.guide li { margin-bottom: 0.3rem; }
/* 본문 표는 위치표와 달리 문장이 들어가므로 nowrap 해제 */
.guide .astro-table { margin: 1rem 0; }
.guide .astro-table th, .guide .astro-table td { white-space: normal; }
.guide .box, .guide .prompt-box {
  background: var(--water);
  border: 1px solid var(--rim);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin: 1.1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.guide .box > h3 { margin-top: 0; color: var(--text); }
.guide .box p:first-of-type { margin-top: 0; }
.guide .box p:last-child { margin-bottom: 0; }
.guide .prompt-box {
  font-family: var(--font);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  line-height: 1.8;
  font-size: 0.85rem;
}

.cross { margin-top: 0; padding-top: 3.6rem; text-align: center; }
.cross-cap {
  font-family: var(--font);
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.55rem;
}
.cross-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
}
.cross-card {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--display);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--accent);
  padding: 0.35rem 0.15rem 0.08rem;
  white-space: nowrap;
}
.cross-card:focus-visible {
  color: var(--text);
  border-bottom-color: var(--text);
}
@media (hover: hover) {
  .cross-card:hover {
    color: var(--text);
    border-bottom-color: var(--text);
  }
}

.note {
  border-left: 0;
  padding-left: 0;
  font-size: 0.9rem;
}
.note p:last-child { margin-bottom: 0; }

.site-footer {
  border-top: 1px solid var(--rim);
  padding: 1.25rem 1rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  position: relative;
  z-index: 1;
}
.site-footer p { margin: 0.25rem 0; }
.site-footer .fine { font-size: 0.72rem; }

.admin-ok { color: var(--ok); }

@media (prefers-reduced-motion: reduce) {
  .stars i { animation: none; opacity: 0.45; }
  .spinner { animation-duration: 3s; }
}

@media (min-width: 720px) {
  body:not(.admin) main { max-width: 32rem; padding-top: 1.6rem; }
}

/* ── 출생정보 카드 — 큰 터치 타겟, 또렷한 라벨, 명확한 선택 상태 ── */
/* 입력·버튼·안내를 한 장의 카드로 (레퍼런스 이미지 구조) */
form:has(.entry) {
  width: min(22rem, 88vw);
  margin-inline: auto;
  padding: 1.35rem 1.2rem 1.25rem;
  border: 1px solid var(--rim);
  border-radius: 1.1rem;
  background: var(--water);
}
.entry { max-width: none; padding: 0; border: 0; border-radius: 0; background: none; }
.entry .field { margin-bottom: 1.15rem; text-align: left; }
.entry .field > legend, .entry .field > label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: 0.55rem;
  text-align: left;
}

/* 연/월/일 · 시/분+모름 */
/* 연·월·일 / 시·분을 한 격자에 둔다 — 두 행의 칸 폭이 1px도 어긋나지 않게 */
.sel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
.entry select {
  height: 2.75rem;
  padding: 0 1.5rem 0 0.7rem;
  border: 1px solid var(--rim);
  border-radius: 0.75rem;
  font-size: 0.95rem;
  text-align: left;
  text-align-last: left;
  appearance: none;
  -webkit-appearance: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%238aa0b0' stroke-width='1.5'><path d='M1 1.5 6 6.5 11 1.5'/></svg>") no-repeat right 0.5rem center / 0.7rem;
}
.entry select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* 시·분 아래 한 줄 통째로 — 좁은 칸에 끼우면 문구가 잘리고 터치 영역도 손해다 */
.entry .check--inline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.25rem;
  margin: 0;
  padding-left: 0.1rem;
  font-size: 0.88rem;
  color: var(--text);
}
.entry .check--inline input { flex: none; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.check-note { color: var(--muted); font-size: 0.82rem; }

/* 양력·음력 / 성별 — 2분할 버튼. 라디오는 왼쪽, 글자는 가운데 (이미지와 동일 배치) */
.entry .radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.entry .radio-row label {
  position: relative;
  justify-content: center;
  height: 2.75rem;
  padding: 0 0.5rem 0 2.4rem;
  border: 1px solid var(--rim);
  border-radius: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.entry .radio-row input {
  position: absolute;
  left: 0.85rem;
  width: 1.15rem;
  height: 1.15rem;
}
.entry .radio-row label:has(:checked) {
  border-color: var(--accent);
  background: rgba(215, 230, 240, 0.12);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--text);
  font-weight: 700;
}
.entry .leap-wrap { margin-top: 0.55rem; font-size: 0.9rem; }

.legend-info {
  margin-left: 0.35rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
  cursor: help;
}
.legend-info:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 50%; }

/* 출생정보 폼의 제출 버튼 — PR #8(꿈 노트)과 같은 박스형. dream 1단계 버튼은 그쪽 규칙이 담당한다 */
form:has(.entry) > button[type="submit"] {
  width: 100%;
  margin: 1.2rem auto 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--rim);
  border-radius: 0.75rem;
  background: rgba(215, 230, 240, 0.05);
}
form:has(.entry) > button[type="submit"]:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(215, 230, 240, 0.09);
}

.privacy-note {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0.85rem auto 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--rim);
  border-radius: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
  text-align: left;
  word-break: keep-all; /* 한글은 어절 단위로 끊는다 — '씁니/다.' 방지 */
}
.privacy-note svg { flex: none; width: 1.2rem; height: 1.2rem; opacity: 0.75; }
