:root {
  --bg: #F5F6F3;
  --surface: #FFFFFF;
  --surface-2: #FBFCFA;
  --ink: #15201B;
  --ink-2: #2E3A34;
  --muted: #4A5650;
  --muted-2: #5A6660;
  --line: #E2E5E0;
  --line-2: #EEF0EC;
  --field: #CBD2CD;
  --accent: #0E6B4E;
  --accent-hover: #0A5039;
  --accent-soft: #E6F2EC;
  --on-accent: #FFFFFF;
  --deduct: #A45A12;
  --deduct-bar: #E3A25B;
  --warn-bg: #FFF4E5;
  --warn-ink: #7A4304;
  --head: #F0F2EE;
  --cta: #15201B;
  --cta-ink: #FFFFFF;
  --cta-sub: #C9D3CD;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101614;
    --surface: #18201D;
    --surface-2: #1C2522;
    --ink: #E8EEEA;
    --ink-2: #D2DBD6;
    --muted: #A8B4AE;
    --muted-2: #9AA6A0;
    --line: #2A3531;
    --line-2: #24302C;
    --field: #3A4742;
    --accent: #4CC59A;
    --accent-hover: #6DD6AE;
    --accent-soft: #163329;
    --on-accent: #0B1A14;
    --deduct: #F0A55A;
    --deduct-bar: #C98738;
    --warn-bg: #3A2A12;
    --warn-ink: #F5C98A;
    --head: #1F2925;
    --cta: #22302B;
    --cta-ink: #FFFFFF;
    --cta-sub: #B5C3BC;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 880px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.bar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.logo-text { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.nav { display: flex; gap: 2px 16px; font-size: 15px; }
.nav a { color: var(--muted); text-decoration: none; padding: 10px 0; }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.tools { border-top: 1px solid var(--line-2); }
.tools-inner { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; scrollbar-width: none; }
.tools-inner::-webkit-scrollbar { display: none; }
.tools a { flex: none; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.tools a:hover { border-color: var(--accent); color: var(--accent); }
.tools a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.ad { margin-top: 24px; min-height: 90px; text-align: center; }

/* hero */
.hero { padding: 32px 0 20px; }
.eyebrow { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--accent); }
h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.25; letter-spacing: -0.03em; font-weight: 700; }
.lead { margin: 10px 0 0; font-size: 16px; color: var(--muted); max-width: 680px; }
h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; line-height: 1.35; }
.section { padding-top: 44px; }
.section-desc { margin: 6px 0 18px; color: var(--muted); font-size: 15px; }

