/* 2027 공휴일·연차 계산기 — Seeknoter */
:root {
  --bg: #f6f6f3; --surface: #ffffff; --surface-2: #f0f1ed; --text: #1b1c1e; --muted: #555a61; --line: #d9dbd5;
  --accent: #1f5fbf; --accent-ink: #ffffff; --accent-soft: #e7eefa;
  --hol: #b8282b; --hol-soft: #fbeaea; --sub: #8a4a00; --sub-soft: #fff1dc; --sat: #2a5ca6;
  --warn-soft: #fff6e3; --warn-line: #e8c98f; --ok: #1c7445;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "맑은 고딕", system-ui, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416; --surface: #1b1d20; --surface-2: #24272b; --text: #ececeb; --muted: #a7acb3; --line: #34383d;
    --accent: #86b4ff; --accent-ink: #0c1626; --accent-soft: #1c2a40;
    --hol: #ff8a8a; --hol-soft: #3a2023; --sub: #ffbd6b; --sub-soft: #392b17; --sat: #93b9ff;
    --warn-soft: #30281a; --warn-line: #6b5429; --ok: #74d6a0;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 48rem; margin: 0 auto; padding: 0 1rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
.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; }

/* header */
.site-header { padding: 1.5rem 0 1rem; }
.brand { margin: 0; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
h1 { font-size: 1.65rem; line-height: 1.3; margin: .25rem 0 .5rem; letter-spacing: -.01em; }
.lede { margin: 0 0 .5rem; color: var(--muted); }
.meta { margin: 0; font-size: .85rem; color: var(--muted); }
.toc { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.toc a { display: inline-block; padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; color: var(--text); font-size: .9rem; min-height: 44px; line-height: 1.9; }

/* sections */
main section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1rem; margin: 1rem 0; }
h2 { font-size: 1.3rem; line-height: 1.35; margin: 0 0 .75rem; }
h3 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
p { margin: .5rem 0; }
.note { font-size: .9rem; color: var(--muted); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: .75rem 0 1rem; padding: 0; list-style: none; }
.stats li { background: var(--surface-2); border-radius: 10px; padding: .75rem; }
.stats b { display: block; font-size: 1.5rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stats span { font-size: .85rem; color: var(--muted); }
@media (min-width: 40rem) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: .55rem .6rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-size: .82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.holiday-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.holiday-table td:last-child { white-space: nowrap; font-size: .85rem; color: var(--muted); }
.holiday-table tr.is-sub td { background: var(--sub-soft); }
/* 2026-09-12: 좁은 화면에서 공휴일 이름이 글자 중간(「대체공/휴일」)에서 끊기지 않게.
   body 의 overflow-wrap: anywhere 는 칸의 최소 너비를 한 글자로 만들어 이름 칸을 좁힌다 → 이 표만 break-word.
   대신 좁은 화면에서는 날짜·근거 칸과 머리칸이 띄어쓰기 자리에서 줄을 바꿔 표가 화면 폭 안에 들어오게 한다. */
.holiday-table td { overflow-wrap: break-word; }
@media (max-width: 30rem) {
  .holiday-table th, .holiday-table td { padding-left: .45rem; padding-right: .45rem; }
  .holiday-table thead th, .holiday-table td:first-child, .holiday-table td:last-child { white-space: normal; }
}
.tag { display: inline-block; font-size: .72rem; line-height: 1.4; padding: 0 .4rem; border-radius: 4px; border: 1px solid currentColor; margin-left: .25rem; white-space: nowrap; vertical-align: 1px; }
.tag-sub { color: var(--sub); }
.tag-wknd { color: var(--muted); }
.small { font-size: .8rem; color: var(--muted); }

/* reasoning + callouts */
details { border: 1px solid var(--line); border-radius: 10px; padding: .25rem .9rem; margin: .75rem 0; background: var(--surface); }
details > summary { cursor: pointer; font-weight: 600; padding: .55rem 0; min-height: 44px; }
details[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: .5rem; }
.reason-list { padding-left: 1.2rem; }
.reason-list li { margin: .5rem 0; }
.reason-list .step { display: block; font-size: .88rem; color: var(--muted); }
.callout { border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 10px; padding: .75rem .9rem; margin: .75rem 0; }
.callout strong { color: var(--sub); }
.badge-pending { display: inline-block; font-weight: 700; color: var(--sub); border: 1px solid currentColor; border-radius: 4px; padding: 0 .35rem; font-size: .8rem; }
blockquote.law { margin: .5rem 0; padding: .75rem .9rem; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; font-size: .92rem; }
blockquote.law p { margin: .35rem 0; }
blockquote.law ol { margin: .25rem 0; padding-left: 1.4rem; }
.sources { margin-top: 1.25rem; padding-top: .75rem; border-top: 1px dashed var(--line); font-size: .85rem; color: var(--muted); }
.sources h3 { font-size: .9rem; margin: 0 0 .35rem; color: var(--text); }
.sources ol { margin: 0; padding-left: 1.2rem; }
.sources li { margin: .2rem 0; }

/* calendar */
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: .75rem; margin-top: .75rem; }
.month { font-size: .8rem; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.month caption { text-align: left; font-weight: 700; padding: .4rem .6rem; background: var(--surface-2); caption-side: top; }
.month th, .month td { text-align: center; padding: .25rem 0; border: 0; width: 14.28%; }
.month th { font-size: .72rem; color: var(--muted); }
.month .sun, .month .hol { color: var(--hol); font-weight: 600; }
.month .sat { color: var(--sat); }
.month .hol span { display: inline-block; min-width: 1.6rem; border-radius: 999px; background: var(--hol-soft); }
.month .sub span { background: var(--sub-soft); color: var(--sub); }
.legend { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .8rem; color: var(--muted); margin: .5rem 0 0; padding: 0; list-style: none; }
.legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 999px; margin-right: .3rem; vertical-align: -1px; }
.legend .l-hol { background: var(--hol-soft); border: 1px solid var(--hol); }
.legend .l-sub { background: var(--sub-soft); border: 1px solid var(--sub); }

/* forms */
.controls { display: grid; gap: .75rem; margin: .75rem 0; }
.field label, .field .label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .25rem; }
.field .hint { font-size: .8rem; color: var(--muted); margin: .2rem 0 0; }
input[type="date"], input[type="number"], select {
  width: 100%; min-height: 44px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem;
}
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0; padding: .5rem .75rem .75rem; }
legend { font-weight: 600; font-size: .92rem; padding: 0 .25rem; }
.seg { display: flex; flex-wrap: wrap; gap: .5rem; }
.seg label { display: flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 500; }
.seg input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
.check label { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-weight: 500; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }
@media (min-width: 40rem) { .controls.two { grid-template-columns: 1fr 1fr; } }

