/* ------------------------------------------------------------------
   집계산기 — 공통 스타일
   방향: 숫자가 주인공인 절제된 미니멀. 따뜻한 종이색 배경, 녹색 강조 하나.
   ------------------------------------------------------------------ */

:root {
  --bg: #f6f4ee;
  --bg-deep: #ece9e0;
  --surface: #ffffff;
  --surface-2: #faf9f5;
  --ink: #17191c;
  --ink-2: #4a4f57;
  --ink-3: #7b818b;
  --line: #e2dfd6;
  --line-2: #cfcbbf;
  --accent: #0e6b52;
  --accent-2: #0b5642;
  --accent-soft: #e4f1ec;
  --accent-ink: #ffffff;
  --warn-soft: #fbf1dc;
  --warn: #8a5a00;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 25, 28, .04), 0 8px 24px -12px rgba(23, 25, 28, .12);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121315;
    --bg-deep: #0c0d0f;
    --surface: #1b1d20;
    --surface-2: #202327;
    --ink: #eef0f2;
    --ink-2: #b6bbc3;
    --ink-3: #7f858f;
    --line: #2b2f35;
    --line-2: #3a3f47;
    --accent: #4fc39d;
    --accent-2: #6ad3b1;
    --accent-soft: #163a30;
    --accent-ink: #08160f;
    --warn-soft: #3a2d10;
    --warn: #e6b658;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
    --bg: #121315;
    --bg-deep: #0c0d0f;
    --surface: #1b1d20;
    --surface-2: #202327;
    --ink: #eef0f2;
    --ink-2: #b6bbc3;
    --ink-3: #7f858f;
    --line: #2b2f35;
    --line-2: #3a3f47;
    --accent: #4fc39d;
    --accent-2: #6ad3b1;
    --accent-soft: #163a30;
    --accent-ink: #08160f;
    --warn-soft: #3a2d10;
    --warn: #e6b658;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .5);
  }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: "tnum" 1;
  padding-bottom: 88px; /* 모바일 하단 요약 바 여유 */
}
@media (min-width: 900px) { body { padding-bottom: 40px; } }

/* 배경 분위기: 상단에 옅은 빛 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 15% -10%, rgba(14, 107, 82, .10), transparent 60%),
    radial-gradient(700px 360px at 95% 0%, rgba(14, 107, 82, .06), transparent 60%);
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

a { color: var(--accent); }
button { font: inherit; }

.container { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }

/* ---------- 좌우 광고 레일 ----------
   넓은 화면에서만 본문 양옆에 세로 슬롯을 띄운다.
   1280px 미만에서는 숨기고 본문 안 슬롯만 남긴다. */
