/* 머니셈 — 급여명세서처럼 또렷한 숫자 중심 레이아웃
   남색 상단 밴드 + 흰 카드, 숫자는 Space Grotesk, 본문은 IBM Plex Sans KR */
:root {
  --ink: #0f1d3a;          /* 상단 밴드, 제목 */
  --ink-2: #1b2d55;
  --bg: #f3f5fa;
  --card: #ffffff;
  --text: #17213a;
  --muted: #5c6782;
  --line: #e2e6f0;
  --soft: #eef2fb;
  --brand: #2f6bff;        /* 링크, 선택 상태 */
  --brand-ink: #ffffff;
  --money: #0fa37f;        /* 실수령액 */
  --ins: #4c7dff;          /* 4대보험 */
  --tax: #f59f3a;          /* 세금 */
  --band-text: #e9eefc;
  --band-muted: #9fb0d6;
  --warn-bg: #fff7e8;
  --warn-line: #f3d9a6;
  --shadow: 0 1px 2px rgba(15, 29, 58, .05), 0 8px 24px rgba(15, 29, 58, .06);
  --radius: 16px;
  --f-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --f-num: "Space Grotesk", "IBM Plex Sans KR", "Malgun Gothic", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #0a1430; --ink-2: #14244a;
    --bg: #0d1220; --card: #161d2e; --text: #e6eaf4; --muted: #9aa5c0;
    --line: #273149; --soft: #1c2640;
    --brand: #7aa2ff; --brand-ink: #0d1220;
    --money: #3fd1a6; --ins: #7aa2ff; --tax: #ffb661;
    --warn-bg: #2a2416; --warn-line: #5a4a25;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #0a1430; --ink-2: #14244a;
  --bg: #0d1220; --card: #161d2e; --text: #e6eaf4; --muted: #9aa5c0;
  --line: #273149; --soft: #1c2640;
  --brand: #7aa2ff; --brand-ink: #0d1220;
  --money: #3fd1a6; --ins: #7aa2ff; --tax: #ffb661;
  --warn-bg: #2a2416; --warn-line: #5a4a25;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--f-body); font-size: 16px; line-height: 1.65;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--brand); }
.wrap {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------- 상단 바 + 카테고리 탭 ---------- */
.topbar { background: var(--ink); color: var(--band-text); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--ink); z-index: 21; }
.topbar-in { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: -0.03em; white-space: nowrap; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--money); display: grid; place-items: center; }
.logo-mark svg { width: 16px; height: 16px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  color: var(--band-muted); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px; white-space: nowrap; transition: background .15s, color .15s;
}
.tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.tab.is-active { color: var(--ink); background: #fff; font-weight: 700; }

/* ---------- 남색 히어로 밴드 ---------- */
.band { background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%); color: var(--band-text); padding-block: 28px 96px; }
.crumb { font-size: 14px; color: var(--band-muted); }
.crumb a { color: var(--band-muted); text-decoration: none; }
.band h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.25; margin: 6px 0 8px; color: #fff; letter-spacing: -0.03em; text-wrap: balance; }
.band p { margin: 0; color: var(--band-muted); max-width: 60ch; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(63, 209, 166, .15); color: #6ee7c2; margin-top: 14px; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 계산기 2단 ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: -72px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.panel-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--muted); margin: 0 0 16px; }

.field { display: grid; gap: 6px; }
.field + .field, .row + .field, .field + .row, .row + .row { margin-top: 18px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { font-weight: 600; font-size: 15px; }
.hint { font-size: 13px; color: var(--muted); }
.money-input { position: relative; }
.money-input input {
  width: 100%; height: 60px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text);
  font-family: var(--f-num); font-size: 26px; font-weight: 600; padding: 0 64px 0 16px; font-variant-numeric: tabular-nums;
}
.money-input.sm input { height: 48px; font-size: 18px; padding-right: 40px; border-width: 1px; }
.money-input .unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money-input input:focus { border-color: var(--brand); outline: none; }
.kor { font-size: 14px; color: var(--brand); font-weight: 600; min-height: 1.4em; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.quick button {
  font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--soft); color: var(--text);
  border-radius: 8px; padding: 5px 11px; cursor: pointer;
}
.quick button:hover, .quick button.on { border-color: var(--brand); color: var(--brand); background: var(--card); }

/* 세그먼트(버튼형 선택) */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  font: inherit; font-size: 15px; min-width: 44px; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); } }