/* results */
.result { margin-top: 1rem; }
.result:empty { display: none; }
.big { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0; }
.big div { flex: 1 1 10rem; background: var(--accent-soft); border-radius: 10px; padding: .75rem; }
.big b { display: block; font-size: 1.6rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.big span { font-size: .85rem; color: var(--muted); }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "D2Coding", monospace; background: var(--surface-2); border-radius: 8px; padding: .5rem .7rem; font-size: .88rem; overflow-x: auto; }
.error { color: var(--hol); font-weight: 600; }

/* planner */
.plan-list { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .6rem; }
.plan-list li { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; background: var(--surface); }
.plan-list .head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .75rem; }
.plan-list .len { font-size: 1.15rem; font-weight: 700; }
.plan-list .range { font-variant-numeric: tabular-nums; }
.plan-list .days { font-size: .88rem; color: var(--muted); margin-top: .2rem; }
.plan-list .leave b { color: var(--accent); }

/* ads */
.ad-slot { min-height: 120px; margin: 1rem 0; border: 1px dashed var(--line); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .75rem; background: transparent; }
.ad-slot::before { content: attr(data-label); }

/* faq */
.faq details { margin: .5rem 0; }
.faq p { margin: .25rem 0 .75rem; }

/* footer */
.site-footer { padding: 1.5rem 0 3rem; font-size: .85rem; color: var(--muted); }
.site-footer p { margin: .35rem 0; }
@media print { .ad-slot, .toc, .skip { display: none !important; } main section { border: 0; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 1.2rem; margin-top: .75rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(1.05); }
.plan-list.compact li { padding: .5rem .75rem; }
.edge li { margin: .45rem 0; }
