/* ════════════════════════════════════════════════
   상속세·증여세 계산기 — Design System
   ════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── 0. CSS Variables ── */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-alt: #fafaf7;
  --border: #e5e3db;
  --border-light: #eeecea;

  --text-1: #1a1917;
  --text-2: #4a4845;
  --text-3: #8a8780;
  --text-4: #b5b2aa;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff4ff;
  --accent-border: #bfdbfe;

  --green: #059669;
  --green-dark: #047857;
  --green-light: #ecfdf5;
  --green-border: #a7f3d0;

  --amber: #d97706;
  --amber-dark: #b45309;
  --amber-light: #fffbeb;
  --amber-border: #fde68a;

  --red: #dc2626;
  --red-dark: #b91c1c;
  --red-light: #fef2f2;
  --red-border: #fecaca;

  --font-sans: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --radius-full: 9999px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.15);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --dur: 200ms;
  --dur-slow: 400ms;
}

/* ── 1. Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── 2. Hero Section ── */
.hero {
  background: linear-gradient(160deg, #0c1222 0%, #182848 40%, #1a2744 60%, #0f172a 100%);
  position: relative;
  overflow: hidden;
  padding: 56px 24px 48px;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -15%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.18) 0%, transparent 65%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.1) 0%, transparent 65%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  margin-bottom: 20px;
  backdrop-filter: blur(4px);
}

.hero-title {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.hero-title span {
  display: block;
  font-size: 16px;
  font-weight: 400;
  color: rgba(255,255,255,0.45);
  margin-top: 6px;
  letter-spacing: 0;
}

.hero-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 36px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  overflow: hidden;
  max-width: 680px;
  margin: 0 auto;
}

.hero-stat {
  padding: 18px 16px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(8px);
}

.hero-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}

.hero-stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

/* ── 3. Calculator Container ── */
.calculator-wrapper {
  max-width: 840px;
  margin: -28px auto 0;
  padding: 0 20px 60px;
  position: relative;
  z-index: 1;
}

.calculator {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

/* ── 4. Info Badges ── */
.info-badges {
  display: flex;
  gap: 6px;
  padding: 14px 24px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.info-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.info-badge.blue {
  background: var(--accent-light);
  color: var(--accent);
}

.info-badge.green {
  background: var(--green-light);
  color: var(--green);
}

.info-badge.amber {
  background: var(--amber-light);
  color: var(--amber);
}

/* ── 5. Tab Switcher ── */
.tab-switcher {
  display: flex;
  gap: 3px;
  padding: 6px;
  margin: 20px 24px 0;
  background: #f0efe9;
  border-radius: var(--radius-sm);
}

.tab-btn {
  flex: 1;
  text-align: center;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-3);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  position: relative;
}

.tab-btn:hover {
  color: var(--text-2);
}

.tab-btn.active {
  background: var(--surface);
  color: var(--text-1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ── 6. Tab Panels ── */
.tab-panel {
  display: none;
  padding: 24px;
  animation: fadeIn 0.3s var(--ease-out);
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 7. Result Cards ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: all var(--dur-slow) var(--ease);
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  transition: background var(--dur-slow) var(--ease);
}

/* Card Color States */
.result-card.state-green {
  background: var(--green-light);
  border-color: var(--green-border);
}
.result-card.state-green::before { background: var(--green); }

.result-card.state-yellow {
  background: var(--amber-light);
  border-color: var(--amber-border);
}
.result-card.state-yellow::before { background: var(--amber); }

.result-card.state-red {
  background: var(--red-light);
  border-color: var(--red-border);
}
.result-card.state-red::before { background: var(--red); }

.result-card.state-accent {
  background: var(--accent-light);
  border-color: var(--accent-border);
}
.result-card.state-accent::before { background: var(--accent); }

.card-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.card-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
  transition: color var(--dur-slow) var(--ease);
}

.card-value.val-green { color: var(--green); }
.card-value.val-yellow { color: var(--amber); }
.card-value.val-red { color: var(--red); }
.card-value.val-accent { color: var(--accent); }
.card-value.val-muted { color: var(--text-4); }

.card-desc {
  display: block;
  font-size: 10px;
  color: var(--text-3);
  margin-top: 4px;
  transition: color var(--dur) var(--ease);
}

.card-desc.desc-green { color: var(--green); }
.card-desc.desc-yellow { color: var(--amber); }
.card-desc.desc-red { color: var(--red); }

/* Card value change animation */
.card-value.flash {
  animation: valuePulse 0.3s var(--ease);
}

@keyframes valuePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ── 8. Inline Warning (below cards) ── */
.inline-warning {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 16px;
  animation: slideDown 0.3s var(--ease-out);
}

.inline-warning.show {
  display: flex;
}

.inline-warning.red {
  background: var(--red-light);
  border: 1px solid var(--red-border);
  color: var(--red-dark);
}

.inline-warning.yellow {
  background: var(--amber-light);
  border: 1px solid var(--amber-border);
  color: var(--amber-dark);
}

.inline-warning.gray {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-3);
}

.inline-warning .warn-icon {
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 1px;
}

.inline-warning .warn-text {
  flex: 1;
}

.inline-warning .warn-btn {
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  background: var(--red);
  color: #fff;
  transition: background var(--dur) var(--ease);
  white-space: nowrap;
}

.inline-warning .warn-btn:hover {
  background: var(--red-dark);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 9. Input Section ── */
.input-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
}

.input-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

.input-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  align-items: flex-end;
}

