/* J아재 세금계산기 — 공통 스타일 v2
   분야마다 고유 색(아이콘 타일)으로 길을 찾게 하고, 결과는 명세서 모양으로 보여 준다. */

:root {
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --ink: #191F28;
  --ink-2: #4E5968;
  --ink-3: #8B95A1;
  --line: #E5E8EB;
  --line-2: #D1D6DB;
  --brand: #0B7A6E;
  --brand-ink: #FFFFFF;
  --brand-soft: #E3F3F0;
  --seal: #C8352B;
  --focus: #0B7A6E;
  --shadow-s: 0 1px 2px rgba(17, 24, 39, .06);
  --shadow-m: 0 2px 6px rgba(17, 24, 39, .05), 0 12px 32px -12px rgba(17, 24, 39, .16);
  --r-s: 8px; --r-m: 14px; --r-l: 20px;
  --wrap: 1200px;
  --head-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1419; --surface: #171D24; --surface-2: #1C232B; --ink: #E8ECEF; --ink-2: #B0B8C1; --ink-3: #7D8791;
    --line: #262E37; --line-2: #333C46; --brand: #3CC4B2; --brand-ink: #062320; --brand-soft: #14302C; --seal: #FF7A70; --focus: #3CC4B2;
    --shadow-s: 0 1px 2px rgba(0,0,0,.4); --shadow-m: 0 2px 6px rgba(0,0,0,.3), 0 14px 34px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1419; --surface: #171D24; --surface-2: #1C232B; --ink: #E8ECEF; --ink-2: #B0B8C1; --ink-3: #7D8791;
  --line: #262E37; --line-2: #333C46; --brand: #3CC4B2; --brand-ink: #062320; --brand-soft: #14302C; --seal: #FF7A70; --focus: #3CC4B2;
  --shadow-s: 0 1px 2px rgba(0,0,0,.4); --shadow-m: 0 2px 6px rgba(0,0,0,.3), 0 14px 34px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px; line-height: 1.7; word-break: keep-all; overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
html, body { overflow-x: clip; }
.badge { flex-wrap: wrap; border-radius: 12px; }
a { color: var(--brand); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
button { font: inherit; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.slip, .seg, input, .num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--r-s); z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- 분야 아이콘 타일 ---------- */
.ico { --c: var(--brand); --t: var(--brand-soft); width: 44px; height: 44px; border-radius: 12px; background: var(--t); color: var(--c); display: grid; place-items: center; flex: none; }
.ico svg { width: 22px; height: 22px; }
.ico.s { width: 32px; height: 32px; border-radius: 9px; }
.ico.s svg { width: 17px; height: 17px; }
.ico.l { width: 56px; height: 56px; border-radius: 16px; }
.ico.l svg { width: 28px; height: 28px; }
:root[data-theme="dark"] .ico { background: color-mix(in srgb, var(--c) 18%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ico { background: color-mix(in srgb, var(--c) 18%, transparent); } }

/* ---------- 머리글 ---------- */
.site-head { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.head-row { display: flex; align-items: center; gap: 12px; height: var(--head-h); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; margin-right: 8px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 16px; font-weight: 800; }
.head-nav { display: flex; align-items: center; gap: 2px; }
.head-nav > a, .menu-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; background: none; border: 0; cursor: pointer; white-space: nowrap; }
.head-nav > a:hover, .menu-btn:hover, .menu-btn[aria-expanded="true"] { background: var(--surface-2); color: var(--ink); }
.menu-btn svg { width: 16px; height: 16px; transition: transform .2s; }
.menu-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.search { position: relative; flex: 1; max-width: 360px; margin-left: auto; }
.search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 20px; padding: 0 16px 0 40px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 15px; }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--surface); }
.search > svg { position: absolute; left: 14px; top: 11px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search-results { position: absolute; top: 48px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: var(--shadow-m); padding: 6px; max-height: 70vh; overflow: auto; z-index: 50; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-s); text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a:focus, .search-results a.active { background: var(--surface-2); }
.search-results .t { flex: 1; font-weight: 600; font-size: 15px; }
.search-results .c { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.search-empty { margin: 8px 10px; color: var(--ink-2); font-size: 14px; }
.icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 20px; cursor: pointer; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.burger { display: none; }

/* 메가 메뉴 (PC) */
.mega { position: absolute; left: 0; right: 0; top: var(--head-h); background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-m); }
.mega[hidden] { display: none; }
.mega-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 24px; padding: 24px 20px 28px; max-height: calc(100vh - var(--head-h)); overflow: auto; }
.mega-cat { padding: 6px 0 10px; }
.mega-cat > a { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.mega-cat > a:hover span { color: var(--brand); }
.mega-cat ul { list-style: none; margin: 0; padding: 0 0 0 42px; }
.mega-cat li a { display: block; padding: 4px 0; color: var(--ink-2); text-decoration: none; font-size: 14px; line-height: 1.5; }
.mega-cat li a:hover { color: var(--brand); }

/* 모바일 메뉴 (서랍) */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer[hidden] { display: none; }
.drawer-bg { position: absolute; inset: 0; background: rgba(15, 20, 25, .45); }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(88vw, 380px); background: var(--surface); display: flex; flex-direction: column; box-shadow: var(--shadow-m); animation: slidein .22s ease-out; }
@keyframes slidein { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.drawer-top strong { font-size: 17px; }
.drawer-search { padding: 12px 16px; border-bottom: 1px solid var(--line); position: relative; }
.drawer-search .search { max-width: none; margin: 0; }
.drawer-body { overflow-y: auto; flex: 1; padding: 6px 8px 24px; }
.acc { border-bottom: 1px solid var(--line); }
.acc > button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 8px; background: none; border: 0; color: var(--ink); font-weight: 700; font-size: 16px; cursor: pointer; text-align: left; }
.acc > button .n { margin-left: auto; color: var(--ink-3); font-weight: 500; font-size: 13px; }
.acc > button svg.chev { width: 16px; height: 16px; color: var(--ink-3); transition: transform .2s; }
.acc > button[aria-expanded="true"] svg.chev { transform: rotate(180deg); }
.acc ul { list-style: none; margin: 0; padding: 0 8px 10px 52px; }
.acc ul[hidden] { display: none; }
.acc li a { display: block; padding: 8px 0; color: var(--ink-2); text-decoration: none; font-size: 15px; }
.acc li a[aria-current="page"] { color: var(--brand); font-weight: 700; }
.drawer-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.drawer-foot a { color: var(--ink-2); }

