/* 상복 사주명리 전문가용 — 글씨만 있는 화면. 화려한 효과 없음. 색은 토큰으로만. */
:root {
  --bg: #fbfaf6; --surface: #ffffff; --ink: #1d1b16; --muted: #6b665a; --line: #e2ddd0; --soft: #f2eee3;
  --accent: #7a3d1c; --accent-ink: #ffffff; --ok: #1f6b45; --warn: #9a5b00; --bad: #a3261f; --focus: #1a5fb4;
  --wood: #2f7d45; --fire: #b3382c; --earth: #8a6a1a; --metal: #5b6770; --water: #1f5f99;
  --font: system-ui, -apple-system, 'Segoe UI', 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
  --serif: 'Noto Serif KR', 'Batang', serif; --r: 8px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15140f; --surface: #1d1b15; --ink: #ece7da; --muted: #a39d8c; --line: #38342a; --soft: #26231b;
    --accent: #d99a6c; --accent-ink: #1a1208; --ok: #5fc08a; --warn: #e0a64d; --bad: #f08a80; --focus: #7db3ff;
    --wood: #6cc383; --fire: #f08a7e; --earth: #d9b45f; --metal: #a9b3bb; --water: #78b2ea;
  }
}
:root[data-theme="dark"] {
  --bg: #15140f; --surface: #1d1b15; --ink: #ece7da; --muted: #a39d8c; --line: #38342a; --soft: #26231b;
  --accent: #d99a6c; --accent-ink: #1a1208; --ok: #5fc08a; --warn: #e0a64d; --bad: #f08a80; --focus: #7db3ff;
  --wood: #6cc383; --fire: #f08a7e; --earth: #d9b45f; --metal: #a9b3bb; --water: #78b2ea;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.65 var(--font); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header.top .wrap { display: flex; align-items: center; gap: 8px; min-height: 52px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
header.top .brand { font-weight: 700; text-decoration: none; color: var(--ink); margin-right: auto; font-size: 1rem; }
header.top nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); color: var(--ink); text-decoration: none; font-size: .92rem; }
.chip b { margin-left: 4px; }
main { padding: 16px 0 72px; }
.banner { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--soft); font-size: .93rem; }
.banner.warn { border-color: var(--warn); } .banner.bad { border-color: var(--bad); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0 0 14px; }
.muted { color: var(--muted); } .small { font-size: .88rem; }
.ok { color: var(--ok); } .warnc { color: var(--warn); } .badc { color: var(--bad); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.sb { justify-content: space-between; }
.btn { min-height: 44px; padding: 0 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: .92rem; }
label { display: block; font-size: .9rem; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=password], input[type=email], input[type=search], input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
}
textarea { min-height: 96px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.radios { display: flex; gap: 10px; flex-wrap: wrap; }
.radios label { display: inline-flex; align-items: center; gap: 6px; margin: 0; min-height: 44px; color: var(--ink); font-size: 1rem; }
.radios input { width: 20px; height: 20px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 0 14px; }
.tabs a { padding: 10px 14px; min-height: 44px; text-decoration: none; color: var(--muted); white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.tablewrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--soft); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.c, th.c { text-align: center; }
.pillars td, .pillars th { text-align: center; min-width: 74px; }
.pillars th:first-child, .pillars td:first-child { text-align: left; min-width: 84px; }
.big { font-size: 1.5rem; font-family: var(--serif); line-height: 1.3; }
.el-wood { color: var(--wood); } .el-fire { color: var(--fire); } .el-earth { color: var(--earth); } .el-metal { color: var(--metal); } .el-water { color: var(--water); }
.reading { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; font-family: var(--font); font-size: 1rem; line-height: 1.8; margin: 8px 0; }
pre.calc { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border-radius: var(--r); padding: 12px; font: .9rem/1.6 var(--font); margin: 8px 0; }
.price { font-weight: 700; font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.crow { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 4px; text-decoration: none; color: var(--ink); }
.crow .nm { font-weight: 600; } .crow .sub { color: var(--muted); font-size: .88rem; }
.crow .grow { flex: 1; min-width: 0; }
.tag { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font-size: .8rem; margin-right: 4px; }
.kind { padding: 12px 0; border-bottom: 1px solid var(--line); }
.kind:last-child { border-bottom: 0; }
.kind .head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kind .head .grow { flex: 1; min-width: 150px; }
.pricegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.pricecell { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--surface); }
.pricecell .p { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.bal { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.err { color: var(--bad); margin: 6px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
dialog { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); max-width: min(92vw, 460px); padding: 18px; }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.footnote { margin-top: 28px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.center { max-width: 420px; margin: 8vh auto 0; }
@media print { header.top, .noprint, .tabs { display: none !important; } body { background: #fff; color: #000; } .card, .tablewrap { border-color: #999; } }
