/* ============================================================
   김실비(Silbi-or-Not) 통합 스타일시트 (css/style.css)
   - 1. 타이포그래피 & 서체 토큰
   - 2. 둥글기(Radii), 간격(Spacing), 그림자(Shadows) 토큰
   - 3. 컬러(Colors) & 테마 토큰
   - 4. 리셋(Reset) & 기본 베이스 스타일
   - 5. 앱 레이아웃 & 헤더
   - 6. 카드 및 폼 & 플로팅 입력 컴포넌트
   - 7. 세그먼트 스위처 & 곡률 시스템
   - 8. 보험 선택 카드 & 체크박스
   - 9. 계산 상세 아코디언 & 수식 결과 행
   - 10. 버튼, 배너, 모달 & FAQ
   - 11. 반응형 레이아웃 (모바일 480px / 태블릿·데스크톱 768px)
   ============================================================ */

/* ============================================================
   1. 타이포그래피 토큰
   ============================================================ */
:root {
  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
               system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;

  /* Type scale */
  --fs-xl: 1.5rem;      /* 24px — 헤더 타이틀 */
  --fs-lg: 1.125rem;    /* 18px — 섹션/금액 강조 */
  --fs-md: 1rem;        /* 16px — 본문/입력 */
  --fs-sm: 0.9375rem;   /* 15px — 라벨 */
  --fs-xs: 0.875rem;    /* 14px — 보조 */
  --fs-micro: 0.8125rem;/* 13px — 캡션/힌트 */

  /* 한글 가독성을 위한 트래킹 */
  --tracking: -0.015em;
}

/* 숫자 정렬 유틸 */
.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ============================================================
   2. 둥글기(Radii) · 간격 · 그림자 토큰
   ============================================================ */
:root {
  /* Radii */
  --r: 14px;        /* 입력칸·작은 요소 */
  --rl: 22px;       /* 카드 (넉넉한 라운드) */
  --r-btn: 999px;    /* 주요 버튼 (완전 둥금) */
  --r-tile: 16px;   /* 요약 타일 */
  --r-pill: 999px;  /* 세그먼트·스텝퍼·태그 (완전 둥금) */

  /* Spacing scale (rem) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;

  /* Shadows — 매우 은은하게 */
  --shadow-card: 0 2px 16px rgba(0,0,0,.05);   /* 데스크톱 카드 */
  --shadow-pill: 0 1px 4px rgba(0,0,0,.08);    /* 활성 세그먼트 알약 */
}

/* ============================================================
   3. 컬러(Colors) & 테마 토큰
   ============================================================ */

/* [기본 모드] 웜 뉴트럴 캔버스 (Warm Neutral Canvas) */
:root, body.mode-neutral {
  /* 1. 배경 & 표면 계열 (시그니처 핑크와 어울리는 96% 웜 린넨 캔버스) */
  --bg-canvas: #f6f4f2;
  --bg-surface: #ffffff;
  --bg-secondary: #f4f1ef;

  /* 2. 상호작용 상태 */
  --bg-secondary-hover: #eae5e2;
  --bg-secondary-active: #dfd8d3;

  /* 3. 테두리 계열 */
  --border-light: rgba(60, 40, 30, 0.04);
  --border-strong: rgba(60, 40, 30, 0.07);

  /* 4. 텍스트 계열 */
  --text-primary: #211e1f;
  --text-secondary: #595255;
  --text-muted: #948d90;
  --text-tertiary: var(--text-muted);
  --text-placeholder: #b8b0b4;

  /* 5. 브랜드 포인트 계열 (시그니처 핑크) */
  --primary: #ec4899;
  --primary-bg: #fdf2f8;
  --primary-disabled-bg: #fce7f3;
  --primary-disabled-text: #f9a8d4;
  --shadow-primary: 0 4px 14px rgba(236, 72, 153, 0.28);

  /* 6. 경고 및 고지 피드백 */
  --warning-bg: #fff8e6;
  --warning-text: #856404;
  --warning-border: #ffeeba;

  /* 7. 뉴트럴 솔리드 버튼 토큰 */
  --btn-neutral-bg: var(--bg-secondary);
  --btn-neutral-bg-hover: var(--bg-secondary-hover);
  --btn-neutral-bg-active: var(--bg-secondary-active);
  --btn-neutral-text: var(--text-secondary);
  --btn-neutral-text-hover: var(--text-primary);
}