@media (max-width: 960px) {
  .head-nav, .head-row > .search { display: none; }
  .burger { display: grid; }
  .head-row > .theme-btn { margin-left: auto; }
}

/* ---------- 본문 공통 ---------- */
main { padding: 28px 0 72px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-3); margin: 0 0 12px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--line-2); }
h1 { font-size: clamp(26px, 3.6vw, 34px); line-height: 1.3; margin: 0 0 8px; letter-spacing: -0.025em; font-weight: 800; }
h2 { font-size: clamp(20px, 2.4vw, 23px); line-height: 1.4; margin: 48px 0 14px; letter-spacing: -0.02em; font-weight: 750; }
h3 { font-size: 17px; margin: 24px 0 8px; }
p { margin: 0 0 14px; }
.lead { color: var(--ink-2); max-width: 66ch; margin-bottom: 10px; font-size: 16.5px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--brand); background: var(--brand-soft); padding: 4px 10px; border-radius: 999px; font-weight: 600; }

/* ---------- 계산기 페이지 배치 ---------- */
.page { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 1100px) { .page { grid-template-columns: minmax(0, 1fr); } .side { display: none; } }
.page-main { min-width: 0; }
.side { position: sticky; top: calc(var(--head-h) + 20px); max-height: calc(100vh - var(--head-h) - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px 10px; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 2px 6px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; text-decoration: none; color: var(--ink); font-weight: 700; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a { display: block; padding: 8px 10px; border-radius: var(--r-s); color: var(--ink-2); text-decoration: none; font-size: 14.5px; line-height: 1.45; }
.side li a:hover { background: var(--surface-2); color: var(--ink); }
.side li a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.side-more { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.side-more p { font-size: 12px; color: var(--ink-3); margin: 0 10px 6px; font-weight: 600; }
.side-more a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; color: var(--ink-2); text-decoration: none; font-size: 14px; border-radius: var(--r-s); }
.side-more a:hover { background: var(--surface-2); }
.side-more .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* 같은 분야 계산기 칩 (태블릿·모바일) */
.chips { display: none; gap: 8px; overflow-x: auto; padding: 2px 0 14px; margin: 0 -16px 6px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: 14px; white-space: nowrap; }
.chips a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 700; }
@media (max-width: 1100px) { .chips { display: flex; } }

.title-row { display: flex; gap: 16px; align-items: flex-start; }
.title-row .ico { margin-top: 4px; }
@media (max-width: 640px) { .title-row .ico { display: none; } }

/* 계산기 본체 */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; margin-top: 22px; align-items: start; }
@media (max-width: 900px) { .calc { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 22px 22px 14px; box-shadow: var(--shadow-s); }
@media (max-width: 640px) { .panel { padding: 18px 16px 10px; border-radius: var(--r-m); } }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin: 0 0 4px; }
.panel-title h2 { margin: 0; font-size: 17px; }
.link-btn { background: none; border: 0; color: var(--ink-3); font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { color: var(--ink); background: var(--surface-2); }
.link-btn svg { width: 14px; height: 14px; }

/* 입력칸 */
.field { padding: 13px 0; }
.field + .field { border-top: 1px solid var(--line); }
.field[hidden] { display: none; }
.field label, .field legend { display: block; font-weight: 650; font-size: 15px; margin-bottom: 8px; padding: 0; color: var(--ink); }
.field fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field-group { margin-top: 6px; }
.field-group h3 { margin: 14px 0 0; font-size: 13px; color: var(--brand); font-weight: 700; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.field-group:first-child h3 { border-top: 0; padding-top: 0; }
.input-unit { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); transition: border-color .15s, box-shadow .15s; }
.input-unit:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); background: var(--surface); }
.input-unit input { flex: 1; min-width: 0; border: 0; background: transparent; height: 50px; padding: 0 14px; font: inherit; font-size: 19px; font-weight: 600; color: var(--ink); text-align: right; }
.input-unit input:focus { outline: none; }
.input-unit .unit { padding: 0 14px 0 2px; color: var(--ink-3); font-size: 15px; font-weight: 500; }
.field select, .field input[type="date"] { width: 100%; height: 50px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 16px; padding: 0 12px; }
.field select:focus, .field input[type="date"]:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field-kor { margin: 5px 2px 0; font-size: 13px; color: var(--brand); min-height: 1em; text-align: right; font-weight: 600; }
.field-help { margin: 7px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.55; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-opt { position: relative; margin: 0 !important; font-weight: 500 !important; flex: 1 1 auto; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: block; text-align: center; padding: 10px 12px; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 14.5px; line-height: 1.35; white-space: nowrap; transition: border-color .12s, background .12s; }
.seg-opt span:hover { border-color: var(--line-2); }
.seg-opt input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 700; }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 500 !important; cursor: pointer; margin: 0 !important; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--brand); flex: none; }