.rail { display: none; }
@media (min-width: 1280px) {
  .page-shell {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 180px;
    gap: 28px;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: start;
  }
  .page-shell > .container { max-width: none; padding: 0; }
  .rail { display: block; position: sticky; top: 84px; }
  .rail .slot { padding: 30px 12px 14px; margin: 0; }
  .rail .ad-placeholder { min-height: 560px; font-size: 12.5px; text-align: center; padding: 0 6px; }
  .rail .slot-label { top: 10px; left: 10px; }
}
@media (min-width: 1500px) {
  .page-shell { grid-template-columns: 250px minmax(0, 1fr) 250px; max-width: 1500px; }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 12px; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { left: 16px; }

/* ---------- 헤더 / 내비 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: 56px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; letter-spacing: -.01em; text-decoration: none; color: var(--ink);
  white-space: nowrap;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--accent);
  position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px;
  border: 2px solid var(--accent-ink); border-radius: 3px; border-top-color: transparent;
  transform: rotate(45deg);
}
.tool-nav { margin: 0; padding: 0 0 8px; list-style: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tool-nav::-webkit-scrollbar { display: none; }
.tool-nav a {
  display: inline-block; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--ink-2); border: 1px solid transparent;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.tool-nav a:hover { background: var(--bg-deep); color: var(--ink); }
.tool-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; min-width: 36px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; flex: none;
}
/* 브랜드 이름이 길어 좁은 화면에서는 글자와 마크를 줄인다 */
@media (max-width: 420px) {
  .brand { font-size: 16px; gap: 6px; }
  .brand-mark { width: 19px; height: 19px; border-radius: 6px; }
  .brand-mark::after { left: 5px; top: 5px; width: 9px; height: 9px; border-width: 1.5px; }
  .icon-btn { padding: 0 8px; font-size: 13px; }
  .header-actions { gap: 4px; }
}
@media (max-width: 340px) {
  #menu-toggle .btn-label { display: none; }
}
.icon-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#theme-toggle .sun, #theme-toggle .moon { display: none; }
#theme-toggle[aria-pressed="true"] .sun { display: block; }
#theme-toggle[aria-pressed="false"] .moon { display: block; }
.menu-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: 0 16px 40px -20px rgba(0,0,0,.35);
  padding: 16px 0 20px;
}
.menu-panel[hidden] { display: none; }
.menu-groups { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .menu-groups { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
.menu-group h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.menu-group ul { list-style: none; margin: 0; padding: 0; }
.menu-group a { display: block; padding: 6px 0; color: var(--ink); text-decoration: none; font-size: 14.5px; font-weight: 600; }
.menu-group a:hover, .menu-group a[aria-current="page"] { color: var(--accent); }
.menu-group a small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12.5px; }
@media (min-width: 900px) {
  .header-row { height: 64px; }
  .tool-nav { padding: 0; }
  .site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .site-header nav { flex: 1; min-width: 0; }
}

/* ---------- 히어로 ---------- */
.hero { padding: 36px 0 12px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  color: var(--accent); text-transform: uppercase; margin: 0 0 10px;
}
.hero h1 {
  font-size: clamp(30px, 5.6vw, 44px); line-height: 1.12; letter-spacing: -.025em;
  margin: 0 0 10px; font-weight: 800;
}
.hero-sub { font-size: 18px; color: var(--ink-2); margin: 0 0 12px; letter-spacing: -.005em; }
.hero-body { margin: 0; color: var(--ink-2); max-width: 62ch; }
@media (min-width: 900px) { .hero { padding: 56px 0 20px; } }

/* ---------- 레이아웃 ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 20px; }
.layout > * { min-width: 0; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .layout > .col-sticky { position: sticky; top: 84px; }
}

/* ---------- 카드 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  animation: rise .4s var(--ease) backwards;
}
.card + .card { margin-top: 16px; }
.card:nth-child(2) { animation-delay: .04s; }
.card:nth-child(3) { animation-delay: .08s; }
.card:nth-child(n+4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }
@media (min-width: 720px) { .card { padding: 24px; } }

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card h2 { font-size: 18px; margin: 0; letter-spacing: -.01em; }
.card h3 { font-size: 16px; margin: 0 0 8px; letter-spacing: -.01em; }
.hint { color: var(--ink-3); font-size: 13.5px; margin: 0 0 14px; }
.unit { color: var(--ink-3); font-weight: 400; font-size: .88em; }
.muted { color: var(--ink-3); }

/* ---------- 폼 ---------- */
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 700; padding: 0; margin: 0 0 10px; font-size: 14px; color: var(--ink-2); letter-spacing: .02em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { margin-bottom: 12px; min-width: 0; }
.field label, .label-text { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.input-wrap { position: relative; }
.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%; font: inherit; font-size: 17px; font-weight: 600;
  padding: 12px 40px 12px 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink);
  text-align: right; font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
.field select { text-align: left; padding-right: 36px; font-weight: 500; }
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-wrap .suffix {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 13px; color: var(--ink-3); pointer-events: none;
}
.field-help { color: var(--ink-3); font-size: 12.5px; margin: 6px 0 0; }
.field input::placeholder { color: var(--ink-3); font-weight: 400; }

.segmented { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--bg-deep); border-radius: 12px; }
.seg-option { position: relative; min-width: 0; }
.seg-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg-option span {
  display: block; text-align: center; padding: 9px 6px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s;
  word-break: keep-all; overflow-wrap: break-word; min-width: 0;
}
@media (max-width: 400px) { .seg-option span { font-size: 13px; padding: 9px 4px; } }
.seg-option input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg-option input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip {
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 15px; padding: 12px 18px;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
  transition: transform .12s var(--ease), background .15s, border-color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); width: 100%; padding: 14px; font-size: 16px; }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-sm { padding: 8px 12px; font-size: 13px; }
.btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; border-color: var(--accent); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- 결과 ---------- */
.result-hero { padding: 22px 18px 18px; background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); }
.result-kicker { color: var(--ink-3); font-size: 13px; font-weight: 600; margin: 0; letter-spacing: .02em; }
.result-big {
  font-size: clamp(38px, 9vw, 52px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05;
  margin: 4px 0 14px; font-variant-numeric: tabular-nums; color: var(--ink);
}
.result-big .won, .result-mid .won { font-size: .5em; font-weight: 600; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.result-mid { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.result-note { color: var(--ink-3); font-size: 13px; margin: 8px 0 0; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stat { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid var(--line); }
.stat .k { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin: 0 0 2px; }
.stat .v { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: top; font-size: 15px; }
.tbl td, .tbl thead th:not(:first-child) { text-align: right; white-space: nowrap; }
.tbl th[scope="row"] { word-break: keep-all; }
.tbl.nowrap-head th[scope="row"] { white-space: nowrap; }
.tbl thead th { font-weight: 600; color: var(--ink-3); font-size: 13px; padding-top: 0; }
.tbl tr.total th, .tbl tr.total td { font-weight: 800; border-bottom: 0; padding-top: 12px; }
.tbl tr.sub th, .tbl tr.sub td { color: var(--ink-2); font-size: 14px; }
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
@media (min-width: 720px) { .table-wrap { margin: 0 -24px; padding: 0 24px; } }
.na { color: var(--ink-3); }

/* 분해 막대 */
.bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg-deep); margin: 12px 0 8px; }
.bar > span { display: block; height: 100%; transition: width .35s var(--ease); }
.bar .b1 { background: var(--accent); }
.bar .b2 { background: color-mix(in srgb, var(--accent) 65%, var(--surface)); }
.bar .b3 { background: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.bar .b4 { background: var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-3); margin: 0 0 4px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: 0; }

/* 차트 */
.chart { width: 100%; height: auto; display: block; margin-top: 8px; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: .10; }
.chart .label { font-size: 11px; fill: var(--ink-3); font-family: var(--font); }
.chart .dot { fill: var(--accent); }
.chart .end-label { font-size: 12px; font-weight: 700; fill: var(--ink); font-family: var(--font); }

/* ---------- 비교 (A/B) ---------- */
.ab-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* .field label 규칙(display:block)보다 우선하도록 선택자를 맞춤 */
.toggle, .field label.toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 0;
}
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .knob { display: block; width: 40px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.toggle .knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + .knob { background: var(--accent); }
.toggle input:checked + .knob::after { transform: translateX(16px); }
.toggle input:focus-visible + .knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.ab-body[hidden] { display: none; }

/* ---------- 슬롯 ---------- */
.slot { position: relative; padding-top: 34px; background: var(--surface-2); box-shadow: none; }
.slot-label {
  position: absolute; top: 12px; left: 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  padding: 2px 8px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--ink-3); background: var(--surface);
}
.slot-title { margin: 0 0 8px; font-weight: 700; font-size: 15px; }
.slot-links { margin: 0; padding-left: 18px; }
.slot-links li { margin: 4px 0; font-size: 14.5px; }
.slot-note { color: var(--ink-3); font-size: 12px; margin: 10px 0 0; }
.ad-placeholder {
  min-height: 96px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm); color: var(--ink-3); font-size: 13.5px;
}

