:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5d6470;
  --line: #e3e6eb;
  --accent: #2456e6;
  --accent-soft: #eaf0ff;
  --minus: #c2410c;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #181b21;
    --text: #eceef2;
    --muted: #9aa1ad;
    --line: #2a2f38;
    --accent: #7c9cff;
    --accent-soft: #1e2640;
    --minus: #fb923c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  word-break: keep-all;
}
a { color: var(--accent); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

header.site { border-bottom: 1px solid var(--line); background: var(--surface); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
header.site a.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
header.site nav a { color: var(--muted); text-decoration: none; font-size: 14px; margin-left: 16px; }

main { padding: 28px 0 56px; }
h1 { font-size: 28px; line-height: 1.3; letter-spacing: -0.03em; margin: 0 0 8px; }
h2 { font-size: 20px; letter-spacing: -0.02em; margin: 40px 0 12px; }
h3 { font-size: 16px; margin: 20px 0 6px; }
.lead { color: var(--muted); margin: 0 0 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

/* 입력 폼 */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.input-unit { position: relative; }
.input-unit input { padding-right: 44px; }
.input-unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
input[type="text"], select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 17px;
}
input[type="text"]:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick button {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer;
}
.quick button:hover { border-color: var(--accent); color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* 결과 */
.result { margin-top: 16px; }
.result .net-label { color: var(--muted); font-size: 14px; margin: 0; }
.result .net { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.result .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.breakdown { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.breakdown td { padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.breakdown td:last-child { text-align: right; }
.breakdown tr.minus td:last-child { color: var(--minus); }
.breakdown tr.total td { font-weight: 700; }
.bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--line); margin: 0 0 16px; }
.bar i { display: block; height: 100%; }
.bar .b-net { background: var(--accent); }
.bar .b-ins { background: #94a3b8; }
.bar .b-tax { background: var(--minus); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin: -8px 0 12px; }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; background: currentColor; }
.legend .l-net::before { background: var(--accent); }
.legend .l-ins::before { background: #94a3b8; }
.legend .l-tax::before { background: var(--minus); }

/* 연봉표 */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.salary { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.salary th, table.salary td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); }
table.salary th:first-child, table.salary td:first-child { text-align: left; }
table.salary thead th { background: var(--accent-soft); font-weight: 600; position: sticky; top: 0; }
table.salary tbody tr:last-child td { border-bottom: 0; }
table.salary td.strong { font-weight: 700; }

/* 본문 */
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 20px; }
.note { font-size: 13px; color: var(--muted); }
details { border-top: 1px solid var(--line); padding: 12px 0; }
details summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: var(--muted); }

/* 홈 */
.tools { display: grid; gap: 12px; }
.tools a.card { display: block; text-decoration: none; color: var(--text); transition: border-color .15s; }
.tools a.card:hover { border-color: var(--accent); }
.tools a.card strong { display: block; font-size: 17px; margin-bottom: 2px; }
.tools a.card span { color: var(--muted); font-size: 14px; }

footer.site { border-top: 1px solid var(--line); padding: 24px 0 40px; font-size: 13px; color: var(--muted); }
footer.site a { color: var(--muted); }

@media (max-width: 480px) {
  h1 { font-size: 24px; }
  .result .net { font-size: 30px; }
  .card { padding: 16px; }
}

/* 폼 아래 안내 문구 (비어 있으면 자리 차지 안 함) */
p.hint { color: var(--accent); font-size: 13px; margin: -8px 0 14px; }
p.hint:empty { display: none; }

/* 결과 상태 배지 */
.badge { display: inline-block; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-bottom: 8px; }
.badge.warn { background: #fdeee6; background: color-mix(in srgb, var(--minus) 14%, transparent); color: var(--minus); }
.progress { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 4px 0 16px; }
.progress i { display: block; height: 100%; background: var(--accent); }
input[type="date"] {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 17px;
}
input[type="date"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 15px; background: var(--surface); }
.seg input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
header.site nav { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; }
header.site nav a { margin-left: 0; white-space: nowrap; }
header.site nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
header.site .wrap { gap: 16px; }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.tools-more .wrap { padding-bottom: 40px; }
.tools-more h2 { margin-top: 0; }
.related a.card { text-decoration: none; color: var(--text); font-size: 15px; font-weight: 600; padding: 14px 16px; }
.related a.card:hover { border-color: var(--accent); color: var(--accent); }
footer.site p { margin: 6px 0 0; }
/* 좁은 화면에서 2열 입력칸(특히 날짜)이 넘치지 않게 */
.row2 > * { min-width: 0; }
input[type="date"] { min-width: 0; max-width: 100%; }
@media (max-width: 480px) {
  input[type="date"] { font-size: 15px; padding: 0 8px; }
}

/* ===== 전역일 계산기 ===== */
.svc-field { border: 0; padding: 0; margin: 0 0 20px; }
.svc-field legend { font-weight: 600; font-size: 14px; margin-bottom: 10px; padding: 0; }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.svc { position: relative; cursor: pointer; }
.svc input { position: absolute; opacity: 0; pointer-events: none; }
.svc span {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 76px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--bg); transition: border-color .15s, background .15s;
}
.svc b { font-size: 18px; letter-spacing: -0.02em; }
.svc small { font-size: 13px; color: var(--muted); }
.svc:hover span { border-color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.svc input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.svc input:checked + span b { color: var(--accent); }
.svc input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.dc-result { margin-top: 16px; padding: 24px; }
.dc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dc-top .badge { margin: 0; }
.dc-svc { font-size: 14px; color: var(--muted); font-weight: 600; }
.dc-dday { font-size: 56px; line-height: 1.1; font-weight: 800; letter-spacing: -0.04em; margin: 8px 0 6px; font-variant-numeric: tabular-nums; }
.dc-date { font-size: 18px; font-weight: 600; margin: 0 0 22px; }
.dc-track { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.dc-track i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s ease; }
.dc-ends { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 8px 0 22px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dc-ends strong { font-size: 16px; color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { background: var(--bg); border-radius: 12px; padding: 14px 12px; text-align: center; }
.stats span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.stats strong { font-size: 20px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dc-period { margin: 16px 0 0; font-size: 14px; color: var(--muted); text-align: center; }

/* 결과 아래 '틀릴 수 있음' 안내 (모든 계산기 공통) */
.caution { display: flex; gap: 6px; align-items: flex-start; justify-content: center; text-align: center; font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.caution::before { content: "ⓘ"; font-weight: 700; }

@media (max-width: 480px) {
  .svc-grid { grid-template-columns: repeat(2, 1fr); }
  .svc span { min-height: 68px; padding: 10px 14px; }
  .svc b { font-size: 17px; }
  .dc-result { padding: 20px 16px; }
  .dc-dday { font-size: 46px; }
  .dc-date { font-size: 16px; }
  .stats { gap: 8px; }
  .stats div { padding: 12px 6px; }
  .stats strong { font-size: 17px; }
}
