/* =========================================================
 * 직장인 N잡·부업 합산 세금 & 건보료 임계점 시뮬레이터 마스터 스타일시트
 * 제7조 한국어 조판 6대 불변 규칙 + 애드센스 CLS 0 방어 규격 준수
 * ========================================================= */

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #eff6ff;
  --border-color: #e2e8f0;
  --safe-green: #059669;
  --safe-bg: #ecfdf5;
  --warn-amber: #d97706;
  --warn-bg: #fffbeb;
  --danger-red: #dc2626;
  --danger-bg: #fef2f2;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
}

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

html {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Noto Sans KR", sans-serif;
  font-synthesis: none;
  line-height: 1.65;
  color: var(--text-main);
  background-color: var(--bg-page);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-align: left;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  line-height: 1.35;
  margin-top: 0;
  color: var(--text-main);
}

p,
li,
dd,
td {
  text-wrap: pretty;
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 숫자 등폭 조판 규칙 */
.tabular-nums,
table td,
table th,
input[type="number"],
.metric-value,
.gauge-number {
  font-variant-numeric: tabular-nums;
}

/* 애드센스 Core Web Vitals CLS 0 레이아웃 예약 규격 (승인 전 더미 노출 없음) */
.ad-slot-reserved {
  contain: layout;
  min-height: 90px;
  width: 100%;
  display: none;
}

/* 상단 헤더 및 글로벌 라우트 네비게이션 */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-logo {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.route-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.route-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.route-nav a:hover,
.route-nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary);
}

/* 메인 컨테이너 */
.main-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero-section {
  margin-bottom: 1.75rem;
}

.badge-pill {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.hero-section h1 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
}

/* AEO 두괄식 정답 요약 박스 */
.aeo-summary-box {
  background: var(--bg-card);
  border-left: 4px solid var(--primary);
  padding: 1.1rem 1.35rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
  max-width: 48rem;
}

.aeo-summary-box p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.98rem;
}

/* 시뮬레이터 그리드 (Above the Fold) */
.simulator-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 820px) {
  .simulator-grid {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.form-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.input-control,
.select-control {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  font-size: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text-main);
}

.input-control:focus,
.select-control:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.chip-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}

.chip-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.btn-primary,
.btn-secondary {
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: background-color 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  flex: 1;
}

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

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* 결과 카드 및 건보료 임계점 게이지 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.kpi-box {
  background: var(--bg-subtle);
  padding: 0.95rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.kpi-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.kpi-box.highlight-refund {
  background: var(--safe-bg);
  border-color: #a7f3d0;
}

.kpi-box.highlight-refund .kpi-value {
  color: var(--safe-green);
}

.kpi-box.highlight-pay {
  background: var(--warn-bg);
  border-color: #fde68a;
}

.kpi-box.highlight-pay .kpi-value {
  color: var(--warn-amber);
}

.gauge-container {
  background: var(--bg-subtle);
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
}

.gauge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.gauge-track {
  width: 100%;
  height: 14px;
  background: #cbd5e1;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.gauge-fill {
  height: 100%;
  width: 45%;
  background: var(--safe-green);
  transition: width 0.25s ease, background-color 0.25s ease;
}

.gauge-caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.viral-loop-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.feedback-Banner {
  margin-top: 0.65rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--safe-green);
  min-height: 1.4em;
}

/* 본문 가독 폭 및 아티클 섹션 */
.content-article {
  max-width: 44rem;
  margin-inline: auto;
}

.content-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.content-section h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.data-table-wrapper {
  overflow-x: auto;
  margin: 1rem 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  border: 1px solid var(--border-color);
  padding: 0.65rem 0.85rem;
  text-align: left;
}

.data-table th {
  background: var(--bg-subtle);
  font-weight: 700;
}

/* FAQ 아코디언 */
.faq-accordion-section details {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
  background: #fff;
}

.faq-accordion-section summary {
  font-weight: 700;
  cursor: pointer;
  color: var(--text-main);
}

.faq-accordion-section details p {
  margin: 0.7rem 0 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

/* 1-Hop 내부 링크 크롤 메쉬 */
.crawl-mesh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.mesh-card {
  display: block;
  text-decoration: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  color: var(--text-main);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.mesh-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.mesh-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.mesh-card-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
  margin: 0;
}

/* YMYL 면책조항 박스 & 푸터 */
.disclaimer-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2rem;
}

.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 2rem 1.25rem;
  margin-top: 3rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--primary);
}