/* ---------- 체크리스트 ---------- */
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { border-top: 1px solid var(--line); }
.check-list li:first-child { border-top: 0; }
.check-list label { display: flex; gap: 12px; padding: 12px 2px; cursor: pointer; align-items: flex-start; }
.check-list input { margin: 4px 0 0; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.check-list .t { font-weight: 600; font-size: 15px; }
.check-list .d { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
.check-list input:checked ~ div .t { color: var(--ink-3); text-decoration: line-through; }
.progress { height: 6px; background: var(--bg-deep); border-radius: 999px; overflow: hidden; margin: 6px 0 14px; }
.progress > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s var(--ease); }

.ref-list { list-style: none; margin: 0; padding: 0; }
.ref-list li { padding: 12px 0; border-top: 1px solid var(--line); }
.ref-list li:first-child { border-top: 0; padding-top: 0; }
.ref-list .t { font-weight: 700; font-size: 15px; margin: 0 0 2px; }
.ref-list .d { color: var(--ink-2); font-size: 14px; margin: 0 0 6px; }
.ref-list a { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.ref-list a:hover { text-decoration: underline; }

.callout { background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin: 0 0 16px; }

/* ---------- 모바일 하단 요약 바 ---------- */
.sticky-summary {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 40;
  background: var(--ink); color: var(--bg);
  border-radius: 14px; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
  transform: translateY(120%); transition: transform .3s var(--ease);
}
.sticky-summary.show { transform: none; }
.sticky-summary .k { font-size: 12px; opacity: .7; margin: 0; }
.sticky-summary .v { font-size: 20px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.sticky-summary a { color: inherit; font-size: 13px; font-weight: 700; text-decoration: none; padding: 8px 12px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; white-space: nowrap; }
@media (min-width: 900px) { .sticky-summary { display: none; } }

/* ---------- 푸터 ---------- */
.site-footer { margin-top: 40px; padding: 24px 0 24px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13.5px; }
.footer-links { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-links a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--ink); }
.disclaimer { margin: 0 0 4px; font-weight: 600; color: var(--ink-2); }
.privacy { margin: 0; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 16px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s var(--ease); max-width: calc(100% - 32px); z-index: 60;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; } }

/* 상환표 */
.schedule-wrap { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.schedule { font-size: 13.5px; }
.schedule th, .schedule td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.schedule thead th { position: sticky; top: 0; background: var(--surface-2); text-align: right; font-weight: 600; color: var(--ink-3); font-size: 12.5px; }
.schedule thead th:first-child, .schedule td:first-child { text-align: left; }
.schedule td { text-align: right; }
.schedule tr.year { background: var(--surface-2); font-weight: 700; }

.details-summary { cursor: pointer; font-weight: 700; font-size: 15px; padding: 6px 0; list-style: none; display: flex; justify-content: space-between; }
.details-summary::-webkit-details-marker { display: none; }
.details-summary::after { content: "펼치기"; font-size: 13px; color: var(--accent); font-weight: 600; }
details[open] .details-summary::after { content: "접기"; }

/* ---------- 본문 콘텐츠 (설명·FAQ) ---------- */
.prose { color: var(--ink-2); }
.prose h3 { color: var(--ink); margin: 18px 0 6px; font-size: 16px; }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose code {
  background: var(--bg-deep); border-radius: 5px; padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; color: var(--ink);
}

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 28px 14px 0;
  font-weight: 600; font-size: 15px; color: var(--ink); position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 20px;
  width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg); transition: transform .2s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 23px; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.faq .a { padding: 0 0 16px; color: var(--ink-2); font-size: 14.5px; }
.faq .a p { margin: 0 0 8px; }
.faq .a p:last-child { margin: 0; }

/* 계산기 목록 카드 */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 620px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
.tool-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; background: var(--surface-2);
  transition: border-color .15s, transform .12s var(--ease);
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.tool-card .t { font-weight: 700; font-size: 15px; margin: 0 0 3px; color: var(--ink); }
.tool-card .d { font-size: 13.5px; color: var(--ink-3); margin: 0; }

/* 404 */
.center-page { text-align: center; padding: 60px 0 40px; }
.center-page .code { font-size: 64px; font-weight: 800; letter-spacing: -.04em; color: var(--accent); margin: 0 0 8px; }

/* 문서 페이지 */
.doc h2 { font-size: 18px; margin: 26px 0 8px; letter-spacing: -.01em; color: var(--ink); }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { color: var(--ink-2); font-size: 15px; }
.doc p { margin: 0 0 10px; }
.doc ul { margin: 0 0 14px; padding-left: 20px; }
.doc li { margin: 5px 0; }
.doc .updated { color: var(--ink-3); font-size: 13px; margin: 0 0 20px; }
.doc dl { margin: 0 0 14px; }
.doc dt { font-weight: 700; color: var(--ink); font-size: 15px; margin-top: 12px; }
.doc dd { margin: 2px 0 0; color: var(--ink-2); font-size: 15px; }

/* ---------- 인쇄 ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; color: #000; padding-bottom: 0; font-size: 11pt; }
  body::before { display: none; }
  .site-header, .sticky-summary, .toast, .slot, .rail, .btn, .chips, .skip-link, .tool-nav { display: none !important; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; animation: none; padding: 12px; }
  .layout, .page-shell { display: block; }
  .card + .card { margin-top: 10px; }
  .hero { padding: 0 0 10px; }
  .hero h1 { font-size: 20pt; }
  .result-big { font-size: 24pt; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
  details { break-inside: avoid; }
  details:not([open]) > *:not(summary) { display: none; }
}

/* ---------- 홈 허브 ---------- */
.hub-hero { padding: 40px 0 8px; }
.hub-hero h1 { font-size: clamp(32px, 6vw, 48px); }
.hub-cat { margin-top: 22px; }
.hub-cat h2 { font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.tool-card.featured { background: var(--surface); border-color: var(--accent); }
.tool-card .tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--accent-2); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; margin-left: 6px; vertical-align: 1px; }

