/* 대해회계사무소 세금계산기 — 모바일 우선 스타일시트 (외부 의존성 없음) */

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --surface-3: #e6ebf1;
  --border: #dde3ea;
  --border-strong: #c5cfda;
  --text: #16202b;
  --text-2: #4a5765;
  --text-3: #78848f;
  --brand: #0d3b66;
  --brand-2: #14508a;
  --brand-ink: #ffffff;
  --risk: #b42318;
  --risk-bg: #fef3f2;
  --deadline: #b54708;
  --deadline-bg: #fffaeb;
  --saving: #0f766e;
  --saving-bg: #effcf9;
  --info: #175cd3;
  --info-bg: #eff8ff;
  --muted-bg: #f2f4f7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --shadow-lg: 0 4px 6px -2px rgba(16, 24, 40, .03), 0 12px 16px -4px rgba(16, 24, 40, .08);
  --maxw: 1120px;
  /**
   * Pretendard 셀프호스팅 (OFL-1.1, /css/pretendard.css + /fonts/pretendard/).
   * CSP font-src 'self' 를 지키려고 CDN 을 쓰지 않는다. 다이내믹 서브셋이라
   * 브라우저가 실제로 쓰는 글자 조각(~35KB)만 내려받는다. 미로딩 시 시스템 스택으로 폴백.
   */
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1319;
    --surface: #161d26;
    --surface-2: #1c242f;
    --surface-3: #252f3c;
    --border: #2a3542;
    --border-strong: #3a4756;
    --text: #e8edf3;
    --text-2: #aab6c3;
    --text-3: #7d8896;
    --brand: #4a9de0;
    --brand-2: #6bb2ea;
    --brand-ink: #08131d;
    --risk: #fda29b;
    --risk-bg: #2b1614;
    --deadline: #fdb022;
    --deadline-bg: #2a1e0b;
    --saving: #5eddc8;
    --saving-bg: #0d2320;
    --info: #84caff;
    --info-bg: #0e1e30;
    --muted-bg: #1c242f;
    --shadow: 0 1px 3px rgba(0, 0, 0, .5);
    --shadow-lg: 0 12px 20px -6px rgba(0, 0, 0, .6);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  overflow-wrap: break-word;
  word-break: keep-all; /* 한글 단어 단위 줄바꿈 */
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.35; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .7em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
strong, b { font-weight: 700; }
small { font-size: .82rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.stack > * + * { margin-top: 12px; }
.center { text-align: center; }

/**
 * 여백 유틸리티 — HTML 에서 인라인 style 을 쓰지 않기 위한 것.
 * CSP 의 style-src 에는 'unsafe-inline' 이 없고 style **속성**은 nonce·hash 로
 * 허용할 수 없어서, HTML 에 style="…" 을 쓰면 브라우저가 조용히 무시한다.
 * (JS 생성 요소는 common.js 의 el() 이 cssText 로 넣으므로 영향 없음)
 */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0 !important; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.mt-18 { margin-top: 18px; }
.mt-34 { margin-top: 34px; }
.mb-0 { margin-bottom: 0; }
.pt-18 { padding-top: 18px; }
.pt-20 { padding-top: 20px; }
.pt-28 { padding-top: 28px; }
.list-indent { padding-left: 20px; margin: 0; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.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;
}

/* ─────────────────────────── 헤더 ─────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; flex-wrap: nowrap;
}
/**
 * 브랜드 — 사무소 로고 이미지 하나로 대체 (사무소 제공 2026-07-30).
 * 로고에 사무소명과 「ACCOUNTING & TAX CONSULTING」이 함께 들어 있어
 * 종전의 「大」 마크 + 사무소명 + 역할 3단 구조를 대신한다.
 * 원본 960×138(비율 6.96:1) 투명 PNG — 표시 높이의 4배 이상이라 고DPI 에서도 선명하다.
 */
.brand { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; height: 32px; width: auto; max-width: 100%; }

/**
 * 다크 모드 — 로고가 **검정 단색**이라 어두운 배경에서 그대로 두면 보이지 않는다.
 * 단색이므로 `invert(1)` 로 흰 획이 되고, 알파는 필터의 영향을 받지 않아
 * 투명 배경과 글자 모양이 그대로 유지된다(별도 흰색 파일을 만들 필요가 없다).
 * ⚠ 로고를 여러 색이 섞인 파일로 교체하면 이 방식은 색이 뒤집혀 쓸 수 없다 —
 *   그때는 다크 전용 파일을 따로 두고 이 규칙을 지울 것.
 */
@media (prefers-color-scheme: dark) {
  .brand-logo { filter: invert(1); }
}
.topbar nav { margin-left: auto; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
/**
 * ⚠ `:not(.btn)` 을 지우지 말 것.
 * `.topbar nav a`(0,1,2)는 `.btn-primary`(0,1,0)보다 특이도가 높아서, 이 조건이 없으면
 * 상단바 안의 버튼이 링크 색(--text-2)을 물려받는다 — 네이비 배경에 회색 글씨가 되어
 * 대비 1.55:1 로 떨어진다(2026-07-30 랜딩 CTA 에서 실제 발생).
 * 패딩·라운드·크기까지 같이 덮이므로 버튼 모양 자체가 무너진다.
 */
.topbar nav a:not(.btn) { padding: 8px 10px; border-radius: 8px; font-size: .88rem; color: var(--text-2); font-weight: 600; }
.topbar nav a:not(.btn):hover { background: var(--surface-2); text-decoration: none; }

@media (max-width: 560px) {
  .topbar nav a.opt { display: none; }
  .brand-logo { height: 25px; }
}
@media (max-width: 380px) { .brand-logo { height: 22px; } }

/* ─────────────────────────── 버튼 ─────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-weight: 700; font-size: .94rem; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  white-space: nowrap; text-decoration: none; transition: filter .12s, background .12s;
  min-height: 44px; /* 터치 타깃 */
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; min-height: 52px; }
.btn-sm { padding: 8px 13px; font-size: .84rem; min-height: 40px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

/* ─────────────────────────── 카드 ─────────────────────────── */

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-sub { color: var(--text-2); font-size: .9rem; margin: 2px 0 14px; }

.section-title {
  font-size: .78rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3); margin: 26px 0 10px;
}

/* ─────────────────────────── 폼 ─────────────────────────── */

/**
 * 필드 사이 여백 — help 를 말풍선으로 접은 뒤 퀵버튼이 추가되면서 16px 로는
 * 질문들이 붙어 보였다(사무소 지시 2026-07-27). 질문 단위가 시각적으로 분리되게 넓힌다.
 * 들여쓰기(└) 필드는 부모 칸에 붙어 있어야 관계가 보이므로 절반만 띄운다.
 */
.field { margin-bottom: 28px; }
.field:last-child { margin-bottom: 0; }
.field.indent { margin-left: 14px; padding-left: 12px; border-left: 2px solid var(--border); margin-bottom: 14px; }
.field.indent + .field:not(.indent) { margin-top: 28px; }
.field > label, .field-label {
  display: block; font-weight: 600; font-size: .93rem; margin-bottom: 6px; color: var(--text);
}
.field-label .badge { margin-left: 6px; }
.req { color: var(--risk); margin-left: 2px; }
.help { display: block; color: var(--text-3); font-size: .82rem; margin-top: 5px; line-height: 1.5; }

/* ── 질문 헤더: 번호 칩 + 라벨 + ? 아이콘 ── */
.label-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
/* 질문임이 분명히 보이게 — 라벨을 본문보다 확실히 키우고 굵힌다 */
.label-row .field-label { margin-bottom: 0; font-size: .97rem; font-weight: 700; line-height: 1.45; }
.q-num {
  flex: 0 0 auto; min-width: 23px; height: 23px; padding: 0 6px; margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; background: var(--brand); color: var(--brand-ink);
  font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.info-btn { margin-top: 1px; }
.info-btn {
  flex: 0 0 auto; width: 21px; height: 21px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-strong); border-radius: 50%;
  background: transparent; color: var(--text-3);
  font: inherit; font-size: .74rem; font-weight: 800; line-height: 1; cursor: pointer;
}
.info-btn[aria-expanded="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.help-pop {
  position: relative; margin: 2px 0 10px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 10px 13px; font-size: .84rem; line-height: 1.55; color: var(--text-2);
}
.help-pop::before {
  content: ''; position: absolute; top: -6px; left: 16px; width: 10px; height: 10px;
  background: var(--surface-2); border-left: 1px solid var(--border-strong);
  border-top: 1px solid var(--border-strong); transform: rotate(45deg);
}

input[type="text"], input[type="tel"], input[type="email"], input[type="date"],
input[type="number"], input[type="password"], select, textarea {
  width: 100%; padding: 12px 13px;
  font: inherit; font-size: 16px; /* iOS 자동 확대 방지 */
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 34px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
input[type="date"] { min-height: 46px; }

.money-wrap { position: relative; }
.money-wrap input { padding-right: 44px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.money-wrap .suffix {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: .9rem; pointer-events: none;
}
.money-hint {
  font-size: .82rem; color: var(--brand); font-weight: 600; margin-top: 5px; min-height: 1.2em;
}

/* 금액 퀵버튼 — 현재 값에 더하는 방식 (+10억 · +1억 · +1천만 · +1백만 · C) */
.quick-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.quick-add .qa {
  flex: 0 0 auto; min-height: 34px; padding: 4px 12px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  font: inherit; font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.quick-add .qa:active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.quick-add .qa-clear { color: var(--text-3); min-width: 34px; }

.int-wrap { display: flex; align-items: stretch; gap: 8px; }
.int-wrap input { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.stepper {
  flex: 0 0 46px; border: 1px solid var(--border-strong); background: var(--surface-2);
  border-radius: var(--radius-sm); font-size: 1.2rem; font-weight: 700; color: var(--text-2);
  cursor: pointer; min-height: 46px;
}
.stepper:hover { background: var(--surface-3); }

/* 예/아니오 세그먼트 */
.seg { display: flex; gap: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.seg button {
  flex: 1; padding: 11px 8px; border: 0; background: var(--surface); color: var(--text-2);
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; min-height: 44px;
}
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }
/* 답해야 하는데 아직 답하지 않은 항목 */
.seg-need {
  border-color: var(--deadline);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--deadline) 22%, transparent);
}
/* 갱신 실패로 낡은 금액이 표시되는 상태 */
.stale { opacity: .45; text-decoration: line-through; }
.stale-note { font-size: .78rem; font-weight: 700; color: var(--deadline); }

/* 토글 그룹 (요구사항 8: 필요할 때만 입력) */
.toggle-group { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; background: var(--surface); overflow: hidden; }
.toggle-group.high { border-color: color-mix(in srgb, var(--deadline) 45%, var(--border)); }
.toggle-head {
  display: flex; align-items: flex-start; gap: 11px; padding: 14px;
  cursor: pointer; user-select: none; background: var(--surface-2);
}
.toggle-head:hover { background: var(--surface-3); }
.toggle-group.open .toggle-head { border-bottom: 1px solid var(--border); }
.toggle-box {
  flex: 0 0 22px; width: 22px; height: 22px; margin-top: 1px;
  border: 2px solid var(--border-strong); border-radius: 6px; background: var(--surface);
  display: grid; place-items: center; color: transparent; font-size: .8rem; font-weight: 900;
}
.toggle-group.open .toggle-box { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.toggle-text { flex: 1 1 auto; min-width: 0; }
.toggle-text .t { font-weight: 600; font-size: .95rem; display: block; }
.toggle-text .h { display: block; color: var(--text-3); font-size: .82rem; margin-top: 3px; line-height: 1.5; }
.toggle-body { padding: 16px 14px 4px; }
.toggle-group:not(.open) .toggle-body { display: none; }

/* 체크박스 (동의 등) */
/**
 * 봇 유인용 숨김 필드.
 * display:none 은 일부 봇이 감지해 건너뛰므로 화면 밖으로 밀어낸다.
 * ⚠ 인라인 style 로 숨기면 CSP style-src 에 차단되어 필드가 그대로 보인다 — 반드시 이 클래스로.
 */
.hp-field {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .9rem; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--brand); }

/* ─────────────────────────── 배지·알림 ─────────────────────────── */

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; background: var(--muted-bg); color: var(--text-2);
  vertical-align: middle; white-space: nowrap;
}
.badge-brand { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); }
.badge-risk { background: var(--risk-bg); color: var(--risk); }
.badge-saving { background: var(--saving-bg); color: var(--saving); }
.badge-deadline { background: var(--deadline-bg); color: var(--deadline); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* ── 변경 로그 (개발 기간 전용 페이지) ── */
.log-entry { padding: 12px 0; }
.log-entry + .log-entry { border-top: 1px solid var(--border); }
.log-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.log-at { font-family: var(--mono); font-size: .78rem; color: var(--text-2); }
.log-title { font-weight: 700; }
.log-body { margin: 4px 0 0; font-size: .88rem; line-height: 1.65; color: var(--text-2); }

/* 조언 카드 */
/* ── 검증용 상세 내역 (결과 화면) ── */
.verify-panel { margin-top: 10px; }
.verify-pre {
  white-space: pre-wrap; word-break: break-all;
  font-family: var(--mono); font-size: .76rem; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  max-height: 480px; overflow: auto;
  user-select: all; /* 한 번의 클릭·탭으로 전체 선택 */
}

/* ── 인라인 조언 칩 — 트리거 충족 시 필드 아래에 나타나는 접힌 버튼.
     클릭하면 FAQ 아코디언처럼 칩이 제목이 되고 본문 패널이 아래로 붙는다 ── */
.adv-chip-wrap { margin-top: 8px; }
.adv-chip-wrap.open .adv-chip { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
/* 펼치면 제목 전문이 보여야 한다 — 말줄임은 접힌 상태 전용 */
.adv-chip-wrap.open .ac-title { white-space: normal; }
.adv-panel {
  border: 1px solid var(--border-strong); border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface-2);
}
.adv-panel .a-body { font-size: .88rem; color: var(--text-2); line-height: 1.68; }
.adv-panel .a-body strong { color: var(--text); }
.adv-panel .a-law { font-size: .76rem; color: var(--text-3); margin-top: 6px; font-family: var(--mono); }
.adv-panel .a-cta { margin-top: 11px; }
.adv-panel.c-risk { border-left: 3px solid var(--risk); background: var(--risk-bg); }
.adv-panel.c-deadline { border-left: 3px solid var(--deadline); background: var(--deadline-bg); }
.adv-panel.c-saving { border-left: 3px solid var(--saving); background: var(--saving-bg); }
.adv-chip {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 8px 12px; min-height: 40px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer;
  animation: adv-chip-in .25s ease-out;
}
@keyframes adv-chip-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.adv-chip .ac-badge {
  flex: 0 0 auto; font-size: .72rem; font-weight: 800; padding: 2px 8px;
  border-radius: 999px; white-space: nowrap;
}
.adv-chip .ac-title {
  flex: 1 1 auto; min-width: 0; font-size: .84rem; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.adv-chip .ac-chev { flex: 0 0 auto; font-size: .62rem; color: var(--text-3); }
.adv-chip[aria-expanded="true"] .ac-chev { color: var(--text); }
.adv-chip.c-risk { border-left: 3px solid var(--risk); }
.adv-chip.c-risk .ac-badge { background: var(--risk-bg); color: var(--risk); }
.adv-chip.c-deadline { border-left: 3px solid var(--deadline); }
.adv-chip.c-deadline .ac-badge { background: var(--deadline-bg); color: var(--deadline); }
.adv-chip.c-saving { border-left: 3px solid var(--saving); }
.adv-chip.c-saving .ac-badge { background: var(--saving-bg); color: var(--saving); }
.adv-chip.c-doc, .adv-chip.c-notice { border-left: 3px solid var(--border-strong); }
.adv-chip.c-doc .ac-badge, .adv-chip.c-notice .ac-badge { background: var(--surface); color: var(--text-2); }

.advice { border-radius: var(--radius-sm); padding: 13px 14px; border: 1px solid var(--border); background: var(--surface-2); }
.advice + .advice { margin-top: 10px; }
.advice .a-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.advice .a-title { font-weight: 700; font-size: .95rem; flex: 1 1 auto; min-width: 0; }
.advice .a-body { font-size: .88rem; color: var(--text-2); line-height: 1.68; }
.advice .a-body strong { color: var(--text); }
.advice .a-law { font-size: .76rem; color: var(--text-3); margin-top: 6px; font-family: var(--mono); }
.advice .a-cta { margin-top: 11px; }
.advice.c-risk { border-left: 3px solid var(--risk); background: var(--risk-bg); }
.advice.c-deadline { border-left: 3px solid var(--deadline); background: var(--deadline-bg); }
.advice.c-saving { border-left: 3px solid var(--saving); background: var(--saving-bg); }
.advice.c-doc { border-left: 3px solid var(--info); background: var(--info-bg); }
.advice.c-notice { border-left: 3px solid var(--border-strong); }
.advice-inline { margin-top: 10px; }

.notice-box { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .88rem; background: var(--info-bg); color: var(--text-2); border: 1px solid var(--border); }
.error-box { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; background: var(--risk-bg); color: var(--risk); border: 1px solid color-mix(in srgb, var(--risk) 30%, transparent); font-weight: 600; }
.ok-box { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; background: var(--saving-bg); color: var(--saving); border: 1px solid color-mix(in srgb, var(--saving) 30%, transparent); font-weight: 600; }

/* ─────────────────────────── 스텝 내비 ─────────────────────────── */

/**
 * 단계 탭 줄.
 * 띠(배경·구분선·sticky)는 화면 전체 폭이고, **탭 자체는 `.wrap` 과 같은 폭·여백**이라
 * 첫 탭의 왼쪽이 아래 본문 카드의 왼쪽 모서리와 정확히 맞는다 (사무소 지시 2026-07-30).
 * 종전에는 띠와 탭이 한 요소여서 가운데 정렬이었고, 본문과 시작점이 어긋나 보였다.
 */
#steps-wrap {
  border-bottom: 1px solid var(--border); background: var(--surface);
  position: sticky; top: 56px; z-index: 30;
}
.steps {
  display: flex; gap: 6px; overflow-x: auto;
  max-width: var(--maxw); margin: 0 auto; padding: 10px 16px;
  scrollbar-width: none; -ms-overflow-style: none;
  /* 가운데 정렬하지 않는다 — 본문 좌측 기준선에 맞추는 것이 목적이다 */
  justify-content: flex-start;
}
.steps::-webkit-scrollbar { display: none; }
.steps button {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-2); font: inherit; font-size: .85rem;
  font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 40px;
}
.steps button[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.steps button.done { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.steps button .n { font-variant-numeric: tabular-nums; opacity: .7; margin-right: 4px; }

/**
 * 마지막 「계산 결과」 탭 — 앞의 6개와 **다른 종류의 버튼**으로 보이게 한다
 * (사무소 지시 2026-07-30). 1~6 은 입력 단계이고 7 은 도착지다.
 *  · 모양: 알약(999px)이 아니라 각진 모서리 + 넓은 여백
 *  · 구분선: 입력 단계와 결과 사이에 세로 괘선
 *  · 상태: 잠김(점선·흐림) → 열림(네이비 테두리 + 화살표) → 현재(네이비 채움)
 * `:disabled` 는 `.btn:disabled` 규칙이 걸리지 않으므로 여기서 직접 준다.
 */
.steps .step-div {
  flex: 0 0 auto; align-self: center;
  width: 1px; height: 20px; margin: 0 9px;
  background: var(--border-strong);
}
.steps button.step-result { border-radius: var(--radius-sm); padding: 8px 15px; }
.steps button.step-result .go { margin-left: 5px; font-weight: 800; }
.steps button.step-result:disabled {
  opacity: .45; cursor: not-allowed;
  border-style: dashed; background: transparent; color: var(--text-3);
}
/* 열렸다는 신호 — 아직 누르지 않은 상태에서 눈에 들어와야 한다 */
.steps button.step-result.ready:not([aria-current="true"]) {
  border-color: var(--brand); border-width: 1.5px; color: var(--brand); font-weight: 800;
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}
.steps button.step-result.ready:not([aria-current="true"]):hover {
  background: color-mix(in srgb, var(--brand) 16%, var(--surface));
}
/* 결과 화면에서는 앞 단계 6개가 「돌아갈 수 있는 곳」이라는 것이 보여야 한다 */
.steps button.done:hover { background: var(--surface-3); }

/**
 * 입력 초기화 — 탭 줄 맨 우측.
 * 되돌릴 수 없는 동작이라 **탭보다 흐리게** 그려 눌리고 싶지 않게 만든다:
 * 테두리·배경 없음, 흐린 글자, 얇은 굵기. 대신 마우스를 올리면 경고색으로 또렷해져
 * 「찾을 수는 있지만 무심코 누르지는 않는」 상태가 된다.
 * margin-left:auto 로 우측 끝에 붙는다 (좁은 화면에서 넘칠 때는 자동으로 0 이 되어
 * 7번 탭 뒤에 이어 붙고, 탭 줄을 스크롤해 닿을 수 있다).
 */
/**
 * ⚠ 색을 --text-3(#78848f) 로 더 흐리게 하면 흰 배경 대비가 3.82:1 로 떨어져
 *   읽기 기준(4.5:1)에 미달한다. 「덜 눈에 띄게」는 색이 아니라
 *   테두리·배경 없음 + 얇은 굵기로 만든다 (글자 크기는 탭과 같게 — 사무소 지시).
 *   opacity 도 0.8 이면 실효 대비가 4.44:1 로 아슬하게 미달해 0.85 로 둔다.
 */
.steps button.step-reset {
  margin-left: auto;
  border-color: transparent; background: transparent;
  color: var(--text-2); font-size: .85rem; font-weight: 500;
  padding: 8px 10px; min-height: 36px; border-radius: var(--radius-sm);
  opacity: .85;
}
.steps button.step-reset:hover {
  opacity: 1; color: var(--risk);
  background: var(--risk-bg);
  border-color: color-mix(in srgb, var(--risk) 35%, transparent);
}
.steps button.step-reset:focus-visible { opacity: 1; }

/* ─────────────────────────── 계산기 레이아웃 ─────────────────────────── */

.calc-layout { display: block; padding: 18px 0 0; }
.calc-main { min-width: 0; }
.calc-side { display: none; }

@media (min-width: 960px) {
  .calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
  /**
   * 결과 화면은 우측 칸을 넓힌다 (사무소 지시 2026-07-30).
   * 진단 내용이 많아 320px 에서는 줄바꿈이 과해 패널이 지나치게 길어졌다.
   * 실시간 세액 카드(입력 화면)는 숫자 몇 줄이라 320px 로 충분해 그대로 둔다.
   */
  .calc-layout.with-advice { grid-template-columns: minmax(0, 1fr) 420px; }
  .calc-side { display: block; position: sticky; top: 116px; }
}

/* 실시간 세액 패널 (데스크톱 사이드) */
.live-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.live-top { padding: 16px; background: var(--brand); color: var(--brand-ink); }
.live-top .lbl { font-size: .8rem; opacity: .85; font-weight: 600; }
.live-top .amt { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.25; }
.live-top .sub { font-size: .8rem; opacity: .85; }
.live-rows { padding: 12px 16px; }
.live-rows .r { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; padding: 4px 0; }
.live-rows .r span:first-child { color: var(--text-2); }
.live-rows .r span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-foot { padding: 12px 16px 16px; border-top: 1px solid var(--border); }

/**
 * 결과 화면의 진단 패널 — 실시간 세액 카드가 있던 자리·폭을 그대로 쓴다.
 * sticky 를 끄는 이유: 조언이 십수 건이면 패널이 화면보다 길어지는데,
 * sticky 로 두면 위쪽이 고정된 채 아래쪽에 스크롤로 닿을 수 없다.
 */
.calc-side.side-advice-host { position: static; }
.side-advice { padding: 18px 16px; }
.side-advice .sa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.side-advice .section-title { margin: 20px 0 8px; }

/* 패널 안의 접히는 조언 항목 */
.adv-acc { background: var(--surface-2); }
.adv-acc + .adv-acc { margin-top: 8px; }
.adv-acc > summary {
  padding: 10px 12px; gap: 8px; align-items: flex-start;
  font-size: .87rem; font-weight: 600; line-height: 1.5;
}
.adv-acc > summary::after { align-self: center; }
.adv-acc > summary .ac-badge {
  flex: 0 0 auto; margin-top: 2px;
  font-size: .68rem; font-weight: 800; letter-spacing: .05em; white-space: nowrap;
}
.adv-acc > summary .ac-title { flex: 1 1 auto; min-width: 0; }
.adv-acc > .acc-body { padding: 0 12px 12px; }
.adv-acc .a-body { font-size: .85rem; line-height: 1.7; color: var(--text-2); }
.adv-acc .a-body strong { color: var(--text); }
.adv-acc .a-law { font-size: .74rem; color: var(--text-3); margin-top: 6px; font-family: var(--mono); }
.adv-acc .a-cta { margin-top: 10px; }
/* 분류별 좌측 색 띠 — 카드와 같은 규칙을 따른다 */
.adv-acc.c-risk { border-left: 3px solid var(--risk); }
.adv-acc.c-risk .ac-badge { color: var(--risk); }
.adv-acc.c-deadline { border-left: 3px solid var(--deadline); }
.adv-acc.c-deadline .ac-badge { color: var(--deadline); }
.adv-acc.c-saving { border-left: 3px solid var(--saving); }
.adv-acc.c-saving .ac-badge { color: var(--saving); }
.adv-acc.c-doc { border-left: 3px solid var(--info); }
.adv-acc.c-doc .ac-badge { color: var(--info); }
.adv-acc.c-notice { border-left: 3px solid var(--border-strong); }
.adv-acc.c-notice .ac-badge { color: var(--text-2); }
/* 좁은 화면에서 본문 흐름으로 내려왔을 때의 간격 */
.advice-mobile-slot:empty { display: none; }
.advice-mobile-slot > .card { margin-top: 14px; }

/* 모바일 하단 바 */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(8px); border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + var(--safe-b));
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -2px 12px rgba(16, 24, 40, .08);
}
.mobile-bar .m-amt { flex: 1 1 auto; min-width: 0; }
.mobile-bar .m-amt .lbl { font-size: .72rem; color: var(--text-3); font-weight: 600; display: block; line-height: 1.3; }
.mobile-bar .m-amt .amt { font-size: 1.12rem; font-weight: 800; font-variant-numeric: tabular-nums; display: block; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-bar .btn { flex: 0 0 auto; }
@media (min-width: 960px) { .mobile-bar { display: none; } }
.has-mobile-bar { padding-bottom: 92px; }
@media (min-width: 960px) { .has-mobile-bar { padding-bottom: 24px; } }

/* ─────────────────────────── 결과 ─────────────────────────── */

.result-hero {
  background: linear-gradient(160deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 72%, #000) 100%);
  color: #fff; border-radius: var(--radius); padding: 24px 20px; text-align: center;
}
.result-hero .lbl { font-size: .88rem; opacity: .88; font-weight: 600; }
.result-hero .amt {
  font-size: clamp(1.9rem, 8.5vw, 2.9rem); font-weight: 800; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums; margin: 4px 0 2px; line-height: 1.15;
}
.result-hero .amt-ko { font-size: .95rem; opacity: .9; font-weight: 600; }
.result-hero .chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.result-hero .chip {
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px; padding: 5px 12px; font-size: .8rem; font-weight: 600; white-space: nowrap;
}

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 13px; }
.kpi .k { font-size: .78rem; color: var(--text-3); font-weight: 600; display: block; }
.kpi .v { font-size: 1.06rem; font-weight: 800; font-variant-numeric: tabular-nums; display: block; margin-top: 2px; }
.kpi .n { font-size: .76rem; color: var(--text-3); display: block; }

/* CTA 블록 (요구사항 7) */
.cta-block {
  background: var(--surface); border: 2px solid var(--brand);
  border-radius: var(--radius); padding: 20px; text-align: center; box-shadow: var(--shadow-lg);
}
.cta-block.compact { padding: 16px; text-align: left; }
.cta-block h3 { font-size: 1.1rem; margin-bottom: 6px; }
.cta-block p { color: var(--text-2); font-size: .9rem; margin-bottom: 14px; }
.cta-block .btn-row { justify-content: center; }
.cta-trust { font-size: .78rem; color: var(--text-3); margin-top: 10px; }
.cta-strip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--brand); color: var(--brand-ink); border-radius: var(--radius); padding: 18px 20px;
}
.cta-strip .t { flex: 1 1 260px; min-width: 0; }
.cta-strip .t strong { display: block; font-size: 1.05rem; }
.cta-strip .t span { font-size: .86rem; opacity: .9; }
.cta-strip .t .note { font-size: .82rem; opacity: .85; margin: 6px 0 0; }
.cta-strip .btn { background: #fff; color: var(--brand); }

/* 계산내역 테이블 */
.breakdown { overflow-x: auto; }
.breakdown table { width: 100%; border-collapse: collapse; font-size: .89rem; min-width: 340px; }
.breakdown th, .breakdown td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.breakdown td.amt { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.breakdown tr.step-row { background: var(--surface-2); }
.breakdown tr.step-row td { font-weight: 700; }
.breakdown tr.emph td { background: color-mix(in srgb, var(--brand) 8%, transparent); font-weight: 800; font-size: .95rem; }
.breakdown tr.final td { background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 1rem; }
.breakdown tr.grp td { font-weight: 700; color: var(--text-2); padding-top: 12px; }
.breakdown td.ind { padding-left: 24px; color: var(--text-2); font-weight: 400; }
.breakdown .no { display: inline-block; min-width: 22px; color: var(--text-3); font-weight: 700; }
.breakdown .law { font-family: var(--mono); font-size: .74rem; color: var(--text-3); margin-left: 6px; }
.breakdown .rownote { display: block; font-size: .78rem; color: var(--text-3); font-weight: 400; }

/* 시나리오 비교 */
.scenario { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 15px; background: var(--surface); }
.scenario + .scenario { margin-top: 12px; }
.scenario h4 { font-size: .98rem; margin-bottom: 10px; }
.sc-compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.sc-side { text-align: center; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.sc-side .l { font-size: .76rem; color: var(--text-3); font-weight: 600; display: block; }
.sc-side .v { font-size: 1.02rem; font-weight: 800; font-variant-numeric: tabular-nums; display: block; }
.sc-side.better { background: var(--saving-bg); color: var(--saving); }
.sc-arrow { color: var(--text-3); font-size: 1.1rem; }
.sc-delta { text-align: center; font-weight: 700; font-size: .95rem; color: var(--saving); }
.sc-caution { font-size: .84rem; color: var(--text-2); margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }

details.acc { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
details.acc + details.acc { margin-top: 10px; }
details.acc > summary {
  padding: 13px 15px; cursor: pointer; font-weight: 700; font-size: .95rem;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: "▾"; margin-left: auto; color: var(--text-3); transition: transform .15s; }
details.acc[open] > summary::after { transform: rotate(180deg); }
details.acc > .acc-body { padding: 0 15px 15px; }

/**
 * 「눌러보고 싶은」 아코디언 — 접혀 있어도 지나치지 않도록 (사무소 지시 2026-07-30).
 * 네이비 테두리 + 연한 배경으로 면을 세우고, 부제로 안에 무엇이 있는지 미리 알리고,
 * 우측에 펼치기 알약을 둔다. 화살표는 폰트 글리프(▾)가 Pretendard 에 없어
 * CSS 로 그린 삼각형을 쓴다 — 폴백 서체로 튀지 않는다.
 */
details.acc.acc-invite {
  border: 1.5px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 5%, var(--surface));
}
details.acc.acc-invite:hover { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
details.acc.acc-invite > summary { align-items: center; gap: 12px; padding: 15px 16px; }
details.acc.acc-invite > summary::after { content: none; }
.acc-invite .lbl { flex: 1 1 auto; min-width: 0; }
.acc-invite .lbl strong { display: block; font-size: 1.02rem; font-weight: 800; color: var(--brand); }
.acc-invite .lbl .sub {
  display: block; margin-top: 3px;
  font-size: .82rem; font-weight: 500; line-height: 1.5; color: var(--text-2);
}
.acc-invite .open-hint {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--brand); color: var(--brand-ink);
  font-size: .8rem; font-weight: 700; white-space: nowrap;
}
.acc-invite .open-hint::after {
  content: ''; width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .15s;
}
details.acc.acc-invite[open] > summary { border-bottom: 1px solid var(--border); }
details.acc.acc-invite[open] .open-hint {
  background: transparent; color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}
details.acc.acc-invite[open] .open-hint::after { transform: rotate(180deg); }

/* ═════════════════════ 랜딩(홈) ═════════════════════
 * 참고 레퍼런스: 사무소가 지정한 SaaS 랜딩 문법 —
 * 「작은 라벨 → 큰 제목 → 카드들」 3단이 섹션마다 반복되고,
 * 섹션 배경이 흰색/회색으로 교대해 스크롤 리듬을 만든다.
 * ⚠ 색은 전부 토큰(var)만 쓴다 — 다크 모드에서 흰 카드에 흰 글씨가 되는 것을 막는다.
 */

.landing { background: var(--bg); }
.lp { padding: 76px 0; }
.lp-white { background: var(--surface); }
.lp-gray { background: var(--bg); }
@media (max-width: 720px) { .lp { padding: 48px 0; } }

/* 큰 제목 — .section-title 은 작은 라벨 스타일이므로 h2 에 쓰지 않는다 */
.lp-h2 {
  font-size: clamp(1.5rem, 5.2vw, 1.9rem); font-weight: 800; letter-spacing: -.03em;
  margin: 0 0 10px; max-width: 24ch; text-wrap: balance;
}
.lp-sub { color: var(--text-2); font-size: 1rem; margin: 0 0 26px; max-width: 46ch; }
.lp .section-title { margin-top: 0; }
.lp-note { margin: 22px 0 0; font-size: .86rem; color: var(--text-2); max-width: 60ch; }
.lp-center { text-align: center; margin: 26px 0 0; }
/* 계산 / 상담 두 경로를 나란히. 모바일에서는 세로로 쌓여 터치 타깃이 겹치지 않는다 */
.lp-cta-pair { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.lp-cta-pair .btn { flex: 0 1 auto; }
@media (max-width: 520px) { .lp-cta-pair .btn { flex: 1 1 100%; } }

/* ── 히어로 ── */
.lp-hero { text-align: center; }
.lp-hero .trust-line { margin: 0 auto 14px; max-width: none; font-size: .9rem; color: var(--text-2); }
.lp-h1 {
  font-size: clamp(1.75rem, 7vw, 2.6rem); font-weight: 800; letter-spacing: -.035em;
  line-height: 1.28; margin: 0 auto; max-width: 22ch;
}
/* 의도적 2행 — <br> 대신 블록 span 이라 폭이 바뀌어도 깨지지 않는다 */
.lp-h1 .ln { display: block; }
.lp-h1 em { font-style: normal; color: var(--brand); }
.lp-lede {
  margin: 16px auto 0; max-width: 52ch;
  font-size: 1rem; line-height: 1.75; color: var(--text-2);
}

.lp-cta-wrap { margin-top: 28px; }
/* 버튼 안에 보조문구를 2단으로 — 레퍼런스의 CTA 구조 */
.btn-stack { flex-direction: column; gap: 3px; padding: 14px 30px; min-height: 64px; }
.btn-stack .t { font-size: 1.05rem; font-weight: 800; }
.btn-stack .n { font-size: .76rem; font-weight: 500; opacity: .85; }
.lp-cta-hint { margin: 14px auto 0; max-width: 44ch; font-size: .88rem; color: var(--text-2); }

/* ── 제품 미리보기 카드 ── */
.preview-card {
  margin: 34px auto 0; max-width: 560px; text-align: left;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
}
.pv-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 14px 16px 0;
}
.pv-title { font-weight: 800; font-size: .95rem; }
.pv-tag { font-size: .74rem; color: var(--text-2); }
.pv-given { margin: 6px 16px 12px; font-size: .78rem; color: var(--text-2); }
.pv-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.pv-table th, .pv-table td { padding: 9px 16px; text-align: left; font-weight: 400; color: var(--text-2); }
.pv-table td {
  text-align: right; white-space: nowrap; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pv-table tr.sub th, .pv-table tr.sub td { background: var(--surface-2); font-weight: 800; color: var(--text); }
.pv-table tr.final th, .pv-table tr.final td {
  border-top: 2px solid var(--border-strong);
  font-weight: 800; color: var(--brand); font-size: 1.02rem; padding-top: 12px; padding-bottom: 14px;
}
.pv-note { display: block; margin-top: 3px; font-size: .72rem; color: var(--text-2); font-weight: 400; }
.pv-confirm { margin: 0; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.pv-confirm > div { display: flex; gap: 10px; font-size: .8rem; line-height: 1.6; }
.pv-confirm > div + div { margin-top: 5px; }
.pv-confirm dt { flex: 0 0 auto; font-weight: 800; color: var(--brand); }
.pv-confirm dd { margin: 0; color: var(--text-2); }
.pv-foot { margin: 0; padding: 10px 16px 12px; font-size: .78rem; color: var(--text-2); text-align: right; }
/* 12px 캡션은 --text-3 이면 흰 배경에서 대비가 모자란다 */
.pv-caption { margin: 10px 0 0; font-size: .76rem; color: var(--text-2); }

/* ── 지표 3개 ── */
.lp-stats {
  list-style: none; margin: 40px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
@media (max-width: 620px) { .lp-stats { grid-template-columns: 1fr; gap: 22px; } }
.lp-stats .v {
  display: block; font-size: 1.9rem; font-weight: 800; color: var(--brand);
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.lp-stats .k { display: block; margin-top: 2px; font-size: .84rem; color: var(--text-2); }

/* ── 카드 그리드 ── */
.lp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.lp-grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.lp-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 18px;
}
.lp-gray .lp-card { background: var(--surface); }
.lp-white .lp-card { background: var(--bg); border-color: transparent; }
.lp-card h3 { font-size: 1rem; margin: 0 0 7px; letter-spacing: -.01em; }
.lp-card p { margin: 0; font-size: .89rem; line-height: 1.7; color: var(--text-2); }

/* ── 사용 방법 스텝 ── */
.lp-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px;
}
.lp-steps > li { padding-top: 14px; border-top: 2px solid var(--brand); }
.lp-steps .no {
  display: block; font-size: .82rem; font-weight: 800; color: var(--brand);
  letter-spacing: .08em; font-variant-numeric: tabular-nums; margin-bottom: 6px;
}
.lp-steps h3 { font-size: 1rem; margin: 0 0 6px; }
.lp-steps p { margin: 0; font-size: .89rem; line-height: 1.7; color: var(--text-2); }

/* ── 상담 안내 (가격 자리) ── */
.lp-plan { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; }
.lp-plan > div { padding: 18px 0; border-top: 1px solid var(--border); }
.lp-plan dt { font-size: .76rem; font-weight: 800; letter-spacing: .06em; color: var(--text-2); }
.lp-plan dd { margin: 6px 0 0; font-size: .89rem; line-height: 1.7; color: var(--text-2); }
.lp-plan dd strong { display: block; font-size: 1rem; color: var(--text); margin-bottom: 3px; }
@media (min-width: 720px) {
  .lp-plan { column-gap: 28px; }
}

/* ── 면책 ── */
.lp-disclaimer { margin: 0; padding-left: 1.2em; }
.lp-disclaimer li { margin-bottom: 12px; font-size: .92rem; line-height: 1.75; color: var(--text-2); }
.lp-disclaimer strong { color: var(--text); }
.lp-closing {
  margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border);
  font-size: 1rem; font-weight: 700; color: var(--text);
}

/* ── 최종 CTA ── */
.lp-final {
  background: var(--brand); color: var(--brand-ink);
  border-radius: var(--radius); padding: 44px 24px; text-align: center;
}
.lp-final h2 { font-size: clamp(1.35rem, 5vw, 1.75rem); letter-spacing: -.03em; margin: 0 0 14px; }
.lp-final p { margin: 0 auto 6px; max-width: 44ch; font-size: .94rem; line-height: 1.7; opacity: .92; }
.lp-final .btn { margin-top: 22px; background: var(--surface); border-color: var(--surface); color: var(--brand); }
.lp-final .btn:hover { background: var(--surface-2); border-color: var(--surface-2); }

/* 랜딩 상단바 — 링크 메뉴 없이 CTA 하나 */
.topbar-cta { margin-left: auto; flex: 0 0 auto; }

/* ─────────────────────────── 페이지 리드문 ─────────────────────────── */

/**
 * ⚠ 조상 선택자를 붙이지 않는다.
 * 종전에는 `.hero .lede` 였는데 랜딩 재작성으로 `.hero` 마크업이 사라지면서
 * 매칭 0건이 되어 `/about`·`/404` 의 리드문이 본문과 같은 크기로 렌더됐다.
 * 선언은 멀쩡한데 화면만 달랐던 부류라 눈으로는 잘 잡히지 않는다.
 */
.lede { font-size: 1.02rem; color: var(--text-2); max-width: 620px; margin-top: 10px; }


.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.feature h3 { font-size: .98rem; margin: 6px 0 4px; }
.feature p { font-size: .86rem; color: var(--text-2); margin: 0; }

/* ─────────────────────────── 모달 ─────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(16, 24, 40, .55);
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) { .modal-backdrop { align-items: center; padding: 24px; } }
.modal {
  background: var(--surface); width: 100%; max-width: 520px;
  border-radius: 16px 16px 0 0; padding: 20px 18px calc(20px + var(--safe-b));
  max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .modal { border-radius: var(--radius); padding-bottom: 20px; max-height: 88vh; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.modal-head h2 { flex: 1 1 auto; font-size: 1.15rem; }
.modal-close {
  flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 8px;
  background: var(--surface-2); color: var(--text-2); font-size: 1.2rem; cursor: pointer;
}

/* ─────────────────────────── 푸터 ─────────────────────────── */

.footer { margin-top: 48px; padding: 28px 0 40px; border-top: 1px solid var(--border); background: var(--surface); }
.footer .wrap { display: flex; gap: 24px; flex-wrap: wrap; }
.footer .col { flex: 1 1 220px; min-width: 0; }
.footer h4 { font-size: .84rem; color: var(--text-3); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .05em; }
.footer p, .footer li { font-size: .86rem; color: var(--text-2); margin: 0 0 4px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer .legal { font-size: .78rem; color: var(--text-3); margin-top: 20px; line-height: 1.7; }

/* ─────────────────────────── 관리자 ─────────────────────────── */

.admin-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav button {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font: inherit; font-weight: 600;
  font-size: .88rem; cursor: pointer; white-space: nowrap; min-height: 38px;
}
.admin-nav button[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.data-table { overflow-x: auto; }
.data-table table { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 560px; }
.data-table th { text-align: left; padding: 9px 10px; border-bottom: 2px solid var(--border); color: var(--text-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table tr:hover td { background: var(--surface-2); }

.kv { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 8px 14px; font-size: .89rem; align-items: center; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; gap: 4px; } .kv > .k { color: var(--text-3); font-weight: 600; margin-top: 8px; } }
.kv > .k { color: var(--text-2); font-weight: 600; }

code, pre { font-family: var(--mono); font-size: .84rem; }
pre { background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; border: 1px solid var(--border); }
textarea.code { font-family: var(--mono); font-size: .84rem; min-height: 200px; line-height: 1.5; white-space: pre; }

.spinner {
  display: inline-block; width: 15px; height: 15px; border: 2px solid var(--border-strong);
  border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { color: var(--text-3); font-size: .9rem; padding: 24px; text-align: center; }
.empty { color: var(--text-3); font-size: .9rem; padding: 28px 16px; text-align: center; background: var(--surface-2); border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* ─────────────────────────── 인쇄 ─────────────────────────── */

@media print {
  :root { --bg: #fff; --surface: #fff; --text: #000; --text-2: #333; --text-3: #666; --border: #ccc; }
  .topbar, .steps, .mobile-bar, .no-print, .btn, .cta-block, .cta-strip, .footer { display: none !important; }
  /**
   * ⚠ `.calc-side` 를 통째로 숨기지 않는다.
   * 결과 화면의 진단(세무리스크·절세포인트)이 넓은 화면에서 이 칸에 들어가므로
   * (calculator.js placeAdvicePanel), 숨기면 **인쇄물에서 진단이 통째로 사라진다.**
   * 실제로 2026-07-30 재배치 때 그렇게 됐다 — 화면에는 있는데 종이에는 없었다.
   * 대신 실시간 세액 카드만 숨긴다(입력 화면을 인쇄할 때 딸려 나오는 것을 막는다).
   */
  .calc-side > .live-card { display: none !important; }
  .calc-side { position: static !important; display: block !important; width: auto !important; }
  body { padding: 0; font-size: 11pt; }
  .card { border: 1px solid #ccc; box-shadow: none; page-break-inside: avoid; }
  .result-hero { background: #fff !important; color: #000 !important; border: 2px solid #000; }
  .breakdown tr.final td { background: #eee !important; color: #000 !important; }
  details.acc { border: 0; }
  details.acc > .acc-body { display: block !important; }
  a[href]::after { content: ""; }
}
