/* ==========================================================================
   상속세 간단 계산기 — 스타일
   블로그 iframe 임베드와 독립 페이지 모두를 고려해 폭에 따라 유연하게 배치합니다.
   ========================================================================== */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-alt: #f8f9fb;
  --border: #e3e6ec;
  --border-strong: #ccd1da;

  --text: #1a1d23;
  --text-soft: #4a5160;
  --text-muted: #7b8494;

  --primary: #1c4e80;
  --primary-hover: #163f68;
  --primary-soft: #e8f0f9;
  --primary-fg: #ffffff;

  --danger: #c2372d;
  --danger-soft: #fdeceb;
  --warn: #b26a00;
  --warn-soft: #fef4e4;
  --ok: #1f7a4d;
  --ok-soft: #e8f6ef;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 12px rgba(16, 24, 40, 0.06);

  --font: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard',
    'Malgun Gothic', '맑은 고딕', 'Noto Sans KR', sans-serif;
  --font-num: 'SF Mono', 'Consolas', 'Menlo', monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #14161a;
    --surface: #1c1f25;
    --surface-alt: #23272e;
    --border: #2f343c;
    --border-strong: #414751;

    --text: #eceef2;
    --text-soft: #b9c0cc;
    --text-muted: #8990a0;

    --primary: #5b9bd5;
    --primary-hover: #74aee0;
    --primary-soft: #1e2c3b;
    --primary-fg: #0f1216;

    --danger: #f08b82;
    --danger-soft: #35211f;
    --warn: #e0a758;
    --warn-soft: #332818;
    --ok: #6cc79b;
    --ok-soft: #172c22;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* ── 헤더 ───────────────────────────────────────────────── */
.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.header-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-size: 0.86rem;
}

/* ── 레이아웃 ───────────────────────────────────────────── */
.layout {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr); }
  .result-col { position: sticky; top: 16px; }
}

/* ── 카드/섹션 ──────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.card > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.98rem;
  font-weight: 700;
}

.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 0.78rem;
  font-weight: 700;
  flex: none;
}

.card-body { padding: 16px 18px; }

/* ── 입력 행 ────────────────────────────────────────────── */
.field {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-bottom: 14px;
}

.field:last-child { margin-bottom: 0; }

.field > label,
.field-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.5;
}

.money-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.money-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.money-input input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-num);
  font-size: 1rem;
  text-align: right;
}

.money-input .unit {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--surface-alt);
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.money-echo {
  min-height: 1.2em;
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  text-align: right;
}

.money-echo:empty::before { content: '\00a0'; }

/* 숫자 입력의 스피너 제거 */
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type='number'] { -moz-appearance: textfield; }

.grid-2 {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 560px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* ── 선택형 입력 ────────────────────────────────────────── */
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  position: relative;
  flex: 1 1 auto;
  min-width: 84px;
}

.choice input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.choice span {
  display: block;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.88rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.choice input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.choice input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper button {
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.stepper button:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.stepper input {
  width: 64px;
  padding: 9px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-num);
  font-size: 1rem;
  text-align: center;
}

.stepper .stepper-echo {
  font-size: 0.85rem;
  color: var(--text-muted);
}

input[type='date'] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
}

/* 체크박스 목록 */
.check-list { display: grid; gap: 10px; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  cursor: pointer;
  transition: all 0.15s;
}

.check:hover { border-color: var(--border-strong); }

.check input {
  margin: 3px 0 0;
  width: 17px;
  height: 17px;
  flex: none;
  accent-color: var(--primary);
  cursor: pointer;
}

.check:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.check-text { font-size: 0.89rem; line-height: 1.5; }
.check-text small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── 상세 입력 접기 ─────────────────────────────────────── */
details.more {
  margin-top: 14px;
  border-top: 1px dashed var(--border-strong);
  padding-top: 12px;
}

details.more > summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}

details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before {
  content: '＋';
  font-size: 0.9rem;
}
details.more[open] > summary::before { content: '－'; }

details.more > .more-body { padding-top: 14px; }

