/* 세후 — 금융 계산기. 밝은 단일 테마, 숫자가 주인공. 서체는 Pretendard 하나. */
:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --card: #ffffff;
  --line: #e1e4de;
  --line-2: #cfd4cc;
  --ink: #171b1e;
  --ink-2: #454c52;
  --muted: #737b82;
  --accent: #0b6b52;
  --accent-ink: #ffffff;
  --accent-tint: #e6f2ed;
  --warn: #a8481f;
  --warn-tint: #fbeee6;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --wrap: 960px;
  --measure: 700px;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--ink); background: var(--bg); word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
p a, li a, td a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -.01em; margin: 0; }
.num, td, .big, .kv td:last-child { font-variant-numeric: tabular-nums; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-inline: 16px; }
.skip { position: absolute; left: -9999px; top: 10px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; font-weight: 700; }
.skip:focus { left: 10px; }
.main { flex: 1; padding-block: 20px 48px; }

/* 상단 */
.mast { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.mast-in { display: flex; align-items: center; gap: 18px; height: 56px; }
.wordmark { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; flex: none; }
.wm-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 800; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-right: -16px; padding-right: 16px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; padding: 6px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-tint); color: var(--accent); }
/* 데스크톱: 칩이 줄바꿈되는 인라인 메뉴. 모바일: 인라인 메뉴를 숨기고 접이식 전체 메뉴 */
.menu { display: none; }
@media (min-width: 768px) { .mast-in { height: auto; min-height: 56px; padding: 8px 0; } .nav { flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 0; } }
@media (max-width: 767px) {
  .nav { display: none; }
  .menu { display: block; margin-left: auto; }
  .menu summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; }
  .menu summary::-webkit-details-marker { display: none; }
  .menu-cur { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-ico { font-size: 16px; color: var(--accent); }
  .menu[open] summary { border-color: var(--accent); }
  .menu-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,.08); padding: 6px 16px 14px; max-height: calc(100vh - 56px); overflow-y: auto; }
  .menu-h { margin: 12px 0 4px; font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .02em; }
  .menu-panel ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; }
  .menu-panel a { display: block; padding: 9px 10px; border-radius: 8px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); background: var(--bg); text-decoration: none; }
  .menu-panel a[aria-current="page"] { background: var(--accent-tint); color: var(--accent); }
}
.group { margin-top: 22px; }
.group-h { font-size: 15px; font-weight: 800; color: var(--muted); letter-spacing: .02em; margin-bottom: 8px; }
.group .cards { margin-top: 0; }