.input-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: flex-end;
  margin-top: 12px;
}

.input-group {
  display: flex;
  flex-direction: column;
}

.input-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  pointer-events: none;
  z-index: 1;
}

.calc-input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.calc-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.calc-input.has-prefix {
  padding-left: 30px;
}

.calc-input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.calc-input::placeholder {
  color: var(--text-4);
  font-weight: 400;
}

.calc-select {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8780' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.calc-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.calc-input.readonly {
  background: var(--surface-alt);
  color: var(--text-3);
  cursor: default;
}

.input-error {
  font-size: 11px;
  color: var(--red);
  margin-top: 4px;
  display: none;
}

.input-error.show {
  display: block;
  animation: fadeIn 0.2s var(--ease);
}

/* ── 10. Radio Group ── */
.radio-group {
  display: flex;
  gap: 8px;
}

.radio-option {
  flex: 1;
}

.radio-option input[type="radio"] {
  display: none;
}

.radio-label {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  color: var(--text-3);
  background: var(--surface);
}

.radio-label:hover {
  border-color: var(--accent);
  color: var(--text-2);
}

.radio-option input[type="radio"]:checked + .radio-label {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* ── 11. Period Pills ── */
.pills-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.pill-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}

.pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pill-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.pill-amount {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
}

/* ── 12. Detail Table ── */
.detail-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.table-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 10px 18px;
  background: #f0efe9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.table-header span:last-child {
  text-align: right;
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 10px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--dur) var(--ease);
}

.table-row:last-child {
  border-bottom: none;
}

.table-row:hover {
  background: #fafaf7;
}

.table-row span:last-child {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-1);
}

.table-row.highlight {
  background: var(--accent-light);
  font-weight: 700;
}

.table-row.highlight span:last-child {
  color: var(--accent);
  font-weight: 700;
}

/* ── 13. Action Buttons ── */
.action-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.action-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all var(--dur) var(--ease);
}

.action-btn:hover {
  background: var(--surface-alt);
  border-color: var(--text-4);
}

.action-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.action-btn.primary:hover {
  background: var(--accent-hover);
}

/* ── 14. Warning Banners ── */
.warning-banner {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.65;
  margin-bottom: 12px;
}

.warning-banner.show {
  display: flex;
}

.warning-banner.red-banner {
  background: var(--red-light);
  border: 1px solid var(--red-border);
  color: var(--red-dark);
}

.warning-banner.yellow-banner {
  background: var(--amber-light);
  border: 1px solid var(--amber-border);
  color: var(--amber-dark);
}

.warning-banner.green-banner {
  background: var(--green-light);
  border: 1px solid var(--green-border);
  color: var(--green-dark);
}

.warning-banner .wb-icon {
  flex-shrink: 0;
  font-size: 14px;
}