/* 7가지 테마별 포인트 컬러 정의 */
body.theme-pink {
  --primary: #ec4899;
  --primary-bg: #fdf2f8;
  --primary-disabled-bg: #fce7f3;
  --primary-disabled-text: #f9a8d4;
  --shadow-primary: 0 4px 14px rgba(236, 72, 153, 0.28);
}
body.theme-blue {
  --primary: #3182f6;
  --primary-bg: #e8f3ff;
  --primary-disabled-bg: #dbeafe;
  --primary-disabled-text: #93c5fd;
  --shadow-primary: 0 4px 14px rgba(49, 130, 246, 0.28);
}
body.theme-mint {
  --primary: #059669;
  --primary-bg: #ecfdf5;
  --primary-disabled-bg: #d1fae5;
  --primary-disabled-text: #6ee7b7;
  --shadow-primary: 0 4px 14px rgba(5, 150, 105, 0.28);
}
body.theme-indigo {
  --primary: #6366f1;
  --primary-bg: #eef2ff;
  --primary-disabled-bg: #e0e7ff;
  --primary-disabled-text: #a5b4fc;
  --shadow-primary: 0 4px 14px rgba(99, 102, 241, 0.28);
}
body.theme-coral {
  --primary: #f97316;
  --primary-bg: #fff7ed;
  --primary-disabled-bg: #ffedd5;
  --primary-disabled-text: #fdba74;
  --shadow-primary: 0 4px 14px rgba(249, 115, 22, 0.28);
}
body.theme-purple {
  --primary: #9333ea;
  --primary-bg: #faf5ff;
  --primary-disabled-bg: #f3e8ff;
  --primary-disabled-text: #d8b4fe;
  --shadow-primary: 0 4px 14px rgba(147, 51, 234, 0.28);
}
body.theme-navy {
  --primary: #1e3a8a;
  --primary-bg: #f0f4ff;
  --primary-disabled-bg: #dbeafe;
  --primary-disabled-text: #93c5fd;
  --shadow-primary: 0 4px 14px rgba(30, 58, 138, 0.28);
}

/* 밀키 파스텔 틴트 캔버스 */
body.mode-tint.theme-pink, body.mode-tint:not([class*="theme-"]) {
  --bg-canvas: #f7eff3;
  --bg-secondary: #f6edf2;
  --bg-secondary-hover: #ece0e7;
  --bg-secondary-active: #e2d1dc;
}
body.mode-tint.theme-blue {
  --bg-canvas: #edf3fa;
  --bg-secondary: #edf3fa;
  --bg-secondary-hover: #e0ecf7;
  --bg-secondary-active: #d1e2f3;
}
body.mode-tint.theme-mint {
  --bg-canvas: #edf5f0;
  --bg-secondary: #edf5f1;
  --bg-secondary-hover: #dfeed7;
  --bg-secondary-active: #cee6d8;
}
body.mode-tint.theme-indigo {
  --bg-canvas: #eff1f9;
  --bg-secondary: #eff1f9;
  --bg-secondary-hover: #e1e5f5;
  --bg-secondary-active: #d2d8f0;
}
body.mode-tint.theme-coral {
  --bg-canvas: #f9f1eb;
  --bg-secondary: #f7efe8;
  --bg-secondary-hover: #ede1d5;
  --bg-secondary-active: #e2d1c0;
}
body.mode-tint.theme-purple {
  --bg-canvas: #f5f0f9;
  --bg-secondary: #f5eef8;
  --bg-secondary-hover: #ebdff3;
  --bg-secondary-active: #decced;
}
body.mode-tint.theme-navy {
  --bg-canvas: #edf2f8;
  --bg-secondary: #edf2f8;
  --bg-secondary-hover: #dbe4f1;
  --bg-secondary-active: #c8d6e9;
}

