/* ==========================================
   더보다 AI - 보고서 출력용 스타일 (A4 세로)
   v2.0 전면 재작성 — 인쇄 품질 최적화
   ========================================== */

@media print {

  /* ── A4 Setup ── */
  @page {
    size: A4 portrait;
    margin: 0;
  }

  /* ── 인쇄 색상 강제 적용 ── */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  /* ── UI 요소 완전 숨기기 ── */
  .sidebar, .topbar, .topbar-actions, .toast-container,
  .no-print, .tab-nav-buttons, .btn,
  .section-header .btn, #save-btn, #preview-btn,
  .preview-toolbar {
    display: none !important;
  }

  /* ── 미리보기 래퍼 배경 제거 ── */
  body, html {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .preview-wrap {
    background: #fff !important;
    padding: 0 !important;
  }
  .report-viewer {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* ── 기본 보고서 페이지 ── */
  .report-page {
    width: 210mm;
    min-height: 297mm;
    padding: 15mm 15mm 20mm;
    margin: 0 !important;
    background: #fff !important;
    color: #0a1628 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    border: none !important;
    page-break-after: always;
    position: relative;
    box-sizing: border-box;
    font-family: 'Pretendard Variable', 'Nanum Square Neo', 'Noto Sans KR', sans-serif;
    font-size: 9.5pt;
    line-height: 1.55;
  }
  .report-page:last-child {
    page-break-after: avoid;
  }

  /* ──────────────────────────────────
     표지 (풀 배경 모던 레이아웃)
     ────────────────────────────────── */
  .cover-page {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    height: 297mm;
    overflow: hidden;
    background: #1a3669 !important;
    color: #fff !important;
  }
  .cover-page * { color: #fff !important; }
  .cover-top {
    padding: 12mm 12mm 0;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
  }
  .cover-doc-label {
    font-size: 7pt;
    color: rgba(255,255,255,0.5) !important;
    letter-spacing: 0.15em;
    font-weight: 500;
  }
  .cover-hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12mm;
  }
  .cover-glass {
    background: rgba(255,255,255,0.08) !important;
    border: 0.3mm solid rgba(255,255,255,0.12) !important;
    border-radius: 5mm;
    padding: 11mm 12mm;
    width: 100%;
    max-width: 130mm;
  }
  .cover-accent-line {
    width: 12mm;
    height: 0.8mm;
    background: #4a90d9 !important;
    border-radius: 0.5mm;
    margin-bottom: 5mm;
  }
  .cover-title {
    font-size: 22pt !important;
    font-weight: 700;
    color: #fff !important;
    margin-bottom: 1.5mm;
    line-height: 1.2;
  }
  .cover-subtitle {
    font-size: 9pt;
    color: rgba(255,255,255,0.45) !important;
    letter-spacing: 0.06em;
    margin-bottom: 6mm;
  }
  .cover-address {
    font-size: 10pt;
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    margin-bottom: 8mm;
    line-height: 1.6;
  }
  .cover-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }
  .cover-info-item {
    padding: 2.5mm 0;
    border-bottom: 0.3mm solid rgba(255,255,255,0.08) !important;
  }
  .cover-info-label {
    font-size: 6.5pt;
    color: rgba(255,255,255,0.4) !important;
    letter-spacing: 0.05em;
    margin-bottom: 0.5mm;
  }
  .cover-info-value {
    font-size: 9pt;
    font-weight: 600;
    color: #fff !important;
  }
  .cover-bottom {
    padding: 0 12mm 9mm;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
  .cover-bottom-left {
    font-size: 7pt;
    color: rgba(255,255,255,0.3) !important;
    line-height: 1.6;
  }
  .cover-bottom-logo {
    height: 16mm !important;
  }

  /* ──────────────────────────────────
     간지 (섹션 구분 페이지)
     ────────────────────────────────── */
  .divider-page {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 297mm;
    padding: 0 !important;
    page-break-after: always;
  }
  .divider-line { width: 12mm; height: 0.8mm; background: #4a90d9 !important; margin-bottom: 6mm; border-radius: 1mm; }
  .divider-num { font-size: 9pt; font-weight: 700; color: #4a90d9 !important; letter-spacing: 0.1em; margin-bottom: 3mm; }
  .divider-title { font-size: 18pt; font-weight: 700; color: #1a3669 !important; margin-bottom: 2mm; }
  .divider-sub { font-size: 9pt; color: #4a6a8a !important; }

  /* ──────────────────────────────────
     페이지 머릿글 / 바닥글
     ────────────────────────────────── */
  .rpt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1.5pt solid #4a90d9;
    padding-bottom: 2.5mm;
    margin-bottom: 5mm;
  }
  .rpt-header-brand { font-size: 8.5pt; font-weight: 700; color: #4a90d9 !important; }
  .rpt-header-right { font-size: 7.5pt; color: #4a6a8a !important; }

  .rpt-page-title {
    font-size: 14pt;
    font-weight: 700;
    color: #0a1628 !important;
    margin-bottom: 4mm;
  }

  .rpt-section-title {
    font-size: 9.5pt;
    font-weight: 700;
    color: #4a90d9 !important;
    margin: 4mm 0 2.5mm;
    padding-left: 2.5mm;
    border-left: 2.5pt solid #4a90d9;
  }

  .rpt-footer {
    position: absolute;
    bottom: 8mm;
    left: 15mm;
    right: 15mm;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 0.4pt solid #d8e2ec;
    padding-top: 1.5mm;
    font-size: 7pt;
    color: #4a6a8a !important;
  }

  /* ──────────────────────────────────
     표 스타일
     ────────────────────────────────── */
  .info-table, .checklist-table, .fixed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
    margin-bottom: 3mm;
  }
  .info-table th, .checklist-table th {
    background: #4a90d9 !important;
    color: #fff !important;
    font-weight: 600;
    padding: 2mm 3mm;
    text-align: left;
    font-size: 7.5pt;
  }
  .info-table td, .checklist-table td {
    padding: 2mm 3mm;
    border-bottom: 0.3pt solid #d8e2ec;
  }
  .info-table .label-cell {
    color: #4a6a8a !important;
    font-weight: 600;
    font-size: 8pt;
    width: 25%;
    background: #f8fafc !important;
  }

  /* ── 판정 뱃지 ── */
  .status-badge {
    display: inline-block;
    font-size: 7pt;
    font-weight: 700;
    padding: 0.8mm 2.5mm;
    border-radius: 20pt;
  }
  .status-badge.good { background: #f0fff4 !important; color: #27ae60 !important; }
  .status-badge.normal { background: #fff8e1 !important; color: #e67e22 !important; }
  .status-badge.bad { background: #fff8e1 !important; color: #d35400 !important; }
  .status-badge.danger { background: #fff0f0 !important; color: #c0392b !important; }
  .status-badge.na { background: #f4f7fb !important; color: #7a8fa3 !important; }

  /* ── 평면도 이미지 ── */
  #preview-floorplan { max-height: 85mm !important; overflow: hidden; }
  #preview-floorplan img { max-height: 85mm !important; object-fit: contain !important; }

  /* ── 판정 기준 테이블 ── */
  .criteria-table { width: 100%; border-collapse: collapse; font-size: 8pt; margin-bottom: 3mm; }
  .criteria-table th { background: #f4f7fb !important; padding: 2mm 3mm; font-weight: 600; border-bottom: 0.5pt solid #d8e2ec; text-align: left; }
  .criteria-table td { padding: 1.5mm 3mm; border-bottom: 0.3pt solid #eef2f7; }
  .criteria-badge { display: inline-block; padding: 0.5mm 2.5mm; border-radius: 20pt; font-size: 7pt; font-weight: 700; }

  /* ──────────────────────────────────
     사진 그리드
     ────────────────────────────────── */
  .photo-grid {
    display: grid;
    gap: 2mm;
    margin: 2mm 0 3mm;
  }
  .photo-grid[data-cols="1"] { grid-template-columns: 1fr; }
  .photo-grid[data-cols="2"] { grid-template-columns: 1fr 1fr; }
  .photo-grid[data-cols="3"] { grid-template-columns: 1fr 1fr 1fr; }
  .photo-grid[data-cols="4"] { grid-template-columns: 1fr 1fr; }
  .photo-grid[data-cols="6"] { grid-template-columns: 1fr 1fr 1fr; }
  .photo-grid[data-cols="8"] { grid-template-columns: 1fr 1fr 1fr 1fr; }

  /* 모든 사진 셀을 동일한 4:3 비율로 통일.
     원본이 세로/가로 어느 쪽이든 object-fit: cover로 영역을 채워 균일한 그리드 보장.
     ※ 인쇄에서 aspect-ratio가 안 먹는 일부 엔진 대비 max-height도 함께 둠. */
  .photo-cell img {
    width: 100%;
    aspect-ratio: 4/3;
    height: auto;
    max-height: 60mm;
    object-fit: cover;
    border: 0.3pt solid #d8e2ec;
    border-radius: 1.5pt;
    display: block;
  }
  .photo-grid[data-cols="1"] .photo-cell img { max-height: 110mm; }
  .photo-grid[data-cols="2"] .photo-cell img { max-height: 75mm; }
  .photo-grid[data-cols="3"] .photo-cell img { max-height: 50mm; }
  .photo-grid[data-cols="4"] .photo-cell img { max-height: 75mm; }
  .photo-grid[data-cols="6"] .photo-cell img { max-height: 50mm; }
  .photo-grid[data-cols="8"] .photo-cell img { max-height: 38mm; }
  .photo-cell-caption {
    font-size: 7pt;
    color: #4a6a8a !important;
    text-align: center;
    padding: 0.5mm 1mm;
    background: #f8fafc !important;
    margin-top: 0.5mm;
  }

  /* ──────────────────────────────────
     진단 카드
     ────────────────────────────────── */
  .diag-card {
    border: 0.5pt solid #d8e2ec;
    border-radius: 3pt;
    margin-bottom: 3mm;
    overflow: hidden;
    page-break-inside: avoid;
  }
  .diag-card-header {
    background: #f4f7fb !important;
    padding: 2mm 3mm;
    border-bottom: 0.3pt solid #d8e2ec;
  }
  .diag-card-title { font-size: 9pt; font-weight: 700; color: #0a1628 !important; }
  .diag-card-body { padding: 2.5mm 3mm; }
  .diag-label { font-size: 8pt; font-weight: 600; color: #4a90d9 !important; margin: 2mm 0 1mm; }
  .diag-text { font-size: 8.5pt; color: #4a6a8a !important; line-height: 1.5; margin-bottom: 2mm; white-space: pre-wrap; }

  /* ── 세부판정 테이블 ── */
  .sj-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8pt;
    margin-bottom: 2mm;
  }
  .sj-table th {
    background: #f4f7fb !important;
    padding: 1.5mm 3mm;
    font-weight: 600;
    text-align: left;
    border-bottom: 0.5pt solid #d8e2ec;
  }
  .sj-table td {
    padding: 1.5mm 3mm;
    border-bottom: 0.3pt solid #eef2f7;
  }

  /* ──────────────────────────────────
     종합판단 전용
     ────────────────────────────────── */
  .summary-overall {
    display: flex;
    align-items: center;
    gap: 3mm;
    padding: 3mm 4mm;
    background: #f4f7fb !important;
    border: 0.5pt solid #d8e2ec;
    border-radius: 3pt;
    margin-bottom: 4mm;
    page-break-inside: avoid;
  }
  .overall-label { font-size: 9pt; font-weight: 700; color: #0a1628 !important; }

  /* ── 전문가 의견 박스 ── */
  .expert-box {
    border: 0.5pt solid #d8e2ec;
    border-radius: 3pt;
    padding: 3mm 4mm;
    margin-bottom: 3mm;
    page-break-inside: avoid;
  }
  .expert-box-title { font-size: 9pt; font-weight: 700; color: #4a90d9 !important; margin-bottom: 2mm; }
  .expert-box-text { font-size: 8.5pt; color: #4a6a8a !important; line-height: 1.6; white-space: pre-wrap; }

  /* ──────────────────────────────────
     Page Break 규칙 (핵심)
     ────────────────────────────────── */

  /* 카드 단위로 분리 금지 — 카드 전체가 다음 페이지로 */
  .diag-card,
  .expert-box,
  .summary-overall,
  .photo-grid {
    page-break-inside: avoid;
  }

  /* 2026-08-22 acPipe 통합 카드(사진 무캡) — 카드 통째 avoid 면 다사진 시 강제 분할로
     사진이 페이지 경계에서 잘림. 카드만 분할 허용, 사진은 4장 청크 .photo-grid(위 avoid) 단위 보호. */
  .diag-card-multipage {
    page-break-inside: auto;
  }

  /* 표 단위로 분리 금지 */
  .info-table,
  .checklist-table,
  .sj-table,
  .criteria-table,
  .cover-info-grid {
    page-break-inside: avoid;
  }

  /* 제목 뒤에서 끊기지 않도록 */
  .rpt-page-title,
  .rpt-section-title,
  .diag-card-header,
  h1, h2, h3 {
    page-break-after: avoid;
  }

  /* 표지/간지는 반드시 단독 페이지 */
  .cover-page,
  .divider-page {
    page-break-after: always;
    page-break-before: auto;
  }

  /* ──────────────────────────────────
     기타
     ────────────────────────────────── */
  .empty-text { font-size: 8pt; color: #aab8c2 !important; font-style: italic; }

  /* 빈 페이지 숨기기용 (내용 없는 마지막 페이지) */
  .report-page:empty { display: none; }
}

/* ==========================================
   §9.2 신축 보고서 — 점검 결과 요약 (PR1) + §9.4 표 (PR2)
   더보다 AI 디자인 규칙 (THEBODA-DESIGN-RULES.md) 준수
   ========================================== */

/* ── §9.2 점검 결과 요약 ── */
.precheck-summary {
  font-family: 'Pretendard Variable', 'Nanum Square Neo', 'Noto Sans KR', sans-serif;
  color: #0a1628;
}
.precheck-summary-title {
  font-size: 18pt;
  font-weight: 700;
  color: #1a3669;
  margin: 0 0 8mm 0;
  padding-bottom: 3mm;
  border-bottom: 2px solid #4a90d9;
}
.precheck-summary-cards {
  display: flex;
  gap: 8mm;
  margin-bottom: 8mm;
}
.precheck-summary-card {
  flex: 1;
  background: #f4f7fb;
  border-radius: 14px;
  padding: 6mm;
  text-align: center;
  border-left: 4px solid #4a90d9;
}
.precheck-summary-card-title {
  font-size: 10pt;
  font-weight: 500;
  color: #4a6a8a;
  margin-bottom: 2mm;
}
.precheck-summary-card-value {
  font-size: 22pt;
  font-weight: 700;
  color: #1a3669;
}
.precheck-summary-section {
  margin-bottom: 6mm;
}
.precheck-summary-section h2 {
  font-size: 12pt;
  font-weight: 700;
  color: #1a3669;
  margin: 0 0 3mm 0;
}
.precheck-summary-severity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4mm;
}
.precheck-summary-severity-chip {
  display: inline-block;
  padding: 1mm 3mm;
  border-radius: 9999px;
  font-size: 10pt;
  font-weight: 500;
  background: #f4f7fb;
  color: #0a1628;
}
.precheck-summary-severity-chip.severity-major {
  background: #fff0f0;
  color: #c0392b;
}
.precheck-summary-severity-chip.severity-normal {
  background: #fff8e1;
  color: #e67e22;
}
.precheck-summary-severity-chip.severity-confirm {
  background: #f0fff4;
  color: #27ae60;
}
.precheck-summary-severity-chip.severity-unset {
  background: #f4f7fb;
  color: #4a6a8a;
}
/* 2026-07-22 — 장비 점검 "별도 기록" 상시 안내 (건수·목록 표기 제거) */
.precheck-summary-equipment-note {
  font-size: 9pt;
  color: #4a6a8a;
  margin: 0 0 2mm 0;
}
/* ============================================
 * 2026-05-22 PR-Chart — §9.2 가로 바 + §9.2.1 공간별 유형 분포
 * spec: docs/superpowers/specs/2026-05-22-pr-chart-room-type-distribution-design.md
 * ============================================ */

/* ===== ①③ §9.2 가로 바 (공간별 + 유형별) ===== */
.precheck-summary-distribution {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.precheck-summary-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.precheck-summary-bar-label {
  width: 80px;
  font-size: 12px;
  color: #4a6a8a;
  text-align: right;
  flex-shrink: 0;
}

.precheck-summary-bar-track {
  flex: 1;
  background: #f4f7fb;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
}

.precheck-summary-bar-fill {
  height: 100%;
  border-radius: 8px;
}

.precheck-summary-bar-value {
  width: 36px;
  text-align: right;
  font-size: 13px;
  color: #0a1628;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== ② §9.2.1 공간별 유형 분포 (방 카드 grid) ===== */
.precheck-room-types {
  /* report-page 기본 padding 상속 */
}

.precheck-room-types-title {
  font-size: 24px;
  font-weight: 700;
  color: #0a1628;
  margin: 0 0 20px 0;
}

.precheck-room-types-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

.precheck-room-type-card {
  background: #f4f7fb;
  border-radius: 12px;
  padding: 12px 14px;
}

.precheck-room-type-card-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #0a1628;
  margin-bottom: 8px;
}

.precheck-room-type-card-header-total {
  color: #1a3669;
}

.precheck-room-type-card-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.precheck-room-type-card-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}

.precheck-room-type-card-label {
  width: 50px;
  color: #4a6a8a;
  text-align: right;
  flex-shrink: 0;
}

.precheck-room-type-card-track {
  flex: 1;
  background: #ffffff;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}

.precheck-room-type-card-fill {
  height: 100%;
  border-radius: 5px;
}

.precheck-room-type-card-value {
  width: 18px;
  text-align: right;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== 인쇄 (PDF) ===== */
@media print {
  .precheck-summary-bar-fill,
  .precheck-room-type-card-fill,
  .precheck-room-type-card,
  .precheck-summary-bar-track,
  .precheck-room-type-card-track {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .precheck-summary-section,
  .precheck-room-types-grid,
  .precheck-room-type-card {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
.precheck-summary-empty {
  font-size: 10pt;
  color: #4a6a8a;
  font-style: italic;
  margin: 0;
}
.precheck-summary-priority-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.precheck-summary-priority-list li {
  padding: 1.5mm 0;
  font-size: 10pt;
  color: #0a1628;
  border-bottom: 1px solid #f4f7fb;
}
.precheck-summary-priority-list li:last-child {
  border-bottom: none;
}

/* ── §9.4 하자 접수 요약표 ── */
.precheck-table-page {
  font-family: 'Pretendard Variable', 'Nanum Square Neo', 'Noto Sans KR', sans-serif;
  color: #0a1628;
}
.precheck-table-title {
  font-size: 16pt;
  font-weight: 700;
  color: #1a3669;
  margin: 0 0 6mm 0;
  padding-bottom: 2.5mm;
  border-bottom: 2px solid #4a90d9;
}
.precheck-table-empty {
  font-size: 11pt;
  color: #4a6a8a;
  font-style: italic;
  text-align: center;
  margin: 20mm 0;
}
.precheck-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
  table-layout: fixed;
}
.precheck-table thead {
  background: #1a3669;
  color: #fff !important;
}
.precheck-table th {
  padding: 2mm 2mm;
  text-align: center;
  font-weight: 600;
  color: #fff !important;
  border-right: 1px solid #4a90d9;
}
.precheck-table th:last-child { border-right: none; }
.precheck-table .th-no    { width: 6%; }
.precheck-table .th-room  { width: 12%; }
.precheck-table .th-loc   { width: 12%; }
.precheck-table .th-types { width: 16%; }
.precheck-table .th-detail{ width: 46%; }
.precheck-table .th-photo { width: 8%; }
.precheck-table tbody tr {
  border-bottom: 1px solid #f4f7fb;
  page-break-inside: avoid;
}
.precheck-table tbody tr:nth-child(even) {
  background: #f4f7fb;
}
.precheck-table td {
  padding: 1.8mm 2mm;
  color: #0a1628;
  vertical-align: middle;
  border-right: 1px solid #f4f7fb;
}
.precheck-table td:last-child { border-right: none; }
.precheck-table .td-no    { text-align: center; color: #4a6a8a; }
.precheck-table .td-room  { text-align: center; font-weight: 500; }
.precheck-table .td-loc   { text-align: center; color: #4a6a8a; }
.precheck-table .td-types {
  white-space: normal;
  line-height: 1.4;
  word-break: keep-all;
}
.precheck-table .td-detail {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #4a6a8a;
}
.precheck-table .td-photo { text-align: center; color: #4a90d9; font-weight: 700; }

/* ── §9.5 공간별 상세 (#22 v2 — 표 형식 재설계) ── */
.precheck-rooms-page {
  font-family: 'Pretendard Variable', 'Nanum Square Neo', 'Noto Sans KR', sans-serif;
  color: #0a1628;
}
.precheck-rooms-title {
  font-size: 16pt;
  font-weight: 700;
  color: #1a3669;
  margin: 0 0 6mm 0;
  padding-bottom: 2.5mm;
  border-bottom: 2px solid #4a90d9;
}
.precheck-rooms-empty {
  font-size: 11pt;
  color: #4a6a8a;
  font-style: italic;
  text-align: center;
  margin: 20mm 0;
}

/* 표 자체 */
.precheck-rooms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 9pt;
  table-layout: fixed;
}
.precheck-rooms-th {
  background: #f4f7fb;
  color: #0a1628;
  font-weight: 600;
  font-size: 10pt;
  padding: 3mm 2mm;
  border-bottom: 1px solid #4a90d9;
  text-align: center;
  vertical-align: middle;
}
/* #22 follow-up — 등급 column 제거, 사진 크게, 비고 10% */
.precheck-rooms-th.th-no { width: 6%; }
.precheck-rooms-th.th-loc { width: 10%; }
.precheck-rooms-th.th-types { width: 12%; }
.precheck-rooms-th.th-far,
.precheck-rooms-th.th-near { width: 28%; }
.precheck-rooms-th.th-note { width: 10%; }

.precheck-rooms-row {
  page-break-inside: avoid;
}
.precheck-rooms-row.room-header {
  page-break-after: avoid;
}
.precheck-rooms-room-header-cell {
  background: #ffffff;
  color: #1a3669;
  font-weight: 700;
  font-size: 14pt;
  padding: 4mm 2mm 2mm 0;
  border-top: 2px solid #1a3669;
  border-bottom: 1px solid #e8eef6;
}

.precheck-rooms-td {
  padding: 2mm;
  border-bottom: 1px solid #f0f4f8;
  vertical-align: middle;
  font-size: 9pt;
  word-break: break-word;
}
.precheck-rooms-td.td-no { text-align: center; }
.precheck-rooms-td.td-photo {
  text-align: center;
  position: relative;
}
.precheck-rooms-td.td-note { white-space: pre-wrap; }

/* 사진 슬롯 — 2026-05-19: 1:1(45×45mm) → 3:2(45×30mm) 가로 비율
   휴대폰 가로 촬영 비율 정합 + 행 높이 ~33% 압축 (PDF 가독성 향상). */
.precheck-room-photo-img {
  width: 45mm;
  height: 30mm;
  object-fit: cover;
  border-radius: 4px;
  display: inline-block;
}
.precheck-room-photo-empty {
  width: 45mm;
  height: 30mm;
  border: 1px dashed #b9c4cf;
  background: #f4f7fb;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4a6a8a;
  font-size: 11pt;
  font-weight: 600;
}
.precheck-room-photo-badge {
  position: absolute;
  top: 3mm;
  right: 3mm;
  background: #1a3669;
  color: #ffffff;
  font-size: 8pt;
  font-weight: 600;
  padding: 0.5mm 2mm;
  border-radius: 9999px;
  min-width: 8mm;
  text-align: center;
}

/* 등급 배지 — #22 follow-up: 등급 column 제거됨. CSS 보존 (미래 PC 편집기 등급 입력 시 활용 가능). dead path. */
.precheck-severity-badge {
  display: inline-block;
  font-size: 8pt;
  font-weight: 600;
  padding: 0.5mm 2.5mm;
  border-radius: 9999px;
  white-space: nowrap;
}
.precheck-severity-badge.severity-normal {
  color: #27ae60;
  background: #f0fff4;
}
.precheck-severity-badge.severity-confirm {
  color: #e67e22;
  background: #fff8e1;
}
.precheck-severity-badge.severity-major {
  color: #c0392b;
  background: #fff0f0;
}

/* 공통 안내 footer (마지막 페이지만) */
.precheck-rooms-footer {
  margin-top: 6mm;
  padding: 3mm 4mm;
  font-size: 10pt;
  color: #4a6a8a;
  background: #f4f7fb;
  border-radius: 8px;
  line-height: 1.6;
}

/* ── §9.6 장비 점검 결과 — F pivot 표 only ──
   2026-05-22 PR-PrecheckReset v7 T1.5 — 옛 5-col flatten table CSS dropped:
   .precheck-equipment-table, .precheck-equipment-th.th-*, .precheck-equipment-td.td-loc/td-item/td-val/td-std/td-jud,
   .precheck-equipment-opinion (옛 line 914-968). retained CSS = F pivot 표 전용 (.precheck-equipment-table-f 이하). */
.precheck-equipment-page {
  font-family: 'Pretendard Variable', 'Nanum Square Neo', 'Noto Sans KR', sans-serif;
  color: #0a1628;
}
.precheck-equipment-title {
  font-size: 16pt;
  font-weight: 700;
  color: #1a3669;
  margin: 0 0 6mm 0;
  padding-bottom: 2.5mm;
  border-bottom: 2px solid #4a90d9;
}

/* === v8 location-pivot 표 (F 카테고리 전용 — T1.6 section-categories.js 호출) === */
.precheck-equipment-table-f {
  width: 100%;
  border-collapse: collapse;
}
/* thead 정합 — 옛 table 의 dark 헤더 (.precheck-equipment-th color:#fff !important) 와 일치 */
.precheck-equipment-table-f thead {
  background: #1a3669;
  color: #fff;
}
.precheck-equipment-table-f th,
.precheck-equipment-table-f td {
  border: 1px solid #e0e6ee;
  padding: 4px 6px;
  font-size: 9pt;
  text-align: center;
}
.precheck-equipment-table-f .td-loc {
  text-align: left;
  color: #4a6a8a;
  font-weight: 500;
}
.precheck-equipment-table-f .td-iaq {
  color: #0a1628;
  white-space: nowrap;
}

/* === IAQ 배지 (양호 / 기준 초과) === */
.iaq-badge {
  display: block;
  margin-top: 3px;
  font-size: 0.78em;
  line-height: 1.15;
  white-space: normal;
}
.iaq-badge.badge-good { color: #27ae60; }
.iaq-badge.badge-over { color: #c0392b; }

/* === 범례 === */
.precheck-equipment-legend {
  margin-top: 8px;
  text-align: right;
  font-size: 8.5pt;
  color: #4a6a8a;
}
.precheck-equipment-legend-item { margin-left: 12px; }

/* === footnote (기준 출처) === */
.precheck-equipment-footnote {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #e0e6ee;
  font-size: 8pt;
  color: #4a6a8a;
  line-height: 1.5;
}
.precheck-equipment-footnote-title { font-weight: 600; margin-bottom: 4px; }
.precheck-equipment-footnote-line { white-space: pre; }

/* 2026-05-20 #12-PR5 — §9.9 부록 (책임기간 표 + 유의사항 7항목).
   spec: docs/superpowers/specs/2026-05-20-12-pr5-section-appendix-design.md §4.4. */

.precheck-appendix-responsibility,
.precheck-appendix-notice {
  page-break-before: always;
  padding: 24px 28px;
  font-family: 'Pretendard Variable', 'Noto Sans KR', sans-serif;
  color: #0a1628;
}

.precheck-appendix-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #0a1628;
}

.precheck-appendix-subtitle {
  font-size: 13px;
  color: #4a6a8a;
  margin: 0 0 16px;
}

/* 책임기간 표 */
.precheck-appendix-table-wrap {
  page-break-inside: avoid;
  margin-bottom: 16px;
}

.precheck-appendix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.5;
}

.precheck-appendix-table thead {
  background: #1a3669;
  color: #ffffff;
}

.precheck-appendix-table thead th {
  padding: 10px 12px;
  text-align: center;
  font-weight: 600;
  border: 1px solid #1a3669;
}

.precheck-appendix-table tbody th {
  background: #f4f7fb;
  color: #1a3669;
  font-weight: 700;
  text-align: center;
  width: 80px;
  padding: 10px 12px;
  border: 1px solid #dbe4ef;
}

.precheck-appendix-table tbody td {
  padding: 10px 14px;
  border: 1px solid #dbe4ef;
  color: #0a1628;
  word-break: keep-all;
}

.precheck-appendix-years {
  white-space: nowrap;
}

.precheck-appendix-basis {
  font-size: 12px;
  color: #4a6a8a;
  margin: 8px 0 4px;
}

.precheck-appendix-disclaimer {
  font-size: 11px;
  color: #4a6a8a;
  line-height: 1.5;
  margin: 4px 0 0;
}

/* 유의사항 7항목 */
.precheck-appendix-notice-list-wrap {
  page-break-inside: auto;
}

.precheck-appendix-notice-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.precheck-appendix-notice-item {
  page-break-inside: avoid;
  margin-bottom: 14px;
}

.precheck-appendix-notice-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a3669;
  margin: 0 0 4px;
}

.precheck-appendix-notice-body {
  font-size: 13px;
  color: #0a1628;
  line-height: 1.6;
  margin: 0 0 4px;
}

.precheck-appendix-bullets {
  margin: 4px 0 0 20px;
  padding: 0;
}

.precheck-appendix-bullets li {
  font-size: 12px;
  color: #4a6a8a;
  line-height: 1.6;
  margin-bottom: 2px;
}

/* ============================================================================
   PR-GuidePlus — §9.6 보조 가이드 (결로 + 공기질) — 2026-05-24
   ============================================================================ */

.guide-page .guide-subtitle {
  font-size: 9px;
  color: #4a6a8a;
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.guide-section { margin-bottom: 8px; }
.guide-section .rpt-section-title {
  font-size: 11px;
  font-weight: 700;
  color: #1a3669;
  margin-bottom: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid #d8e2ec;
}

.guide-p   { font-size: 10px; color: #4a6a8a; line-height: 1.55; margin: 0 0 4px; }
.guide-note { font-size: 9px;  color: #4a6a8a; font-style: italic; margin-bottom: 4px; }
.guide-callout {
  font-size: 10px; color: #1a3669; line-height: 1.55;
  background: #eaf2fb; border-left: 3px solid #4a90d9;
  padding: 6px 10px; border-radius: 4px; margin-bottom: 4px;
}

/* 결로 삼각형 (spec §7.1) — 컴팩트 (사용자 피드백 2026-05-24: 삼각형 축소) */
.condensation-triangle { display: flex; gap: 14px; align-items: center; margin: 4px 0 6px; }
.condensation-triangle svg {
  flex: 0 0 32%;
  max-width: 32%;
  max-height: 150px;
  height: auto;
}
.condensation-triangle .triangle-desc { flex: 1; font-size: 9.5px; line-height: 1.55; color: #4a6a8a; }
.condensation-triangle .triangle-desc strong { color: #1a3669; }

/* 계절별 4 카드 (2x2) */
.guide-cards-2x2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin: 4px 0 6px;
}
.guide-card {
  background: #ffffff; border: 1px solid #d8e2ec; border-radius: 6px;
  padding: 6px 10px;
}
.guide-card .guide-card-title { font-size: 10px; font-weight: 700; color: #0a1628; margin-bottom: 4px; }
.guide-card ul { font-size: 9px; color: #4a6a8a; line-height: 1.5; padding-left: 14px; margin: 0; }

/* 체크리스트 */
.guide-checklist, .guide-checklist-numbered {
  list-style: none; padding: 0; margin: 4px 0 8px;
  font-size: 9.5px; color: #4a6a8a; line-height: 1.55;
}
.guide-checklist li, .guide-checklist-numbered li {
  padding: 3px 0; padding-left: 18px; position: relative;
}

/* 결로 시공 하자 의심 패턴 = 2 컬럼 grid (8 항목, 사용자 피드백 2026-05-24) */
.guide-section[data-section-id="defect-suspicion"] .guide-checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  row-gap: 0;
}
.guide-check-box {
  position: absolute; left: 0; top: 3px;
  color: #4a90d9; font-size: 11px;
}
.guide-num {
  display: inline-block; width: 16px; height: 16px;
  background: #4a90d9; color: #ffffff;
  border-radius: 9999px; text-align: center;
  font-size: 8.5px; font-weight: 700;
  margin-right: 6px; line-height: 16px;
}

/* 새집증후군 증상 배지 */
.guide-symptoms { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.guide-symptom-badge {
  display: inline-block; padding: 2px 8px;
  background: #f4f7fb; color: #4a6a8a;
  font-size: 9px; border-radius: 9999px;
  border: 1px solid #d8e2ec;
}

/* 매트릭스 (법정 + 참고 분리) */
.guide-matrix {
  width: 100%; border-collapse: collapse;
  font-size: 9px; margin: 4px 0 6px;
}
.guide-matrix thead th {
  background: #f4f7fb; color: #1a3669;
  padding: 4px 6px; text-align: left;
  font-size: 9px; border-bottom: 1px solid #d8e2ec;
}
.guide-matrix tbody td {
  padding: 4px 6px; border-bottom: 1px solid #eaf2fb;
  font-size: 9px; color: #4a6a8a;
}
.guide-matrix-legal thead th { background: #eaf2fb; }
.guide-matrix-reference thead th { background: #f8fafc; font-style: italic; }

.guide-no-data { color: #aab8c2; font-style: italic; }

/* 베이크아웃 7-day timeline (가로 7카드) */
.guide-timeline-7day {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; margin: 6px 0 8px;
}
.timeline-card {
  background: #ffffff; border: 1px solid #d8e2ec; border-radius: 4px;
  padding: 6px 4px; text-align: center;
}
.timeline-day { font-size: 9px; font-weight: 700; color: #1a3669; }
.timeline-action { font-size: 8px; color: #4a6a8a; line-height: 1.3; margin: 3px 0; min-height: 28px; }
.timeline-time { font-size: 8px; color: #7a8fa3; font-style: italic; }

/* 환기 표 */
.guide-table-4col {
  width: 100%; border-collapse: collapse;
  font-size: 9px; margin: 4px 0 6px;
}
.guide-table-4col thead th {
  background: #f4f7fb; color: #1a3669;
  padding: 4px 6px; text-align: left;
  font-size: 9px; border-bottom: 1px solid #d8e2ec;
}
.guide-table-4col tbody td {
  padding: 4px 6px; border-bottom: 1px solid #eaf2fb;
  font-size: 9px; color: #4a6a8a;
}

/* 안전 박스 */
.guide-safety-box {
  background: #fff0f0; border-left: 3px solid #c0392b;
  border-radius: 4px; padding: 8px 12px; margin: 6px 0 8px;
}
.guide-safety-box .safety-header {
  font-size: 10px; font-weight: 700; color: #c0392b;
  margin-bottom: 4px;
}
.guide-safety-box ul {
  font-size: 9px; color: #4a6a8a; line-height: 1.55;
  padding-left: 14px; margin: 0;
}

/* 측정 신뢰도 박스 (B5 흡수) */
.measurement-device-box {
  page-break-inside: avoid;
}

/* A4 print: "잘리면 시각적으로 깨지는 작은 시각 단위만" page-break-inside avoid.
   큰 컨테이너 (.guide-page / .guide-section / .guide-checklist 전체) 에 걸면 가이드
   본문이 1 페이지에 살짝 안 맞을 때 인쇄 엔진이 통째로 다음 장으로 미뤄 → 첫 장 빈 공간
   대량 + 본문 + 잔여 분산 = 1 가이드가 3 페이지 차지하는 부작용. 시각 단위만 보호. */
@media print {
  .condensation-triangle,
  .guide-card,
  .guide-callout,
  .guide-matrix,
  .guide-timeline-7day .timeline-card,
  .guide-table-4col,
  .guide-safety-box {
    page-break-inside: avoid;
  }
}

/* === 2026-05-24 PR-Law v3 — §9.9 부록 ㈒/㈓/㈔ === */

/* 페이지 컨테이너 (자연 흐름 허용 — 큰 컨테이너 page-break-inside 안 보호) */
.law-page {
  padding: 24px 32px;
  background: #ffffff;
}

/* === 면책 박스 === */
.law-disclaimer {
  margin-bottom: 16px;
  border-radius: 8px;
}
.law-disclaimer-full {
  background: #fff8e1;
  border-left: 4px solid #e67e22;
  padding: 12px 16px;
}
.law-disclaimer-full .law-disclaimer-title {
  font-size: 12px;
  font-weight: 700;
  color: #0a1628;
  margin-bottom: 4px;
}
.law-disclaimer-full .law-disclaimer-line {
  font-size: 11px;
  color: #4a6a8a;
  line-height: 1.6;
  margin: 4px 0;
}
.law-disclaimer-short {
  background: #f4f7fb;
  border-left: 2px solid #6aaee8;
  padding: 8px 12px;
  font-size: 10px;
  color: #4a6a8a;
}

/* === ㈒ 분야별 점검 안내 + 관련 법령 영역 (v3) === */
.law-criteria-source {
  font-size: 11px;
  color: #4a6a8a;
  margin-bottom: 12px;
  padding-left: 4px;
}
.law-criteria-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.law-criteria-box {
  background: #ffffff;
  border-left: 4px solid #4a90d9;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.law-criteria-confirmed { border-left-color: #1a3669; }
.law-criteria-separate  { border-left-color: #e67e22; }
.law-criteria-presumed  { border-left-color: #4a6a8a; }
.law-criteria-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.law-criteria-field {
  font-size: 12px;
  font-weight: 700;
  color: #0a1628;
}
.law-verify-badge {
  font-size: 9.5px;
  padding: 4px 8px;
  border-radius: 9999px;
  margin-left: auto;
  white-space: nowrap;
}
.law-verify-confirmed { background: #e8f1fb; color: #1a3669; }
.law-verify-separate  { background: #fff4e1; color: #c47a1c; }
.law-verify-presumed  { background: #f4f7fb; color: #4a6a8a; }
.law-criteria-summary {
  font-size: 11px;
  color: #0a1628;
  line-height: 1.55;
  margin-bottom: 8px;
}
.law-criteria-legal-area {
  font-size: 9.5px;
  color: #4a6a8a;
  font-style: italic;
}

/* === ㈓ 입주민 실무 안내 === */
.law-practices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.law-practice-card {
  background: #ffffff;
  border: 1px solid #e1ebf5;
  border-radius: 14px;
  padding: 12px;
}
.law-practice-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.law-practice-number {
  font-size: 14px;
  font-weight: 700;
  color: #1a3669;
}
.law-practice-title {
  font-size: 13px;
  font-weight: 700;
  color: #0a1628;
  margin: 0;
}
.law-practice-headline {
  font-size: 11px;
  color: #4a6a8a;
  margin-bottom: 8px;
  font-weight: 500;
}
.law-practice-bullets {
  font-size: 10.5px;
  color: #4a6a8a;
  line-height: 1.6;
  padding-left: 16px;
  margin: 0;
}
.law-practice-bullets li {
  margin: 4px 0;
}

/* === ㈔ 분쟁재정 6 단계 (v3) === */
.law-dispute-source {
  font-size: 11px;
  color: #4a6a8a;
  margin-bottom: 12px;
}
.law-dispute-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.law-step-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e1ebf5;
  border-radius: 14px;
  padding: 12px;
}
.law-step-badge {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: #1a3669;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.law-step-body {
  flex: 1;
}
.law-step-title {
  font-size: 12px;
  font-weight: 700;
  color: #0a1628;
  margin-bottom: 4px;
}
.law-step-headline {
  font-size: 11px;
  color: #4a90d9;
  margin-bottom: 4px;
}
.law-step-detail {
  font-size: 10.5px;
  color: #4a6a8a;
  line-height: 1.55;
}
.law-dispute-footer {
  margin-top: 16px;
  padding-top: 8px;
  border-top: 1px dashed #e1ebf5;
}
.law-dispute-footer-line {
  font-size: 10px;
  color: #4a6a8a;
  line-height: 1.5;
  margin: 4px 0;
  text-align: left;
}

/* === 인쇄 가드 (PR-GuidePlus layout hotfix 1 학습) === */
@media print {
  /* 작은 시각 단위만 보호 (큰 컨테이너 .law-page 는 자연 흐름) */
  .law-criteria-box,
  .law-practice-card,
  .law-step-card,
  .law-disclaimer-full,
  .law-disclaimer-short {
    page-break-inside: avoid;
    break-inside: avoid;
  }
}
