/* 음력노트 — Line 킷 변형: 한지 바탕 · 먹색 · 남색 단색 액센트 · 괘선 · 그림자·그라디언트·블러 없음 */
:root {
  --bg: #fbfaf6; --paper: #ffffff; --ink: #1c1d22; --ink2: #4a4c55; --mute: #80828b;
  --line: #e3e1da; --line2: #cfccc2; --accent: #2e3f8f; --accent-ink: #ffffff; --accent-soft: #eef0f8;
  --hl: #fff6d6; --warn: #9a3412;
  --serif: 'Noto Serif KR', 'Nanum Myeongjo', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #121318; --paper: #191b21; --ink: #e9e8e4; --ink2: #b9b8b3; --mute: #85858b;
  --line: #2a2c34; --line2: #3a3d47; --accent: #9fb0ff; --accent-ink: #121318; --accent-soft: #1f2436;
  --hl: #2f2a17; --warn: #f0a37a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.7 var(--sans); word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 3px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
button, input, select { font: inherit; color: inherit; }

/* 머리 */
.masthead { border-bottom: 1px solid var(--line); background: var(--bg); }
.masthead .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); margin-right: auto; padding: 8px 0; }
.brand svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand-sub { font-size: 12.5px; color: var(--mute); }
.nav { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; color: var(--ink2); text-decoration: none; font-size: 14.5px; padding: 6px 10px; border-radius: 6px; }
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.theme-btn { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: transparent; cursor: pointer; display: grid; place-items: center; flex: none; margin-left: 4px; }
.theme-btn svg { width: 17px; height: 17px; }
@media (max-width: 720px) {
  .masthead .wrap { gap: 0; }
  .brand-sub { display: none; }
  .nav { order: 3; width: 100%; padding-bottom: 8px; margin: 0 -10px; width: calc(100% + 20px); }
}

