/* 세상의 모든 계산기 디자인 시스템 (BI 시안 C "계산 도장")
   Layout: 한지 바탕 위에 흰 "서류"를 놓는 구성. 헤더(도장 심볼 · 워드마크 · 검색 · 전체 메뉴) 아래
   본문(계산기 서류 + 해설)과 오른쪽 부록(사이드바) 2단, 960px 이하 1단.
   구분은 그림자가 아니라 괘선(1px), 합계는 이중선, 명세 항목은 점선. 모서리 0~2px.
   색은 인주(도장·강조)와 먹(글자)뿐이고, 파랑은 하락 표시에만 씁니다.
   변수 이름은 기존 페이지 호환을 위해 그대로 두었습니다(--lcd 는 이제 명세서 종이색). */
:root {
  /* 바탕과 글자 */
  --paper: #FBFAF7;        /* 한지: 페이지 바탕 */
  --surface: #FFFFFF;      /* 종이: 계산기·글 서류 */
  --surface-2: #F5F3EE;    /* 표 머리, 공식 상자 */
  --ink: #1E1E1E;          /* 먹 */
  --muted: #6B675F;        /* 회먹 */
  --icon-dim: #A39E94;
  --line: #E3DFD6;         /* 괘선 */
  --line-strong: #CBC5B9;
  /* 인주 */
  --accent: #C8102E;
  --accent-ink: #FFFFFF;
  --accent-soft: #F8E4E6;
  --link: #B00E29;
  --seal: #C8102E;
  --seal-ink: #FFFFFF;
  /* 결과 명세서 (예전 LCD 변수 이름 유지) */
  --lcd: #FFFFFF;
  --lcd-ink: #1E1E1E;
  --lcd-dim: #6B675F;
  --lcd-edge: #CBC5B9;
  --lcd-inset: none;
  /* 의미색: 상승 = 인주, 하락 = 파랑 (한국 관례) */
  --up: #C8102E;
  --down: #1F4E9C;
  --ok: #1E1E1E;
  --warn: #E2808D;
  --focus: #C8102E;
  /* 차트 계열: 인주 · 먹 · 회먹 · 괘선 */
  --s1: #C8102E;
  --s2: #56524A;
  --s3: #A8A296;
  --s-base: #DCD7CC;
  --shadow: none;
  --shadow-pop: none;
  /* 분야 도장 (예전 분야 칩 변수 이름 유지, 모두 같은 인주) */
  --c-salary: var(--seal); --c-salary-bg: transparent;
  --c-tax: var(--seal); --c-tax-bg: transparent;
  --c-finance: var(--seal); --c-finance-bg: transparent;
  --c-invest: var(--seal); --c-invest-bg: transparent;
  --c-realestate: var(--seal); --c-realestate-bg: transparent;
  --c-insurance: var(--seal); --c-insurance-bg: transparent;
  --c-health: var(--seal); --c-health-bg: transparent;
  --c-edu: var(--seal); --c-edu-bg: transparent;
  --c-biz: var(--seal); --c-biz-bg: transparent;
  --c-life: var(--seal); --c-life-bg: transparent;
  --c-date: var(--seal); --c-date-bg: transparent;
  --c-misc: var(--muted); --c-misc-bg: transparent;
  /* 글꼴: 함렛(로고·제목·큰 숫자) + Gothic A1(본문·입력·표·작은 숫자) */
  --font-display: "Hahmlet", "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  --font-body: "Gothic A1", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-num: "Gothic A1", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --r: 0px;
  --gutter: 16px;
  --measure: 41rem;
  --hdr: 154px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #161513; --surface: #1E1D1A; --surface-2: #252420; --ink: #EDEAE3; --muted: #A39E94; --icon-dim: #6E6A62;
    --line: #3A3732; --line-strong: #504B44;
    --accent: #E5484D; --accent-ink: #161513; --accent-soft: #3A1D1F; --link: #F0777B; --seal: #E5484D; --seal-ink: #FFFFFF;
    --lcd: #1E1D1A; --lcd-ink: #EDEAE3; --lcd-dim: #A39E94; --lcd-edge: #504B44;
    --up: #EE6267; --down: #7FA6E8; --ok: #EDEAE3; --warn: #A2505A; --focus: #E5484D;
    --s1: #E5484D; --s2: #B9B4AA; --s3: #78736A; --s-base: #5A554D;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #161513; --surface: #1E1D1A; --surface-2: #252420; --ink: #EDEAE3; --muted: #A39E94; --icon-dim: #6E6A62;
  --line: #3A3732; --line-strong: #504B44;
  --accent: #E5484D; --accent-ink: #161513; --accent-soft: #3A1D1F; --link: #F0777B; --seal: #E5484D; --seal-ink: #FFFFFF;
  --lcd: #1E1D1A; --lcd-ink: #EDEAE3; --lcd-dim: #A39E94; --lcd-edge: #504B44;
  --up: #EE6267; --down: #7FA6E8; --ok: #EDEAE3; --warn: #A2505A; --focus: #E5484D;
  --s1: #E5484D; --s2: #B9B4AA; --s3: #78736A; --s-base: #5A554D;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 16px; line-height: 1.65;
  word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; }
button { font-family: inherit; }
h1, h2, h3 { line-height: 1.3; text-wrap: balance; margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--ink); }
html.sem-lock, html.sem-lock body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

.wrap { max-width: 1160px; margin: 0 auto; padding-inline: var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 24px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: absolute; left: 12px; top: -48px; z-index: 80; padding: 8px 14px;
  background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 600; font-size: 14px;
}
.skip:focus { top: 8px; }

/* ---------- 도장 ---------- */
.ic { display: block; flex: none; }
.seal { display: block; flex: none; overflow: visible; }
.seal text { font-family: var(--font-display); font-weight: 900; }
/* 심볼(사각 도장): 인주 바탕 + 흰 선 + 흰 글자 */
.seal-mark .bg { fill: var(--seal); }
.seal-mark .ln { fill: none; stroke: var(--seal-ink); stroke-width: 1.6; }
.seal-mark text { fill: var(--seal-ink); font-size: 19px; }
/* 분야 도장: 인주 테두리 + 인주 글자 (속 비움). 클래스 이름 chip 은 예전 호환용 */
.chip {
  display: inline-block; flex: none; width: 26px; height: 26px; color: var(--seal);
  vertical-align: middle; line-height: 0;
}
.chip.sm { width: 22px; height: 22px; }
.chip.xs { width: 18px; height: 18px; }
.chip .seal { width: 100%; height: 100%; }
.seal-cat rect { fill: none; stroke: currentColor; stroke-width: 1.6; }
.seal-cat text { fill: currentColor; font-size: 14px; }
/* 원형 확인 도장: 결과 명세서 한 곳에만 */
.seal-ok {
  position: absolute; top: 16px; right: 18px; width: 66px; height: 66px; z-index: 1;
  transform: rotate(-8deg); opacity: .92; pointer-events: none;
  animation: sem-stamp .32s cubic-bezier(.2, .9, .3, 1.2) .15s both;
}
.seal-ok circle { fill: none; stroke: var(--seal); stroke-width: 3; }
.seal-ok text { fill: var(--seal); font-size: 17px; }
@keyframes sem-stamp {
  from { opacity: 0; transform: rotate(-8deg) scale(1.35); }
  to { opacity: .92; transform: rotate(-8deg) scale(1); }
}
@media (max-width: 560px) { .seal-ok { width: 46px; height: 46px; top: 8px; right: 10px; } }