/* ── 15. Disclaimer ── */
.disclaimer {
  padding: 16px 24px;
  background: var(--surface-alt);
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.7;
}

.disclaimer p {
  margin: 0;
}

/* ── 16. Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.2s var(--ease);
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 580px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  animation: modalSlide 0.3s var(--ease-out);
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface-alt);
  border-radius: var(--radius-xs);
  font-size: 18px;
  color: var(--text-3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur) var(--ease);
}

.modal-close:hover {
  background: var(--border);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-textarea {
  width: 100%;
  min-height: 340px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-1);
  background: #f8f8f5;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 16px;
  resize: vertical;
  outline: none;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── 17. Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--text-1);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn 0.3s var(--ease-out), toastOut 0.3s var(--ease) 2.5s forwards;
  white-space: nowrap;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

/* ── 18. Capture Area (for html2canvas) ── */
#capture-area {
  position: relative;
}

/* ── 18-1. Conditional Fields ── */
.cond-fields {
  display: none;
  margin-top: 12px;
  animation: slideDown 0.3s var(--ease-out);
}

.cond-fields.show {
  display: block;
}

/* ── 18-2. Schedule Table (원금균등분할) ── */
.schedule-container {
  display: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}

.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
}

.schedule-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}

.schedule-toggle {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}

.schedule-toggle:hover {
  background: var(--accent-light);
}

.schedule-table-wrapper {
  max-height: 280px;
  overflow-y: auto;
}

.schedule-table-wrapper.expanded {
  max-height: none;
}

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

.schedule-table th {
  position: sticky;
  top: 0;
  background: #f0efe9;
  padding: 8px 10px;
  text-align: right;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.schedule-table th:first-child {
  text-align: center;
  width: 50px;
}

.schedule-table td {
  padding: 7px 10px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 11px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-2);
}

.schedule-table td:first-child {
  text-align: center;
  color: var(--text-3);
  font-weight: 600;
}

.schedule-table tr:hover td {
  background: var(--surface-alt);
}

.schedule-table .ellipsis-row td {
  text-align: center;
  font-family: var(--font-sans);
  color: var(--text-4);
  font-style: italic;
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
}

/* ── 19. Footer ── */
.page-footer {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.footer-inner {
  text-align: center;
  font-size: 11px;
  color: var(--text-4);
  padding: 20px 0 0;
  border-top: 1px solid var(--border-light);
}

/* ── 20. Responsive ── */
@media (max-width: 768px) {
  .hero {
    padding: 44px 20px 40px;
  }

  .hero-title {
    font-size: 28px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stat-value {
    font-size: 17px;
  }

  .calculator-wrapper {
    padding: 0 12px 40px;
    margin-top: -24px;
  }

  .adsense-top {
    margin: 10px auto 0 !important;
    padding: 0 12px !important;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .card-value {
    font-size: 17px;
  }

  .input-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .input-row-2 {
    grid-template-columns: 1fr;
  }

  .pills-row {
    flex-wrap: wrap;
  }

  .pill-btn {
    flex: 1;
    text-align: center;
    min-width: 0;
  }

  .tab-switcher {
    margin: 16px 16px 0;
  }

  .tab-panel {
    padding: 16px;
  }

  .info-badges {
    padding: 10px 16px;
  }

  .action-bar {
    flex-wrap: wrap;
  }

  .action-btn {
    flex: 1;
    justify-content: center;
    min-width: 100px;
  }

  .table-header,
  .table-row {
    padding: 8px 14px;
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 24px;
  }

  .hero-desc {
    font-size: 13px;
  }

  .tab-btn {
    font-size: 12px;
    padding: 8px 10px;
  }

  .card-value {
    font-size: 15px;
  }

  .card-label {
    font-size: 10px;
  }

  .result-card {
    padding: 12px;
  }

  .pills-row {
    gap: 6px;
  }

  .pill-btn {
    font-size: 11px;
    padding: 5px 10px;
  }
}

/* ── 21. Print ── */
@media print {
  .hero { break-inside: avoid; }
  .calculator { box-shadow: none; border: 1px solid #ccc; }
  .action-bar { display: none; }
  .toast-container { display: none; }
}