/* 도구 */
.tool { padding: 26px 16px 8px; }
.tool-head h1 { font-family: var(--serif); font-size: clamp(24px, 4.6vw, 32px); line-height: 1.3; margin: 0 0 6px; letter-spacing: -0.02em; }
.tool-head p { margin: 0 0 22px; color: var(--ink2); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin: 0 0 14px; font-weight: 700; }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12.5px; font-weight: 700; margin-right: 8px; vertical-align: 1px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.field label, .field .lab { display: block; font-size: 13.5px; color: var(--ink2); margin-bottom: 6px; font-weight: 600; }
.field input[type=text], .field input[type=number], .field input[type=date], .field select {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--bg); }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline select { width: auto; min-width: 84px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.help { font-size: 13px; color: var(--mute); margin: 6px 0 0; }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 9px 14px; cursor: pointer; font-size: 14px; color: var(--ink2); }
.seg button + button { border-left: 1px solid var(--line2); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.opts { display: grid; gap: 12px; }
.opt { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
.opt > span { font-size: 14.5px; font-weight: 600; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; font-size: 14.5px; color: var(--accent); font-weight: 600; }
details.more[open] summary { margin-bottom: 12px; }
.conv-out { margin-top: 10px; padding: 10px 12px; background: var(--accent-soft); border-radius: 8px; font-size: 14.5px; min-height: 22px; }
.conv-out:empty { display: none; }
.err { color: var(--warn); }

/* 결과 */
.result { scroll-margin-top: 10px; }
.next { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; padding: 16px 18px; border: 1px solid var(--accent); border-radius: 12px; margin-bottom: 14px; background: var(--accent-soft); }
.next .k { font-size: 13px; color: var(--ink2); width: 100%; }
.next .v { font-family: var(--serif); font-size: clamp(21px, 4vw, 27px); font-weight: 700; }
.next .d { font-weight: 700; color: var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line2); background: var(--paper); cursor: pointer; font-size: 14.5px; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.small { height: 34px; padding: 0 10px; font-size: 13.5px; }
.btn svg { width: 16px; height: 16px; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 0 0 18px; background: var(--paper); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
.tbl td.wrap-ok, .prose .tbl td { white-space: normal; }
.tbl td.wrap-ok { min-width: 210px; }
.tbl thead th { background: var(--bg); font-size: 13px; color: var(--ink2); font-weight: 600; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.past td { color: var(--mute); }
.tbl tr.now td { background: var(--hl); }
.tbl .num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 13.5px; }
.tbl .sun { color: #b42318; } .tbl .sat { color: #1d4ed8; }
[data-theme="dark"] .tbl .sun { color: #ff8f86; } [data-theme="dark"] .tbl .sat { color: #8fb4ff; }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line2); color: var(--ink2); margin-left: 4px; }
.tag.leap { border-color: var(--accent); color: var(--accent); }
.tag.calc { border-style: dashed; color: var(--mute); }
.tag.warn { border-color: var(--warn); color: var(--warn); }
.note-s { font-size: 12.5px; color: var(--warn); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.toast.on { opacity: 1; }

/* 기념일 행 */
.rows { display: grid; gap: 10px; }
.row { display: grid; gap: 8px; grid-template-columns: 120px 1fr auto auto auto auto; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.row select, .row input[type=text] { height: 40px; padding: 0 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--paper); width: 100%; }
.row .md { display: flex; gap: 6px; }
.row .md select { width: 74px; }
.row .del { border: 0; background: transparent; cursor: pointer; color: var(--mute); font-size: 20px; width: 34px; height: 34px; border-radius: 8px; }
.row .del:hover { color: var(--warn); background: var(--paper); }
@media (max-width: 720px) {
  .row { grid-template-columns: 1fr 1fr; }
  .row .t-title { grid-column: 1 / -1; order: -1; }
  .row .md { grid-column: 1 / -1; }
}
.holis { display: flex; flex-wrap: wrap; gap: 8px 16px; }

/* 문서 */
.doc { padding: 22px 16px 10px; }
.crumbs { font-size: 13px; color: var(--mute); margin-bottom: 10px; }
.crumbs a { color: var(--mute); }
.doc-head { border-bottom: 2px solid var(--ink); padding-bottom: 14px; margin-bottom: 22px; }
.kicker { font-size: 12px; letter-spacing: .14em; color: var(--accent); font-weight: 700; }
.doc-head h1 { font-family: var(--serif); font-size: clamp(25px, 5vw, 34px); line-height: 1.32; margin: 6px 0 6px; letter-spacing: -0.02em; }
.doc-head .meta { font-size: 13px; color: var(--mute); }
.prose { max-width: 760px; }
.prose .lead { font-size: 17.5px; color: var(--ink2); }
.prose h2 { font-family: var(--serif); font-size: 22px; margin: 38px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); letter-spacing: -0.01em; }
.prose h3 { font-size: 17px; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 4px 0; }
.prose .tbl-wrap { margin: 16px 0 20px; }
.prose .note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 12px 16px; margin: 18px 0; border-radius: 0 8px 8px 0; }
.prose .note p { margin: 4px 0; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; }
.faq h3 { font-size: 16px; }
.sources { margin-top: 36px; font-size: 14px; color: var(--ink2); }
.sources h2 { font-size: 16px; }
.cta { display: inline-block; background: var(--accent); color: var(--accent-ink); text-decoration: none; padding: 10px 18px; border-radius: 8px; font-weight: 600; margin: 6px 0; }
.cards { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.cards li { border-bottom: 1px solid var(--line); padding: 14px 0 14px 42px; position: relative; }
.cards .no { position: absolute; left: 0; top: 15px; font-family: var(--mono); font-size: 13px; color: var(--accent); }
.cards a { font-weight: 700; font-size: 16.5px; text-decoration: none; color: var(--ink); }
.cards a:hover { color: var(--accent); }
.cards p { margin: 3px 0 0; font-size: 14px; color: var(--ink2); }
.tools-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 0 0 20px; padding: 0; list-style: none; }
.tools-list a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); background: var(--paper); height: 100%; }
.tools-list a:hover { border-color: var(--accent); }
.tools-list b { display: block; margin-bottom: 2px; }
.tools-list span { font-size: 13.5px; color: var(--ink2); }
.info { margin-top: 30px; }

/* 광고 — 래퍼에 border-radius·overflow 금지(애드핏 규정) */
.ad-wrap { margin: 26px auto 8px; }
.ad-grid { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 672px; margin-left: auto; margin-right: auto; }
.ad-grid[data-ad-layout="mixed"] { max-width: 760px; }
.ad-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
.ad-cell { min-height: 50px; }

/* 꼬리 */
.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 34px; font-size: 13px; color: var(--mute); }
.foot .links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 10px; }
.foot a { color: var(--ink2); text-decoration: none; }
.foot a:hover { color: var(--accent); }

@media print {
  .masthead, .foot, .ad-wrap, .actions, .no-print, form .card, .tool-head p { display: none !important; }
  body { background: #fff; color: #000; }
  .tbl-wrap { border: 0; overflow: visible; }
}
