/* 월급셈 — 방향: 금융 앱처럼 차분한 회색 바탕 위 흰 카드, 파란 강조 하나, Pretendard 한 가지 글꼴. */
:root {
  --bg: #f2f4f6;
  --card: #ffffff;
  --ink: #191f28;
  --ink-2: #4e5968;
  --muted: #6b7684;
  --line: #e8ebee;
  --soft: #f9fafb;
  --blue: #3182f6;
  --blue-ink: #1b64da;
  --blue-soft: #e8f3ff;
  --red: #f04452;
  --red-soft: #ffeeee;
  --green: #03b26c;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 48px; --s9: 64px;
  --r: 20px; --r-sm: 12px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; width: 100%; overflow-x: clip; }
body { width: 100%; max-width: 100%; overflow-x: clip; }
img, svg, table, input, select, textarea { max-width: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  font-size: 16px; line-height: 1.6; word-break: keep-all; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
button { font-family: inherit; }
/* 배경 그래픽: 위쪽 파란 하늘 띠 + 옅은 모눈(가계부 느낌) + 오른쪽 위 동전·막대 그림 */
body { position: relative; isolation: isolate; }
body::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 640px; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(242,244,246,0) 0%, var(--bg) 100%),
    linear-gradient(rgba(49,130,246,.07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(49,130,246,.07) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, #dcebff 0%, #eaf3ff 45%, var(--bg) 100%);
}
body::after {
  content: ""; position: absolute; top: 56px; right: max(0px, calc(50% - 640px)); width: 360px; height: 300px; z-index: -1; pointer-events: none;
  background: url("/assets/bg-deco.svg") no-repeat right top / contain;
}
@media (max-width: 720px) { body::after { width: 190px; height: 160px; top: 52px; opacity: .8; } }


.wrap { max-width: 1040px; margin: 0 auto; padding: 0 var(--s5); }
.narrow { max-width: 680px; }

.top { background: rgba(255,255,255,.92); -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid rgba(0,0,0,.05); position: sticky; top: 0; z-index: 30; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { font-weight: 800; font-size: 19px; letter-spacing: -0.04em; text-decoration: none; display: flex; align-items: center; gap: var(--s2); }
.brand .logo { width: 26px; height: 26px; display: block; }
.nav { display: flex; gap: var(--s5); font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }

h1, h2, h3 { margin: 0; letter-spacing: -0.03em; line-height: 1.35; }
.kicker { font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 0 0 var(--s2); }
.title { font-size: clamp(26px, 6.4vw, 32px); font-weight: 800; }
.lede { font-size: 16px; color: var(--ink-2); margin: var(--s3) 0 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card { background: var(--card); border-radius: var(--r); padding: var(--s6) var(--s5); box-shadow: 0 1px 3px rgba(25,31,40,.05); }
.stack > * + * { margin-top: var(--s3); }

.calc-page { padding-block: var(--s2) var(--s9); }
.page-hero { padding: var(--s5) var(--s1) var(--s4); max-width: 520px; }
.page-hero .title { font-size: clamp(28px, 7.6vw, 36px); line-height: 1.3; }
.page-hero .lede { font-size: 17px; margin-top: var(--s2); }
.calc { display: grid; gap: var(--s3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 920px) { .calc { grid-template-columns: minmax(0, 1fr) 420px; align-items: start; gap: var(--s5); } .side { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; scrollbar-width: thin; } }

.salary { margin-top: 0; }
.salary-label { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: var(--s2); }
.salary .row { display: flex; align-items: baseline; gap: var(--s2); border-bottom: 2px solid var(--line); padding-bottom: var(--s2); transition: border-color .15s; }
.salary .row:focus-within { border-color: var(--blue); }
.salary input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 32px; font-weight: 800; letter-spacing: -0.03em; padding: 0; outline: none; appearance: none; -moz-appearance: textfield; }
.salary input::-webkit-outer-spin-button, .salary input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.salary input::placeholder { color: #c4cad1; }
.salary .unit { font-size: 20px; font-weight: 700; color: var(--muted); }
.salary .lab { font-size: 14px; color: var(--muted); margin-top: var(--s2); }
.salary input { font-size: 34px; }

.fields { display: grid; gap: var(--s4); grid-template-columns: minmax(0,1fr) minmax(0,1fr); margin-top: var(--s6); }
.field label { display: block; font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.field .hint { display: block; font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.input { position: relative; }
.input input {
  width: 100%; font: inherit; font-size: 17px; font-weight: 600; text-align: right; color: var(--ink);
  padding: 13px 48px 13px 14px; border: 0; border-radius: var(--r-sm); background: var(--bg); appearance: none; -moz-appearance: textfield;
}
.input input::-webkit-outer-spin-button, .input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); background: var(--card); }
.input input::placeholder { color: #9aa3ad; font-weight: 500; font-size: 15px; }
.input .unit { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 15px; pointer-events: none; }
@media (max-width: 420px) { .fields { grid-template-columns: minmax(0,1fr); } }

details.acc { background: var(--card); border-radius: var(--r); box-shadow: 0 1px 3px rgba(25,31,40,.05); }
details.acc > summary { list-style: none; cursor: pointer; padding: var(--s5) var(--s5); display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc .t { font-size: 18px; font-weight: 700; }
details.acc .s { display: block; font-size: 14.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
details.acc .chev { width: 24px; height: 24px; flex: none; color: var(--muted); transition: transform .2s; }
details.acc[open] .chev { transform: rotate(180deg); }
details.acc .body { padding: 0 var(--s5) var(--s6); }
details.acc .body .fields { margin-top: var(--s2); }

.check { display: flex; gap: var(--s3); align-items: center; font-size: 15px; padding: var(--s2) 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--blue); flex: none; }

.privacy-note { font-size: 14px; color: var(--muted); padding: var(--s2) var(--s2) 0; }
.linkbtn { font: inherit; background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; }

.result .label { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.result .amt { font-size: clamp(36px, 10vw, 42px); font-weight: 800; letter-spacing: -0.04em; color: var(--blue); line-height: 1.2; margin-top: var(--s1); }
.result.is-due .amt { color: var(--red); }
.result.is-empty .amt { color: #c4cad1; }
.chip { display: inline-block; background: var(--blue-soft); color: var(--blue-ink); font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: 8px; margin-top: var(--s2); }
.result.is-due .chip { background: var(--red-soft); color: var(--red); }
.result.is-empty .chip { background: var(--bg); color: var(--muted); }
.ledger { width: 100%; border-collapse: collapse; margin-top: var(--s5); font-size: 15px; }
.ledger td { padding: 10px 0; color: var(--ink-2); }
.ledger td:last-child { text-align: right; color: var(--ink); font-weight: 600; white-space: nowrap; }
.ledger tr.sub td { font-size: 14px; color: var(--muted); padding: 4px 0 4px var(--s3); }
.ledger tr.sub td:last-child { color: var(--muted); font-weight: 500; }
.ledger tr.total td { border-top: 1px solid var(--line); padding-top: var(--s3); font-weight: 800; color: var(--ink); font-size: 16px; }
.more summary { cursor: pointer; font-size: 15px; font-weight: 600; color: var(--blue-ink); list-style: none; padding: var(--s3) 0 0; }
.more summary::-webkit-details-marker { display: none; }
.note { font-size: 14px; color: var(--muted); margin: var(--s3) 0 0; line-height: 1.55; }

.btn { display: block; width: 100%; text-align: center; border: 0; border-radius: 16px; padding: 16px; font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s; }
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(.95); }
.btn-kakao { background: #fee500; color: #191919; }
.btn-kakao:hover { filter: brightness(.97); }
.btn-ghost { background: var(--bg); color: var(--ink-2); }
.btn-row { display: grid; gap: var(--s2); margin-top: var(--s5); }
.share-msg { font-size: 13px; color: var(--blue-ink); text-align: center; margin: var(--s2) 0 0; }
.share-msg:empty { display: none; }

.diag h2 { font-size: 22px; font-weight: 800; }
.diag-sum { margin-top: var(--s2); font-size: 16px; color: var(--ink-2); line-height: 1.6; }
.diag-sum b { color: var(--blue); }
.diag-group { margin-top: var(--s7); }
.diag-group h3 { font-size: 15px; font-weight: 800; color: var(--ink); margin-bottom: var(--s2); padding-bottom: var(--s2); border-bottom: 2px solid var(--ink); }
.diag-item { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: var(--s3); padding: var(--s4) 0; align-items: start; }
.diag-item + .diag-item { border-top: 1px solid var(--line); }
.diag-item .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--blue-soft); color: var(--blue-ink); margin-top: 1px; }
.diag-item.ok .ic { background: #e5f8ef; color: var(--green); }
.diag-item.info .ic { background: var(--bg); color: var(--muted); }
.diag-item .tt { font-weight: 700; font-size: 17px; line-height: 1.45; }
.diag-item .dd { font-size: 15px; color: var(--ink-2); margin-top: 6px; line-height: 1.65; }
.diag-item .gain { display: inline-block; margin-top: 6px; font-weight: 800; color: var(--blue-ink); background: var(--blue-soft); font-size: 15px; padding: 4px 10px; border-radius: 8px; }

.sticky-result {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40; background: var(--ink); color: var(--card);
  border-radius: 16px; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; font-size: 14px;
  transform: translateY(140%); transition: transform .25s; text-decoration: none;
}
.sticky-result.show { transform: none; }
.sticky-result strong { font-size: 18px; }
@media (min-width: 920px) { .sticky-result { display: none; } }

.page { padding-block: var(--s7) var(--s9); }
.article h1 { font-size: clamp(26px, 6vw, 32px); font-weight: 800; }
.article .meta { margin-top: var(--s3); font-size: 14px; color: var(--muted); }
.prose { font-size: 17px; line-height: 1.75; color: var(--ink); }
.prose h2 { font-size: 21px; font-weight: 800; margin: var(--s8) 0 var(--s3); }
.prose h3 { font-size: 17px; font-weight: 700; margin: var(--s6) 0 var(--s2); }
.prose p, .prose ul, .prose ol { margin: 0 0 var(--s4); }
.prose li { margin-bottom: var(--s1); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: var(--s4) 0 var(--s6); display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; white-space: nowrap; }
.prose th { background: var(--bg); font-weight: 700; }
.prose .callout { background: var(--blue-soft); border-radius: var(--r-sm); padding: var(--s4); margin: var(--s6) 0; font-size: 15.5px; }
.cta-card { margin-top: var(--s7); background: var(--blue); color: #fff; border-radius: var(--r); padding: var(--s6) var(--s5); }
.cta-card b { font-size: 19px; display: block; }
.cta-card span { opacity: .85; font-size: 14px; }
.cta-card .btn { background: #fff; color: var(--blue-ink); margin-top: var(--s4); }
.breadcrumb { font-size: 13px; color: var(--muted); margin: 0 0 var(--s3); }
.breadcrumb a { text-decoration: none; }

.hero { padding-block: var(--s8) var(--s6); }
.hero .title { font-size: clamp(30px, 7.5vw, 42px); }
.hero .btn { max-width: 320px; margin-top: var(--s6); }
.list-card { background: var(--card); border-radius: var(--r); padding: var(--s1) var(--s5); margin-top: var(--s3); }
.list-card a { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s4) 0; text-decoration: none; }
.list-card a + a { border-top: 1px solid var(--line); }
.list-card .t { font-weight: 700; font-size: 16.5px; }
.list-card .d { display: block; font-size: 14.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.list-card .go { color: #c4cad1; font-size: 20px; flex: none; }
.sec-title { font-size: 20px; font-weight: 800; margin: var(--s8) 0 0; }

.ad-slot:empty { display: none; }
.ad-slot { margin: var(--s3) 0; min-height: 100px; }

.foot { padding-block: var(--s7) var(--s9); font-size: 14px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-bottom: var(--s3); }
.foot a { text-decoration: none; color: var(--ink-2); }