/* calculator */
.calc { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.calc-form { flex: 1 1 340px; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-label { font-size: 15px; font-weight: 600; padding: 0; }
.field-label small { font-weight: 400; color: var(--muted-2); font-size: 13px; }
.hint { margin: 0; font-size: 13px; color: var(--muted-2); }
.input-box, .select-box { display: flex; align-items: center; border: 1px solid var(--field); border-radius: 12px; padding: 0 16px; background: var(--surface); }
.input-box:focus-within, .select-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.input-box.primary { border: 1.5px solid var(--accent); }
.input-box input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-weight: 600; font-size: 18px; padding: 10px 0; text-align: right; color: var(--ink); background: transparent; font-variant-numeric: tabular-nums; }
.input-box input[type="date"] { text-align: left; font-size: 17px; color-scheme: light dark; }
.input-box.primary input { font-size: 24px; font-weight: 700; padding: 12px 0; }
.input-box .unit { font-size: 15px; font-weight: 600; color: var(--muted); padding-left: 8px; }
.select-box { padding: 0 12px; }
.select-box select { width: 100%; border: 0; outline: none; font: inherit; font-size: 16px; padding: 12px 0; background: transparent; color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid var(--field); background: var(--surface); color: var(--ink-2); }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.raise-chips { margin-top: -8px; }
.steppers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.steppers.one { grid-template-columns: minmax(0, 1fr); }
.stepper { display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--field); border-radius: 12px; padding: 2px; }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 22px; color: var(--ink); cursor: pointer; border-radius: 10px; }
.stepper button:hover { background: var(--line-2); }
.stepper button:disabled { color: var(--field); cursor: default; background: transparent; }
.stepper output { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.seg-field { border: 0; margin: 0; padding: 0; }
.seg { display: flex; border: 1px solid var(--field); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 42px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.check span { font-size: 15px; font-weight: 600; }
.check small { display: block; font-weight: 400; color: var(--muted-2); font-size: 13px; }
body.is-monthly .mode-annual { display: none; }

.result { flex: 1.3 1 420px; min-width: 0; overflow: hidden; }
.result-top { background: var(--accent-soft); padding: 24px; }
.result-label { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.result-net { margin: 4px 0 0; font-size: clamp(34px, 5vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; color: var(--accent); font-variant-numeric: tabular-nums; }
.result-net .won { font-size: 22px; margin-left: 2px; }
.result-sub { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 10px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.keep { margin: 12px 0 0; font-size: 15px; color: var(--ink-2); }
.warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-ink); font-size: 14px; }
.bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin-top: 16px; background: var(--surface); }
.bar-net { background: var(--accent); }
.bar-ded { flex: 1; background: var(--deduct-bar); }
.bar-legend { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.result-body { padding: 8px 24px 16px; }
.ded-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.ded-row .name { flex: 1; min-width: 0; }
.ded-row .name strong { display: block; font-size: 15px; font-weight: 600; }
.ded-row .name span { font-size: 13px; color: var(--muted-2); }
.ded-row .amt { font-size: 16px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.ded-total { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 4px; font-weight: 700; }
.ded-total .amt { font-size: 18px; color: var(--deduct); font-variant-numeric: tabular-nums; }
.ded-total .amt.good { color: var(--accent); }
.callout { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.note { margin: 12px 0 0; font-size: 13px; color: var(--muted-2); line-height: 1.55; }
.mini { margin-top: 12px; }
.mini summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent); }
.calc-steps { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 8px 12px; background: var(--surface-2); border-radius: 8px; }
.step span { color: var(--muted); }
.step strong { text-align: right; font-variant-numeric: tabular-nums; }
.result-actions { display: flex; align-items: center; gap: 12px; padding: 0 24px 20px; flex-wrap: wrap; }
.share { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.share:hover { border-color: var(--accent); color: var(--accent); }
.share-msg { font-size: 14px; color: var(--accent); }

/* tables */
.table-box { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.table-box.flat { border-radius: 10px; margin-top: 12px; }
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
thead tr { background: var(--head); }
th, td { padding: 11px 16px; }
thead th { font-weight: 600; text-align: right; }
thead th:first-child { text-align: left; }
tbody tr { border-top: 1px solid var(--line-2); }
tbody th { text-align: left; font-weight: 600; }
tbody th small { display: block; font-weight: 400; font-size: 12px; color: var(--muted-2); }
tbody td { text-align: right; }
td.ded { color: var(--deduct); }
td.net, tr.strong td, tr.strong th { font-weight: 700; }
td.plus { color: var(--accent); font-weight: 600; }
tbody th a { text-decoration: underline; text-underline-offset: 3px; }
tr.total { border-top: 2px solid var(--field); background: var(--accent-soft); }
tr.total td { color: var(--accent); font-weight: 700; }
.table-left td { text-align: left; color: var(--muted); }
.table-left td:last-child { text-align: right; color: var(--ink); }
.cmp { min-width: 0; font-size: 14px; }
.cmp th, .cmp td { padding: 9px 10px; }
.prose table { min-width: 0; }
.prose .table-box { margin: 12px 0; }
.prose td { text-align: left; }

/* tiles / cards */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.tile { padding: 18px; }
.tile .k { font-size: 14px; color: var(--muted); }
.tile .v { font-size: 26px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.tile .d { font-size: 13px; color: var(--muted-2); }
.tile.soft { background: var(--accent-soft); border-color: transparent; }
.tile.soft .k { color: var(--ink-2); }
.tile .v.plain { color: var(--ink); }
.tile .v.ded { color: var(--deduct); }
.tile .v.sm { font-size: 23px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; }
.tool-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.tool-card strong { font-size: 17px; }
.tool-card span { font-size: 14px; color: var(--muted); }
.tool-card:hover { border-color: var(--accent); }
.guide-list { display: flex; flex-direction: column; gap: 10px; }
.guide-item { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; text-decoration: none; color: var(--ink); }
.guide-item strong { font-size: 17px; }
.guide-item span { font-size: 14px; color: var(--muted); }
.guide-item:hover { border-color: var(--accent); }

/* faq */
.faq { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.faq details { padding: 16px 20px; }
.faq summary { font-size: 16px; font-weight: 600; cursor: pointer; }
.faq p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }

/* detail & guide */
.crumbs { padding-top: 20px; font-size: 14px; color: var(--muted-2); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.detail-h1 { margin-top: 16px; font-size: clamp(26px, 4vw, 36px); line-height: 1.3; }
.detail-h1 em { font-style: normal; color: var(--accent); }
.cta { margin-top: 32px; background: var(--cta); color: var(--cta-ink); border-radius: var(--radius); padding: 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cta strong { display: block; font-size: 19px; }
.cta span { font-size: 15px; color: var(--cta-sub); }
.cta a { min-height: 48px; padding: 0 22px; display: inline-flex; align-items: center; border-radius: 12px; background: #fff; color: #15201B; font-weight: 700; text-decoration: none; }
.near { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 14px; }
.near a { display: block; padding: 16px 18px; text-decoration: none; color: var(--ink); }
.near a:hover { border-color: var(--accent); }
.near .t { font-size: 15px; font-weight: 600; }
.near .s { font-size: 14px; color: var(--muted); }
.near .s strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.prose { margin: 10px 0 0; color: var(--ink-2); }
.prose p { margin: 0 0 12px; }
.prose h2 { margin: 28px 0 10px; font-size: 22px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.guide .section h2 { font-size: 23px; }
.contact-mail { font-size: 20px; font-weight: 700; }

/* footer */
.site-footer { margin-top: 56px; background: var(--surface); border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 32px; padding-bottom: 36px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted-2); }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 20px; margin-bottom: 16px; }
.foot-cols h2 { font-size: 14px; margin: 0 0 8px; color: var(--ink); }
.foot-cols a { display: block; padding: 4px 0; font-size: 14px; text-decoration: none; }
.foot-cols a:hover { text-decoration: underline; }

@media (max-width: 560px) {
  table { min-width: 0; font-size: 14px; }
  th, td { padding: 10px 12px; }
  .m-hide { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { padding: 14px; }
  .tile .v { font-size: 22px; }
  .tile .v.sm { font-size: 18px; }
}
@media (max-width: 480px) {
  .calc-form, .result-top { padding: 20px; }
  .result-body { padding: 4px 20px 12px; }
  .result-actions { padding: 0 20px 18px; }
  h2 { font-size: 22px; }
  .bar-top { padding-top: 10px; }
}