/* ---------- 결과: 급여명세서 ---------- */
.slip { position: sticky; top: 76px; }
.slip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.slip-head .panel-title { margin: 0; }
.slip-head .period { font-size: 13px; color: var(--muted); }
.net { margin: 10px 0 2px; font-size: clamp(36px, 5vw, 46px); font-weight: 700; color: var(--money); line-height: 1.1; }
.net small { font-size: .45em; color: var(--muted); font-weight: 600; margin-left: 4px; }
.net-sub { color: var(--muted); font-size: 14px; }
.net-sub b { color: var(--text); font-family: var(--f-num); }

.bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin: 18px 0 10px; background: var(--soft); }
.bar span { display: block; height: 100%; transition: width .35s ease; }
.bar .b-net { background: var(--money); }
.bar .b-ins { background: var(--ins); }
.bar .b-tax { background: var(--tax); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

.lines { margin-top: 18px; border-top: 1px dashed var(--line); }
.group-label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--muted); padding: 14px 0 4px; }
.group-label span:last-child { font-family: var(--f-num); }
.line { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 15px; }
.line .rate { color: var(--muted); font-size: 13px; margin-left: 6px; }
.line .v { font-family: var(--f-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.line.gross { font-weight: 600; padding-top: 14px; }
.line.total { border-top: 2px solid var(--text); margin-top: 10px; padding-top: 12px; font-weight: 700; font-size: 17px; }
.line.total .v { color: var(--money); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.fine { font-size: 13px; color: var(--muted); margin: 14px 0 0; }

.flabel { font-weight: 600; font-size: 15px; }
.field input[type="date"] {
  width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text);
  font-family: var(--f-num); font-size: 17px; padding: 0 14px;
}
.field input[type="date"]:focus { border-color: var(--brand); outline: none; }
.warn { font-size: 14px; color: #c2410c; font-weight: 600; }
.net.is-neg { color: var(--tax); }
.net.is-muted { color: var(--muted); }
.line.total.neg .v { color: var(--tax); }
.bar[hidden], .legend[hidden] { display: none !important; }
.long-table { max-height: 520px; overflow: auto; }
.long-table thead th { position: sticky; top: 0; }

/* ---------- 정보 탭 ---------- */
.section { margin-top: 40px; }
.section h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0 0 14px; text-wrap: balance; }
.info-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.info-tabs::-webkit-scrollbar { display: none; }
.info-tabs button {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--muted); background: none; border: 0;
  padding: 12px 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap;
}
.info-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); }
.tab-panel { padding-top: 18px; }
.tab-panel p { max-width: 70ch; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: 13px; color: var(--muted); font-weight: 700; background: var(--soft); }
td { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
td:first-child { font-family: var(--f-body); }
tbody tr:hover { background: var(--soft); }
tr.here { background: var(--soft); }
tr.here td:first-child { box-shadow: inset 3px 0 0 var(--brand); font-weight: 700; }
td a { color: var(--text); text-decoration: none; font-weight: 600; }
td a:hover { color: var(--brand); }
.net-col { color: var(--money); font-weight: 700; }
.table-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table-scroll { overflow-x: auto; }
.table-scroll table { min-width: 480px; }
.plain td { font-family: var(--f-body); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.info-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; min-width: 0; }
.info-card .k { font-size: 13px; color: var(--muted); font-weight: 600; }
.info-card .big { font-family: var(--f-num); font-size: 26px; font-weight: 700; margin: 2px 0; }
.info-card .big del { font-size: 16px; color: var(--muted); margin-right: 6px; font-weight: 500; }
.info-card p { margin: 0; font-size: 14px; color: var(--muted); }
.up { color: #e5484d; font-size: 13px; font-weight: 700; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--soft); color: var(--brand); font-family: var(--f-num); font-weight: 700; display: grid; place-items: center; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: 14px; }

details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; }
details + details { margin-top: 8px; }
summary { cursor: pointer; font-weight: 600; padding: 15px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-family: var(--f-num); font-size: 20px; color: var(--muted); line-height: 1; }
details[open] summary::after { content: "−"; }
details p { margin: 0 0 16px; color: var(--muted); }

.note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 12px; padding: 12px 16px; font-size: 14px; margin-top: 20px; }