/* ============================================================
   4. 리셋(Reset) & 기본 베이스 스타일
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-size: var(--fs-md);
  letter-spacing: -0.015em;
  min-height: 100vh;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea, select, button {
  font-family: inherit;
}

input, textarea, select {
  -webkit-user-select: text;
  user-select: text;
}

.hidden { display: none !important; }
.rs { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ============================================================
   5. 앱 레이아웃 & 헤더
   ============================================================ */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 3.75rem;
}

.header {
  padding: 1.25rem 1.125rem 0.875rem;
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.header-text { flex: 1; }
.header-title { font-size: var(--fs-xl); font-weight: 700; }
.header-sub { font-size: var(--fs-xs); color: var(--text-tertiary); margin-top: 0.125rem; }

.history-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-canvas);
  border: none;
  border-radius: 999px;
  padding: 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s, color .1s;
  flex-shrink: 0;
  margin-top: 2px;
  min-width: 40px;
  min-height: 40px;
}
.history-btn:hover { background: var(--bg-secondary-hover); color: var(--text-primary); }
.history-btn .history-label { display: none; }

.content { padding: 0.875rem 0.875rem 0; }
hr.dv { border: none; border-top: 1px solid var(--border-light); margin: 0.75rem 0; }

/* ============================================================
   6. 카드 및 폼 & 플로팅 입력 컴포넌트
   ============================================================ */
.empty-msg { text-align: center; padding: 2rem 1.5rem; color: var(--text-secondary); font-size: var(--fs-lg); font-weight: 500; }
.hint-inline { font-size: var(--fs-micro); color: var(--text-muted); font-weight: 400; }
.hint-inline.primary { color: var(--primary); font-weight: 700; }

.card {
  background: var(--bg-surface);
  border: none;
  border-radius: var(--rl);
  padding: 1.25rem;
  margin-bottom: 0.625rem;
}
.card-label {
  font-size: var(--fs-micro);
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.fl { font-size: var(--fs-sm); color: var(--text-secondary); margin-bottom: 0.3125rem; display: block; }
.fg { margin-bottom: 0.625rem; }
.fg:last-child { margin-bottom: 0; }
.sg { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }

.pharm-split-grid {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: 100%;
}
@media (min-width: 540px) {
  .pharm-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
}

.floating-group {
  position: relative;
  width: 100%;
  margin-bottom: 0.625rem;
  display: block;
}
.floating-group:last-child {
  margin-bottom: 0;
}

/* [안 A: 기본] 토스 핀테크 인셋형 */
.floating-group .floating-input {
  width: 100%;
  height: 3.625rem;
  padding: 1.3125rem 2.25rem 0.375rem 0.9375rem;
  font-size: 1.0625rem;
  font-weight: 700;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .18s cubic-bezier(0.4, 0, 0.2, 1),
              background-color .18s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow .18s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-group .floating-input:hover:not(:focus):not(:disabled) {
  background: var(--bg-secondary-hover);
}

.floating-group .floating-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3.5px var(--primary-bg);
}

.floating-group .floating-label {
  position: absolute;
  left: 0.9375rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--text-placeholder);
  pointer-events: none;
  transition: all .18s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  user-select: none;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 2.5rem);
}

.floating-group .floating-input::placeholder {
  color: var(--text-placeholder);
  opacity: 1;
}

.floating-group .floating-label .hint-inline {
  margin-left: 0.25rem;
  font-size: inherit;
  opacity: 0.85;
}

.floating-group .floating-input:focus ~ .floating-label,
.floating-group .floating-input:not(:placeholder-shown) ~ .floating-label,
.floating-group .floating-input.has-value ~ .floating-label {
  top: 0.8125rem;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.floating-group .floating-input:focus ~ .floating-label {
  color: var(--primary);
}

.floating-group .floating-unit {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-placeholder);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, color .15s ease;
  user-select: none;
}

.floating-group .floating-input:focus ~ .floating-trailing .floating-unit,
.floating-group .floating-input:not(:placeholder-shown) ~ .floating-trailing .floating-unit,
.floating-group .floating-input.has-value ~ .floating-trailing .floating-unit {
  opacity: 1;
  color: var(--text-muted);
}

.floating-group .floating-input:focus ~ .floating-trailing .floating-unit {
  color: var(--primary);
}

.floating-trailing {
  position: absolute;
  right: 1.1875rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
  pointer-events: auto;
}