/* 홈 */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: clamp(26px, 5vw, 36px); font-weight: 800; }
.hero p { margin: 10px 0 0; color: var(--ink-2); font-size: 17px; max-width: var(--measure); }
.hero .sample { display: inline-block; margin-top: 14px; padding: 8px 14px; border-radius: 999px; background: var(--accent-tint); color: var(--accent); font-weight: 700; font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 22px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 16px; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card b { display: block; font-size: 17px; margin-bottom: 4px; }
.card span { color: var(--ink-2); font-size: 14px; }
.card .go { display: block; margin-top: 10px; color: var(--accent); font-weight: 700; font-size: 14px; font-style: normal; }
.trust { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.trust div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; font-size: 14px; color: var(--ink-2); }
.trust b { display: block; color: var(--ink); margin-bottom: 4px; font-size: 15px; }

/* 계산기 페이지 */
.crumb { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.crumb a { color: var(--muted); text-decoration: none; }
.calc-head h1 { font-size: clamp(23px, 4.5vw, 30px); font-weight: 800; }
.calc-head .year { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 6px; background: var(--accent-tint); color: var(--accent); font-size: 13px; font-weight: 700; vertical-align: middle; }
.basis { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tabs a { padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); background: var(--card); }
.tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.year-cmp { margin: 12px 0 0; }
.year-cmp a { display: inline-block; margin-right: 12px; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-top: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .field > .lbl { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.field small { font-size: 12px; color: var(--muted); font-weight: 400; }
.inp { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; height: 46px; overflow: hidden; }
.inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.inp input, .inp select { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; padding: 0 12px; font: inherit; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }
.inp select { text-align: left; appearance: auto; }
.inp input[type="date"] { text-align: left; }
.inp input:focus, .inp select:focus { outline: none; }
.inp .unit { padding: 0 12px 0 4px; color: var(--muted); font-size: 14px; flex: none; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { flex: 1 1 0; min-width: max-content; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 14.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.seg label:hover { border-color: var(--accent); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + label { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.presets button { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.presets button:hover { border-color: var(--accent); color: var(--accent); }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.form-foot small { color: var(--muted); font-size: 12.5px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 26px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
@media (max-width: 520px) { .btn { width: 100%; } }
@media (min-width: 640px) { .field:has(.presets) { grid-column: span 2; } }

.result { border-color: var(--accent); border-width: 1.5px; }
.result-label { margin: 0; font-size: 14px; font-weight: 700; color: var(--accent); }
.big { margin: 2px 0 6px; font-size: clamp(32px, 7vw, 44px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.big span { font-size: .5em; font-weight: 700; margin-left: 2px; color: var(--ink-2); }
.big-sub { margin: 0 0 14px; color: var(--ink-2); font-size: 14.5px; }
.kv { width: 100%; border-collapse: collapse; font-size: 15px; }
.kv th, .kv td { padding: 9px 4px; border-top: 1px solid var(--line); text-align: left; font-weight: 500; }
.kv td:last-child, .kv th:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.kv th { color: var(--ink-2); font-weight: 600; }
.kv .sum th, .kv .sum td { border-top: 2px solid var(--ink); font-weight: 800; }
.kv .sub th { padding-left: 16px; color: var(--muted); font-weight: 500; font-size: 14px; }
.kv .minus td:last-child { color: var(--warn); }
.kv .net td:last-child { color: var(--accent); font-weight: 800; }
.notice { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--warn-tint); color: var(--warn); font-size: 14px; }

.ad { min-height: 280px; margin: 20px 0; display: grid; place-items: center; }
.ad ins { width: 100%; }

.prose { margin-top: 28px; max-width: none; }
.prose h2 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.prose h3 { font-size: 16.5px; font-weight: 700; margin: 18px 0 6px; }
.prose p, .prose li { max-width: var(--measure); color: var(--ink-2); font-size: 15.5px; }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 10px; }
.prose .lede { color: var(--ink); font-size: 16px; }
.prose code { font-family: inherit; background: var(--accent-tint); padding: 1px 6px; border-radius: 5px; font-size: .95em; }
.formula { padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px; color: var(--ink); max-width: var(--measure); margin: 0 0 12px; }
.table-scroll { overflow-x: auto; margin: 6px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; white-space: nowrap; }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: right; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl thead th { background: var(--bg); color: var(--ink-2); font-weight: 700; font-size: 13.5px; position: sticky; top: 0; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.is { background: var(--accent-tint); font-weight: 700; }
.tbl a { text-decoration: none; color: var(--accent); font-weight: 600; }
details.sched summary { cursor: pointer; font-weight: 700; color: var(--accent); padding: 8px 0; }
details.sched .table-scroll { max-height: 480px; overflow-y: auto; }

.faq { margin-top: 28px; }
.faq h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; padding: 10px 0; font-weight: 700; font-size: 15.5px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; max-width: var(--measure); }

.related { margin-top: 28px; }
.related h2 { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.related a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: inherit; }
.related a:hover { border-color: var(--accent); }
.related b { display: block; font-size: 15px; }
.related span { font-size: 13px; color: var(--muted); }

.sources { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.sources h2 { font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.sources ul { padding-left: 18px; margin: 0 0 8px; }
.sources a { color: var(--ink-2); }

/* 일반 페이지 */
.page { max-width: var(--measure); }
.page h1 { font-size: 26px; font-weight: 800; margin: 8px 0 14px; }
.page h2 { font-size: 18px; font-weight: 800; margin: 24px 0 8px; }
.page p, .page li { color: var(--ink-2); font-size: 15.5px; }
.page ul { padding-left: 20px; }

/* 하단 */
.foot { border-top: 1px solid var(--line); background: var(--card); }
.foot-in { padding: 22px 16px 28px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.foot-note { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); max-width: var(--measure); }
.foot-note a { text-decoration: underline; }

@media (max-width: 640px) {
  .panel { padding: 14px; }
  .kv { font-size: 14.5px; }
  .tbl th, .tbl td { padding: 8px 10px; }
}