/* ---------- 명세서(결과) ---------- */
.result-col { position: sticky; top: calc(var(--head-h) + 20px); }
@media (max-width: 900px) { .result-col { position: static; } }
.slip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l) var(--r-l) 0 0; box-shadow: var(--shadow-m); padding: 22px 22px 18px; position: relative; }
@media (max-width: 640px) { .slip { padding: 18px 16px 16px; border-radius: var(--r-m) var(--r-m) 0 0; } }
.slip::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: -10px; height: 10px;
  background: linear-gradient(-45deg, transparent 6px, var(--surface) 0) 0 0 / 12px 10px repeat-x, linear-gradient(45deg, transparent 6px, var(--surface) 0) 0 0 / 12px 10px repeat-x; }
.slip-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-3); padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.slip-head span:first-child { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.slip-main { padding: 18px 0 16px; border-bottom: 1px solid var(--line); }
.slip-main-label { margin: 0; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.slip-main-value { margin: 2px 0 0; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.slip-main-value span { font-size: clamp(34px, 5.4vw, 46px); font-weight: 800; line-height: 1.15; color: var(--seal); letter-spacing: -0.03em; }
.slip-main-value em { font-style: normal; font-size: 18px; font-weight: 700; color: var(--seal); }
.slip-main-kor { margin: 2px 0 0; font-size: 14px; color: var(--ink-3); }
.slip-main-sub { margin: 6px 0 0; font-size: 14px; color: var(--ink); }
.slip-list { margin: 0; padding: 10px 0 4px; border-bottom: 1px solid var(--line); }
.slip-list:last-of-type { border-bottom: 0; }
.slip-group { font-size: 12.5px; font-weight: 700; color: var(--brand); padding: 6px 0 2px; }
.slip-row { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; }
.slip-row dt { flex: none; max-width: 62%; font-size: 15px; color: var(--ink); }
.slip-row dt small { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.slip-row::after { content: ""; order: 1; flex: 1; border-bottom: 1px dotted var(--ink-3); opacity: .5; transform: translateY(-4px); min-width: 12px; }
.slip-row dd { order: 2; margin: 0; font-weight: 650; text-align: right; white-space: nowrap; font-size: 15px; }
.slip-row dd .u { font-weight: 400; color: var(--ink-3); font-size: 13px; margin-left: 2px; }
.slip-row.kind-sub dd { color: var(--ink-2); }
.slip-row.kind-total { border-top: 1px solid var(--ink); margin-top: 4px; padding-top: 9px; }
.slip-row.kind-total dt, .slip-row.kind-total dd { font-weight: 800; }
.slip-row.kind-info dt, .slip-row.kind-info dd { color: var(--ink-3); font-weight: 400; font-size: 14px; }
.slip-notes { margin: 12px 0 0; padding: 12px 0 0 18px; border-top: 1px dashed var(--line-2); font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.slip-notes li + li { margin-top: 4px; }
.slip-error { margin: 0; color: var(--seal); font-weight: 600; }
.slip-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.btn-ghost { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer; font-weight: 600; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.result-foot { font-size: 12px; color: var(--ink-3); margin: 20px 4px 0; line-height: 1.6; }

/* ---------- 광고 자리 ---------- */
.ad-slot { margin: 32px 0; }
.ad-slot:empty { display: none; }

/* ---------- 설명글 ---------- */
.article { max-width: 780px; }
.article > h2:first-child { margin-top: 40px; }
.article table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 12px 0 18px; font-size: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.table-scroll { overflow-x: auto; border-radius: var(--r-m); }
.article th, .article td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.article tr:last-child td { border-bottom: 0; }
.article th { background: var(--surface-2); font-weight: 700; font-size: 14px; color: var(--ink-2); }
.article td.r, .article th.r { text-align: right; white-space: nowrap; }
.article ul, .article ol { padding-left: 22px; margin: 0 0 14px; }
.article li + li { margin-top: 5px; }
.formula { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); padding: 14px 18px; margin: 12px 0 16px; border-radius: var(--r-s); font-weight: 600; }
.example { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px 18px; margin: 12px 0 16px; }
.example p:last-child { margin-bottom: 0; }
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: 4px 18px; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-3); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 0 14px; color: var(--ink-2); }
.sources { font-size: 14px; color: var(--ink-2); padding-left: 20px; }
.sources li { margin: 5px 0; }
.notice { font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 40px; }

/* 블로그 글 연결 */
.blog-links { list-style: none; padding: 0 !important; margin: 0 0 14px; display: grid; gap: 8px; }
.blog-links a { display: block; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--r-s); text-decoration: none; color: var(--ink); }
.blog-links a:hover { border-color: var(--line-2); border-left-color: var(--brand); box-shadow: var(--shadow-m); }
.blog-links .bl-src { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 2px; }
.blog-links strong { font-weight: 650; line-height: 1.5; }

/* ---------- 계산기 카드 목록 ---------- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cards a { display: flex; gap: 14px; align-items: flex-start; height: 100%; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.cards a:hover { border-color: var(--line-2); box-shadow: var(--shadow-m); transform: translateY(-1px); }
.cards strong { display: block; font-weight: 700; font-size: 15.5px; line-height: 1.4; }
.cards span.d { display: block; font-size: 13.5px; color: var(--ink-3); line-height: 1.5; margin-top: 3px; }
@media (max-width: 640px) { .cards { grid-template-columns: minmax(0, 1fr); gap: 8px; } .cards a { padding: 14px; } }

/* ---------- 홈 ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; padding: 24px 0 8px; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 8px; } }
.hero h1 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.22; letter-spacing: -0.035em; }
.hero .lead { font-size: 17px; margin-bottom: 20px; }
.hero-search { position: relative; max-width: 520px; }
.hero-search input { width: 100%; height: 56px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 18px 0 50px; font: inherit; font-size: 17px; color: var(--ink); box-shadow: var(--shadow-s); }
.hero-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.hero-search > svg { position: absolute; left: 18px; top: 18px; width: 20px; height: 20px; color: var(--ink-3); }
.hero-search .search-results { top: 62px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero-tags a { font-size: 13.5px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; }
.hero-tags a:hover { border-color: var(--brand); color: var(--brand); }
#quick-salary label { font-weight: 650; display: block; margin: 14px 0 8px; }
.quick-out { min-height: 64px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding-top: 14px; }
.quick-out strong { font-size: clamp(32px, 5vw, 42px); color: var(--seal); line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
.quick-label { width: 100%; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.quick-unit { color: var(--seal); font-weight: 700; }
.quick-hint { color: var(--ink-3); font-size: 14px; }
.quick-more { display: inline-flex; margin-top: 12px; font-size: 14px; font-weight: 600; }

.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 52px 0 16px; }
.sec-head h2 { margin: 0; }
.sec-head a { font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1000px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .cat-grid { gap: 8px; } }
.cat-card { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.cat-card:hover { box-shadow: var(--shadow-m); transform: translateY(-2px); border-color: var(--line-2); }
.cat-card .top { display: flex; align-items: center; justify-content: space-between; }
.cat-card .n { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.cat-card strong { font-size: 17px; font-weight: 750; letter-spacing: -0.01em; }
.cat-card p { margin: 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.5; }
@media (max-width: 480px) { .cat-card { padding: 14px; gap: 8px; } .cat-card p { display: none; } .cat-card strong { font-size: 15.5px; } }
.cat-sec { margin-top: 44px; scroll-margin-top: calc(var(--head-h) + 16px); }
.cat-sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cat-sec-head h2 { margin: 0; font-size: 21px; }
.cat-sec-head p { margin: 0; font-size: 14px; color: var(--ink-3); }
.cat-sec-head a { margin-left: auto; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }

/* 분야 페이지 */
.cat-hero { display: flex; gap: 18px; align-items: center; padding: 8px 0 24px; }
.cat-hero h1 { margin: 0 0 4px; }
.cat-hero p { margin: 0; color: var(--ink-2); }
.other-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.other-cats a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.other-cats a:hover { border-color: var(--line-2); color: var(--ink); }

/* ---------- 바닥글 ---------- */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 40px 0 44px; font-size: 14px; color: var(--ink-2); }
.foot-grid { display: grid; grid-template-columns: 1.2fr 2fr; gap: 32px; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr; gap: 20px; } }
.foot-brand p { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); line-height: 1.6; max-width: 40ch; }
.foot-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 16px; list-style: none; margin: 0; padding: 0; }
@media (max-width: 800px) { .foot-cats { grid-template-columns: repeat(2, 1fr); } }
.foot-cats a { color: var(--ink-2); text-decoration: none; }
.foot-cats a:hover { color: var(--brand); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 28px 0 10px; padding: 18px 0 0; list-style: none; border-top: 1px solid var(--line); }
.foot-links a { color: var(--ink-2); }
.foot-note { max-width: 80ch; line-height: 1.6; font-size: 13px; color: var(--ink-3); margin: 0 0 6px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .site-head, .site-foot, .ad-slot, .side, .chips, .panel-title button, .slip-actions { display: none !important; }
  .page, .calc { grid-template-columns: 1fr; }
}