.floating-clear-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-placeholder);
  color: #ffffff;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: background .12s ease, transform .12s ease;
  user-select: none;
  box-sizing: border-box;
}

.floating-clear-btn:hover {
  background: var(--text-secondary);
  transform: scale(1.1);
}

.floating-clear-btn:active {
  transform: scale(0.92);
}

.floating-group .floating-input.has-value ~ .floating-trailing .floating-clear-btn,
.floating-group .floating-input:not(:placeholder-shown) ~ .floating-trailing .floating-clear-btn {
  display: flex;
}

.floating-info-btn {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
  transition: color .12s, background .12s;
  pointer-events: auto;
}
.floating-info-btn:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.06);
}

/* [안 B] 스트라이프/애플 노치 아웃라인형 */
body.input-outline .floating-group {
  margin-top: 0.5rem;
}

body.input-outline .floating-group .floating-input {
  height: 3.375rem;
  padding: 0.875rem 2.25rem 0.875rem 0.9375rem;
  font-size: 1.0625rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg-surface);
}

body.input-outline .floating-group .floating-input:hover:not(:focus):not(:disabled) {
  border-color: var(--text-muted);
  background: var(--bg-surface);
}

body.input-outline .floating-group .floating-input:focus {
  border-color: var(--primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

body.input-outline .floating-group .floating-label {
  left: 0.75rem;
  top: 50%;
  padding: 0 5px;
  background: transparent;
  border-radius: 4px;
  line-height: 1;
}

body.input-outline .floating-group .floating-input:focus ~ .floating-label,
body.input-outline .floating-group .floating-input:not(:placeholder-shown) ~ .floating-label,
body.input-outline .floating-group .floating-input.has-value ~ .floating-label {
  top: 0;
  transform: translateY(-50%);
  font-size: 11.5px;
  font-weight: 700;
  background: var(--bg-surface);
  color: var(--text-secondary);
}

body.input-outline .floating-group .floating-input:focus ~ .floating-label {
  color: var(--primary);
}

/* ============================================================
   7. 세그먼트 스위처 & 곡률 시스템
   ============================================================ */
.seg-group {
  margin-bottom: 0.875rem;
  width: 100%;
}
.seg-group:last-child {
  margin-bottom: 0;
}
.seg-group.hidden {
  display: none !important;
}

.seg-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.4375rem;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.seg-label .hint-inline {
  font-size: var(--fs-micro);
  font-weight: 500;
  color: var(--text-muted);
}

.seg {
  display: flex;
  width: 100%;
  height: 2.875rem;
  border: none;
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
  box-sizing: border-box;
  transition: background-color .18s cubic-bezier(0.4, 0, 0.2, 1);
}

.sb {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  user-select: none;
}

.sb:hover:not(.active) {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.sb.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 곡률 시스템 */
body.radius-squircle .floating-group .floating-input { border-radius: 14px; padding-left: 0.9375rem; padding-right: 2.25rem; }
body.radius-squircle .floating-group .floating-label { left: 0.9375rem; }
body.radius-squircle .floating-group .floating-unit { right: 0.9375rem; }
body.radius-squircle .floating-trailing { right: 0.875rem; }
body.radius-squircle .seg { border-radius: 14px; }
body.radius-squircle .sb { border-radius: 10px; }
body.radius-squircle .calc-btn, body.radius-squircle .cmp-btn, body.radius-squircle .save { border-radius: 14px; }

body.radius-pill .floating-group .floating-input, body:not([class*="radius-"]) .floating-group .floating-input { border-radius: 999px; padding-left: 1.375rem; padding-right: 2.75rem; }
body.radius-pill .floating-group .floating-label, body:not([class*="radius-"]) .floating-group .floating-label { left: 1.375rem; }
body.radius-pill .floating-group .floating-unit, body:not([class*="radius-"]) .floating-group .floating-unit { right: 1.375rem; }
body.radius-pill .floating-trailing, body:not([class*="radius-"]) .floating-trailing { right: 1.1875rem; }
body.radius-pill .seg, body:not([class*="radius-"]) .seg { border-radius: 999px; }
body.radius-pill .sb, body:not([class*="radius-"]) .sb { border-radius: 999px; }
body.radius-pill .calc-btn, body.radius-pill .cmp-btn, body.radius-pill .save,
body:not([class*="radius-"]) .calc-btn, body:not([class*="radius-"]) .cmp-btn, body:not([class*="radius-"]) .save { border-radius: 999px; }

body.radius-hybrid .floating-group .floating-input { border-radius: 18px; padding-left: 1.125rem; padding-right: 2.5rem; }
body.radius-hybrid .floating-group .floating-label { left: 1.125rem; }
body.radius-hybrid .floating-group .floating-unit { right: 1.125rem; }
body.radius-hybrid .floating-trailing { right: 1rem; }
body.radius-hybrid .seg { border-radius: 999px; }
body.radius-hybrid .sb { border-radius: 999px; }
body.radius-hybrid .calc-btn, body.radius-hybrid .cmp-btn, body.radius-hybrid .save { border-radius: 999px; }

body.input-outline .seg { background: var(--bg-canvas); border: 1px solid var(--border-strong); border-radius: 10px; }
body.input-outline .sb { border-radius: 7px; }

/* ============================================================
   8. 보험 선택 카드 & 체크박스
   ============================================================ */
#settingCard {
  background: var(--bg-surface);
  border-color: transparent;
  padding: 0.75rem 1.125rem;
  margin-bottom: 0.625rem;
  transition: padding .2s cubic-bezier(0.4, 0, 0.2, 1);
}
#settingCard.open {
  padding: 1.125rem 1.125rem 1.25rem;
}

.st {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
  height: 2rem;
  padding: 0;
  box-sizing: border-box;
}
.stl { font-size: var(--fs-md); font-weight: 700; color: var(--text-primary); align-items: center; gap: 0.375rem; }
.str { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: 0.375rem; margin-left: auto; }

.sb2 { display: none; margin-top: 0.75rem; border-top: 1px solid var(--border-light); padding-top: 0.625rem; }

.gsr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5625rem 0;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.gsr:last-child { border-bottom: none; }
.gsn { font-size: var(--fs-sm); font-weight: 700; }
.gsp { font-size: var(--fs-micro); color: var(--text-muted); margin-top: 0.0625rem; }

/* 커스텀 체크박스 */
.p-chk-label {
  display: inline-block;
  position: relative;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  width: 1.5rem;
  height: 1.5rem;
}
.p-chk-label input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
.p-chk-custom {
  position: absolute;
  top: 0;
  left: 0;
  height: 1.5rem;
  width: 1.5rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.gsr:hover input:not(:checked) ~ .p-chk-custom {
  background-color: var(--bg-secondary-hover);
}
input:checked ~ .p-chk-custom {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(236, 72, 153, 0.15);
}
.gsr:hover input:checked ~ .p-chk-custom {
  background-color: #db2777;
  border-color: #db2777;
}
.p-chk-custom:after {
  content: "";
  position: absolute;
  display: none;
  left: 8px;
  top: 4px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
}
input:checked ~ .p-chk-custom:after {
  display: block;
}

/* ============================================================
   9. 계산 상세 아코디언 & 수식 결과 행
   ============================================================ */
.det-btn {
  font-size: var(--fs-micro);
  color: var(--btn-neutral-text);
  background: var(--btn-neutral-bg);
  border: none;
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .1s, color .1s;
}
.det-btn:hover {
  background: var(--btn-neutral-bg-hover);
  color: var(--btn-neutral-text-hover);
}

.calc-detail {
  margin-top: 0.625rem;
  background: var(--bg-canvas);
  border-radius: var(--r);
  padding: 0.625rem 0.75rem;
  font-size: var(--fs-micro);
}
.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  color: var(--text-secondary);
}
.calc-row + .calc-row {
  border-top: 1px solid var(--border-light);
}
.calc-formula {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 400;
}
.calc-result-row {
  color: var(--primary);
}
.calc-result-row span:first-child {
  color: var(--primary);
  font-weight: 600;
}
.calc-result-row .tabular {
  font-weight: 700;
  color: var(--primary);
}
.primary-text {
  color: var(--primary);
}

.prop-notice {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 0.625rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

/* 태그 & 요약 타일 */
.ptags { display: flex; flex-wrap: nowrap; gap: 0.25rem; margin: 0; }
.ptag { font-size: var(--fs-micro); font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--primary-bg); color: var(--primary); }

.mt { background: var(--bg-canvas); border-radius: 16px; padding: 1rem; text-align: center; }
.mt:has(.mv.g) { background: var(--primary-bg); }
.mt:has(.mv.g) .ml { color: var(--primary); }
.ml { font-size: var(--fs-micro); color: var(--text-muted); margin-bottom: 0.1875rem; }
.mv { font-size: 1.25rem; font-weight: 800; }
.mv.g { color: var(--primary); }

.grr { display: flex; align-items: flex-start; justify-content: space-between; padding: 0.6875rem 0; border-bottom: 1px solid var(--border-light); gap: 0.5rem; }
.grr:last-child { border-bottom: none; padding-bottom: 0.375rem; }
.gn { font-size: var(--fs-md); font-weight: 700; }
.gd { font-size: var(--fs-micro); color: var(--text-secondary); margin-top: 0.1875rem; line-height: 1.5; }
.gr { text-align: right; flex-shrink: 0; }
.gt { font-size: var(--fs-lg); font-weight: 700; color: var(--primary); white-space: nowrap; }
.gt.z { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 400; }

.note { font-size: var(--fs-micro); color: var(--text-muted); line-height: 1.6; margin-top: 0.75rem; padding-top: 0.625rem; border-top: 1px solid var(--border-light); }

/* ============================================================
   10. 버튼, 배너, 모달 & FAQ
   ============================================================ */
.calc-btn { width: 100%; padding: 1.125rem; background: var(--primary); color: #fff; border: none; border-radius: var(--r-btn); font-size: var(--fs-lg); font-weight: 700; cursor: pointer; margin-bottom: 0.75rem; transition: opacity .12s, background .12s; }
.calc-btn:active:not(:disabled) { opacity: .85; }
.calc-btn:disabled { background: var(--primary-disabled-bg); color: var(--primary-disabled-text); cursor: not-allowed; }

.cmp-btn { flex-shrink: 0; min-width: 6.25rem; padding: 1.125rem 1rem; background: var(--bg-surface); color: var(--primary); border: 1.5px solid var(--primary); border-radius: var(--r-btn); font-size: var(--fs-md); font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .12s, opacity .12s; }
.cmp-btn:active:not(:disabled) { opacity: .8; }
.cmp-btn:focus:not(:focus-visible) { outline: none; background: var(--bg-surface); }
.cmp-btn:disabled { border-color: var(--border-strong); color: var(--text-muted); cursor: not-allowed; background: var(--bg-surface); opacity: 0.5; }

@media (hover: hover) and (pointer: fine) {
  .calc-btn:hover:not(:disabled) { opacity: .92; }
  .cmp-btn:hover:not(:disabled) { background: var(--primary-bg); }
}

.save { width: 100%; padding: 0.8125rem; background: var(--bg-canvas); border: none; border-radius: var(--r); font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: background .1s, color .1s; }
.save:hover { background: var(--bg-secondary-hover); color: var(--text-primary); }
.save:active { background: var(--bg-secondary-active); }

.back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-secondary); text-decoration: none; font-weight: 700; transition: color .15s; width: fit-content; }
.back-btn:hover { color: var(--primary); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-micro);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1.4;
  white-space: nowrap;
}
.copy-btn:hover {
  background: var(--bg-secondary-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.copy-btn:active {
  background: var(--bg-secondary-active);
  transform: scale(0.96);
}
.copy-btn.copied {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-bg);
}

.guide-banner { display: block; text-decoration: none; }
.guide-banner .card { transition: background-color 0.15s ease !important; }
.guide-banner:hover .card { background: var(--bg-secondary-hover) !important; }
.guide-banner:active { opacity: 0.9; }

/* 모달 */
.info-icon { cursor: pointer; font-size: var(--fs-lg); margin-left: 0.5rem; opacity: 0.8; transition: opacity .15s; }
.info-icon:hover { opacity: 1; }
.modal-title { font-weight: 700; margin-bottom: 0.75rem; font-size: 0.9375rem; display: flex; align-items: center; gap: 0.375rem; }
.modal-body { font-size: var(--fs-sm); line-height: 1.6; color: var(--text-primary); }
.modal-btn { margin-top: 1rem; width: 100%; padding: 0.75rem; background: var(--bg-canvas); color: var(--text-secondary); font-weight: 700; border: none; border-radius: var(--r-btn); cursor: pointer; transition: background .1s, color .1s; }
.modal-btn:hover { color: var(--text-primary); }
.modal-btn:active { background: var(--bg-secondary-active); color: var(--text-primary); }

#alertModal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 10000; align-items: center; justify-content: center; backdrop-filter: blur(2px); }

/* FAQ 아코디언 */
#faqWrap { max-width: 580px; margin-left: auto; margin-right: auto; padding: 0 0.875rem; margin-top: 4.5rem; }
.faq-section { max-width: 580px; margin: 0 auto; padding: 0 0 0.5rem; }
.faq-section h2 { font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); letter-spacing: .05em; text-transform: uppercase; margin-bottom: 0.5rem; }
.faq-item { border-bottom: 1px solid var(--border-light); }
.faq-item:first-of-type { border-top: 1px solid var(--border-light); }
.faq-q { width: 100%; background: none; border: none; text-align: left; padding: 0.75rem 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-secondary); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; line-height: 1.4; }
.faq-q .faq-arrow { flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s; display: flex; align-items: center; }
.faq-q[aria-expanded="true"] .faq-arrow { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 0 0.75rem; font-size: var(--fs-xs); color: var(--text-secondary); line-height: 1.7; }
.faq-a.open { display: block; }
.faq-a code { display: block; background: var(--bg-secondary); border: 1px solid var(--border-light); border-radius: var(--r); padding: 0.5rem 0.75rem; margin: 0.5rem 0; font-family: inherit; font-size: var(--fs-micro); color: var(--text-primary); line-height: 1.6; }
.faq-a dl { margin: 0.5rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.75rem; }
.faq-a dt { font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.faq-a dd { margin: 0; }

/* ============================================================
   11. 반응형 레이아웃 (모바일 480px / 태블릿·데스크톱 768px)
   ============================================================ */

/* 가로 480px 이하 모바일 최적화 */
@media (max-width: 480px) {
  .card { padding: 1rem 0.875rem; }
  .summary-grid { grid-template-columns: 1fr; gap: 0.625rem; }
  .mt { padding: 0.875rem 0.75rem; }
  .mv { font-size: 1.25rem; }
  .mv.g + span { font-size: var(--fs-micro) !important; }
  .grr { gap: 0.25rem; padding: 0.5rem 0; }
  .gn { font-size: var(--fs-sm); }
  .gt { font-size: var(--fs-md); }
  .gd { font-size: 10px; margin-top: 0.1rem; }
  .gr div[style*="font-size:var(--fs-micro)"] { font-size: 10px !important; }
  .det-btn { padding: 0.2rem 0.4rem; font-size: 10px; }
}

/* 가로 768px 이상 태블릿 & 데스크톱 레이아웃 */
@media (min-width: 768px) {
  body { background: var(--bg-canvas); }
  .app { max-width: 1200px; padding-top: 1.875rem; padding-bottom: 5rem; }
  .header { border-bottom: none; background: transparent; padding: 0.625rem 0 1.875rem 0; max-width: 580px; margin-left: auto; margin-right: auto; }
  .header-title { font-size: 1.625rem; }
  .header-sub { font-size: var(--fs-md); margin-top: 0.375rem; }
  .history-btn { padding: 8px 16px; margin-top: 2px; }
  .history-btn .history-label { display: inline; }
  #settingCard, #noMsg, #singleMode, #historyList, #historyHeader, #faqWrap, #compareSection { max-width: 580px; margin-left: auto; margin-right: auto; }
  #faqWrap { padding: 0; }
  .card { box-shadow: 0 2px 16px rgba(0,0,0,0.05); border: none; padding: 1.5rem; }
  #settingCard { padding: 0.8125rem 1.25rem; }
  #settingCard.open { padding: 1.375rem 1.375rem 1.5rem; }
}
