:root {
  --bg: #faf7f0;
  --card: #ffffff;
  --ink: #1d2235;
  --sub: #5d6375;
  --line: #ebe6da;
  --navy: #1e2a4a;
  --yellow: #ffd43b;
  --yellow-soft: #fff3bf;
  --wood: #2b8a3e; --wood-bg: #e3f5e6;
  --fire: #d6336c; --fire-bg: #ffe3ec;
  --earth: #b07d00; --earth-bg: #fff1c2;
  --metal: #6c7480; --metal-bg: #eef0f3;
  --water: #1c4fa0; --water-bg: #e2ecff;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(30, 42, 74, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 16px; line-height: 1.65; word-break: keep-all;
}
a { color: var(--navy); }
img { max-width: 100%; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 18px; }

/* 헤더 */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.logo { color: #fff; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: -.5px; display: flex; align-items: center; gap: 8px; }
.logo .mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--yellow); color: var(--navy); font-size: 17px; font-weight: 900; }
.nav { display: flex; gap: 4px; }
.nav a { color: #dfe4f2; text-decoration: none; font-size: 15px; font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.nav a:hover, .nav a.on { color: var(--navy); background: var(--yellow); }

/* 히어로 */
.hero { padding: 34px 0 10px; text-align: center; }
.hero h1 { font-size: 30px; line-height: 1.3; margin: 0 0 10px; font-weight: 800; letter-spacing: -1px; }
.hl { background: linear-gradient(transparent 55%, var(--yellow) 55%); padding: 0 2px; }
.hero p { color: var(--sub); margin: 0; font-size: 16px; }
.today { display: inline-flex; gap: 8px; align-items: center; margin-top: 16px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--sub); }
.today b { color: var(--ink); }

/* 카드 */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 22px; margin: 18px 0; }
.card h2 { font-size: 21px; margin: 0 0 14px; font-weight: 800; letter-spacing: -.5px; }
.card h3 { font-size: 18px; margin: 18px 0 8px; font-weight: 800; }

