/* 생일첩 — 먹과 한지 (사주첩 자매 디자인) */
:root {
  --paper: #F6F1E8; --paper-deep: #EFE8DA; --card: #FFFDF8;
  --line: #E6DCC9; --line-soft: #F0E9DA; --underline: #C9BDA6;
  --ink: #211C15; --ink-body: #40372B; --muted: #6E6455; --faint: #8B8070;
  --seal: #B8382D; --seal-deep: #92291F;
  --el-mok: #3B9C69; --el-hwa: #BC3E28; --el-to: #B98D28; --el-geum: #6297DC; --el-su: #2C69A8;
  --serif: 'Noto Serif KR', 'Nanum Myeongjo', Batang, serif;
  --sans: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper-deep); color: var(--ink); font-family: var(--sans); line-height: 1.55; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: break-word; }
a { color: var(--seal-deep); }
.app { max-width: 680px; margin: 0 auto; padding: 18px 18px 40px; min-height: 100vh; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 480px) { .app { padding: 14px 14px 36px; } }

.hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
.brand-name { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: 0.04em; }
.nav { display: flex; gap: 14px; flex-wrap: wrap; }
.nav a { font-size: 13px; color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--seal); }

/* 자매 사이트 칩 — 브랜드 옆 */
.brand-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sis-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px 0 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-family: var(--serif); font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); text-decoration: none; white-space: nowrap; transition: border-color 0.15s ease, color 0.15s ease; }
.sis-chip svg { flex: none; }
.sis-chip:hover { color: var(--ink); border-color: var(--ink); }
@media (max-width: 480px) { .sis-chip span { display: none; } .sis-chip { padding: 0 6px; } }

.overline { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.overline a { color: inherit; text-decoration: none; }
h1 { font-family: var(--serif); font-size: 26px; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
@media (max-width: 480px) { h1 { font-size: 22px; } }
.lead { margin-top: 10px; font-size: 15px; color: var(--ink-body); line-height: 1.7; }
.meta { margin-top: 8px; font-size: 12px; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.chips span, .chips a { font-size: 12px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; background: var(--card); }
.chips b { color: var(--ink); font-weight: 600; }

.big { font-family: var(--serif); font-size: 40px; font-weight: 700; color: var(--seal); line-height: 1.1; letter-spacing: 0.04em; margin: 8px 0 6px; }

section { margin-top: 26px; }
h2 { font-family: var(--serif); font-size: 18px; font-weight: 700; padding-bottom: 6px; border-bottom: 1px solid var(--underline); margin-bottom: 12px; }
h3 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
p { font-size: 14.5px; color: var(--ink-body); line-height: 1.75; margin: 8px 0; }
ul, ol { margin: 8px 0 8px 20px; }
li { font-size: 14px; color: var(--ink-body); line-height: 1.7; margin: 3px 0; }
strong { color: var(--ink); }
.note { font-size: 13px; color: var(--muted); line-height: 1.65; }

/* 사실 카드 */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
@media (max-width: 480px) { .facts { grid-template-columns: repeat(2, 1fr); } }
.fact { background: var(--card); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 11px; }
.fact small { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.fact b { display: block; font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.fact i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.fact.hi { border-color: var(--seal); background: #FBF3E6; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 10px 0; background: var(--card); }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
th { background: var(--paper); font-weight: 700; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
td a { text-decoration: none; }
.tw { overflow-x: auto; }
.r { text-align: right; }

.callout { background: var(--card); border-left: 3px solid var(--seal); padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-body); margin: 12px 0; }
.callout a { text-decoration: none; }

/* 링크 격자 */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 8px 0; }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(3, 1fr); } .grid.g6 { grid-template-columns: repeat(4, 1fr); } }
.grid a { display: block; padding: 8px 6px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 9px; text-decoration: none; color: inherit; text-align: center; font-size: 13px; line-height: 1.35; }
.grid a b { display: block; font-family: var(--serif); font-size: 15px; }
.grid a small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.grid a.cur { border-color: var(--seal); background: #FBF3E6; }

/* 달력 */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 10px 0; }
.cal .wd { text-align: center; font-size: 11px; color: var(--faint); padding: 2px 0; }
.cal a { display: block; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line-soft); border-radius: 8px; padding: 6px 2px; text-align: center; font-size: 14px; line-height: 1.2; min-height: 48px; }
.cal a small { display: block; font-size: 10.5px; color: var(--faint); margin-top: 3px; white-space: nowrap; }
.cal a small:first-of-type, .cal span.d small:first-of-type { color: var(--muted); }
.cal a.son { border-color: #D9C58F; }
.cal a.term { color: var(--seal); }
.cal .sun { color: var(--seal); }
.cal .sat { color: var(--el-su); }

/* 폼 */
.form { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-top: 14px; }
.form .row { display: flex; gap: 8px; }
.form select, .form button { font: inherit; font-size: 15px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); }
.form select { flex: 1; min-width: 0; }
.form button { width: 100%; margin-top: 10px; background: var(--seal); color: #fff; border: none; font-weight: 700; cursor: pointer; }
.form button:hover { background: var(--seal-deep); }

.pn { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0 0; font-size: 13.5px; }
.pn a { text-decoration: none; }

.ad { margin: 22px 0; min-height: 90px; }

footer { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); }
.frow { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--faint); }
.frow nav { display: flex; gap: 12px; }
.frow a { color: var(--muted); text-decoration: none; }
.fnote { margin-top: 8px; font-size: 12px; color: var(--faint); line-height: 1.6; }

.el-목 { color: var(--el-mok); } .el-화 { color: var(--el-hwa); } .el-토 { color: var(--el-to); } .el-금 { color: var(--el-geum); } .el-수 { color: var(--el-su); }

/* 달력·공휴일 */
.cal span.d { display: block; background: var(--card); border: 1px solid var(--line-soft); border-radius: 8px; padding: 6px 2px; text-align: center; font-size: 14px; line-height: 1.2; min-height: 48px; }
.cal span.d small { display: block; font-size: 10.5px; color: var(--faint); margin-top: 3px; white-space: nowrap; }
.cal .hol { background: #FBF0EE; border-color: #E8B4AE; color: var(--seal); }
.cal .hol small:last-child { color: var(--seal); }
.cal .today { box-shadow: inset 0 0 0 2px var(--seal); }
.cal span.son { border-color: #D9C58F; }
tr.sub td { background: #FBF6EE; }
td.sun { color: var(--seal); } td.sat { color: var(--el-su); }

/* 계산기 폼 */
.frow-label { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.frow-label input[type=date], .frow-label input[type=number] { font: inherit; font-size: 15px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); flex: 1; min-width: 0; }
.frow-label.chk { font-size: 13px; }
.out { margin-top: 14px; }
.out .lead { margin-top: 0; }