/* ---------- 머리글 ---------- */
#site-header { min-height: var(--hdr); }
html:has(#hero-search) { --hdr: 96px; }
@media (max-width: 559.98px) { :root { --hdr: 162px; } html:has(#hero-search) { --hdr: 76px; } }
@media (max-width: 719.98px) { .site-header { position: relative; } }
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40;
  background: var(--paper);
}
.site-header .bar { display: flex; align-items: center; gap: 10px 14px; min-height: 96px; flex-wrap: wrap; }
/* 로고 묶음: 왼쪽 도장 + 오른쪽 두 줄(사이트 이름, 소개 문구) */
.logo {
  display: inline-flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink);
  flex-shrink: 0; padding-block: 14px;
}
.logo .seal { width: 64px; height: 64px; flex: none; }
.logo .wm-stack { display: grid; gap: 7px; }
.logo .wm { font-family: var(--font-display); font-weight: 900; font-size: 30px; letter-spacing: -.035em; line-height: 1; white-space: nowrap; }
.logo .wm-tag { font-family: var(--font-body); font-weight: 600; font-size: 13.5px; letter-spacing: .01em; color: var(--muted); line-height: 1.2; white-space: nowrap; }
.logo .wm-short { display: none; }
@media (max-width: 559.98px) {
  .site-header .bar { min-height: 76px; gap: 8px 10px; }
  .site-header .logo { gap: 11px; padding-block: 12px; }
  .site-header .logo .seal { width: 50px; height: 50px; }
  .site-header .logo .wm-stack { gap: 5px; }
  .site-header .logo .wm { font-size: 20px; }
  .site-header .logo .wm-tag { font-size: 11px; letter-spacing: 0; }
}
@media (max-width: 359.98px) { .site-header .logo .wm-tag { display: none; } }
/* 검색창: 로고 줄 아래 두 번째 줄 전체 폭 */
.hs-row { order: 20; flex: 1 0 100%; padding-bottom: 14px; display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
.hs-ask { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; cursor: text; }
.hs-row .hs { flex: 1 1 320px; max-width: none; margin: 0; }
.hs-row .hs-box { height: 44px; }
.hero-ask { margin: 0 0 10px; }
.hero-ask label { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; color: var(--ink); cursor: text; }
@media (max-width: 559.98px) {
  .hs-ask { font-size: 17px; }
  .hs-row { padding-bottom: 12px; }
  .hero-ask label { font-size: 19px; }
}
.sem-home .site-header .bar { padding-bottom: 0; }
.bar-gap { flex: 1 1 0; min-width: 0; }
.top-links { display: none; align-items: center; gap: 4px; }
.top-links a {
  display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap;
  padding: 8px 10px; font-size: 14.5px; font-weight: 600; color: var(--muted);
}
.top-links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.top-links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
.hd-tools { display: flex; align-items: center; gap: 6px; }
.icon-btn, .theme-btn {
  flex-shrink: 0; border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  width: 40px; height: 40px; border-radius: 1px; cursor: pointer; display: inline-grid; place-items: center; padding: 0;
}
.icon-btn:hover, .theme-btn:hover { border-color: var(--ink); }
.theme-btn svg { width: 18px; height: 18px; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 12px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  border-radius: 1px; font: 600 14.5px var(--font-body); cursor: pointer; white-space: nowrap;
}
.menu-btn:hover { background: var(--surface); }
.menu-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
.hs-toggle[aria-expanded="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* 머리글 검색: 항상 두 번째 줄에 보이므로 열기 버튼은 쓰지 않습니다 */
.hs-toggle { display: none !important; }
@media (min-width: 720px) { .top-links { display: flex; } }
@media (max-width: 719.98px) {
  .menu-btn { width: 40px; padding: 0; justify-content: center; }
  .menu-btn .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- 검색 (머리글·메인 공용) ---------- */
.hs { position: relative; min-width: 0; }
.hs-box {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 1px; background: var(--surface); color: var(--muted);
}
.hs-box:focus-within { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.hs-q {
  flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink);
  font: 400 16px/1.2 var(--font-body); padding: 0; outline: none; -webkit-appearance: none; appearance: none;
}
.hs-q::placeholder { color: var(--muted); opacity: 1; }
.hs-q::-webkit-search-decoration { -webkit-appearance: none; }
.hs-q::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 14px; height: 14px; cursor: pointer;
  background: linear-gradient(45deg, transparent 44%, var(--muted) 44%, var(--muted) 56%, transparent 56%), linear-gradient(-45deg, transparent 44%, var(--muted) 44%, var(--muted) 56%, transparent 56%);
}
.hs-kbd {
  font: 600 11px/1 var(--font-num); color: var(--muted); border: 1px solid var(--line-strong);
  padding: 3px 5px; flex: none;
}
.hs-box:focus-within .hs-kbd { display: none; }
@media (hover: none) { .hs-kbd { display: none; } }
.hs-list {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 45;
  width: 100%; list-style: none; margin: 0; padding: 4px 0;
  background: var(--surface); border: 1px solid var(--ink);
  max-height: min(440px, 70vh); overflow-y: auto; overscroll-behavior: contain;
}
.site-header .hs-list { width: max(100%, min(440px, calc(100vw - 32px))); }
.hs-list li { margin: 0; }
.hs-list li + li[role="option"] a { border-top: 1px dotted var(--line-strong); }
.hs-list a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  text-decoration: none; color: var(--ink); min-width: 0;
}
.hs-list li[aria-selected="true"] a, .hs-list a:hover { background: var(--surface-2); }
.hs-t { display: grid; min-width: 0; flex: 1; gap: 1px; }
.hs-t b { font-size: 15px; font-weight: 600; line-height: 1.35; }
.hs-t span { font-size: 13px; color: var(--muted); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-cat { font-size: 12px; color: var(--muted); white-space: nowrap; flex: none; }
@media (max-width: 480px) { .hs-cat { display: none; } }
.hs-list mark { background: var(--accent-soft); color: inherit; padding: 0 1px; }
.hs-none { padding: 14px 12px; font-size: 14px; color: var(--muted); }
.hs-foot { padding: 8px 12px 4px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 4px; }
@media (hover: none) { .hs-foot { display: none; } }

/* 메인 검색: 넓은 칸 + "찾기" 버튼 */
.hs.big .hs-box { height: 58px; padding: 0 6px 0 16px; gap: 12px; border-color: var(--ink); }
.hs.big .hs-box:focus-within { box-shadow: inset 0 0 0 1px var(--ink); }
.hs.big .hs-q { font-size: 18px; }
.hs-go {
  flex: none; height: 44px; padding: 0 20px; border: 0; border-radius: 1px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font: 800 15px/1 var(--font-body); letter-spacing: .02em;
}
.hs-go:hover { filter: brightness(.92); }
@media (max-width: 480px) { .hs.big .hs-box { height: 54px; padding-left: 12px; } .hs.big .hs-q { font-size: 16px; } .hs-go { height: 42px; padding: 0 14px; } }

/* ---------- 전체 메뉴 ---------- */
.mega {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 42;
  background: var(--surface); border-bottom: 2px solid var(--ink);
  max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain;
}
.mega-in { padding-block: 20px 28px; display: grid; gap: 18px; }
.mega-head { display: flex; align-items: baseline; gap: 10px; }
.mega-head b { font-family: var(--font-display); font-weight: 700; font-size: 21px; }
.mega-head .cnt { font: 600 13px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; }
.mega-head .icon-btn { margin-left: auto; align-self: center; }
.mega-quick { display: flex; flex-wrap: wrap; gap: 4px 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.mega-quick a { font-size: 14.5px; font-weight: 600; color: var(--ink); text-decoration: none; padding: 4px 0; }
.mega-quick a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.mega-grid { columns: 4 220px; column-gap: 36px; }
.mega-cat { break-inside: avoid; display: grid; gap: 2px; padding-bottom: 22px; }
.mega-cat-h {
  display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; font-size: 15px;
  padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line);
}
.mega-cat-h small { font: 600 12px var(--font-num); color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.mega-cat-h:hover span { color: var(--accent); }
.mega-cat ul { list-style: none; margin: 0; padding: 0 0 0 31px; display: grid; }
.mega-cat li a { display: block; padding: 3px 0; font-size: 14px; color: var(--muted); text-decoration: none; line-height: 1.5; }
.mega-cat li a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 719.98px) {
  .mega {
    position: fixed; inset: 0; z-index: 60; max-height: none; height: 100%; border: 0;
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .mega-in { padding-top: 0; }
  .mega-head { position: sticky; top: 0; z-index: 1; background: var(--surface); min-height: 60px; align-items: center; border-bottom: 1px solid var(--line-strong); margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .mega-grid { columns: 1; }
  .mega-cat { padding-bottom: 18px; }
  .mega-cat ul { padding-left: 0; grid-template-columns: 1fr 1fr; column-gap: 14px; }
  .mega-cat li a { padding: 7px 0; font-size: 14.5px; }
}

/* ---------- 본문 2단 ---------- */
.page { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 36px; padding-block: 28px 64px; align-items: start; }
.main { display: grid; gap: 28px; min-width: 0; }
.side { display: grid; gap: 28px; min-width: 0; align-content: start; }
@media (max-width: 960px) {
  .page { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px 32px; align-items: start; }
}

/* 서류 한 장 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 0; }

/* ---------- 계산기 서류 ---------- */
.calc { padding: 32px 36px 36px; display: grid; gap: 24px; min-width: 0; }
@media (max-width: 560px) { .calc { padding: 22px 16px 26px; gap: 22px; } }
.calc-head { display: grid; gap: 10px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.calc-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.calc-title h1 { flex: 1 1 260px; min-width: 0; }
.calc h1 { font-family: var(--font-display); font-size: clamp(26px, 3.3vw, 34px); font-weight: 900; letter-spacing: -.03em; line-height: 1.25; }
/* 제목 뒤 "2026" 같은 연도 표시: 한 단어만 색칠하지 않고 판(版) 표시처럼 작게 */
.calc h1 > span[style] { color: var(--muted) !important; font-weight: 700; font-size: .62em; letter-spacing: 0; margin-left: .15em; vertical-align: .12em; }
.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; font-size: 13px; color: var(--muted); min-height: 22px; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.crumb .sep { color: var(--icon-dim); }
.crumb-cat { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink); }
.lede { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; max-width: 46em; }

/* 내 계산기 고정(책갈피) */
.fav-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; flex: none;
  border: 0; border-radius: 1px; background: transparent; color: var(--icon-dim); cursor: pointer;
}
.fav-btn:hover { color: var(--ink); }
.fav-btn[aria-pressed="true"], .fav-btn[aria-pressed="true"]:hover { color: var(--accent); }
.fav-btn[aria-pressed="true"] .ic-star path { fill: currentColor; }
.fav-btn.full {
  display: inline-flex; align-items: center; gap: 6px; width: auto; height: 34px; padding: 0 12px 0 9px; margin-top: 2px;
  border: 1px solid var(--line-strong); color: var(--muted);
  font: 600 13.5px var(--font-body); white-space: nowrap;
}
.fav-btn.full:hover { color: var(--ink); border-color: var(--ink); }
.fav-btn.full[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
/* 제목 옆 버튼이 나중에 붙어도 제목 줄 높이가 늘지 않게(레이아웃 이동 방지) */
.calc-title .fav-btn.full { margin-block: 0 -4px; }
@media (max-width: 560px) {
  .calc-title { flex-wrap: nowrap; }
  .calc-title h1 { flex: 1 1 0; }
  .calc-title .fav-btn.full { width: 34px; padding: 0; justify-content: center; }
  .calc-title .fav-btn.full .fav-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- 입력 ---------- */
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 20px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field > .label { font-size: 14px; font-weight: 600; }
.field .sub { font-weight: 400; color: var(--muted); }
.inp {
  display: flex; align-items: stretch; min-height: 46px; border: 1px solid var(--line-strong); border-radius: 0;
  background: var(--surface); overflow: hidden; min-width: 0; transition: border-color .12s, box-shadow .12s;
}
.inp:hover { border-color: var(--muted); }
.inp:focus-within { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.inp input, .inp select {
  flex: 1; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--ink);
  font: 600 17px/1.2 var(--font-num); padding: 11px 12px; outline: none;
  font-variant-numeric: tabular-nums;
}
.inp select { font-family: var(--font-body); font-weight: 400; font-size: 16px; cursor: pointer; }
.inp select option { background: var(--surface); color: var(--ink); }
.inp input[type="date"], .inp input[type="time"] { font-family: var(--font-body); font-size: 16px; }
.inp .unit { display: flex; align-items: center; padding: 0 12px 0 2px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.hint { font-size: 13px; color: var(--muted); min-height: 1.2em; font-variant-numeric: tabular-nums; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* 세그먼트: 괘선으로 나눈 선택 칸, 고른 칸은 먹색 */
.seg { display: inline-flex; flex-wrap: wrap; gap: 0; padding: 0; background: var(--surface); border: 1px solid var(--line-strong); max-width: 100%; justify-self: start; }
.seg button {
  border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 14px var(--font-body);
  padding: 8px 15px; cursor: pointer; min-height: 40px; margin: 0; box-shadow: 0 1px 0 var(--line-strong);
}
.seg button:first-child { border-left: 0; }
.seg button:hover { color: var(--ink); background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-left-color: var(--ink); }
.seg button[aria-pressed="true"] + button { border-left-color: var(--ink); }
.seg.full { display: flex; justify-self: stretch; }
.seg.full button { flex: 1; }

.btn {
  border: 1px solid var(--muted); background: var(--surface); color: var(--ink);
  font: 600 14px var(--font-body); padding: 9px 16px; border-radius: 1px; cursor: pointer; min-height: 40px;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(.92); background: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 결과 명세서 ----------
   첫 .main-ro = 명세 제목 + 큰 함렛 숫자 + 합계 이중선. 나머지 .ro = 점선 명세 행(항목 ··· 금액). */
.readout {
  position: relative; background: var(--lcd); color: var(--lcd-ink);
  border: 1px solid var(--lcd-edge); border-radius: 0;
  padding: 26px 28px 16px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; align-items: start;
}
.readout > * { grid-column: 1 / -1; }
.readout:not(.has-seal) > .main-ro:has(+ .main-ro), .readout:not(.has-seal) > .main-ro + .main-ro { grid-column: auto; }
@media (max-width: 560px) {
  .readout { padding: 20px 16px 12px; grid-template-columns: minmax(0, 1fr); }
  .readout:not(.has-seal) > .main-ro:has(+ .main-ro), .readout:not(.has-seal) > .main-ro + .main-ro { grid-column: 1 / -1; }
}
.ro {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px;
  min-width: 0; padding: 10px 0; border-bottom: 1px dotted var(--lcd-edge);
}
.ro .k { flex: 1 1 auto; min-width: 0; font-size: 15px; color: var(--lcd-ink); }
.ro .v {
  flex: 0 1 auto; margin-left: auto; text-align: right; min-width: 0;
  font: 800 16.5px/1.4 var(--font-num); font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.ro .s { flex: 1 1 100%; text-align: right; font-size: 13px; color: var(--lcd-dim); font-variant-numeric: tabular-nums; line-height: 1.5; }
.ro .s:empty { display: none; }
.ro > .gauge-wrap { flex: 1 1 100%; margin: 4px 0 2px; }
/* 넓은 화면: 항목 | 적요(보조 설명) | 금액 을 한 줄에 */
@media (min-width: 561px) {
  .ro:not(.main-ro) {
    display: grid; grid-template-columns: minmax(7em, 1fr) minmax(0, max-content) max-content;
    column-gap: 20px; row-gap: 2px;
  }
  .ro:not(.main-ro) > .k { grid-column: 1; grid-row: 1; }
  .ro:not(.main-ro) > .s { grid-column: 2; grid-row: 1; text-align: right; max-width: 24em; }
  .ro:not(.main-ro) > .v { grid-column: 3; grid-row: 1; margin-left: 0; }
  .ro:not(.main-ro) > .gauge-wrap { grid-column: 1 / -1; }
}
/* 명세 제목과 합계 */
.ro.main-ro { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 0; padding: 0 0 14px; border-bottom: 0; align-content: start; }
.ro.main-ro .k { font: 700 18px/1.4 var(--font-display); color: var(--lcd-ink); letter-spacing: -.01em; }
.ro.main-ro .v {
  margin: 10px 0 0; text-align: left;
  font: 900 clamp(32px, 4.6vw, 48px)/1.12 var(--font-display); letter-spacing: -.025em;
  padding-bottom: 10px; border-bottom: 3px double var(--lcd-ink);
}
.ro.main-ro .s { text-align: left; font-size: 13.5px; margin-top: 8px; }
.readout.has-seal > .seal-ok + .main-ro .k { padding-right: 74px; }
.readout.has-seal > .main-ro + .main-ro { padding-top: 12px; }
@media (max-width: 560px) { .readout.has-seal > .seal-ok + .main-ro .k { padding-right: 52px; } }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.note { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.65; }
.alert {
  font-size: 14px; padding: 10px 14px 10px 34px; position: relative; margin: 0;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink); line-height: 1.6;
}
.alert::before { content: "※"; position: absolute; left: 13px; top: 10px; color: var(--accent); font-weight: 800; }

/* ---------- 표 (장부식: 위 먹선, 머리 아래 먹선, 합계 위 먹선과 아래 이중선) ---------- */
.tbl-wrap { overflow: auto; max-height: 460px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 4px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 4px; }
.tbl thead th { position: sticky; top: 0; background: var(--surface); font-weight: 600; font-size: 13px; color: var(--muted); z-index: 1; border-bottom: 0; box-shadow: inset 0 -1px 0 var(--ink); }
.tbl td { font-family: var(--font-num); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tfoot td { font-weight: 800; background: var(--surface); border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
.tbl-wrap:has(tfoot) { border-bottom: 0; }
/* 가로로 넘치는 표: 좌우 끝에 옅은 그늘로 옆으로 밀어 볼 수 있음을 알립니다(스크롤 끝에서는 사라짐) */
.tbl-wrap, .prose .tbl-scroll {
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(30, 30, 30, .16), rgba(30, 30, 30, 0)) left center / 10px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(30, 30, 30, .16), rgba(30, 30, 30, 0)) right center / 10px 100% no-repeat scroll;
  background-color: var(--surface);
  -webkit-overflow-scrolling: touch;
}
/* 휴대폰: 글자·여백을 줄이고 첫 열(항목 이름)만 줄바꿈을 허용, 숫자 열은 한 줄 유지.
   페이지 안 <style> 의 #id 규칙이 더 구체적이므로 그대로 우선 적용됩니다. */
@media (max-width: 560px) {
  table.tbl { font-size: 13px; }
  .tbl th, .tbl td { padding: 8px 6px; }
  .tbl th:first-child, .tbl td:first-child { white-space: normal; word-break: keep-all; overflow-wrap: normal; min-width: 4.5em; padding-left: 2px; }
  .tbl thead th { white-space: normal; word-break: keep-all; overflow-wrap: normal; }
  .prose table { font-size: 13.5px; }
  .prose th, .prose td { padding: 8px 6px; }
}
.section-title {
  font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -.01em;
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap;
}
.section-title > * { font-family: var(--font-body); }
.block { display: grid; gap: 12px; min-width: 0; }

/* ---------- 차트 ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 11px var(--font-num); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 14px; height: 8px; display: inline-block; }

/* ---------- 해설·정보 글 (prose) ---------- */
.prose { padding: 40px clamp(18px, 5vw, 52px) 48px; min-width: 0; font-size: 16.5px; line-height: 1.85; }
.prose > * { margin: 0; max-width: var(--measure); }
.prose > * + * { margin-top: 1em; }
.prose h1 { font-family: var(--font-display); font-size: clamp(27px, 3.6vw, 36px); font-weight: 900; letter-spacing: -.03em; line-height: 1.28; }
.prose > h2 {
  font-family: var(--font-display); font-size: clamp(21px, 2.4vw, 24px); font-weight: 700; letter-spacing: -.02em; line-height: 1.4;
  margin-top: 2.4em; padding-bottom: .5em; border-bottom: 1px solid var(--line);
}
.prose > h2:first-child { margin-top: 0; }
.prose > h3 { font-size: 17.5px; font-weight: 800; line-height: 1.5; margin-top: 1.9em; letter-spacing: -.01em; }
.prose > h2 + *, .prose > h3 + * { margin-top: .7em; }
.prose > h2 + h3 { margin-top: 1.3em; }
/* 자주 묻는 질문: 서류 문답처럼 "문." */
.prose h3.q { position: relative; padding-left: 1.9em; }
.prose h3.q::before { content: "문."; position: absolute; left: 0; top: -.07em; font-family: var(--font-display); font-weight: 900; color: var(--accent); }
.prose h3.q + p { padding-left: 1.9em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--muted); }
.prose ol > li::marker { font-weight: 600; font-size: .92em; }
.prose a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose .crumb a { color: inherit; text-decoration: none; }
.prose .crumb a:hover { color: var(--ink); text-decoration: underline; }
.prose b, .prose strong { font-weight: 800; }
.prose > .note { font-size: 13.5px; line-height: 1.7; }
.prose > .alert { font-size: 15px; line-height: 1.7; }
.prose .formula {
  font-family: var(--font-num); font-weight: 600; font-size: 15px; line-height: 1.8; color: var(--ink); font-variant-numeric: tabular-nums;
  background: var(--surface-2); border: 1px solid var(--line);
  padding: 14px 18px; overflow-x: auto; white-space: pre; max-width: 100%;
}
.prose > .formula, .prose > .tbl-scroll, .prose > .tbl-wrap, .prose > .readout, .prose > table { max-width: 100%; }
.prose > .formula { max-width: var(--measure); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.55; font-variant-numeric: tabular-nums; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.prose th:first-child, .prose td:first-child { padding-left: 4px; }
.prose thead th, .prose tr > th:only-child { background: transparent; font-weight: 600; font-size: 13.5px; color: var(--muted); border-bottom: 1px solid var(--ink); }
.prose tbody th { font-weight: 800; }
.prose .tbl-scroll { overflow-x: auto; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.prose .tbl-scroll table { min-width: 100%; }
.prose .tbl-scroll tr:last-child td, .prose .tbl-scroll tr:last-child th { border-bottom: 0; }
.prose .tbl-scroll caption { caption-side: bottom; text-align: left; padding: 8px 4px; font-size: 13px; color: var(--muted); }
.article-head { display: grid; gap: 12px; padding-bottom: 26px; border-bottom: 1px solid var(--ink); max-width: none; }
.article-head > * { margin: 0; }
.article-head .lede { font-size: 17px; line-height: 1.75; max-width: var(--measure); color: var(--muted); }
.article-head .note { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prose > .article-head + * { margin-top: 2em; }
@media (max-width: 560px) { .prose { font-size: 16px; line-height: 1.8; padding: 26px 16px 34px; } }

/* ---------- 부록 (사이드바): 카드 대신 먹선 아래 목록 ---------- */
.side-box.card { background: transparent; border: 0; }
.side-box { padding: 0; display: grid; gap: 4px; align-content: start; min-width: 0; border-top: 2px solid var(--ink); }
.side-box h2 { font-size: 14px; color: var(--ink); font-weight: 800; padding-top: 10px; display: flex; align-items: center; gap: 8px; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; }
.side-list a { display: flex; align-items: center; gap: 9px; padding: 9px 0; text-decoration: none; border-bottom: 1px dotted var(--line-strong); font-size: 14.5px; line-height: 1.45; }
.side-list li:last-child a { border-bottom: 0; }
.side-list .t { flex: 1; min-width: 0; }
.side-list .chev { color: var(--icon-dim); }
.side-list a:hover { color: var(--link); }
.side-list a:hover .chev { color: var(--accent); }
.side-list a[aria-current="page"] { color: var(--link); font-weight: 800; }
.side-more { font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 4px 0 8px; }
.side-more:hover { color: var(--ink); }

/* ---------- 광고 자리 ----------
   광고는 위아래로 넉넉히 띄워 버튼·결과와 붙지 않게 합니다(잘못 누름 방지). 위에 작은 '광고' 표시를 둡니다. */
.ad-slot:empty { display: none; }
.ad-slot { margin-block: 12px; min-width: 0; position: relative; }
.ad-slot.ad-on::before { content: '광고'; display: block; font-size: 11px; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.ad-slot.placeholder {
  min-height: 120px; border: 1px dashed var(--line-strong); background: var(--surface);
  display: grid; place-content: center; gap: 4px; color: var(--muted); font-size: 13px; text-align: center; padding: 14px;
}
.ad-slot.placeholder b { color: var(--ink); font-size: 14px; }
.side .ad-slot.placeholder { min-height: 250px; }
.ad-slot.placeholder[data-slot="in-article"], .ad-slot.placeholder[data-slot="mid"] { min-height: 250px; }
.prose .ad-mid { margin-block: 28px; }
/* 슬롯 ID 광고: 광고가 늦게 채워질 때의 레이아웃 이동(CLS)을 줄이려고 자리를 미리 잡습니다 */
.ad-slot.ad-on { min-height: 120px; }
.ad-slot.ad-on[data-slot="in-article"], .ad-slot.ad-on[data-slot="mid"] { min-height: 280px; }
.side .ad-slot.ad-on { min-height: 250px; }
@media (min-width: 1024px) { .side .ad-stick { position: sticky; top: calc(var(--hdr, 96px) + 16px); } }

/* ---------- 언어 선택 ---------- */
.lang { position: relative; }
.lang > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 1px; cursor: pointer; color: var(--ink);
  font: 700 13px var(--font-body); letter-spacing: .04em; user-select: none;
}
.lang > summary::-webkit-details-marker { display: none; }
.lang > summary:hover, .lang[open] > summary { border-color: var(--ink); }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 168px; margin: 0; padding: 6px 0; list-style: none;
  background: var(--paper); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--line);
}
.lang-menu a, .lang-menu .lg-off { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 14.5px; text-decoration: none; color: var(--ink); }
.lang-menu a:hover { background: var(--surface); }
.lang-menu a[aria-current] { font-weight: 800; }
.lang-menu .lg-chk { color: var(--accent); }
.lang-menu .lg-off { color: var(--muted); cursor: default; }
.lang-menu .lg-off small { font-size: 11.5px; border: 1px solid var(--line-strong); padding: 1px 6px; }
.theme-btn-m { display: none; }
.mega-head .theme-btn-m { margin-left: auto; align-self: center; }

@media (max-width: 719.98px) {
  .lang > summary { padding: 0 9px; }
  .lang > summary svg { display: none; }
  .hd-tools > .theme-btn { display: none; }
  .site-header .bar-gap { display: none; }
  .site-header .hd-tools { margin-left: auto; }
  .site-header .bar { column-gap: 8px; }
  .theme-btn-m { display: inline-grid; }
  .mega-head .theme-btn-m + .icon-btn { margin-left: 6px; }
}

/* ---------- 메인: 책의 목차처럼 ---------- */
.home { display: grid; gap: 56px; padding-block: 8px 72px; }
.home-hero {
  padding-block: 40px 44px; display: grid; gap: 40px 64px; align-items: start;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); border-bottom: 1px solid var(--line-strong);
}
.hero-text { display: grid; gap: 18px; min-width: 0; align-content: start; }
.home-hero h1 { font-family: var(--font-display); font-size: clamp(30px, 4.4vw, 46px); letter-spacing: -.035em; font-weight: 900; line-height: 1.2; }
.home-hero h1 em { font-style: normal; }
.home-hero p { margin: 0; color: var(--muted); max-width: 34em; font-size: 16.5px; line-height: 1.75; }
.hero-meta { font: 600 13.5px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; }
.home-hero .hero-meta { font-size: 13.5px; }
.hero-quick { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; font-size: 14.5px; color: var(--muted); }
.hero-quick > span:first-child { font-weight: 600; margin-right: 12px; color: var(--ink); }
.hero-quick a { text-decoration: none; color: var(--ink); }
.hero-quick a:not(:last-child)::after { content: "·"; color: var(--icon-dim); padding: 0 9px; display: inline-block; }
.hero-quick a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.search { max-width: 540px; }
@media (max-width: 860px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); padding-block: 28px 32px; }
}

/* 분야 목차 (히어로 오른쪽): 서류 한 장 위의 색인 */
.cat-index { background: var(--surface); border: 1px solid var(--line); padding: 22px 24px 14px; display: grid; gap: 6px; min-width: 0; }
.cat-index h2 { font-family: var(--font-display); font-weight: 700; font-size: 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.cat-index h2 small { font: 600 13px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; }
.cat-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.cat-card {
  display: flex; align-items: center; gap: 10px; padding: 7px 0; min-width: 0;
  text-decoration: none; color: var(--ink); font-size: 15px;
}
.cat-card b { font-weight: 600; white-space: nowrap; }
.cat-card::after { content: ""; flex: 1 1 auto; min-width: 16px; order: 2; border-bottom: 1px dotted var(--icon-dim); align-self: flex-end; margin-bottom: 9px; }
.cat-card small { order: 3; font: 600 14px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: right; }
.cat-card:hover b { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 560px) {
  .cat-index { padding: 18px 16px 10px; }
  .cat-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; }
  .cat-card { font-size: 14.5px; gap: 8px; }
}

/* 섹션 머리 */
.home-sec { display: grid; gap: 16px; min-width: 0; scroll-margin-top: calc(var(--hdr) + 16px); }
.sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.sec-head h2 { font-family: var(--font-display); font-size: clamp(21px, 2.4vw, 24px); font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.sec-head h2:focus { outline: none; }
.sec-head h2:focus-visible { outline: 2px solid var(--focus); }
.sec-head .cnt { font: 600 13px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; }
.sec-note { margin: 0; font-size: 13px; color: var(--muted); }
.sec-head .push { margin-left: auto; }
.link-btn {
  border: 0; background: none; padding: 4px 0; color: var(--muted); font: 600 13px var(--font-body);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); }
.link-btn.armed { color: var(--up); }
.more-link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--link); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.more-link:hover { text-decoration-thickness: 2px; }

.mine-empty {
  display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px;
  border: 1px dashed var(--line-strong); background: transparent;
}
.mine-empty .ic { color: var(--accent); margin-top: 2px; }
.mine-empty p { margin: 0; font-size: 14.5px; color: var(--muted); }
.mine-empty b { color: var(--ink); font-weight: 800; display: block; margin-bottom: 2px; font-size: 15.5px; }
.sub-head { font-size: 14px; font-weight: 800; color: var(--ink); margin: 26px 0 8px; }

/* 메인 소개 (정적 텍스트) */
.home-about { padding: 36px clamp(18px, 4vw, 44px) 40px; }
.home-about > h2 { margin-top: 0; }
.home-about > h3 { margin-top: 1.5em; }
/* 스크립트가 그리기 전에도 검색창 자리를 잡아 레이아웃 이동을 줄입니다 */
#hero-search { min-height: 58px; }
@media (max-width: 480px) { #hero-search { min-height: 54px; } }

/* 분야별 목차: 분야 도장 + 함렛 이름, 계산기 이름 · 점선 리더 · 한 줄 설명 */
.cats { columns: 2 440px; column-gap: 64px; }
.cat { break-inside: avoid; display: block; padding-bottom: 40px; scroll-margin-top: calc(var(--hdr) + 16px); }
.cat h2 {
  font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.02em;
  display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--ink);
}
.cat h2 small { font: 400 13.5px var(--font-body); color: var(--muted); letter-spacing: 0; }
.cat h2 .cnt { font: 600 13px var(--font-num); color: var(--muted); margin-left: auto; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.cat ul { list-style: none; margin: 0; padding: 0; }
.cat li {
  display: flex; align-items: baseline; gap: 0; padding: 5px 0;
  font-size: 13.5px; color: var(--muted); line-height: 1.5; text-align: right;
}
.cat li > a { order: -1; flex: none; font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; text-align: left; white-space: nowrap; }
.cat li::before { content: ""; flex: 1 1 24px; min-width: 24px; margin: 0 10px; border-bottom: 1px dotted var(--icon-dim); position: relative; top: -4px; }
.cat li > a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 600px) {
  .cats { columns: 1; }
  .cat { padding-bottom: 32px; }
  .cat li { display: grid; gap: 1px; text-align: left; padding: 8px 0; border-bottom: 1px dotted var(--line-strong); }
  .cat li:last-child { border-bottom: 0; }
  .cat li::before { display: none; }
  .cat li > a { white-space: normal; }
  .cat h2 small { flex-basis: 100%; order: 3; }
}

/* 계산기 목록 행 (내 계산기 · 많이 찾는 계산기). 예전 타일 클래스 이름 유지 */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0 40px; }
.tile { position: relative; min-width: 0; border-bottom: 1px dotted var(--line-strong); }
.tile-a {
  display: flex; align-items: flex-start; gap: 11px; height: 100%;
  padding: 12px 40px 12px 0; text-decoration: none; color: var(--ink);
}
.tile-a .chip { margin-top: 1px; }
.tile-a:focus-visible { outline-offset: -2px; }
.tile-t { display: grid; gap: 1px; min-width: 0; }
.tile-t b { font-size: 15.5px; font-weight: 600; line-height: 1.4; }
.tile-t > span { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.tile-a:hover b { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.tile-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font: 600 12px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; }
.tile-meta .pin { color: var(--accent); font-family: var(--font-body); font-weight: 800; }
.tile .fav-btn { position: absolute; top: 8px; right: 0; }
.tiles.compact { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 0 32px; }
.tiles.compact .tile-a { align-items: center; padding: 9px 36px 9px 0; }
.tiles.compact .tile-t b { font-size: 15px; }
.tiles.compact .tile-t > span { display: none; }
.tiles.compact .fav-btn { top: 50%; margin-top: -16px; }

/* 정보 글 · 대출금리 */
.home-duo { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: start; }
@media (max-width: 860px) { .home-duo { grid-template-columns: minmax(0, 1fr); gap: 48px; } }
.rates-card { display: grid; gap: 14px; }
.rates-card.card { background: transparent; border: 0; padding: 0; }
.rates-card .readout { padding: 22px 24px 12px; }
.rates-card .ro.main-ro .v { font-size: clamp(32px, 4vw, 42px); }
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; }
.guide-list li { border-bottom: 1px dotted var(--line-strong); }
.guide-list a {
  display: grid; gap: 2px; padding: 11px 0;
  text-decoration: none; color: var(--ink); font-size: 15.5px; font-weight: 600; line-height: 1.5;
}
.guide-list a .ic { display: none; }
.guide-list a small { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
.guide-list a:hover > span, .guide-list a:hover { color: var(--accent); }
.guide-list a:hover small { color: var(--muted); }
.empty { color: var(--muted); padding-block: 24px; margin: 0; }

/* 사이트 소개: 기본 정보 표, 로고 묶음 */
.info-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0; }
.info-list dt, .info-list dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.info-list dt { font-weight: 600; color: var(--muted); padding-right: 28px; }
.brand-lockup { display: flex; align-items: center; gap: 18px; padding: 6px 0 4px; }
.brand-lockup .seal { width: 72px; height: 72px; }
.brand-lockup .wm { font-family: var(--font-display); font-weight: 900; font-size: clamp(26px, 4vw, 38px); letter-spacing: -.035em; line-height: 1; }
.brand-lockup small { display: block; font: 600 11.5px var(--font-body); letter-spacing: .28em; color: var(--muted); margin-top: 10px; }
@media (max-width: 480px) { .brand-lockup { gap: 14px; } .brand-lockup .seal { width: 56px; height: 56px; } .brand-lockup small { letter-spacing: .16em; } }

/* 정보 글 목록 페이지 */
.guide-index > h3 a { color: var(--ink); text-decoration: none; }
.guide-index > h3 a:hover { color: var(--accent); text-decoration: underline; }
.guide-index > h3 + p { color: var(--ink); }
.guide-index > p.note { margin-top: .35em; }

/* ---------- 바닥글: 책의 판권면처럼 ---------- */
.site-footer { border-top: 1px solid var(--line-strong); background: var(--paper); }
.foot { padding-block: 36px 40px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) minmax(0, 1fr); gap: 28px 48px; font-size: 13.5px; color: var(--muted); }
@media (max-width: 860px) { .foot { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .foot-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .foot { grid-template-columns: minmax(0, 1fr); } }
.foot-brand { display: grid; gap: 10px; align-content: start; }
.foot-brand .logo .seal { width: 32px; height: 32px; }
.foot-brand .logo .wm { font-size: 18px; }
.foot-brand p { margin: 0; max-width: 40ch; line-height: 1.65; }
.foot h2 { font-size: 13px; font-weight: 800; color: var(--ink); padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot-cats ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot .copy { font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- 알림 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 70;
  transform: translate(-50%, 10px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 1px;
  font-size: 14px; font-weight: 600; max-width: calc(100vw - 32px); width: max-content;
  transition: opacity .2s, transform .2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 계산기 전용 부품 ---------- */
.rows { display: grid; gap: 10px; }
.row-line { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.row-line .idx { font: 800 14px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; }
.row-line .del { border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); border-radius: 0; height: 46px; cursor: pointer; font-size: 18px; }
.row-line .del:hover { color: var(--up); border-color: var(--up); }
.row-head { font-size: 13px; color: var(--muted); font-weight: 600; }
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.mini { display: grid; gap: 12px; padding: 20px; border: 1px solid var(--line-strong); align-content: start; min-width: 0; background: var(--surface); }
.mini h2 { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.01em; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.mini .eq { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 15px; }
.mini .eq .inp { width: 140px; flex: 0 1 140px; }
@media (max-width: 560px) { .mini { padding: 16px; } .mini .eq .inp { width: auto; flex: 1 1 96px; } }
.mini .ans {
  justify-self: start; max-width: 100%;
  font: 900 26px/1.2 var(--font-display); letter-spacing: -.02em; color: var(--lcd-ink);
  padding-bottom: 6px; border-bottom: 3px double var(--lcd-ink); overflow-wrap: anywhere;
}
.gauge { height: 10px; display: flex; gap: 2px; overflow: hidden; }
.gauge i { display: block; height: 100%; }
.gauge-wrap { position: relative; padding-top: 22px; }
.gauge-pin { position: absolute; top: 0; transform: translateX(-50%); font: 800 12px var(--font-num); color: var(--lcd-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gauge-pin::after { content: ""; display: block; width: 2px; height: 18px; background: currentColor; margin: 1px auto 0; }
.gauge-labels { position: relative; height: 16px; font-size: 11px; color: var(--lcd-dim); margin-top: 4px; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.gauge-labels span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
/* 양 끝 눈금 글자가 게이지 밖으로 나가 잘리거나 줄바꿈되지 않게 끝에 맞춥니다 */
.gauge-labels span:first-child { transform: none; }
.gauge-labels span:last-child { transform: translateX(-100%); }

/* 배포 스크립트가 미리 채우는 하단 전체 목록 (검색 로봇용, 화면에서는 스크립트가 푸터로 교체) */
.seo-static { max-width: 1160px; margin: 0 auto; padding: 24px 16px 40px; font-size: 13px; line-height: 1.9; color: var(--muted); border-top: 1px solid var(--line-strong); }
.seo-static p { margin: 0 0 6px; }
.seo-static a { color: inherit; }

/* ---------- 선화 일러스트 (BI 색만 사용, 테마 자동 대응) ---------- */
.illus { margin: 0; }
.illus svg { display: block; width: 100%; height: auto; overflow: visible; }
.illus .il-ink { stroke: var(--ink); }
.illus .il-line { stroke: var(--line-strong); }
.illus .il-paper { fill: var(--surface); }
.illus .il-fill-ink { fill: var(--ink); }
.illus .il-mute { fill: var(--line-strong); }
.illus .il-seal-line { stroke: var(--accent); }
.illus .il-seal-fill { fill: var(--accent); }
.illus .il-screen { fill: var(--paper); }
.illus .il-keys rect { fill: var(--surface); opacity: .92; }
.illus .il-white { fill: #fff; }
.illus .il-white-line { stroke: #fff; }
.illus text { font-family: var(--font-display); font-weight: 900; }
.illus .il-title { font-size: 17px; font-weight: 700; fill: var(--ink); }
.illus .il-small { font-family: var(--font-body); font-size: 11px; font-weight: 800; fill: var(--ink); }
.illus .il-stamp { font-size: 12.5px; fill: var(--accent); text-anchor: middle; }
.illus .il-lcd { font-size: 21px; fill: var(--ink); text-anchor: end; letter-spacing: -.02em; }
.illus .il-op { font-family: var(--font-body); font-size: 17px; font-weight: 800; fill: var(--ink); text-anchor: middle; }
.illus .il-bill { font-family: var(--font-body); font-size: 18px; font-weight: 800; fill: var(--muted); }
.illus .il-env-title { font-size: 19px; fill: var(--ink); text-anchor: middle; letter-spacing: .02em; }
.illus .il-cell { font-family: var(--font-body); font-size: 10px; font-weight: 800; fill: var(--muted); text-anchor: middle; }
.illus .il-seal-txt { font-size: 15px; fill: #fff; text-anchor: middle; }
/* 메인 첫 화면: 소개 아래 책상 장면 */
.illus-hero { max-width: 500px; margin-top: 8px; }
/* 해설 본문 오른쪽 그림 */
.prose > .illus-side { float: right; width: 250px; margin: 0 0 18px 28px; }
.prose > .illus-side + h2 { margin-top: 0; overflow: hidden; }
.illus-side figcaption { margin-top: 10px; font-size: 13px; line-height: 1.6; color: var(--muted); text-align: center; text-wrap: balance; }
@media (max-width: 760px) {
  .prose > .illus-side { float: none; width: auto; max-width: 260px; margin: 0 auto 22px; }
  .illus-hero { max-width: 420px; }
}

/* ---------- 사진 (시험용) : 종이 서류에 붙인 사진처럼 얇은 테두리 ---------- */
.photo { margin: 0; }
.photo img { display: block; width: 100%; height: auto; object-fit: cover; border: 1px solid var(--line-strong); background: var(--surface); }
.photo figcaption { margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.photo figcaption span { display: block; font-size: 11.5px; opacity: .8; }
.photo-hero { max-width: 520px; margin-top: 8px; }
.photo-hero img { aspect-ratio: 16 / 10; padding: 8px; }
.prose > .photo-side { float: right; width: 260px; margin: 0 0 18px 28px; }
.prose > .photo-side + h2 { margin-top: 0; overflow: hidden; }
.photo-side img { aspect-ratio: 1 / 1; padding: 6px; }
@media (max-width: 760px) { .prose > .photo-side { float: none; width: auto; max-width: 300px; margin: 0 auto 22px; } }

/* ---------- 메인 첫 화면 v2: 왼쪽 이미지 + 오른쪽 소개·검색, 아래 분야별 목차 두 칸 ---------- */
.hero-v2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "img text" "search search" "cats cats"; column-gap: clamp(56px, 8vw, 120px); row-gap: 40px; align-items: stretch; }
.hero-v2 > .photo-hero { grid-area: img; max-width: none; margin: 0; }
.hero-v2 > .photo-hero img { height: 100%; min-height: 360px; aspect-ratio: auto; padding: 10px; }
.hero-v2 > .hero-text { grid-area: text; align-content: center; }
.hero-v2 > .cat-index { grid-area: cats; padding: 24px 28px 16px; }
.hero-v2 .cat-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: repeat(6, auto); grid-auto-flow: column; column-gap: 56px; }
@media (max-width: 860px) {
  /* 휴대폰: 검색을 첫 화면 맨 위에 둡니다 */
  .hero-v2 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "search" "img" "text" "cats"; row-gap: 28px; }
  .hero-v2 > .photo-hero img { min-height: 0; height: auto; aspect-ratio: 16 / 10; }
  .hero-v2 .cat-grid { column-gap: 20px; }
}

/* ---------- 메인 이미지 시험: A 콜라주(큰 1 + 작은 2), B 배너 띠 ---------- */
.hero-v2 > .collage { grid-area: img; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; min-height: 380px; }
.collage img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; border: 1px solid var(--line); }
.collage .c-big { grid-row: 1 / 3; }
@media (max-width: 860px) { .hero-v2 > .collage { min-height: 0; aspect-ratio: 16 / 10; } }
.banner-strip { display: grid; grid-template-columns: 2fr 1fr 1.25fr; gap: 10px; height: 260px; margin-top: 8px; }
.banner-strip img { display: block; width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--line); }
.banner-strip img:first-child { object-position: 50% 62%; }
@media (max-width: 720px) { .banner-strip { grid-template-columns: 1.4fr 1fr; height: 180px; } .banner-strip img:last-child { display: none; } }

.banner-wrap { padding-top: 8px; }

.banner-strip { overflow: hidden; }
.banner-strip img { height: 260px; }
@media (max-width: 720px) { .banner-strip img { height: 180px; } }

/* ---------- 검색 띠: 첫 화면 아래 전체 폭 (질문 | 검색창 / 많이 찾는 계산) ---------- */
.search-band {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "ask box" ". quick";
  align-items: center; gap: 14px 36px; margin-top: 8px; padding: 30px 36px;
  background: var(--surface); border: 1px solid var(--line);
}
.hero-v2 > .search-band { grid-area: search; margin-top: 0; }
.search-band .hero-ask { grid-area: ask; margin: 0; }
.search-band #hero-search { grid-area: box; min-width: 0; }
.search-band .hero-quick { grid-area: quick; margin: 0; }
@media (max-width: 860px) {
  .search-band { grid-template-columns: minmax(0, 1fr); grid-template-areas: "ask" "box" "quick"; gap: 12px; padding: 22px 18px; }
}