/* 폼 */
.form-row { margin-bottom: 16px; }
.form-row > label, .form-row .lbl { display: block; font-weight: 700; font-size: 15px; margin-bottom: 7px; }
.form-row .opt { color: var(--sub); font-weight: 500; font-size: 13px; }
input[type=text], select {
  width: 100%; height: 50px; border: 1.5px solid var(--line); border-radius: 12px; padding: 0 14px;
  font: inherit; font-size: 16px; background: #fff; color: var(--ink); appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235d6375' stroke-width='2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
input:focus, select:focus { outline: none; border-color: var(--navy); }
.grid3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #f3efe5; border-radius: 12px; padding: 4px; }
.seg input { display: none; }
.seg label { text-align: center; padding: 10px 0; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--sub); margin: 0; }
.seg input:checked + label { background: #fff; color: var(--navy); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-top: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
details.adv { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 4px; }
details.adv summary { cursor: pointer; font-weight: 700; color: var(--sub); font-size: 14px; }
details.adv .help { font-size: 13px; color: var(--sub); margin: 2px 0 8px 26px; }
.btn {
  display: block; width: 100%; height: 56px; border: 0; border-radius: 14px; background: var(--navy); color: #fff;
  font: inherit; font-size: 18px; font-weight: 800; cursor: pointer; margin-top: 8px;
}
.btn:hover { filter: brightness(1.1); }
.btn.yellow { background: var(--yellow); color: var(--navy); }
.btn.line { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.err { color: #c92a2a; font-weight: 700; font-size: 14px; margin-top: 10px; min-height: 1em; }

/* 결과: 원국 */
.result { display: none; }
.result.show { display: block; animation: up .4s ease; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.r-head { text-align: center; }
.r-head .who { font-size: 22px; font-weight: 800; }
.r-head .meta { color: var(--sub); font-size: 14px; margin-top: 4px; }
.r-head .tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tag { background: var(--yellow-soft); color: var(--navy); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 18px; }
.pillar { text-align: center; }
.pillar .plabel { font-size: 13px; color: var(--sub); font-weight: 700; margin-bottom: 6px; }
.pillar .god { font-size: 12.5px; font-weight: 700; color: var(--sub); height: 20px; }
.pillar .god.me { color: var(--navy); }
.chip { border-radius: 14px; padding: 10px 0 8px; margin: 4px 0; }
.chip .hj { font-size: 34px; font-weight: 800; line-height: 1.1; font-family: 'Noto Serif KR', 'Batang', serif; }
.chip .ko { font-size: 13px; font-weight: 700; }
.pillar .hidden { font-size: 12px; color: #9aa0ad; margin-top: 2px; white-space: nowrap; letter-spacing: 1px; }
.pillar.empty .chip { background: #f3f1ec; color: #b3b6bf; }
.pillar.day .chip { outline: 2.5px solid var(--yellow); outline-offset: -2.5px; }
.el0 { background: var(--wood-bg); color: var(--wood); }
.el1 { background: var(--fire-bg); color: var(--fire); }
.el2 { background: var(--earth-bg); color: var(--earth); }
.el3 { background: var(--metal-bg); color: var(--metal); }
.el4 { background: var(--water-bg); color: var(--water); }

/* 오행 */
.bars { display: grid; gap: 10px; margin: 6px 0 14px; }
.bar { display: grid; grid-template-columns: 54px 1fr 34px; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.bar .track { height: 14px; background: #f2efe7; border-radius: 99px; overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; transition: width .6s ease; }
.fill.el0 { background: var(--wood); } .fill.el1 { background: var(--fire); } .fill.el2 { background: #e0a800; } .fill.el3 { background: var(--metal); } .fill.el4 { background: var(--water); }
.bar .n { text-align: right; color: var(--sub); }
.note { background: #f8f6f0; border-radius: 12px; padding: 12px 14px; margin: 8px 0; font-size: 15px; }
.note b { color: var(--navy); }

/* 풀이 */
.big-title { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.kw { color: var(--navy); font-weight: 700; font-size: 14px; background: var(--yellow-soft); display: inline-block; padding: 3px 10px; border-radius: 8px; margin-bottom: 8px; }
dl.kv { margin: 10px 0 0; }
dl.kv dt { font-weight: 800; font-size: 15px; margin-top: 12px; }
dl.kv dd { margin: 3px 0 0; color: #33384a; }
.more { display: inline-block; margin-top: 12px; font-weight: 700; font-size: 14px; }

/* 대운 */
.daeun { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.daeun .d { flex: 0 0 64px; text-align: center; }
.daeun .age { font-size: 13px; font-weight: 800; color: var(--sub); margin-bottom: 4px; }
.daeun .chip { padding: 6px 0; margin: 3px 0; border-radius: 10px; }
.daeun .chip .hj { font-size: 22px; }
.daeun .g { font-size: 11.5px; color: var(--sub); font-weight: 700; }
.daeun .d.now .age { color: var(--navy); }
.daeun .d.now .age::after { content: ' 지금'; color: #c92a2a; }

.sipsin-list { display: grid; gap: 8px; }
.sipsin-list div { font-size: 15px; }
.sipsin-list b { display: inline-block; min-width: 46px; color: var(--navy); }

.share { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share .btn { font-size: 16px; height: 52px; margin: 0; }
.insta {
  display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff;
  background: linear-gradient(120deg, #833ab4, #e1306c 55%, #f77737); border-radius: var(--radius); padding: 18px 20px; margin: 18px 0;
}
.insta .t1 { font-weight: 800; font-size: 17px; }
.insta .t2 { font-size: 14px; opacity: .9; }
.insta .arr { margin-left: auto; font-size: 22px; font-weight: 800; }

/* 아티클 */
.article h2 { font-size: 22px; }
.article p { margin: 0 0 12px; color: #33384a; }
.article ul { padding-left: 20px; color: #33384a; }
.article li { margin: 4px 0; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 8px 0 0; color: #33384a; }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 14px; }
table.t th, table.t td { border: 1px solid var(--line); padding: 8px 6px; text-align: center; }
table.t th { background: #f6f3ea; }

/* 일주 목록 */
.ilju-index { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.ilju-index a { text-align: center; text-decoration: none; font-weight: 700; font-size: 14px; padding: 8px 0; border-radius: 10px; }
.ilju-item { scroll-margin-top: 76px; border-top: 1px solid var(--line); padding: 18px 0; }
.ilju-item:first-of-type { border-top: 0; }
.ilju-item h3 { margin: 0 0 4px; font-size: 19px; }
.ilju-item h3 .hj { font-family: 'Noto Serif KR', 'Batang', serif; margin-left: 4px; color: var(--sub); font-weight: 700; }
.ilju-item p { margin: 6px 0 0; }

/* 푸터 */
.site-footer { margin-top: 36px; padding: 26px 0 40px; color: var(--sub); font-size: 14px; border-top: 1px solid var(--line); }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 10px; }
.site-footer a { color: var(--sub); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--navy); }
.small { font-size: 13px; color: #8a8f9c; }

@media (max-width: 520px) {
  .hero h1 { font-size: 26px; }
  .nav a { font-size: 14px; padding: 6px 7px; }
  .nav a.hide-m { display: none; }
  .card { padding: 20px 16px; }
  .chip .hj { font-size: 29px; }
  .pillars { gap: 6px; }
  .ilju-index { grid-template-columns: repeat(5, 1fr); }
}
@media print { .site-header, .share, .insta, form, .site-footer { display: none; } }
