/* 2026 연말정산 계산기 공통 스타일 */
:root{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
body{margin:0}
/* Layout: 남색 머리 띠(정산 기간 배지) → 입력 양식(왼쪽) + 원천징수영수증 같은 결과(오른쪽, 고정). 모바일은 한 열 + 하단 결과 바 */
:root {
  --bg: #EDF0F7;
  --surface: #FFFFFF;
  --sunk: #F4F6FB;
  --ink: #0F1A33;
  --muted: #44506A;
  --line: #C9D1E2;
  --accent: #1E3EC0;
  --accent-ink: #FFFFFF;
  --accent-soft: #E1E8FD;
  --hero: #13235C;
  --hero-ink: #FFFFFF;
  --hero-muted: #BCC7EE;
  --badge: #FFD34D;
  --badge-ink: #1A1400;
  --refund: #05784F;
  --refund-soft: #DFF4EA;
  --owe: #B3261E;
  --owe-soft: #FCE6E4;
  --font-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-num: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0F1A; --surface: #141B2B; --sunk: #0F1626; --ink: #EEF1F8; --muted: #A8B2C8;
    --line: #2E3851; --accent: #8EA3FF; --accent-ink: #0A0F1A; --accent-soft: #1E2950;
    --hero: #15224D; --hero-ink: #FFFFFF; --hero-muted: #AEBCEA; --badge: #FFD34D; --badge-ink: #1A1400;
    --refund: #4CD3A0; --refund-soft: #0F2E26; --owe: #FF8A80; --owe-soft: #3A1B1E;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0F1A; --surface: #141B2B; --sunk: #0F1626; --ink: #EEF1F8; --muted: #A8B2C8;
  --line: #2E3851; --accent: #8EA3FF; --accent-ink: #0A0F1A; --accent-soft: #1E2950;
  --hero: #15224D; --hero-ink: #FFFFFF; --hero-muted: #AEBCEA; --badge: #FFD34D; --badge-ink: #1A1400;
  --refund: #4CD3A0; --refund-soft: #0F2E26; --owe: #FF8A80; --owe-soft: #3A1B1E;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font-body);
  font-size: 15px; line-height: 1.55; word-break: keep-all;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 머리 띠 */
.hero { background: var(--hero); color: var(--hero-ink); }
.hero-in {
  max-width: 1160px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 28px 30px;
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px 24px;
}
.hero-text { min-width: 0; max-width: 680px; }
.period { display: inline-flex; flex-wrap: wrap; align-items: stretch; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 2px var(--badge); }
.period span { display: flex; align-items: center; padding: 7px 14px; font-weight: 700; font-size: clamp(15px, 2.2vw, 18px); letter-spacing: -.01em; }
.period .p-year { background: var(--badge); color: var(--badge-ink); }
.period .p-when { color: var(--hero-ink); gap: 8px; }
.period .p-when small { font-size: 12px; font-weight: 500; color: var(--hero-muted); }
h1 { margin: 14px 0 0; font-size: clamp(28px, 5vw, 42px); line-height: 1.15; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.lede { margin: 8px 0 0; color: var(--hero-muted); font-size: 15.5px; max-width: 60ch; }
.lede b { color: var(--hero-ink); font-weight: 600; }
.top-actions { display: flex; flex-wrap: wrap; gap: 8px; }
button.ghost {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--hero-ink); background: transparent;
  border: 1.5px solid var(--hero-muted); border-radius: 999px; padding: 8px 16px; cursor: pointer;
}
button.ghost:hover { background: var(--hero-ink); color: var(--hero); border-color: var(--hero-ink); }
button.ghost:focus-visible { outline-color: var(--badge); }

.wrap {
  max-width: 1160px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 24px 120px;
}
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
@media (max-width: 960px) { .grid { grid-template-columns: minmax(0, 1fr); } }

/* 입력 양식 */
.form { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
details.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
details.sec > summary {
  list-style: none; cursor: pointer; padding: 15px 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary:hover h2 { color: var(--accent); }
summary .n {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-family: var(--font-num); font-size: 13px; font-weight: 600;
}
summary h2 { margin: 0; font-size: 17px; font-weight: 700; }
summary .sum {
  margin-left: auto; font-family: var(--font-num); font-size: 13.5px; font-weight: 600; white-space: nowrap;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 11px;
}
summary::after { content: "▾"; color: var(--muted); font-size: 14px; transition: transform .15s; }
details[open] > summary::after { transform: rotate(180deg); }
details[open] > summary { border-bottom: 1px solid var(--line); }
.sec-body { padding: 16px 18px 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
@media (max-width: 560px) { .sec-body { grid-template-columns: minmax(0, 1fr); } }
.sec-note { grid-column: 1 / -1; margin: 0; font-size: 13.5px; color: var(--ink); background: var(--sunk); border-radius: 8px; padding: 9px 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 14px; font-weight: 600; }
.field .help { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.inbox { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 9px; background: var(--surface); min-height: 46px; }
.inbox:hover { border-color: var(--muted); }
.inbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inbox input, .inbox select {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font-family: var(--font-num); font-size: 17px; font-weight: 600; padding: 10px 12px; text-align: right; outline: none;
}
.inbox input::placeholder { color: var(--muted); font-weight: 400; }
.inbox select { text-align: left; font-family: var(--font-body); font-size: 15px; font-weight: 500; cursor: pointer; }
.inbox .u { padding-right: 12px; font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; font-size: 14px; font-weight: 500; border: 1.5px solid var(--line); border-radius: 9px; }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.field.check-field { justify-content: end; }
.field[hidden] { display: none !important; }

/* 결과 영수증 */
.result { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); min-width: 0; }
.receipt {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 18px 20px 18px; position: relative; overflow: hidden;
  box-shadow: 0 10px 30px -18px rgba(15, 26, 51, .45);
}
.receipt .rhead { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; color: var(--ink); }
.receipt .rhead span:last-child { font-weight: 500; color: var(--muted); }
.big { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; border-radius: 10px; padding: 16px 16px 14px; position: relative; }
.refund .big { background: var(--refund-soft); }
.owe .big { background: var(--owe-soft); }
.big .label { font-size: 15px; font-weight: 700; }
.big .amt { font-family: var(--font-num); font-weight: 600; font-size: clamp(36px, 6vw, 46px); letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.big .amt small { font-size: .45em; font-weight: 600; margin-left: 3px; }
.refund .amt, .refund .big .label { color: var(--refund); }
.owe .amt, .owe .big .label { color: var(--owe); }
.stamp {
  position: absolute; right: 30px; top: 50px; transform: rotate(-9deg);
  border: 2.5px solid currentColor; border-radius: 6px; padding: 3px 10px;
  font-size: 14px; font-weight: 700; letter-spacing: .12em; background: var(--surface);
}
.refund .stamp { color: var(--refund); }
.owe .stamp { color: var(--owe); }
.split { margin-top: 6px; font-size: 13px; color: var(--ink); font-family: var(--font-num); }
.rule { border: 0; border-top: 1.5px dashed var(--line); margin: 16px 0 8px; }
table.lines { width: 100%; border-collapse: collapse; font-size: 14px; }
table.lines td { padding: 6px 0; vertical-align: top; }
table.lines td:last-child { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; font-weight: 500; }
table.lines tr.sub td { color: var(--muted); font-size: 13px; padding-top: 1px; }
table.lines tr.sub td:first-child { padding-left: 14px; }
table.lines tr.key td { font-weight: 700; font-size: 15px; background: var(--sunk); padding: 9px 10px; }
table.lines tr.key td:first-child { border-radius: 8px 0 0 8px; }
table.lines tr.key td:last-child { border-radius: 0 8px 8px 0; font-weight: 600; }
.mode { margin-top: 12px; font-size: 13px; color: var(--ink); background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; }
.mode b { color: var(--accent); font-weight: 700; }

.tips { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px; }
.tips h3 { margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.tips ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tips li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; font-size: 14px; padding: 12px 12px; border: 1px solid var(--line); border-radius: 10px; }
.tips li strong { font-weight: 700; }
.tips li .gain { font-family: var(--font-num); font-weight: 700; font-size: 14px; color: var(--refund); background: var(--refund-soft); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.tips li .gain.info { color: var(--muted); background: var(--sunk); font-weight: 600; font-family: var(--font-body); font-size: 12px; }
.tips li p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 13px; }
.disclaimer { margin: 14px 2px 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* 모바일 하단 바 */
.bar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 3px solid var(--line);
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--ink);
  box-shadow: 0 -8px 24px -16px rgba(15, 26, 51, .5);
}
.bar .bl { font-size: 14px; font-weight: 700; }
.bar .ba { font-family: var(--font-num); font-weight: 600; font-size: 24px; letter-spacing: -.02em; }
.bar.refund { border-top-color: var(--refund); }
.bar.owe { border-top-color: var(--owe); }
.bar.refund .ba, .bar.refund .bl { color: var(--refund); }
.bar.owe .ba, .bar.owe .bl { color: var(--owe); }
@media (max-width: 960px) { .bar { display: flex; } .result { position: static; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 사이트 탐색 */
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; width: 100%; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.brand { color: var(--hero-ink); text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.brand span { color: var(--badge); }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.nav a.lnk { display: block; color: var(--hero-muted); text-decoration: none; font-size: 14px; font-weight: 500; padding: 5px 10px; border-radius: 8px; }
.nav a.lnk:hover { color: var(--hero-ink); background: rgba(255, 255, 255, .1); }
.nav a.lnk[aria-current="page"] { color: var(--hero-ink); background: rgba(255, 255, 255, .14); font-weight: 600; }
.nav a:focus-visible { outline-color: var(--badge); }

/* 본문 글 */
.doc { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.wrap > .doc { margin-top: 0; }
.grid + .doc { margin-top: 48px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 26px clamp(18px, 4vw, 34px); min-width: 0; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.doc h2 { font-size: clamp(20px, 3vw, 24px); line-height: 1.3; margin: 0 0 12px; font-weight: 700; letter-spacing: -.01em; text-wrap: balance; }
.doc h3 { font-size: 17px; margin: 26px 0 8px; font-weight: 700; }
.doc p, .doc li { font-size: 16px; line-height: 1.8; }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.doc a { color: var(--accent); text-underline-offset: 3px; }
.doc strong { font-weight: 700; }
.meta-line { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.kicker { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .04em; margin-bottom: 6px; }
.tbl { overflow-x: auto; margin: 8px 0 16px; border: 1px solid var(--line); border-radius: 10px; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 420px; }
.tbl th, .tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: var(--sunk); font-weight: 700; font-size: 13.5px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.steps { counter-reset: s; list-style: none; padding-left: 0 !important; gap: 14px !important; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 12px; }
.steps > li::before { content: counter(s); width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--font-num); font-weight: 600; font-size: 14px; margin-top: 2px; }
.steps > li > div { min-width: 0; }
.callout { background: var(--accent-soft); border-radius: 10px; padding: 14px 16px; font-size: 15px; line-height: 1.7; margin: 8px 0 14px; }
.callout b { color: var(--accent); }
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 16px; font-weight: 700; font-size: 15.5px; display: flex; gap: 10px; align-items: baseline; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; color: var(--accent); font-family: var(--font-num); font-weight: 600; flex: none; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq details > div { padding: 12px 16px 4px 38px; }
.faq details > div p { font-size: 15px; }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.related a { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.related a:hover { border-color: var(--accent); }
.related a b { display: block; color: var(--accent); font-size: 15.5px; margin-bottom: 2px; }
.related a span { font-size: 13.5px; color: var(--muted); }

/* 바닥글 */
.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in {
  max-width: 1160px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 26px 96px;
  display: flex; flex-direction: column; gap: 10px;
}
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.foot a:hover { color: var(--accent); text-decoration: underline; }
.foot p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
@media (min-width: 961px) { .foot-in { padding-block: 26px 34px; } }
.steps > li h3 { margin-top: 3px; }