/* ── 결과 패널 ──────────────────────────────────────────── */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.verdict {
  padding: 20px 18px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.verdict-badge {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: var(--surface-alt);
  color: var(--text-muted);
}

/* 아직 다 입력하지 않아 계산을 보여줄 수 없는 상태 */
.verdict[data-level='empty'] { background: var(--surface-alt); }
.verdict[data-level='empty'] .verdict-amount { color: var(--text-muted); }
.verdict-amount .waiting { font-size: 1.5rem; opacity: 0.45; letter-spacing: 0.1em; }

.verdict[data-level='taxable'] { background: var(--danger-soft); }
.verdict[data-level='taxable'] .verdict-badge {
  background: var(--danger);
  color: #fff;
}

.verdict[data-level='borderline'] { background: var(--warn-soft); }
.verdict[data-level='borderline'] .verdict-badge {
  background: var(--warn);
  color: #fff;
}

.verdict[data-level='safe'] { background: var(--ok-soft); }
.verdict[data-level='safe'] .verdict-badge {
  background: var(--ok);
  color: #fff;
}

.verdict-amount {
  font-family: var(--font-num);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  word-break: keep-all;
}

.verdict-amount .won { font-size: 1.1rem; margin-left: 2px; }

.verdict-label {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.verdict-summary {
  margin: 10px 0 0;
  font-size: 0.87rem;
  color: var(--text-soft);
  line-height: 1.55;
  word-break: keep-all;
}

.verdict-sub {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.verdict-sub div { font-size: 0.8rem; color: var(--text-muted); }
.verdict-sub strong {
  display: block;
  font-family: var(--font-num);
  font-size: 0.98rem;
  color: var(--text);
  font-weight: 700;
}

/* 계산 내역 */
.breakdown { padding: 4px 18px 16px; }

.breakdown > summary {
  cursor: pointer;
  padding: 12px 0;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
  user-select: none;
}
.breakdown > summary::-webkit-details-marker { display: none; }
.breakdown > summary::after { content: ' ▾'; }
.breakdown[open] > summary::after { content: ' ▴'; }

.breakdown table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.breakdown th,
.breakdown td {
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 400;
  color: var(--text-soft);
  vertical-align: top;
}

.breakdown td {
  text-align: right;
  font-family: var(--font-num);
  color: var(--text);
  white-space: nowrap;
}

.breakdown tr.sum th,
.breakdown tr.sum td {
  font-weight: 700;
  color: var(--text);
  border-bottom: 2px solid var(--border-strong);
}

.breakdown tr.minus td { color: var(--ok); }
.breakdown tr.indent th { padding-left: 12px; font-size: 0.81rem; color: var(--text-muted); }
.breakdown tr.indent td { font-size: 0.81rem; color: var(--text-muted); }

/* ── 안내 카드 ──────────────────────────────────────────── */
.advice-list {
  padding: 0 18px 18px;
  display: grid;
  gap: 10px;
}

.advice {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--surface-alt);
}

.advice[data-level='critical'] { border-left-color: var(--danger); background: var(--danger-soft); }
.advice[data-level='warning'] { border-left-color: var(--warn); background: var(--warn-soft); }
.advice[data-level='info'] { border-left-color: var(--primary); background: var(--primary-soft); }
.advice[data-level='good'] { border-left-color: var(--ok); background: var(--ok-soft); }

.advice h3 {
  margin: 0 0 5px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
  word-break: keep-all;
}

.advice p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-soft);
  line-height: 1.6;
  word-break: keep-all;
}

/* ── 상담 유도 ──────────────────────────────────────────── */
.cta {
  margin: 0 18px 18px;
  padding: 16px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.cta h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  word-break: keep-all;
}

.cta p {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.6;
  word-break: keep-all;
}

.cta-buttons { display: grid; gap: 8px; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 16px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-fg);
  font-family: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }

.btn.secondary {
  background: var(--surface);
  color: var(--primary);
}

.btn.secondary:hover { background: var(--surface-alt); }