/* 블로그 연관 글 */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.post {
  display: grid; gap: 6px; text-decoration: none; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; min-width: 0;
  transition: border-color .15s, transform .15s;
}
.post:hover { border-color: var(--money); transform: translateY(-2px); }
.post-src { font-size: 12px; font-weight: 700; color: var(--money); letter-spacing: .02em; }
.post strong { font-size: 16px; line-height: 1.45; text-wrap: balance; }
.post-go { font-size: 14px; color: var(--brand); font-weight: 600; }

/* 관련 계산기 / 카드 그리드 */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tool {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center;
  text-decoration: none; color: var(--text); background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; transition: border-color .15s, transform .15s; min-width: 0;
}
.tool:hover { border-color: var(--brand); transform: translateY(-2px); }
.tool .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--brand); }
.tool .ic svg { width: 22px; height: 22px; }
.tool strong { display: block; font-size: 16px; }
.tool small { color: var(--muted); font-size: 13px; }
.tool.soon { cursor: default; }
.tool.soon:hover { transform: none; border-color: var(--line); }
.tool.soon strong::after { content: "준비 중"; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }
.ic.c-pay { color: var(--money); }
.ic.c-loan { color: var(--ins); }
.ic.c-home { color: var(--tax); }

/* 홈 */
.home-band { padding-block: 44px 56px; }
.home-band h1 { font-size: clamp(30px, 5vw, 44px); }
.home-feature { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; margin-top: 28px; }
.feature-card { background: var(--card); color: var(--text); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); text-decoration: none; display: grid; gap: 6px; min-width: 0; }
.feature-card .k { font-size: 13px; font-weight: 700; color: var(--money); letter-spacing: .04em; }
.feature-card strong { font-size: 22px; letter-spacing: -0.02em; }
.feature-card .demo { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 12px; color: var(--muted); font-size: 14px; }
.feature-card .demo b { font-family: var(--f-num); font-size: 26px; color: var(--money); }
.feature-card .go { color: var(--brand); font-weight: 700; font-size: 15px; }
.facts { display: grid; gap: 10px; align-content: start; }
.fact { display: flex; justify-content: space-between; gap: 10px; padding: 12px 16px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); font-size: 14px; color: var(--band-muted); }
.fact b { color: #fff; font-family: var(--f-num); }
.cat { scroll-margin-top: 80px; }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 36px 0 12px; }
.cat-head h2 { margin: 0; font-size: 20px; }
.cat-head span { color: var(--muted); font-size: 14px; }

/* 문서 페이지 */
.doc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-top: -72px; box-shadow: var(--shadow); }
.doc h2 { font-size: 19px; margin: 28px 0 8px; }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { color: var(--text); max-width: 70ch; }

/* 푸터 */
.footer { margin-top: 64px; background: var(--ink); color: var(--band-muted); padding-block: 28px 40px; font-size: 14px; }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer a { color: var(--band-muted); text-decoration: none; margin-right: 16px; }
.footer a:hover { color: #fff; }

@media (max-width: 860px) {
  .calc, .home-feature { grid-template-columns: minmax(0, 1fr); }
  .slip { position: static; }
}
@media (max-width: 560px) {
  .topbar-in { flex-wrap: wrap; gap: 4px 12px; padding-block: 10px 6px; }
  .tabs { margin-left: 0; width: 100%; }
  .panel, .doc { padding: 18px; }
  .row { grid-template-columns: 1fr; }
  .band { padding-block: 22px 88px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
