/* 셈집 — 장부 종이 위에 급여명세서. 눈에 띄는 건 결과 명세서와 붉은 인장 하나뿐, 나머지는 조용하게. */
:root {
  --paper: #f7f8f5;
  --sheet: #ffffff;
  --ink: #1d2733;
  --ink-2: #4a5563;
  --ink-3: #6b7480;
  --rule: #d7dcd4;
  --rule-2: #e9ece6;
  --ledger: #2e6a4f;
  --ledger-soft: #e6f0ea;
  --seal: #c4302b;
  --focus: #2e6a4f;
  --radius-input: 6px;
  --sans: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --seal-font: "Song Myung", "Batang", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161b20;
    --sheet: #1e252c;
    --ink: #e8ebe6;
    --ink-2: #b9c0c7;
    --ink-3: #8e98a2;
    --rule: #34404a;
    --rule-2: #2a333b;
    --ledger: #7cc4a0;
    --ledger-soft: #1f3329;
    --seal: #e0574f;
    --focus: #7cc4a0;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  font-variant-numeric: tabular-nums;
  word-break: keep-all; /* 한국어 낱말 중간에서 줄바꿈하지 않게 */
  overflow-wrap: anywhere;
}
a { color: var(--ledger); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* 머리 */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); }
.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
.nav a { color: var(--ink-2); text-decoration: none; padding: 8px 10px; border-radius: 6px; font-size: 15px; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--rule-2); }

/* 제목 */
.lead { padding: 36px 0 20px; }
.lead h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.2; letter-spacing: -0.03em; margin: 0 0 10px; font-weight: 700; }
.lead p { margin: 0; color: var(--ink-2); max-width: 62ch; }

/* 계산기: 왼쪽 입력, 오른쪽 명세서 */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; padding-bottom: 12px; }
@media (max-width: 820px) { .calc { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

.form { display: grid; gap: 18px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field .help { color: var(--ink-3); font-size: 13.5px; margin-top: 5px; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 10px 12px;
  font: inherit; font-size: 17px; color: var(--ink);
  background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-input);
}
.field input:hover, .field select:hover { border-color: var(--ink-3); }
.field input:focus, .field select:focus { border-color: var(--ledger); outline: 2px solid var(--ledger-soft); outline-offset: 0; }
.field .unit { position: relative; }
.field .unit input { padding-right: 40px; text-align: right; }
.field .unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.field .ko { color: var(--ledger); font-size: 13.5px; margin-top: 4px; text-align: right; }
.field .ko:empty { display: none; }
.field.invalid input { border-color: var(--seal); }
.field .err { color: var(--seal); font-size: 13.5px; margin-top: 5px; }

/* 명세서 — 이 사이트의 단 하나의 큰 장면 */
.slip {
  position: relative; background: var(--sheet); border: 1px solid var(--rule);
  padding: 22px 22px 18px; box-shadow: 0 1px 0 var(--rule-2), 0 18px 30px -24px rgba(29, 39, 51, .35);
}
@media (min-width: 821px) { .slip { position: sticky; top: 16px; } }
.slip::before { /* 명세서 위쪽 절취선 */
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 6px;
  background: radial-gradient(circle at 5px -1px, var(--paper) 4px, transparent 4.5px) 0 0 / 10px 6px repeat-x;
}
.slip h2 { font-size: 15px; font-weight: 600; color: var(--ink-2); margin: 0 0 4px; }
.slip .big { font-size: clamp(32px, 6vw, 44px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 4px; word-break: keep-all; }
.slip .ko { color: var(--ink-3); font-size: 14px; min-height: 1.4em; }
.slip .basis { color: var(--ink-3); font-size: 12.5px; margin-top: 14px; border-top: 1px solid var(--rule-2); padding-top: 10px; }

.rows { list-style: none; margin: 18px 0 0; padding: 0; }
.rows li { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; font-size: 15.5px; }
.rows li .k { color: var(--ink-2); flex: none; }
.rows li .dots { flex: 1; border-bottom: 1.5px dotted var(--rule); transform: translateY(-4px); min-width: 16px; }
.rows li .v { flex: none; font-weight: 500; text-align: right; }
.rows li.strong .k, .rows li.strong .v { color: var(--ink); font-weight: 700; }

.slip table, .content table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14.5px; }
.slip th, .slip td, .content th, .content td { padding: 8px 6px; border-bottom: 1px solid var(--rule-2); text-align: right; white-space: nowrap; }
.slip th:first-child, .slip td:first-child, .content th:first-child, .content td:first-child { text-align: left; }
.slip th, .content th { color: var(--ink-3); font-weight: 500; font-size: 13.5px; border-bottom-color: var(--rule); }
.tablewrap { overflow-x: auto; }

.notes { margin: 14px 0 0; padding: 0; list-style: none; color: var(--ink-3); font-size: 13.5px; }
.notes li { padding-left: 14px; position: relative; margin: 4px 0; }
.notes li::before { content: ""; position: absolute; left: 2px; top: .7em; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); }

/* 인장 */
.seal {
  position: absolute; right: 16px; top: 16px; width: 64px; height: 64px;
  color: var(--seal); opacity: .9; transform: rotate(-8deg);
}
.seal text { font-family: var(--seal-font); }
@media (prefers-reduced-motion: no-preference) {
  .seal.stamp { animation: stamp .42s cubic-bezier(.2, 1.4, .4, 1) both; }
  @keyframes stamp { 0% { transform: rotate(-8deg) scale(1.6); opacity: 0; } 60% { opacity: .95; } 100% { transform: rotate(-8deg) scale(1); opacity: .9; } }
}

/* 본문 */
.content { max-width: 720px; padding: 28px 0 40px; }
.content h2 { font-size: 22px; letter-spacing: -0.02em; margin: 34px 0 10px; }
.content ol, .content ul { padding-left: 1.3em; }
.content li { margin: 6px 0; }
.content details { border-bottom: 1px solid var(--rule); padding: 12px 0; }
.content summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.content .sources a { word-break: break-all; }
.steps { counter-reset: s; list-style: none; padding: 0 !important; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--ledger); color: var(--ledger); font-size: 12.5px; display: grid; place-items: center; }

/* 광고 자리 — 승인 전엔 비어 있되 자리는 잡아 둔다 (레이아웃 밀림 방지) */
.ad { min-height: 0; margin: 24px 0; }
.ad.on { min-height: 100px; }

/* 목록 (홈) */
.group { margin: 34px 0; }
.group h2 { font-size: 15px; font-weight: 600; color: var(--ink-3); margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.list { list-style: none; margin: 0; padding: 0; }
.list a { display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr); gap: 4px 20px; padding: 14px 0; border-bottom: 1px solid var(--rule-2); color: var(--ink); text-decoration: none; }
.list a:hover b { color: var(--ledger); }
.list b { font-weight: 600; font-size: 17px; }
.list span { color: var(--ink-2); }
@media (max-width: 640px) { .list a { grid-template-columns: minmax(0, 1fr); } }

.bottom { border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 13.5px; padding: 26px 0 40px; margin-top: 40px; }
.bottom a { color: var(--ink-2); }
.bottom p { margin: 4px 0; max-width: 70ch; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.calc-steps { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-2); }
.calc-steps li { margin: 6px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