.btn.kakao {
  background: #fee500;
  border-color: #e5cf00;
  color: #191600;
}
.btn.kakao:hover { background: #f5dc00; }

/* 전화 버튼은 번호와 담당자를 두 줄로 보여줍니다. */
.btn.phone {
  flex-direction: column;
  gap: 1px;
  padding: 10px 16px;
  line-height: 1.35;
}

.btn-main { font-size: 0.93rem; font-weight: 700; }
.btn-sub { font-size: 0.82rem; font-weight: 500; opacity: 0.92; }

.cta-hours {
  margin: 12px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.cta-empty {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ── 액션 버튼 ──────────────────────────────────────────── */
.actions {
  display: flex;
  gap: 8px;
  padding: 0 18px 18px;
}

.actions button {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}

.actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ── 푸터 ───────────────────────────────────────────────── */
.page-footer {
  margin-top: 24px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.65;
  word-break: keep-all;
}

.page-footer strong { color: var(--text-soft); }

.page-footer .office {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-weight: 600;
}

/* ── 검색으로 들어온 분들을 위한 설명 ───────────────────── */
.seo-content {
  margin-top: 24px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.seo-content h2 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.seo-content h3 {
  margin: 26px 0 10px;
  font-size: 1rem;
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.seo-content > p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.7;
  word-break: keep-all;
}

.rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.rate-table caption {
  text-align: left;
  padding-bottom: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rate-table th,
.rate-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.rate-table thead th {
  background: var(--surface-alt);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-soft);
}

.rate-table td:nth-child(2),
.rate-table td:nth-child(3) {
  font-family: var(--font-num);
  text-align: right;
  white-space: nowrap;
}

.faq { display: grid; gap: 8px; }

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  overflow: hidden;
}

.faq summary {
  padding: 12px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  list-style: none;
  user-select: none;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  word-break: keep-all;
}

.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '＋'; color: var(--primary); flex: none; }
.faq details[open] summary::after { content: '－'; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }

.faq p {
  margin: 0;
  padding: 12px 14px;
  font-size: 0.87rem;
  color: var(--text-soft);
  line-height: 1.7;
  word-break: keep-all;
}

/* ── 임베드 모드 ────────────────────────────────────────── */
body.embed { background: transparent; }
body.embed .wrap { padding: 8px 10px 20px; max-width: none; }
body.embed .page-header { margin-bottom: 14px; }
body.embed .page-header h1 { font-size: 1.25rem; }
/* 블로그 본문이 길어지지 않도록 설명 영역은 감춥니다. */
body.embed .seo-content { display: none; }

/* ── 인쇄 ───────────────────────────────────────────────── */
@media print {
  body { background: #fff; }
  .actions, .cta-buttons, details.more, .seo-content { display: none; }
  .card, .result-card, .page-footer { box-shadow: none; break-inside: avoid; }
  .layout { grid-template-columns: 1fr; }
  .breakdown[open] > summary { display: none; }
}

/* ── 장애인 공제 입력 ───────────────────────────────────── */
.person-list { display: grid; gap: 8px; }
.person-list:not(:empty) { margin-bottom: 8px; }

.person-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.person-age {
  width: 82px;
  flex: none;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-num);
  font-size: 0.95rem;
  text-align: center;
}

.person-gender { display: flex; gap: 4px; flex: none; }

.person-gender label { position: relative; }

.person-gender input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.person-gender span {
  display: block;
  min-width: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.87rem;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

.person-gender input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.person-gender input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-soft); }

.person-result {
  flex: 1 1 150px;
  min-width: 0;
  font-size: 0.83rem;
  color: var(--text-soft);
}

.person-result.muted { color: var(--text-muted); }
.person-result strong { color: var(--primary); font-weight: 700; }

.person-remove {
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
}

.person-remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.add-person {
  width: 100%;
  padding: 9px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.add-person:hover { border-color: var(--primary); background: var(--primary-soft); }

.person-total:not(:empty) {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  font-size: 0.85rem;
  color: var(--text-soft);
}

.person-total strong { color: var(--primary); }

.person-total .source {
  display: block;
  margin-top: 2px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ── 사무소 표시 ────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.brand-logo { max-height: 44px; width: auto; }

.brand-text { display: flex; flex-direction: column; gap: 1px; }

.brand-text strong {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand-text span { font-size: 0.82rem; color: var(--text-muted); }

/* ── 짧은 안내(토스트) ──────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  z-index: 100;
  max-width: min(420px, calc(100vw - 32px));
  padding: 13px 18px;
  border-radius: var(--radius);
  background: #22262e;
  color: #f4f6f8;
  font-size: 0.86rem;
  line-height: 1.5;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  word-break: keep-all;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── PDF 결과지 (화면 밖에서 그렸다가 이미지로 옮깁니다) ── */
.pdf-sheet {
  position: absolute;
  left: -10000px;
  top: 0;
  width: 794px;
}

.pdf-page {
  width: 794px;
  padding: 40px 44px;
  background: #ffffff;
  color: #1a1d23;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  box-sizing: border-box;
}

.pdf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 2px solid #1c4e80;
  margin-bottom: 22px;
}

.pdf-logo { max-height: 46px; width: auto; }

.pdf-office {
  font-size: 19px;
  font-weight: 700;
  color: #1c4e80;
  letter-spacing: -0.02em;
}

.pdf-head-right { text-align: right; }
.pdf-title { font-size: 16px; font-weight: 700; }
.pdf-date { font-size: 12px; color: #7b8494; margin-top: 2px; }

.pdf-verdict {
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 16px;
}

.pdf-verdict-taxable { background: #fdeceb; border: 1px solid #f3c9c5; }
.pdf-verdict-borderline { background: #fef4e4; border: 1px solid #f2ddb8; }
.pdf-verdict-safe { background: #e8f6ef; border: 1px solid #bfe3d1; }

.pdf-verdict-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pdf-verdict-taxable .pdf-verdict-badge { color: #c2372d; }
.pdf-verdict-borderline .pdf-verdict-badge { color: #b26a00; }
.pdf-verdict-safe .pdf-verdict-badge { color: #1f7a4d; }

.pdf-verdict-amount {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.pdf-verdict-summary { font-size: 12px; color: #4a5160; margin-top: 6px; }

.pdf-meta {
  padding: 10px 14px;
  border-radius: 6px;
  background: #f5f6f8;
  font-size: 12px;
  color: #4a5160;
  margin-bottom: 22px;
}

.pdf-section-title {
  font-size: 14px;
  font-weight: 700;
  padding-bottom: 6px;
  margin: 22px 0 10px;
  border-bottom: 1px solid #e3e6ec;
}

/* 입력한 내용 요약 — 두 칸으로 나눠 지면을 아낍니다. */
.pdf-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  align-items: start;
}

.pdf-input-group { break-inside: avoid; }

.pdf-input-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #1c4e80;
  padding-bottom: 3px;
  margin-bottom: 4px;
  border-bottom: 1px solid #dbe3ee;
}

.pdf-input-table { width: 100%; border-collapse: collapse; font-size: 11px; }

.pdf-input-table th,
.pdf-input-table td {
  padding: 3px 0;
  text-align: left;
  font-weight: 400;
  vertical-align: top;
  line-height: 1.45;
}

.pdf-input-table th { color: #7b8494; width: 45%; padding-right: 8px; }
.pdf-input-table td { color: #1a1d23; text-align: right; }

.pdf-table { width: 100%; border-collapse: collapse; font-size: 12px; }

.pdf-table th,
.pdf-table td {
  padding: 6px 0;
  border-bottom: 1px solid #eceef2;
  text-align: left;
  font-weight: 400;
  color: #4a5160;
}

.pdf-table td { text-align: right; color: #1a1d23; white-space: nowrap; }
.pdf-table tr.sum th, .pdf-table tr.sum td { font-weight: 700; color: #1a1d23; border-bottom: 1.5px solid #ccd1da; }
.pdf-table tr.minus td { color: #1f7a4d; }
.pdf-table tr.indent th { padding-left: 12px; font-size: 11px; color: #7b8494; }
.pdf-table tr.indent td { font-size: 11px; color: #7b8494; }

.pdf-advice {
  padding: 10px 13px;
  border-left: 3px solid #ccd1da;
  background: #f8f9fb;
  border-radius: 0 5px 5px 0;
  margin-bottom: 8px;
}

.pdf-advice-critical { border-left-color: #c2372d; background: #fdeceb; }
.pdf-advice-warning { border-left-color: #b26a00; background: #fef4e4; }
.pdf-advice-info { border-left-color: #1c4e80; background: #e8f0f9; }
.pdf-advice-good { border-left-color: #1f7a4d; background: #e8f6ef; }

.pdf-advice-title { font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
.pdf-advice-body { font-size: 11.5px; color: #4a5160; line-height: 1.55; }

.pdf-contact {
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid #1c4e80;
  border-radius: 8px;
  background: #e8f0f9;
}

.pdf-contact-title { font-size: 13px; font-weight: 700; color: #1c4e80; }
.pdf-contact-body { font-size: 12px; color: #4a5160; margin-top: 3px; }

.pdf-disclaimer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e3e6ec;
  font-size: 10.5px;
  color: #7b8494;
  line-height: 1.55;
}

/* 접근성: 화면에는 안 보이지만 스크린 리더는 읽는 텍스트 */
.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;
}
