/* =================================================================
   정밀조회 리포트 · 공고중 판별 · 뷰어 · 실시간 목록 카드
   (색·반경 토큰은 style.css 의 :root 를 그대로 사용)
   ================================================================= */

.chips-loading { color: var(--text-light); font-size: 13px; }
.chip-btn small { color: var(--text-light); font-weight: 600; margin-left: 2px; }
.source-status { margin-top: 12px; font-size: 12px; color: #92400e; }
.source-status:empty { display: none; }
.report-loading small { color: var(--text-muted); font-weight: 500; }

/* ---------- 상태 배지 ---------- */
.state-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 800; white-space: nowrap;
}
.st-open { background: #dcfce7; color: #166534; }
.st-upcoming { background: #e0f2fe; color: #075985; }
.st-check { background: #fef3c7; color: #92400e; }
.st-closed { background: #e2e8f0; color: #475569; }

/* ---------- 공고중 판별 결과 ---------- */
.gate-banner {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: 13px;
  background: #f0fdf4; border: 1px solid #86efac; color: #14532d;
}
.gate-banner > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.gate-banner.gate-upcoming, .gate-banner.gate-corrected { background: #f0f9ff; border-color: #7dd3fc; color: #0c4a6e; }
.gate-banner.gate-check { background: #fffbeb; border-color: #fcd34d; color: #78350f; }
.gate-period { font-weight: 700; }

.gate-card { padding: 4px 2px; }
.gate-head { font-size: 17px; font-weight: 800; color: var(--text-main); margin-bottom: 8px; line-height: 1.5; }
.gate-reason { color: #334155; font-size: 14px; margin-bottom: 12px; }
.gate-note { color: var(--text-muted); font-size: 13px; margin: 12px 0; }
.gate-stop .gate-head { color: #9a3412; }
.gate-error .gate-head { color: #b91c1c; font-size: 15px; }
.tips { margin: 8px 0 14px 18px; color: #334155; font-size: 13px; line-height: 1.8; }
.portal-links { display: flex; flex-wrap: wrap; gap: 8px; }
.portal-links a {
  padding: 8px 12px; border-radius: 8px; background: #f1f5f9; color: #0f172a; font-size: 13px;
  font-weight: 700; text-decoration: none; border: 1px solid var(--border);
}
.portal-links a:hover { background: #e2e8f0; }

/* ---------- 리포트 머리 ---------- */
.report-head { margin-bottom: 14px; }
.report-head .badge-row { margin-bottom: 8px; }
.report-head h3 { font-size: 24px; font-weight: 850; color: var(--text-main); letter-spacing: -0.5px; line-height: 1.3; }
.report-subtitle { color: #475569; font-size: 14px; font-weight: 700; margin-top: 2px; }
.report-notice { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
.badge-source { background: #0f172a; color: #fff; }
.badge-sub { background: #f1f5f9; color: #334155; }
.badge-etc { background: #7c3aed; color: #fff; }

.apply-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.btn-apply-main, .btn-sub {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 16px;
  border-radius: 10px; font-size: 14px; font-weight: 800; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
}
.btn-apply-main { background: #059669; color: #fff; box-shadow: 0 4px 12px rgba(5, 150, 105, .25); }
.btn-apply-main:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(5, 150, 105, .3); }
.btn-sub { background: #fff; color: #0f172a; border: 1px solid #cbd5e1; font-weight: 700; }
.btn-sub:hover { background: #f8fafc; }
.apply-how { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.6; }

/* ---------- 수집 결과 체크 ---------- */
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
.check-item {
  display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; border-radius: 10px;
  border: 1px solid; font-size: 12px; line-height: 1.45;
}
.check-item b { font-size: 13px; }
.check-item span { font-weight: 700; color: var(--text-main); }
.check-item small { color: #78350f; }
.check-item.ok { border-color: #86efac; background: #f0fdf4; }
.check-item.missing { border-color: #fcd34d; background: #fffbeb; }

/* ---------- 사실 목록 ---------- */
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 0 0 16px; }
.fact-grid > div { padding: 10px 12px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; }
.fact-grid dt { font-size: 11px; font-weight: 800; color: var(--text-muted); margin-bottom: 2px; }
.fact-grid dd { font-size: 14px; font-weight: 700; color: var(--text-main); word-break: keep-all; overflow-wrap: anywhere; }

/* ---------- 섹션 ---------- */
.report-section { margin: 18px 0; padding-top: 16px; border-top: 1px dashed var(--border); }
.report-section h4 { font-size: 15px; font-weight: 850; color: var(--text-main); margin-bottom: 10px; }
.report-section h4 small { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.section-note { font-size: 12px; color: var(--text-muted); margin-top: 8px; line-height: 1.6; }
.empty-inline {
  padding: 14px; border-radius: 10px; background: #fffbeb; border: 1px dashed #fcd34d; color: #78350f;
  font-size: 13px; line-height: 1.6;
}

/* ---------- 평면도·사진 썸네일 ---------- */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb {
  display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; cursor: pointer; text-align: left; transition: box-shadow .15s ease, transform .15s ease;
}
.thumb:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.thumb img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #f8fafc; border-radius: 8px; }
.thumb-label { font-size: 12px; font-weight: 700; color: #334155; line-height: 1.4; word-break: break-all; }

/* ---------- 호실 카드 (LH 매입임대) ---------- */
.unit-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.unit-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: #fff; }
.unit-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.unit-card header b { font-size: 16px; }
.unit-card header span { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.unit-specs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.unit-specs span { padding: 3px 8px; border-radius: 6px; background: #f1f5f9; font-size: 12px; color: #334155; }
.unit-specs span.warn { background: #fef3c7; color: #92400e; }
.rent-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rent-table th { text-align: left; padding: 6px; background: #eff6ff; color: #1e3a8a; font-size: 11px; }
.rent-table td { padding: 7px 6px; border-top: 1px solid var(--border); vertical-align: top; }
.rent-table td:first-child { color: #475569; font-weight: 700; }
.unit-note { display: block; margin-top: 8px; color: var(--text-muted); font-size: 12px; }

/* ---------- 건물 정보 ---------- */
.building-loading { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: 13px; }
.spinner.small { width: 18px; height: 18px; border-width: 3px; flex: none; }
.building-site + .building-site { margin-top: 14px; }
.site-label { font-size: 13px; font-weight: 800; color: #334155; margin-bottom: 8px; }
.building-card header span { max-width: 55%; text-align: right; }

/* ---------- 표 ---------- */
.table-scroll { overflow-x: auto; border: 1px solid #dbeafe; border-radius: 10px; }
.data-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13px; background: #fff; }
.data-table th { padding: 9px 10px; background: #eff6ff; color: #1e3a8a; text-align: left; font-size: 12px; white-space: nowrap; }
.data-table td { padding: 9px 10px; border-top: 1px solid var(--border); vertical-align: middle; }

/* ---------- 관리비 ---------- */
.fee-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.fee-list li { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #f0fdf4; border: 1px solid #bbf7d0; font-size: 13px; }
.fee-list b { color: #166534; }
.snippets { margin-top: 10px; }
.snippets small { display: block; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.snippets blockquote {
  margin: 6px 0; padding: 8px 12px; border-left: 3px solid #cbd5e1; background: #f8fafc;
  font-size: 12px; color: #334155; line-height: 1.6;
}

/* ---------- 일정·첨부 ---------- */
.timeline { list-style: none; display: grid; gap: 6px; }
.timeline li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 10px; background: #f8fafc; font-size: 13px; }
.timeline span { color: var(--text-muted); font-weight: 700; }
.doc-list { list-style: none; display: grid; gap: 6px; }
.doc-list a { display: flex; align-items: center; gap: 8px; color: #0f172a; font-size: 13px; text-decoration: none; word-break: break-all; }
.doc-list a:hover { text-decoration: underline; }
.doc-list .ext { flex: none; min-width: 42px; padding: 2px 6px; border-radius: 5px; background: #e0f2fe; color: #075985; font-size: 11px; font-weight: 800; text-align: center; }
.remark { white-space: pre-line; font-size: 13px; color: #334155; }

/* ---------- 후보 목록 ---------- */
.match-list { list-style: none; display: grid; gap: 8px; margin: 8px 0; }
.match-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.match-row.current { border-color: #34d399; background: #f0fdf4; }
.match-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.match-main b { font-size: 14px; }
.match-main small { color: var(--text-muted); font-size: 12px; }
.match-notice { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-side { display: flex; align-items: center; gap: 8px; flex: none; }
.btn-match {
  padding: 6px 12px; border-radius: 8px; border: 1px solid #0284c7; background: #fff; color: #0369a1;
  font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.btn-match:hover { background: #f0f9ff; }
.match-current { font-size: 12px; font-weight: 800; color: #047857; }

.sources-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px; padding-top: 12px;
  border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted);
}
.sources-line .src { padding: 2px 8px; border-radius: 999px; background: #f1f5f9; }
.sources-line .src.ok { background: #ecfdf5; color: #047857; }
.sources-line .src.fail { background: #fef2f2; color: #b91c1c; }

/* ---------- 뷰어 ---------- */
.viewer-dialog { max-width: 980px; }
.viewer-page { margin: 0 0 16px; text-align: center; }
.viewer-page img { max-width: 100%; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.viewer-page figcaption { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.btn-viewer-download {
  padding: 7px 12px; border-radius: 8px; background: #0f172a; color: #fff; font-size: 12px; font-weight: 800;
  text-decoration: none; white-space: nowrap;
}
.viewer-dialog .modal-header-bar { gap: 10px; }
.viewer-dialog .modal-header-info { min-width: 0; }
.viewer-dialog .modal-header-info h2 { font-size: 16px; overflow-wrap: anywhere; }
.viewer-dialog .modal-top-actions { display: flex; align-items: center; gap: 8px; flex: none; }

/* ---------- 실시간 목록 카드 ---------- */
.live-card .card-title { margin-bottom: 8px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #475569; font-size: 13px; margin-bottom: 14px; }

@media (max-width: 720px) {
  /* 휴대폰에서는 헤더가 화면 1/3을 가리지 않도록 고정 해제, 중첩 여백 축소 */
  .header-container { position: static; }
  .header-inner { padding: 12px 14px; }
  .main-wrapper { padding: 0 10px; margin-top: 12px; }
  .zipzikeo-hero-section { padding: 16px 12px; }
  .zipzikeo-report-box { padding: 14px 12px; margin-top: 16px; }
  .check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-head h3 { font-size: 20px; }
  .btn-apply-main { width: 100%; }
  .match-row { flex-direction: column; align-items: stretch; }
  .match-side { justify-content: space-between; }
  .unit-cards { grid-template-columns: 1fr; }
  .gate-banner { flex-direction: column; align-items: flex-start; }
}
