.legal-page { font-family: 'Noto Sans KR', sans-serif; max-width: 860px; margin: 0 auto; color: #222; line-height: 1.8; }
.legal-page h1 { font-size: 1.6em; font-weight: 700; color: #1a3a5c; border-bottom: 3px solid #1a3a5c; padding-bottom: 12px; margin-bottom: 24px; }
.legal-page h2 { font-size: 1.2em; font-weight: 700; color: #1a3a5c; margin-top: 40px; margin-bottom: 12px; padding-left: 12px; border-left: 4px solid #2e7fd8; }
.legal-page h3 { font-size: 1.05em; font-weight: 700; margin-top: 24px; color: #333; }
.legal-toc { background: #fff; border: 0.5px solid #d0dce8; border-radius: 12px; padding: 28px 32px; margin-bottom: 36px; }
.legal-toc-label { font-size: 11px; font-weight: 600; letter-spacing: 2px; color: #888; text-transform: uppercase; margin: 0 0 16px; }
.legal-toc ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0; }
.legal-toc li { display: flex; align-items: center; gap: 7px; }
.legal-toc-num { font-size: 11px; font-weight: 600; color: #aaa; width: 20px; flex-shrink: 0; }
.legal-toc a { font-size: 0.85em; font-weight: 500; color: #1a3a5c; text-decoration: none; padding: 10px 0; border-bottom: 0.5px solid #e8edf2; flex: 1; display: flex; align-items: center; justify-content: space-between; }
.legal-toc li:last-child a { border-bottom: none; }
.legal-toc a::after { content: "→"; font-size: 0.85em; color: #aaa; }
.legal-toc a:hover { color: #2e7fd8; }
.legal-toc a:hover::after { color: #2e7fd8; }
.legal-page table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; font-size: 0.95em; }
.legal-page th { background: #1a3a5c; color: #fff; padding: 10px 14px; text-align: left; }
.legal-page td { padding: 10px 14px; border-bottom: 1px solid #e0e0e0; }
.legal-page tr:nth-child(even) td { background: #f9f9f9; }
.legal-hero-img { width: 100%; max-height: 320px; object-fit: cover; border-radius: 8px; margin-bottom: 28px; }
.legal-check { background: #f0f7ff; border-left: 4px solid #2e7fd8; padding: 14px 18px; border-radius: 0 6px 6px 0; margin: 16px 0; }

/* ── CTA ──────────────────────────────────────────────── */
.legal-cta { background: #1a3a5c; border-radius: 16px; padding: 48px 40px 44px; text-align: center; margin-top: 48px; }
.legal-cta-label { display: inline-block; font-size: 0.78em; font-weight: 600; color: #a8c8f0; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 16px; }
.legal-cta-office { font-size: 2em; font-weight: 800; color: #fff; margin: 0 0 8px; letter-spacing: -0.5px; line-height: 1.25; }
.legal-cta-phone { font-size: 1.35em; font-weight: 700; color: #ffd76b; margin: 0 0 20px; display: block; }
.legal-cta-divider { width: 40px; height: 2px; background: rgba(255,255,255,0.2); margin: 0 auto 20px; border: none; }
.legal-cta p { color: #b8d0e8; font-size: 0.97em; line-height: 1.75; margin: 0 auto 32px; max-width: 480px; }
.legal-cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.legal-cta-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: 8px; font-weight: 700; text-decoration: none; font-size: 0.97em; min-width: 148px; }
.btn-phone { background: #fff; color: #1a3a5c; }
.btn-kakao { background: #FEE500; color: #3c1e1e; }
.btn-online { background: #2e7fd8; color: #fff; border: none; }
@media (max-width: 560px) {
  .legal-cta { padding: 36px 20px; }
  .legal-cta-office { font-size: 1.5em; }
  .legal-cta-btn { width: 100%; min-width: 0; }
}

/* ── 디자인 유틸리티 (AI가 class로 활용) ─────────────────── */

/* 강조 박스 */
.box-blue  { background: #f4f8ff; border: 1px solid #d0e3f7; border-radius: 8px; padding: 18px 22px; margin: 16px 0; }
.box-gray  { background: #f7f8fa; border: 1px solid #e0e0e0; border-radius: 8px; padding: 18px 22px; margin: 16px 0; }
.box-warn  { background: #fffbea; border: 1px solid #f0d060; border-radius: 8px; padding: 16px 20px; margin: 16px 0; }
.box-red   { background: #fff8f8; border: 1px solid #f5c6c6; border-radius: 8px; padding: 16px 20px; margin: 16px 0; }

/* 아코디언형 항목 */
.acc-item  { border: 1px solid #d0dce8; border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.acc-head  { background: #1a3a5c; color: #fff; padding: 12px 18px; font-weight: 700; }
.acc-body  { background: #f9fbfd; padding: 14px 18px; font-size: 0.96em; }

/* 번호 스텝 */
.step-list { list-style: none; margin: 0; padding: 0; }
.step-item { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.step-num  { flex-shrink: 0; width: 56px; height: 36px; background: #1a3a5c; color: #fff; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1em; }

/* 카드 그리드 */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 16px 0; }
.card-item { background: #f4f8ff; border: 1px solid #d0e3f7; border-radius: 8px; padding: 16px 18px; }
.card-num  { font-size: 1.4em; font-weight: 800; color: #2e7fd8; margin-bottom: 6px; }

/* 좌측 강조선 */
.border-point { border-left: 4px solid #2e7fd8; padding-left: 14px; margin: 16px 0; }

/* 체크리스트 */
.check-list { list-style: none; padding: 0; margin: 8px 0; }
.check-list li { padding: 9px 0 9px 32px; position: relative; border-bottom: 0.5px solid #f0f3f7; }
.check-list li:last-child { border-bottom: none; }
.check-list li::before { content: "✓"; position: absolute; left: 8px; color: #2e7fd8; font-weight: 700; }

/* ── 업무분야 그리드 ──────────────────────────────────────── */
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0 32px; align-items: start; }
.field-card { background: #fff; border: 0.5px solid #d0dce8; border-radius: 10px; overflow: hidden; }
.field-card-head { background: #f7f9fc; padding: 12px 16px; font-weight: 700; font-size: 0.92em; color: #1a3a5c; border-bottom: 0.5px solid #e0e8f0; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.field-card-head::after { content: "＋"; font-size: 1em; font-weight: 400; color: #2e7fd8; }
.field-card.open .field-card-head::after { content: "－"; }
.field-card-body { display: none; padding: 10px 16px 14px; }
.field-card.open .field-card-body { display: block; }
.field-list { list-style: none; margin: 0; padding: 0; }
.field-list li { padding: 5px 0; border-bottom: 0.5px solid #f0f3f7; }
.field-list li:last-child { border-bottom: none; }
.field-list a { font-size: 0.88em; color: #2e7fd8; text-decoration: none; }
.field-list a:hover { text-decoration: underline; }
/* ══════════════════════════════════════════════════════════
   legal_style.css 뒤에 이어 붙이는 v2 추가분
   - 핵심요약/메타정보/법조문·주의·실무포인트 박스/참고자료
   - PC 2단 레이아웃(본문+사이드바) / 모바일 1단 스크롤
   ══════════════════════════════════════════════════════════ */

/* ── 핵심 요약 (H1 바로 아래, AEO 즉답 박스) ── */
.core-summary { background:#f0f5ff; border-left:4px solid #1a3a5c; border-radius:0 8px 8px 0; padding:16px 20px; margin:16px 0 20px; }
.core-summary-label { display:inline-block; font-size:11px; font-weight:800; color:#1a3a5c; letter-spacing:.08em; margin-right:8px; }
.core-summary p { display:inline; margin:0; font-size:15px; line-height:1.75; color:#222; }

/* ── 메타 정보 행 ── */
.meta-info-row { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 20px; }
.meta-tag { display:inline-block; padding:4px 12px; background:#f2f4f7; border-radius:14px; font-size:12px; color:#666; font-weight:500; }

/* ── 법조문 박스 ── */
.box-law { background:#fafafa; border:1px solid #ddd; border-left:4px solid #444; border-radius:0 6px 6px 0; padding:16px 20px; margin:16px 0; }
.box-law-label { font-size:11px; font-weight:800; letter-spacing:.1em; color:#888; margin:0 0 6px; }
.box-law-title { font-size:14px; font-weight:700; color:#1a3a5c; margin:0 0 8px; }
.box-law p:last-child { font-size:14px; color:#444; line-height:1.7; margin:0; }

/* box-warn/box-blue 는 legal_style.css 에 이미 있음 — 라벨만 보강 */
.box-warn-label, .box-blue-label { font-size:11px; font-weight:800; letter-spacing:.08em; margin:0 0 6px; display:block; }
.box-warn-label { color:#c0392b; }
.box-blue-label { color:#2e7fd8; }

/* ── 체크리스트 그룹 (카테고리별) ── */
.checklist-group { margin:14px 0; }
.checklist-cat { font-size:14px; font-weight:700; color:#1a3a5c; margin:0 0 6px; }

/* ── 공식 참고자료 ── */
.ref-list { list-style:none; margin:12px 0 0; padding:0; }
.ref-list li { margin-bottom:8px; }
.ref-list a { font-size:14px; color:#2e7fd8; text-decoration:none; }
.ref-list a:hover { text-decoration:underline; }

/* ══════════════════════════════════════════════════════════
   PC 2단 레이아웃 / 모바일 1단 스크롤
   ══════════════════════════════════════════════════════════ */
.page-layout { display:grid; grid-template-columns:1fr 300px; gap:36px; align-items:start; }
.page-main { min-width:0; }
.page-sidebar { display:flex; flex-direction:column; gap:16px; align-self:start; scrollbar-width:thin; }
.page-sidebar::-webkit-scrollbar { width:6px; }
.page-sidebar::-webkit-scrollbar-thumb { background:#d0d8e2; border-radius:3px; }
/* position은 JS(fix_php_seocho.py 내 스크립트)가 동적으로 제어. CSS에서 sticky/!important 지정 금지 — JS의 inline style을 덮어써서 충돌함 */

.sidebar-card { background:#fff; border:1px solid #e4eaf2; border-radius:10px; padding:20px 22px; }
.sidebar-card-title { font-size:15px; font-weight:800; color:#1a3a5c; letter-spacing:.02em; margin:0 0 14px; padding-bottom:10px; border-bottom:1px solid #eee; }
.sidebar-card-desc { font-size:14.5px; color:#666; line-height:1.65; margin:0 0 10px; }
.sidebar-related-link { display:block; padding:9px 0; font-size:15px; color:#333; text-decoration:none; border-bottom:1px solid #f2f4f7; }
.sidebar-related-link:hover { color:#1a3a5c; }
.sidebar-more-link { display:block; margin-top:12px; font-size:14px; color:#2e7fd8; text-decoration:none; font-weight:600; }
.sidebar-more-link:hover { text-decoration:underline; }

/* 사이드바 상담예약 CTA */
.sidebar-cta { background:#1a3a5c; border:none; }
.sidebar-cta-label { font-size:12.5px; font-weight:800; color:#e5b987; letter-spacing:.1em; margin:0 0 8px; }
.sidebar-cta-phone { font-size:22px; font-weight:800; color:#fff; margin:0 0 10px; }
.sidebar-cta-desc { font-size:14px; color:rgba(255,255,255,.75); line-height:1.6; margin:0 0 16px; }
.sidebar-cta-btn { display:flex; align-items:center; justify-content:center; gap:6px; width:100%; padding:12px; margin-bottom:9px; border-radius:6px; font-size:15px; font-weight:700; text-decoration:none; box-sizing:border-box; }
.sidebar-cta-btn:last-child { margin-bottom:0; }
.sidebar-cta .btn-phone { background:#fff; color:#1a3a5c; }
.sidebar-cta .btn-kakao { background:#FEE500; color:#3c1e1e; }
.sidebar-cta .btn-naver { background:#03C75A; color:#fff; }
.sidebar-cta .btn-online { background:transparent; color:#fff; border:1px solid rgba(255,255,255,.4); }

/* ── 모바일: 1단 스크롤로 전환 (사이드바가 본문 뒤로 자연스럽게 이동) ── */
@media(max-width:900px) {
  .page-layout { display:block; }
  .page-sidebar { position:static; margin-top:40px; }
}


/* ══════════════════════════════════════════════════════════
   목차(TOC) 중첩 구조 레이아웃 수정
   - 기본 legal_style.css 의 flex 규칙(.legal-toc li{display:flex})이
     대분류+하위목록 중첩 구조와 충돌하여 깨지는 문제를 Grid로 해결
   - 기존에 이미 생성된 페이지의 HTML도 수정 없이 그대로 적용됨
   ══════════════════════════════════════════════════════════ */
.legal-toc > ol > li {
  display: grid !important;
  grid-template-columns: 16px 1fr;
  grid-template-areas: "num link" "sub sub";
  column-gap: 8px;
  align-items: start !important;
  padding: 2px 0;
  border-bottom: 0.5px solid #e8edf2;
}
.legal-toc > ol > li:last-child { border-bottom: none; }
.legal-toc-num { grid-area: num; padding-top: 2px; font-size: 0.65em !important; }
.legal-toc > ol > li > a { grid-area: link; padding: 0 !important; border-bottom: none !important; font-size: 1em !important; }
.legal-toc-sub {
  grid-area: sub;
  list-style: none;
  margin: 4px 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0px;
}
.legal-toc-sub li { display: block; border-bottom: none; padding: 0; }
.legal-toc-sub a {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.85em; font-weight: 400; color: #777;
  padding: 2px 0; border-bottom: none;
}
.legal-toc-sub a:hover { color: #2e7fd8; }


/* ══════════════════════════════════════════════════════════
   플로팅 "목차로 이동" 버튼 (build_wrapper가 생성하는 .toc-float)
   ══════════════════════════════════════════════════════════ */
.toc-float { position: fixed; bottom: 32px; right: 32px; z-index: 999; }
.toc-float a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 52px; height: 52px; background: #1a3a5c; color: #fff !important;
  border-radius: 50%; box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  text-decoration: none !important; font-size: 0.65em; font-weight: 700;
  line-height: 1.2; transition: background 0.18s; gap: 2px;
}
.toc-float a:hover { background: #2e7fd8; }
@media (max-width: 560px) { .toc-float { bottom: 18px; right: 18px; } }


/* ══════════════════════════════════════════════════════════
   문단 간격 확대 (기존 대비 약 2배)
   ══════════════════════════════════════════════════════════ */
.legal-page p { margin: 0 0 32px; }
.legal-page p:last-child { margin-bottom: 0; }


/* ══════════════════════════════════════════════════════════
   모바일 테이블 가로 스크롤 (JS가 table을 .table-scroll로 감쌈)
   ══════════════════════════════════════════════════════════ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 16px 0 24px; }
.table-scroll table { margin: 0; min-width: 480px; }
@media (max-width: 640px) {
  .table-scroll::after {
    content: "← 좌우로 스크롤하여 전체 표를 확인하세요 →";
    display: block; text-align: center; font-size: 11px; color: #aaa;
    padding: 6px 0 0;
  }
}


/* legal-toc 박스 자체 패딩 축소 */
.legal-toc { padding: 18px 22px !important; margin-bottom: 24px !important; }
.legal-toc-label { margin: 0 0 10px !important; }