/* ---------- 안내 글 ---------- */
.article { max-width: 720px; }
.article .prose p { font-size: 16px; line-height: 1.75; color: var(--ink-2); }
.article .prose h2 { font-size: 20px; margin: 30px 0 10px; letter-spacing: -.01em; color: var(--ink); }
.article .prose h3 { font-size: 17px; margin: 22px 0 6px; }
.article .prose li { line-height: 1.7; }
.article .lead { font-size: 18px; color: var(--ink-2); margin: 0 0 6px; }
.article .meta { color: var(--ink-3); font-size: 13px; margin: 0 0 22px; }
.article table.tbl th, .article table.tbl td { font-size: 14.5px; }
.cta-box {
  margin: 26px 0; padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.cta-box p { margin: 0 0 8px; color: var(--ink); font-weight: 600; }
.cta-box a.btn { width: auto; }
.related { margin-top: 12px; }
.related h2 { font-size: 16px; margin: 0 0 8px; }

/* 본문 중간 광고 */
.slot.inline { margin: 18px 0; }
.slot.inline .ad-placeholder { min-height: 90px; }

/* 결과 액션 버튼 묶음 */
.btn-row .btn-sm svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 점수 막대 (청약 가점) */
.score-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--bg-deep); margin: 10px 0 6px; }
.score-bar > span { display: block; height: 100%; transition: width .3s var(--ease); }
.score-bar .s1 { background: var(--accent); }
.score-bar .s2 { background: color-mix(in srgb, var(--accent) 65%, var(--surface)); }
.score-bar .s3 { background: color-mix(in srgb, var(--accent) 40%, var(--surface)); }

/* 날짜 입력 */
.field input[type="date"] {
  width: 100%; font: inherit; font-size: 16px; font-weight: 600; padding: 11px 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink);
}
.field input[type="date"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 큰 참고표 */
.ref-table th, .ref-table td { font-size: 13.5px; padding: 8px 6px; }

/* ---------- 2차 추가: 판정 표시, 이사 단계, 서식, 용어 사전 ---------- */
.ok-mark, .warn-mark, .bad-mark { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-right: 4px; vertical-align: 1px; }
.ok-mark { background: var(--accent-soft); color: var(--accent-2); }
.warn-mark { background: var(--warn-soft); color: var(--warn); }
.bad-mark { background: #fbe3e0; color: #9b2c1f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bad-mark { background: #3d1c18; color: #f0a196; } }
:root[data-theme="dark"] .bad-mark { background: #3d1c18; color: #f0a196; }
.phase { margin-top: 18px; }
.phase h3 { font-size: 15px; margin: 0 0 4px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.phase-date { font-weight: 500; font-size: 13px; }
.phase-done h3 { color: var(--ink-3); }
.phase .progress { margin: 4px 0 6px; }
.risk-item .toggle { align-items: flex-start; }
.risk-item .field-help { margin-left: 46px; }
.receipt { border: 1px solid var(--line-2); padding: 26px 22px; background: var(--surface); border-radius: var(--radius-sm); }
.receipt h2 { text-align: center; font-size: 22px; letter-spacing: .4em; margin: 0 0 18px; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt th, .receipt td { border: 1px solid var(--line-2); padding: 9px 10px; text-align: left; font-size: 14.5px; }
.receipt th { width: 28%; background: var(--bg-deep); font-weight: 600; }
.receipt-line { margin: 18px 0 6px; text-align: center; }
.receipt-date { text-align: center; color: var(--ink-2); margin: 0 0 18px; }
.receipt-sign { text-align: right; margin: 0; font-weight: 600; }
.doc-text { white-space: pre-wrap; font-size: 14.5px; line-height: 1.75; background: var(--bg-deep); padding: 14px 16px; border-radius: var(--radius-sm); margin: 0; }
.term-list li .card-head { margin-bottom: 6px; }
.term-list li .t { margin: 0; }
.term-list li { padding: 14px 0; }
.alpha-index { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.alpha-index a { padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; text-decoration: none; color: var(--ink-2); }
.alpha-index a:hover { border-color: var(--accent); color: var(--accent); }
.term-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.term-cat { font-size: 12px; font-weight: 700; color: var(--accent-2); background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; }
.hub-sub { color: var(--ink-3); font-size: 13.5px; margin: -4px 0 10px; }
@media print {
  #form-inputs, .related, .card-head .btn { display: none !important; }
  .receipt { border: 1px solid #000; }
  .receipt th, .receipt td { border-color: #000; }
}

/* 홈 접이식 카테고리, 푸터 보조 링크 */
.hub-fold { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.hub-fold summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.hub-fold summary::-webkit-details-marker { display: none; }
.hub-fold summary h2 { font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0; }
.hub-fold summary .muted { font-size: 13px; margin-left: auto; }
.hub-fold summary::after { content: "+"; font-size: 18px; color: var(--ink-3); line-height: 1; }
.hub-fold[open] summary::after { content: "−"; }
.hub-fold .tool-grid, .hub-fold .hub-sub { padding: 0 16px 16px; }
.hub-fold .hub-sub { margin: 0; padding-bottom: 8px; }
.footer-extra { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
