/* 수당지기 — 디자인 시스템 토큰(종이색·솔잎색·주의색, Pretendard)을 옮긴 스타일 */
@font-face {
  font-family: 'Pretendard';
  src: url('/assets/fonts/PretendardVariable.woff2') format('woff2');
  font-weight: 45 920;
  font-display: swap;
}
:root {
  --surface: #f6f4ef; --raised: #ffffff; --ink: #1b211f; --muted: #545d59;
  --line: #dcd8ce; --line-strong: #7d8682; --brand: #1d5a4c; --on-brand: #ffffff;
  --tint: #e2ede8; --signal: #8f5600;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px;
  --font: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 27px; word-break: keep-all; overflow-wrap: break-word; }
a { color: var(--brand); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.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; }
.skip { position: absolute; left: 8px; top: -48px; padding: 8px 12px; background: var(--brand); color: var(--on-brand); border-radius: var(--r-md); z-index: 10; }
.skip:focus { top: 8px; }
h1, h2, h3, p { margin: 0; }
.num, .big, .big-sub, .row-amt, .summary, .input { font-variant-numeric: tabular-nums; }

/* ---- 틀 ---- */
.wrap { max-width: 680px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.site-header { border-bottom: 1px solid var(--line); }
.head-row { padding-top: 16px; padding-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.logo { font-size: 20px; line-height: 28px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; line-height: 20px; font-weight: 600; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--brand); text-decoration: underline; text-underline-offset: 4px; }
.tabs { padding-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tabs a { min-height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none; text-align: center; }
.tabs a[aria-current="page"] { border-color: var(--brand); background: var(--tint); }
.main { padding-top: 24px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 40px; }
.site-footer { border-top: 1px solid var(--line); }
.foot { padding-top: 24px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 8px; }
.foot-name { font-size: 16px; font-weight: 700; }
.foot-links a { color: var(--muted); }

/* ---- 글자 ---- */
h1 { font-size: 26px; line-height: 36px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 19px; line-height: 28px; font-weight: 600; }
h3 { font-size: 16px; line-height: 24px; font-weight: 600; }
.small { font-size: 13px; line-height: 20px; color: var(--muted); }
.warn-text { color: var(--signal); font-weight: 600; }
.strong { font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.prose { display: flex; flex-direction: column; gap: 16px; }
.prose ul, .prose ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }

/* ---- 카드·배지 ---- */
.card { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: var(--r-sm); background: var(--tint); color: var(--brand); font-size: 14px; line-height: 20px; font-weight: 600; }
.result .badge { background: var(--raised); }
.badge-outline { background: var(--raised); border: 1px solid var(--line-strong); color: var(--muted); }

/* ---- 계산기 ---- */
.calc { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; }
.group { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.group legend, .field > label { padding: 0; margin-bottom: 8px; font-size: 14px; line-height: 20px; font-weight: 600; }
.field > label { margin-bottom: 0; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sub-label, .field > label.sub-label { font-size: 13px; line-height: 20px; font-weight: 400; color: var(--muted); }
.help { font-size: 13px; line-height: 20px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: end; }
.grid-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 16px; }
.input { width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); color: var(--ink); font-family: inherit; font-size: 17px; }
select.input { font-size: 16px; padding: 0 8px; }
.input.w-sm { width: 72px; text-align: right; }
.with-unit { display: flex; align-items: center; gap: 8px; }
.with-unit .input:not(.w-sm) { flex: 1 1 auto; min-width: 0; }
.unit { font-size: 15px; color: var(--muted); }
.opts { display: grid; gap: 8px; }
.opts.c1 { grid-template-columns: minmax(0, 1fr); }
.opts.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opts.auto { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.opt { min-height: 48px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); color: var(--ink); font-family: inherit; font-size: 15px; line-height: 22px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.opt-2 { min-height: 56px; align-items: flex-start; text-align: left; }
.opt-l { font-weight: 400; }
.opt-2 .opt-l { font-weight: 600; }
.opt-s { font-size: 13px; line-height: 20px; color: var(--muted); }
.opt[aria-pressed="true"] { border-color: var(--brand); background: var(--tint); }
.opt[aria-pressed="true"] .opt-l, .opt[aria-pressed="true"] .opt-s { font-weight: 600; }
.summary { padding: 8px 12px; border-radius: var(--r-md); background: var(--surface); font-size: 15px; line-height: 24px; font-weight: 600; }
.verdict-box { padding: 12px; border-radius: var(--r-md); background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.verdict-box .strong { font-size: 15px; line-height: 24px; }

/* ---- 결과 ---- */
.result { background: var(--tint); border-radius: var(--r-lg); padding: 24px 16px; display: flex; flex-direction: column; gap: 8px; }
.result-label { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--muted); }
#result-title, #calc-title { scroll-margin-top: 16px; }
.big { font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -0.01em; }
.big-text { font-size: 28px; line-height: 36px; }
.big-sub { font-size: 19px; line-height: 28px; font-weight: 600; color: var(--brand); }
.result-basis { font-size: 13px; line-height: 20px; color: var(--muted); }
.eq { margin: 4px 0; padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--raised); font-variant-numeric: tabular-nums; }
.eq-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; padding: 6px 0; font-size: 15px; line-height: 22px; }
.eq-op { color: var(--muted); font-weight: 600; text-align: center; }
.eq-amt { text-align: right; font-weight: 600; }
.eq-total { border-top: 1px solid var(--line); font-weight: 700; }
.eq-total .eq-amt { font-weight: 700; }
.assume { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid rgba(29, 90, 76, 0.18); font-size: 14px; line-height: 22px; }
.assume-t { font-weight: 600; color: var(--muted); }
.assume-go { flex: 0 0 auto; padding: 1px 10px; border: 1px solid var(--brand); border-radius: var(--r-md); background: var(--raised); font-weight: 600; text-decoration: none; }
.note { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--raised); padding: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 24px; }
.note-warn { border-color: var(--signal); }
.note-warn > p:not(.small) { color: var(--signal); }
.note-warn > p.note-title { font-weight: 600; }
.note-warn .rows p, .note-warn .row-name, .note-warn .row-amt { color: var(--ink); }
.note-title { font-weight: 600; }
.region-stack { display: flex; flex-direction: column; gap: 16px; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn { flex: 1 1 120px; min-height: 48px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-primary { flex: 1 1 100%; min-height: 52px; border: 0; background: var(--brand); color: var(--on-brand); font-size: 16px; }
.check { flex: 1 1 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 15px; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }

/* ---- 계산기 + 결과 2단 (넓은 화면에서 결과가 오른쪽에 붙어 있다) ---- */
.calc-grid { display: flex; flex-direction: column; gap: 40px; }
@media (min-width: 1024px) {
  .calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 32px; align-items: start; margin-left: calc(50% - min(520px, 50vw - 24px)); margin-right: calc(50% - min(520px, 50vw - 24px)); }
  .result-col { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; }
}

/* ---- 휴대폰 하단 결과 줄 ---- */
.resbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: var(--raised); border-top: 1px solid var(--line-strong); }
.resbar-in { max-width: 648px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.resbar-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.resbar-l { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resbar-v { font-size: 21px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.resbar-go { flex: 0 0 auto; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: var(--r-md); background: var(--brand); color: var(--on-brand); font-size: 15px; font-weight: 600; text-decoration: none; }
@media (min-width: 1024px) { .resbar { display: none !important; } }

/* ---- 이미지 미리보기 창 ---- */
.sheet { width: min(440px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); }
.sheet::backdrop { background: rgba(27, 33, 31, 0.55); }
.sheet-in { padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-title { font-size: 17px; line-height: 24px; }
.sheet-x { width: 44px; height: 44px; margin-right: -8px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); font-family: inherit; font-size: 28px; line-height: 1; cursor: pointer; }
.sheet-img { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--raised); overflow: hidden; }
.sheet-img img { width: 100%; height: 100%; display: block; }
@media (max-width: 599px) {
  .sheet { width: 100%; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; border-width: 1px 0 0; }
  .sheet-in { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .sheet-img { max-height: 52vh; align-self: center; width: min(100%, 52vh); }
}

/* ---- −/+ 버튼 ---- */
.stepper { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 8px; align-items: center; }
.step-btn { height: 48px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); color: var(--ink); font-family: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.step-btn:active { background: var(--tint); }
.span-all { grid-column: 1 / -1; }
.summary-big { font-size: 18px; line-height: 26px; font-weight: 700; background: var(--tint); color: var(--ink); }

/* ---- 항목 표 ---- */
.rows { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 16px; }
.note .rows { padding: 0 12px; }
.row { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.has-op .row { position: relative; padding-left: 24px; }
.row-op { position: absolute; left: 0; top: 12px; width: 16px; text-align: center; color: var(--muted); font-weight: 600; }
.has-op .row-total { border-top: 1px solid var(--line-strong); }
.row:last-child { border-bottom: 0; }
.row-name { font-weight: 600; }
.row-jp { font-weight: 400; font-size: 13px; color: var(--muted); }
.row-amt { font-weight: 600; text-align: right; }
.row-how { flex: 1 1 100%; font-size: 13px; line-height: 20px; color: var(--muted); }
.row-strong .row-name, .row-strong .row-amt, .row-total .row-name, .row-total .row-amt { font-weight: 700; }
.row-flex { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.refund { padding: 12px 0 0; font-weight: 600; color: var(--brand); }
.walls { display: flex; flex-direction: column; gap: 8px; }
.tbl-row { display: grid; grid-template-columns: 1.2fr 0.8fr 1.2fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tbl-row:last-child { border-bottom: 0; }
.tbl-row > span:not(:first-child) { text-align: right; }
.tbl-head { font-size: 13px; line-height: 20px; color: var(--muted); font-weight: 600; }
.tbl-on { background: var(--tint); font-weight: 600; margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: var(--r-sm); }

/* ---- 목록 ---- */
.steps, .checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.step-title { font-weight: 600; }
.checks .card { flex-direction: row; align-items: flex-start; gap: 12px; padding: 12px 16px; }
.tag { flex: 0 0 auto; padding: 0 8px; border-radius: var(--r-sm); background: var(--tint); color: var(--brand); font-size: 13px; line-height: 24px; font-weight: 600; }
.tag-warn { background: var(--surface); color: var(--signal); }
.qa { display: flex; flex-direction: column; }
.qa-q { font-weight: 600; }
.qa-g { padding: 16px 0 8px; font-size: 13px; line-height: 20px; font-weight: 700; color: var(--brand); letter-spacing: 0.02em; }
.qa > .qa-g:first-child { padding-top: 0; }
.qa-item { border-bottom: 1px solid var(--line); }
.qa > .qa-item:first-child, .qa-g + .qa-item { border-top: 1px solid var(--line); }
.qa-item > summary { position: relative; padding: 14px 36px 14px 0; list-style: none; cursor: pointer; }
.qa-item > summary::-webkit-details-marker { display: none; }
.qa-item > summary::after { content: '+'; position: absolute; right: 4px; top: 12px; width: 24px; text-align: center; font-size: 22px; font-weight: 400; color: var(--brand); }
.qa-item[open] > summary::after { content: '−'; }
.qa-item > p { padding: 0 36px 16px 0; }

/* ---- 날짜가 붙은 순서 (세로 선) ---- */
.timeline { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.tl-item { position: relative; padding: 0 0 24px 28px; display: flex; flex-direction: column; gap: 2px; }
.tl-item::before { content: ''; position: absolute; left: 5px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.tl-item::after { content: ''; position: absolute; left: 9px; top: 21px; bottom: 3px; width: 2px; background: var(--line); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item:last-child::after { display: none; }
.tl-when { font-size: 13px; line-height: 20px; font-weight: 700; color: var(--brand); }
.tl-title { font-weight: 600; }
.tl-body { font-size: 15px; line-height: 24px; }

/* ---- 고용보험: 일하는 곳 카드 ---- */
.job { padding: 16px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.job .group { gap: 16px; }
.job legend { font-size: 15px; font-weight: 700; color: var(--brand); }

/* ---- 공휴일 달력 ---- */
.cal { display: flex; flex-direction: column; gap: 12px; }
.cal-y { border-top: 1px solid var(--line); }
.cal-y:last-child { border-bottom: 1px solid var(--line); }
.cal-y > summary { position: relative; padding: 14px 36px 14px 0; list-style: none; cursor: pointer; font-weight: 700; }
.cal-y > summary::-webkit-details-marker { display: none; }
.cal-y > summary::after { content: '+'; position: absolute; right: 4px; top: 12px; width: 24px; text-align: center; font-size: 22px; font-weight: 400; color: var(--brand); }
.cal-y[open] > summary::after { content: '−'; }
.cal-y > .cal { padding-bottom: 16px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; line-height: 20px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-key { width: 14px; height: 14px; border-radius: var(--r-sm); background: var(--tint); }
.cal-key.is-labor { border: 2px solid var(--brand); }
.cal-year { padding-top: 8px; font-size: 13px; line-height: 20px; font-weight: 700; color: var(--brand); }
.cal-month { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cal-mt { font-size: 16px; line-height: 52px; font-weight: 700; }
.cal-runs { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-run { display: flex; gap: 2px; padding: 4px; border-radius: var(--r-lg); background: var(--tint); }
.cal-day { width: 44px; height: 44px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2px solid transparent; border-radius: var(--r-md); background: transparent; color: var(--ink); font-family: inherit; cursor: pointer; }
.cal-day.is-labor { border-color: var(--brand); }
.cal-d { font-size: 17px; line-height: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-w { font-size: 11px; line-height: 14px; color: var(--muted); }
.cal-day[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.cal-day[aria-pressed="true"] .cal-w { color: var(--on-brand); }
.cal-list { grid-column: 2; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 22px; }
.sources { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 24px; }
.sources .small { margin-left: 4px; }
.link-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--raised); color: var(--ink); text-decoration: none; }
a.link-card:hover { border-color: var(--brand); }
.lc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.link-card .lc-title { font-weight: 600; color: var(--brand); }
.link-card .lc-body { font-size: 15px; line-height: 24px; color: var(--muted); }
.link-card .badge { flex: 0 0 auto; font-size: 12px; line-height: 18px; }
.tool-list, .tool-grid { display: grid; gap: 8px; }
.eyebrow { font-size: 13px; line-height: 20px; font-weight: 700; color: var(--brand); letter-spacing: 0.02em; }
.lead { font-size: 17px; line-height: 28px; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 21px; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.ledger th, .ledger td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ledger th { font-size: 13px; color: var(--muted); font-weight: 600; background: var(--surface); }
.ledger-wrap { overflow-x: auto; }

/* ---- 광고 (승인 후에만 나온다) ---- */
.ad { min-height: 280px; display: flex; flex-direction: column; gap: 4px; }
.ad-label { font-size: 12px; line-height: 16px; color: var(--muted); }

@media (min-width: 720px) {
  .main { padding-top: 32px; }
  .tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media print {
  .site-header, .tabs, .share, .ad, .site-footer, .resbar, .sheet, .assume-go { display: none; }
}
.stack-24 { display: flex; flex-direction: column; gap: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.stack-24.plain { padding-top: 0; border-top: 0; }
@media (max-width: 600px) {
  .ledger:not(.compact) thead { display: none; }
  .ledger:not(.compact), .ledger:not(.compact) tbody, .ledger:not(.compact) tr, .ledger:not(.compact) td { display: block; width: 100%; }
  .ledger:not(.compact) tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .ledger:not(.compact) tr:last-child { border-bottom: 0; }
  .ledger:not(.compact) td { padding: 2px 0; border: 0; }
  .ledger:not(.compact) td:first-child { font-weight: 600; }
  .ledger td[data-l]::before { content: attr(data-l) ' · '; color: var(--muted); font-size: 13px; }
  .ledger.compact th, .ledger.compact td { padding: 8px 10px; white-space: nowrap; }   /* 좁은 숫자 표: 표 그대로, 넘치면 옆으로 민다 */
}
