/* gwanbu.com — 관부가세 계산기. 디자인: Flexi Cars Taxis (검정·노랑, 굵은 타이포).
   헤더·히어로·푸터는 검정, 계산기 카드는 노랑, 본문은 흰색·종이색 배경. */
:root {
  color-scheme: light dark;
  --black: #0d0d0d;
  --ink: #141414;
  --yellow: #ffd21f;
  --yellow-dark: #f5c400;
  --white: #ffffff;
  --surface: #ffffff; /* 카드·입력 배경. 다크에서는 --surface만 바꾼다 (--white는 글자색으로도 쓰이므로 건드리지 말 것) */
  --paper: #f6f5f1;
  --line: #e4e2da;
  --muted: #6d6a61;
  --radius: 18px;
  --pass: #0d7a3e;
  --warn: #8a6100;
  --fail: #b3261e;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;          /* 한국어 단어가 중간에서 끊기지 않게 (화면검수 2026-11-25) */
  overflow-wrap: break-word;     /* keep-all로 넘치는 긴 토큰만 예외적으로 끊어 가로 넘침 방지 */
}
::selection { background: var(--yellow); color: var(--black); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
a { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--yellow-dark); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--black); }

/* ── 헤더 ─────────────────────────────── */
header.site { background: var(--black); color: var(--white); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.logo { color: var(--white); text-decoration: none; font-weight: 900; font-size: 22px; letter-spacing: -0.02em; line-height: 1.1; }
.logo b { color: var(--yellow); font-weight: 900; }
.logo small { display: block; font-size: 11px; font-weight: 600; color: #b9b6ac; letter-spacing: 0.08em; margin-top: 3px; }
nav.main { display: flex; gap: 6px; flex-wrap: wrap; }
nav.main a {
  color: #e9e7df; text-decoration: none; font-size: 14px; font-weight: 700;
  padding: 9px 14px; border-radius: 999px; border: 1px solid #33322d;
}
nav.main a:hover { border-color: var(--yellow); color: var(--yellow); }
nav.main a[aria-current="page"] { background: var(--yellow); color: var(--black); border-color: var(--yellow); }

/* ── 히어로 (홈) ──────────────────────── */
.hero { background: var(--black); color: var(--white); padding: 56px 0 72px; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; right: -140px; top: -140px; width: 420px; height: 420px; border-radius: 50%;
  border: 64px solid rgba(255, 210, 31, 0.14); pointer-events: none;
}
.hero .wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: start; position: relative; z-index: 1; }
.eyebrow {
  display: inline-block; background: var(--yellow); color: var(--black);
  font-size: 12px; font-weight: 900; letter-spacing: 0.12em; padding: 6px 12px; border-radius: 6px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(38px, 5.2vw, 62px); font-weight: 900; line-height: 1.06; letter-spacing: -0.03em; margin: 0; }
.hero h1 .hl { color: var(--yellow); }
.hero .lede { margin: 20px 0 0; font-size: 17px; line-height: 1.65; color: #cfccc2; max-width: 34em; }
.hero .trust { display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; }
.hero .trust div { white-space: nowrap; } /* "5개 통화"가 둘로 쪼개지지 않게 (화면검수 2026-11-25) */
.hero .trust div b { display: block; font-size: 24px; font-weight: 900; color: var(--white); }
.hero .trust div span { font-size: 12.5px; color: #a5a296; font-weight: 600; }
.hero .notice {
  margin: 28px 0 0; background: #1c1c1a; border: 1px solid #33322d; border-left: 5px solid var(--yellow);
  border-radius: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.6; color: #d8d5cb; max-width: 36em;
}
.hero .notice a { color: var(--yellow); font-weight: 800; text-decoration: none; }
.hero .notice a:hover { text-decoration: underline; }

/* ── 페이지 히어로 (하위 페이지 제목 띠) ── */
.page-hero { background: var(--black); color: var(--white); padding: 44px 0 50px; position: relative; overflow: hidden; }
.page-hero::after {
  content: ""; position: absolute; right: -120px; top: -160px; width: 340px; height: 340px; border-radius: 50%;
  border: 52px solid rgba(255, 210, 31, 0.12); pointer-events: none;
}
.page-hero .wrap { position: relative; z-index: 1; }
.page-hero h1 { font-size: clamp(30px, 4.4vw, 46px); font-weight: 900; line-height: 1.12; letter-spacing: -0.03em; margin: 0; }
.page-hero h1 .hl { color: var(--yellow); }
.page-hero .lede { margin: 16px 0 0; font-size: 16.5px; line-height: 1.65; color: #cfccc2; max-width: 46em; }
.page-hero .lede a { color: var(--yellow); font-weight: 800; text-decoration: none; }
.page-hero .lede a:hover { text-decoration: underline; }

/* ── 본문 공통 ────────────────────────── */
main.wrap { padding-top: 40px; padding-bottom: 64px; }
main h2 { font-size: 21px; font-weight: 900; letter-spacing: -0.02em; margin: 38px 0 10px; text-wrap: balance; }
main h2:first-child { margin-top: 0; }
main h3 { font-size: 16px; font-weight: 900; margin: 18px 0 4px; }
main p { margin: 0 0 14px; line-height: 1.7; }
main ul, main ol { margin: 0 0 14px; padding-left: 22px; line-height: 1.7; }
main li { margin-bottom: 6px; }
.lede { color: var(--muted); }
.help { font-size: 13px; color: var(--muted); margin: 2px 0 6px; line-height: 1.5; }
.disclaimer { font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 12px; line-height: 1.6; }

/* ── 계산기 카드 (노랑) ───────────────── */
.calc-card {
  background: var(--yellow); color: var(--black); border-radius: 22px; padding: 28px 26px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
main .calc-card { box-shadow: 0 18px 44px rgba(13, 13, 13, 0.22); }
.calc-card h2 { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; margin: 0; }
.calc-card .sub { font-size: 13px; font-weight: 600; color: #5c5518; margin: 4px 0 0; line-height: 1.5; }
.calc-card form { margin-top: 18px; }
form.calc-card { margin-top: 0; }

/* ── 폼 요소 ──────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 900; letter-spacing: -0.01em; margin-bottom: 6px; }
.field .help { font-size: 13px; color: var(--muted); margin: -2px 0 6px; line-height: 1.45; }
.calc-card .field .help { font-size: 11.5px; font-weight: 600; color: #4a420f; } /* 노랑 위 대비 4.27:1 → 7:1 수준 (화면검수 2026-11-25) */
.field input, .field select {
  width: 100%; border: 2px solid var(--black); border-radius: 12px; background: var(--white);
  font: inherit; font-size: 16px; font-weight: 700; padding: 11px 13px; color: var(--ink);
  min-height: 44px; /* 최소 터치 높이 (화면검수 2026-11-25) */
}
.field input:focus, .field select:focus { outline: 3px solid rgba(13, 13, 13, 0.35); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label.check, .check {
  display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; font-weight: 700;
  line-height: 1.45; margin-top: 7px; cursor: pointer; letter-spacing: 0;
}
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--black); flex: none; }
details.more { margin: 2px 0 14px; }
details.more summary { font-size: 13px; font-weight: 900; cursor: pointer; list-style: none; padding: 4px 0; min-height: 44px; display: flex; align-items: center; }
details.more summary::before { content: "＋ "; }
details.more[open] summary::before { content: "－ "; }

/* ── 판정 결과 ────────────────────────── */
#result { margin-top: 16px; display: none; }
#result.show { display: block; }
.verdict {
  border-radius: 14px; padding: 16px 18px; font-size: 17px; font-weight: 900; line-height: 1.45; letter-spacing: -0.01em;
  background: var(--black); color: var(--white);
}
/* 판정문 안의 금액만 큰 숫자로 분리해 강조 (화면검수 2026-11-25 — 금액이 17px 문장 안에 묻힘) */
.verdict .amt-big { display: block; font-size: 26px; font-weight: 900; line-height: 1.25; margin-top: 2px; }
.verdict.pass { background: var(--pass); color: #fff; }
.verdict.pass_declare { background: var(--warn); color: #fff; }
.verdict.exceed { background: var(--fail); color: #fff; }
.kv { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14.5px; }
.kv th { text-align: left; font-weight: 700; color: var(--muted); padding: 7px 8px 7px 0; white-space: nowrap; vertical-align: top; width: 42%; }
.kv td { font-weight: 800; padding: 7px 0; border-bottom: 1px solid var(--line); }
/* 결과 금액 행은 20px 이상 큰 숫자로 (화면검수 2026-11-25 — 14.5px라 본문보다 작았음) */
.kv td.amt { font-size: 22px; font-weight: 900; line-height: 1.3; }
.kv tr:last-child td { border-bottom: none; }
.calc-card .kv th { font-weight: 800; color: #5c5518; }
.calc-card .kv td { border-bottom: 1px dashed rgba(13, 13, 13, 0.25); }
.calc-card .kv tr:last-child td { border-bottom: none; }
.notes { margin: 12px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.6; }
.notes li { margin-bottom: 4px; }
.calc-card .notes { font-size: 12.5px; font-weight: 600; color: #4d4712; }
.calc-card .disclaimer { font-size: 11.5px; font-weight: 600; line-height: 1.55; color: #4a420f; border-top: none; padding-top: 0; } /* 노랑 위 대비 강화 (화면검수 2026-11-25) */
.calc-card .disclaimer a { color: var(--black); font-weight: 800; }
.calc-card .help { color: #4a420f; font-weight: 600; }
/* 역산 "넣어보기" 적용 알림 — 예시 값으로 채웠다는 것을 적용 위치에서 분명히 알림 (화면검수 2026-11-25) */
.apply-note {
  display: block; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px;
  background: rgba(13, 13, 13, 0.1); color: var(--black);
  font-size: 13px; font-weight: 800; line-height: 1.5;
}
.apply-note[hidden] { display: none; }

/* ── 일반 카드 (흰색·검정 테두리) ─────── */
.card { background: var(--surface); border: 2px solid var(--black); border-radius: var(--radius); padding: 22px; }
.link-card {
  background: var(--surface); border: 2px solid var(--black); border-radius: var(--radius);
  padding: 20px 22px; display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap;
}
.link-card .tag {
  display: inline-block; background: var(--black); color: var(--yellow); flex: none;
  font-size: 11px; font-weight: 900; letter-spacing: 0.1em; padding: 5px 9px; border-radius: 5px; margin-top: 2px;
}
.link-card p { margin: 0; line-height: 1.6; }
.link-band { padding: 32px 0 0; }

/* ── 버튼 ─────────────────────────────── */
.btn {
  display: inline-block; padding: 12px 18px; font-size: 15px; font-weight: 800; font-family: inherit;
  border: 2px solid var(--black); border-radius: 12px; min-height: 44px;
  background: var(--black); color: var(--yellow); cursor: pointer;
}
.btn:hover { background: #2a2a26; color: var(--yellow); }
.btn-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; font-weight: 800; color: var(--black); text-decoration: none; border-bottom: 3px solid var(--yellow); padding-bottom: 2px; }
.btn-link:hover { background: var(--yellow); }

/* ── 사례 카드 (홈) ───────────────────── */
.cases { background: var(--paper); padding: 64px 0 72px; margin-top: 64px; }
.cases h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 900; letter-spacing: -0.025em; margin: 0; }
.cases .sub { margin-top: 8px; color: var(--muted); font-size: 15px; font-weight: 600; }
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.case-card {
  background: var(--surface); border: 2px solid var(--black); border-radius: var(--radius);
  padding: 22px 22px 20px; text-align: left; font: inherit; cursor: pointer; width: 100%;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.case-card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(13, 13, 13, 0.14); }
.case-card .tag {
  display: inline-block; background: var(--black); color: var(--yellow);
  font-size: 11px; font-weight: 900; letter-spacing: 0.1em; padding: 5px 9px; border-radius: 5px;
}
.case-card h3 { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; margin: 12px 0 0; line-height: 1.3; text-wrap: balance; }
.case-card .price { font-size: 26px; font-weight: 900; margin-top: 8px; }
.case-card .price small { font-size: 13px; font-weight: 700; color: var(--muted); }
.case-card p { font-size: 13.5px; color: var(--muted); font-weight: 600; line-height: 1.55; margin: 8px 0 0; }
.case-card .go { margin-top: 14px; font-size: 13px; font-weight: 900; color: var(--black); }
.case-card .go::after { content: " →"; }

/* ── 요약·표 ──────────────────────────── */
.summary { padding: 64px 0 72px; }
.summary h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 900; letter-spacing: -0.025em; margin: 44px 0 0; }
.summary h2:first-child { margin-top: 0; }
.summary p { margin-top: 12px; font-size: 15px; line-height: 1.7; color: #3c3a34; max-width: 46em; }
.summary p strong { background: linear-gradient(transparent 62%, var(--yellow) 62%); }
.summary .card { margin-top: 22px; }
table.plain { width: 100%; border-collapse: collapse; margin: 22px 0 10px; font-size: 14.5px; }
table.plain th { background: var(--black); color: var(--white); text-align: left; padding: 12px 14px; font-weight: 900; }
table.plain th:first-child { border-radius: 12px 0 0 0; }
table.plain th:last-child { border-radius: 0 12px 0 0; }
table.plain td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; vertical-align: top; }
table.plain td b { font-weight: 900; }
main table.plain { margin-top: 10px; }

/* ── 경계 사례·FAQ ────────────────────── */
.case { border: 2px solid var(--black); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; background: var(--surface); }
.case h3 { margin: 0 0 6px; font-size: 17px; text-wrap: balance; } /* 금액만 마지막 줄에 남는 고아 줄 방지 (화면검수 2026-11-25) */
.case p { margin: 0 0 8px; }
.case p:last-child { margin-bottom: 0; }
.case .judge { font-weight: 800; background: linear-gradient(transparent 68%, rgba(255, 210, 31, 0.55) 68%); display: inline; }
.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-item h3 { margin: 0 0 6px; font-size: 17px; }
.faq-item p { margin: 0; }

/* ── 푸터 ─────────────────────────────── */
footer.site { background: var(--black); color: #a5a296; padding: 30px 0; font-size: 13px; font-weight: 600; line-height: 1.7; }
footer.site b { color: var(--yellow); }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; gap: 36px; }
  .case-grid { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 52px; }
  .page-hero { padding: 34px 0 38px; }
  nav.main a { padding: 7px 11px; font-size: 13px; }
  .cases { padding: 44px 0 52px; }
  .summary { padding: 44px 0 52px; }
  .kv th { white-space: normal; }
}

/* ── 모바일 헤더: 360px에서 메뉴 7개가 3행(218px)이 되지 않게 가로 스크롤 1행으로 (화면검수 2026-11-25) ── */
@media (max-width: 640px) {
  header.site .wrap { flex-direction: column; align-items: stretch; flex-wrap: nowrap; padding-top: 14px; padding-bottom: 14px; gap: 10px; }
  nav.main { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); } /* 끝단 페이드로 가로 스크롤이 있음을 표시 (교차 재검수 2026-11-25) */
  nav.main::-webkit-scrollbar { display: none; }
  nav.main a { flex: none; min-height: 44px; display: inline-flex; align-items: center; }
  /* 가이드 3열 표를 모바일에서 행별 카드(스택) 형태로 (화면검수 2026-11-25 — 86~136px로 압착) */
  table.plain.stack tr:first-child { display: none; }
  table.plain.stack, table.plain.stack tbody, table.plain.stack tr, table.plain.stack td { display: block; width: 100%; }
  table.plain.stack tr { border-bottom: 1px solid var(--line); padding: 10px 0 12px; }
  table.plain.stack td { border-bottom: none; padding: 3px 14px; }
  table.plain.stack td:first-child { font-weight: 900; font-size: 15.5px; padding-top: 2px; }
  /* 스택 표의 2·3열 셀에 라벨을 붙여 '뜻'과 '주의'를 구분한다 (교차 재검수 2026-11-25) */
  table.plain.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
}

/* ── 다크모드: 기기 설정을 따른다 (화면검수 2026-11-25 — color-scheme:light 고정이라 다크에서도 라이트로 나왔음).
   검정·노랑 브랜드는 유지하고, 배경·본문·카드·표·입력만 다크 토큰으로 바꾼다. ── */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #1e1e1b;
    --paper: #141412;
    --ink: #f0eee6;
    --line: #35332c;
    --muted: #b3b0a4;
  }
  body { background: #141412; }
  .card, .case-card, .case, .link-card { background: var(--surface); border-color: #4c4a40; }
  .card p, .case-card p, .case-card .price small, .cases .sub { color: var(--muted); }
  .case-card h3, .case h3, .faq-item h3 { color: var(--ink); }
  .summary p { color: #d8d5cb; }
  .summary p strong { background: linear-gradient(transparent 62%, rgba(255, 210, 31, 0.35) 62%); }
  .field input, .field select { background: #262622; color: var(--ink); border-color: #5a574c; }
  .field input:focus, .field select:focus { outline-color: rgba(255, 210, 31, 0.65); }
  .btn { border-color: #5a574c; }
  .btn:hover { background: #2a2a26; }
  table.plain td { border-bottom-color: var(--line); }
  table.plain th { background: #000; }
  .kv td { border-bottom-color: var(--line); }
  .calc-card .kv td { border-bottom-color: rgba(13, 13, 13, 0.25); }
  .faq-item { border-bottom-color: var(--line); }
  main .disclaimer { border-top-color: var(--line); }
  .case .judge { background: linear-gradient(transparent 68%, rgba(255, 210, 31, 0.35) 68%); }
  .case-card .go, .btn-link { color: var(--ink); } /* 검정 글씨는 다크 카드에서 안 보임 */
  .hero .notice { background: #1c1c1a; }
  .link-card p { color: var(--ink); }
  .apply-note { background: rgba(13, 13, 13, 0.12); }
}
