/* 추정매물 그리드 전용 스타일 — 정본 = wonwoohoe.css(같은 자리, 같은 이유).
 *
 * ⚠️ 클래스 접두는 화면별(`pp-`)로 고정한다. Propshaft 가 모든 CSS 를 동시에 로드하므로
 *    `.search-hit` 같은 범용 이름은 다른 화면과 충돌한다. 원우회가 `wh-` 를 쓰는 것과 짝.
 *
 * ⚠️ 스크롤바 규칙은 여기 없다 — canon(grid_skin.css)의 `.ds-grid-scroll` 을
 *    prospects_table_preset.js 가 붙인다(가로·세로 둘 다).
 */

/* 검색 정확일치 행 표식 — 원우회 `.wh-search-hit` 와 같은 톤(디자인토큰 primary 8%).
   색을 새로 만들지 않는다. 선택(.tabulator-selected)이 아니라 «표식»이다. */
.tabulator .tabulator-row.pp-search-hit {
  background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}
.tabulator .tabulator-row.pp-search-hit:hover {
  background: color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent);
}

/* ── 헤더 칩(단지 / 연결 / 상태) ─────────────────────────────────────────────
 * ⚠️ `db_components.css` 에 있는 줄 알고 `.chip` 을 그냥 썼다가 **맨 텍스트로 렌더**됐다
 *    (2026-08-11 양희 «이미지 깨진거 같어»). 실제 정의처는 `dsv2_consult_window.css` 이고
 *    그 파일은 상담 팝업 전용 레이아웃에서만 로드된다 — 앱 레이아웃엔 안 실린다.
 *    남의 화면 파일을 레이아웃에 끼워 넣는 대신 여기서 `pp-` 접두로 자체 정의한다
 *    (화면별 접두사 규칙 — Propshaft 가 전 CSS 를 동시 로드하므로 범용 이름은 충돌한다).
 *    모양은 그 파일의 알약 트랙을 그대로 따랐다 — 두 화면이 달라 보일 이유가 없다. */
.pp-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  background: var(--md-sys-color-surface-container-high, #f1f5f9);
  border-radius: 999px;
  padding: 4px;
}

.pp-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant, #374151);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.pp-chip:hover { background: rgba(255, 255, 255, 0.55); }

.pp-chip--on {
  background: var(--md-sys-color-surface, #fff);
  color: var(--md-sys-color-primary, #2563eb);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.pp-chip--on:hover { background: var(--md-sys-color-surface, #fff); }

/* 칩 안의 건수 — 이름과 붙어 보이지 않게 `.pp-chip` 의 gap 이 띄운다. */
.pp-chip-count { font-size: 11px; opacity: 0.65; font-variant-numeric: tabular-nums; }

/* 연결 배지 — 우리 고객(거래처) / 법인고객(원우회) 매칭 표시.
   두 개가 같이 붙는 행이 있어(«고객 · 법인고객») 가로로 나열되고 좁은 칸에서 줄바꿈된다. */
.pp-linked {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.pp-linked-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

/* 색은 m3 토큰만 쓴다 — 하드코딩하면 테마 전환에서 이 칸만 어긋난다.
   우리 고객 = primary(거래 이력이 있는 곳), 법인고객 = tertiary(원우회 명부). */
.pp-linked-badge--customer {
  background: color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent);
  color: var(--md-sys-color-primary);
}

.pp-linked-badge--corp {
  background: color-mix(in srgb, var(--md-sys-color-tertiary) 16%, transparent);
  color: var(--md-sys-color-tertiary);
}

/* ── 대장 자동 채움 배지(2026-10-21) — 채움(primary) · 없음(outline) · 미확인(warning). 행 높이 34 안에 든다. ── */
.pp-registry-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}
.pp-registry-badge--ok {
  background: color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent);
  color: var(--md-sys-color-primary);
}
.pp-registry-badge--none {
  background: color-mix(in srgb, var(--md-sys-color-outline) 18%, transparent);
  color: var(--md-sys-color-on-surface-variant);
}
/* 경고색은 m3 확장 토큰(--md-ext-color-warning, m3-google-blue.css)만 — 테마가 안 주면 같은 호박색으로 떨어진다. */
.pp-registry-badge--warn {
  background: color-mix(in srgb, var(--md-ext-color-warning, #e37400) 18%, transparent);
  color: var(--md-ext-color-warning, #e37400);
}

/* ── 수집 상태 띠(2026-10-21) — 필터 칩 위 한 줄. 읽기 전용이고 재료가 없으면 아예 안 그린다(_pipeline_strip). ── */
.pp-pipeline-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 14px;
  padding: 2px 0 4px;
  font-size: 11px;
  line-height: 16px;
  color: var(--md-sys-color-on-surface-variant);
}
.pp-pipeline-item { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pp-pipeline-label::after { content: ":"; }
.pp-pipeline-value {
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pp-strip-badge {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 15px;
}
/* 오래됨 = 노란(경고) 배지 — 수집이 멈춘 걸 사람이 그냥 지나치지 않게. */
.pp-strip-badge--stale {
  background: color-mix(in srgb, var(--md-ext-color-warning, #e37400) 22%, transparent);
  color: var(--md-ext-color-warning, #e37400);
}

/* ── 구분 세그먼트 버튼(전체 / 법인 / 개인 / 미상) ──────────────────────────────
 * 사장님 2026-09-02: «법인 개인 버튼 만들어, 필터해서 사용자가 쉽게 보도록, 플랫 디자인».
 * 칩 트랙과 다르게 **버튼**이다 — 테두리 하나로 묶인 세그먼트, 그림자 없음, 켜진 칸은 단색 채움.
 * 색은 m3 토큰만: 법인 = primary, 개인 = tertiary, 미상 = outline(회색), 전체 = on-surface. */
.pp-seg {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--md-sys-color-outline-variant, #cbd5e1);
  border-radius: 10px;
  overflow: hidden;
  background: var(--md-sys-color-surface, #fff);
}

.pp-seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  color: var(--md-sys-color-on-surface-variant, #374151);
  text-decoration: none;
  white-space: nowrap;
  border-right: 1px solid var(--md-sys-color-outline-variant, #cbd5e1);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.pp-seg-btn:last-child { border-right: 0; }
.pp-seg-btn:hover { background: var(--md-sys-color-surface-container-high, #f1f5f9); }
.pp-seg-btn:focus-visible { outline: 2px solid var(--md-sys-color-primary, #2563eb); outline-offset: -2px; }

.pp-seg-count { font-size: 11px; font-weight: 500; opacity: 0.7; font-variant-numeric: tabular-nums; }
.pp-seg-btn--on .pp-seg-count { opacity: 0.9; }

.pp-seg-btn--on.pp-seg-btn--all { background: var(--md-sys-color-on-surface, #111827); color: var(--md-sys-color-surface, #fff); }
.pp-seg-btn--on.pp-seg-btn--corp { background: var(--md-sys-color-primary, #2563eb); color: var(--md-sys-color-on-primary, #fff); }
.pp-seg-btn--on.pp-seg-btn--person { background: var(--md-sys-color-tertiary, #0f766e); color: var(--md-sys-color-on-tertiary, #fff); }
.pp-seg-btn--on.pp-seg-btn--unknown { background: var(--md-sys-color-outline, #64748b); color: var(--md-sys-color-surface, #fff); }
.pp-seg-btn--on:hover { filter: brightness(0.96); }

/* 구분 칸 배지 — 세그먼트 버튼과 같은 색 체계(연한 채움, 그림자 없음). */
.pp-entity-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

.pp-entity-badge--corp {
  background: color-mix(in srgb, var(--md-sys-color-primary) 14%, transparent);
  color: var(--md-sys-color-primary);
}

.pp-entity-badge--person {
  background: color-mix(in srgb, var(--md-sys-color-tertiary) 16%, transparent);
  color: var(--md-sys-color-tertiary);
}

.pp-entity-badge--unknown {
  background: color-mix(in srgb, var(--md-sys-color-outline) 14%, transparent);
  color: var(--md-sys-color-on-surface-variant);
}

/* PNU가 검증된 업체 주소만 기존 공장맵 필지로 이어진다. */
.pp-map-address-link {
  display: block;
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--md-sys-color-primary) 45%, transparent);
  text-underline-offset: 2px;
}
.pp-map-address-link:hover { color: var(--md-sys-color-primary); }
.pp-map-address-link:focus-visible {
  outline: 2px solid var(--md-sys-color-primary, #2563eb);
  outline-offset: 1px;
  border-radius: 3px;
}

/* ── 광고매물 탭(kind=listing) ───────────────────────────────────────────── */
/* 선택 바 — 그리드에서 광고를 체크하면 나타난다. */
.pp-bulk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant, #e2e8f0);
  background: color-mix(in srgb, var(--md-sys-color-primary, #2563eb) 8%, transparent);
  font-size: 13px;
}
.pp-bulk-bar[hidden] { display: none; }

/* 광고 관측 문구는 행 높이에 참여한다. 주소 칸의 자동 확장으로 밀리지 않는다. */
.pp-listing-grid .tabulator-row .tabulator-cell { min-height: 54px; }
.pp-listing-grid .pp-region-ad {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  line-height: 1.4; white-space: normal; overflow-wrap: anywhere;
}
.pp-listing-grid .pp-region-ad__region,
.pp-listing-grid .pp-region-ad__reason,
.pp-listing-grid .pp-region-ad .pp-ad { font-size: 13px; white-space: normal; }

/* 그리드 대표 사진 + 사진 수 */
.pp-thumb {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--md-sys-color-surface-container-high, #f1f5f9);
  vertical-align: middle;
}
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-thumb-count {
  position: absolute;
  right: 2px;
  bottom: 2px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
  line-height: 14px;
  font-variant-numeric: tabular-nums;
}

/* 광고 상태 배지 — 광고 중 / 광고했었다(내려감). 거래완료가 아니다. */
.pp-ad {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}
.pp-ad--live {
  background: color-mix(in srgb, var(--md-sys-color-primary, #2563eb) 14%, transparent);
  color: var(--md-sys-color-primary, #2563eb);
}
.pp-ad--gone {
  background: color-mix(in srgb, var(--md-sys-color-outline, #64748b) 14%, transparent);
  color: var(--md-sys-color-on-surface-variant, #475569);
}

/* 상세 창 사진 고르기 — 끈 사진은 자료실로 안 간다. */
.pp-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.pp-photo {
  position: relative;
  display: block;
  border: 2px solid var(--md-sys-color-primary, #2563eb);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
.pp-photo img { width: 100%; height: 90px; object-fit: cover; display: block; }
.pp-photo input { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; cursor: pointer; }
.pp-photo-view { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.pp-photo-view:focus-visible { outline: 3px solid #f59e0b; outline-offset: -3px; }
.pp-photo-zoom { position: absolute; right: 4px; bottom: 4px; padding: 1px 5px; border-radius: 3px; background: #111b; color: #fff; font-size: 12px; pointer-events: none; }
.pp-photo--off { border-color: var(--md-sys-color-outline-variant, #e2e8f0); }
.pp-photo--off img { opacity: 0.35; filter: grayscale(1); }

/* 광고 상세 */
/* 상세 창(<dialog>) — Tailwind preflight 가 margin 을 0 으로 눌러 좌상단에 붙어 잘렸다. 가운데로(입주업체 상세도 같은 창). */
.pp-detail-dialog { margin: auto; }
.pp-detail-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.pp-detail-dialog.pp-detail-dialog--listing { width: 92vw; max-width: 1120px; }
.pp-detail-dialog--listing[open] { display: flex; flex-direction: column; overflow: hidden; max-height: 85dvh; }
.pp-detail-dialog--listing > .pp-detail-top,
.pp-detail-dialog--listing > .pp-ld-fixed-summary { flex: 0 0 auto; }
.pp-detail-dialog--listing > .pp-detail-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border-top: 1px solid #cbd5e1; margin-top: 12px; padding-top: 12px; padding-right: 4px; }
.pp-ld-source-state { color: #64748b; font-size: 13px; }

/* 60대 직원이 읽는 창 — 글자를 키우고, 개발자용 값 없이 주소·부동산·내용·옮길 값만. */
.pp-ld-title { font-size: 22px; font-weight: 700; line-height: 1.35; word-break: keep-all; }
.pp-ld-head-actions { display: inline-flex; gap: 6px; }
.pp-ld-head { margin-bottom: 4px; }
.pp-ld-summary { font-size: 18px; font-weight: 600; line-height: 1.5; }
.pp-ld-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.pp-ld-badges .pp-ad { font-size: 14px; padding: 2px 10px; }
.pp-ld-moved-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--md-sys-color-primary, #2563eb);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pp-ld-section { margin-top: 20px; font-size: 15px; line-height: 1.6; }
.pp-ld-h { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.pp-ld-muted { color: var(--md-sys-color-on-surface-variant, #475569); }

/* 올린 부동산 표 — 좁은 창에서는 표만 옆으로 민다. */
.pp-ld-table-wrap { overflow-x: auto; }
.pp-ld-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.pp-ld-table th,
.pp-ld-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant, #e2e8f0);
  text-align: left;
  vertical-align: middle;
}
.pp-ld-table th {
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant, #475569);
  white-space: nowrap;
}
.pp-ld-table td:nth-child(4) { font-variant-numeric: tabular-nums; min-width: 9em; }
.pp-ld-table td:nth-child(5),
.pp-ld-table td:nth-child(6) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pp-ld-self td { font-weight: 700; background: color-mix(in srgb, var(--md-sys-color-primary, #2563eb) 6%, transparent); }
.pp-ld-ad-cell { white-space: nowrap; }
.pp-ld-ad-cell > * + * { margin-left: 6px; }
.pp-ld-moved {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: color-mix(in srgb, var(--md-sys-color-tertiary, #7c3aed) 16%, transparent);
  color: var(--md-sys-color-tertiary, #7c3aed);
}
.pp-ld-others { margin-top: 10px; }
.pp-ld-others summary { cursor: pointer; color: var(--md-sys-color-on-surface-variant, #475569); }
.pp-ld-others ul { margin: 6px 0 0; padding-left: 1.2em; list-style: disc; }
.pp-ld-others li { margin: 4px 0; }
.pp-ld-others li a { margin-left: 8px; }

/* 광고 내용 — 원문 줄바꿈 그대로, 긴 글은 접어 둔다. */
.pp-ld-desc { white-space: pre-wrap; word-break: break-word; }
.pp-ld-desc--folded {
  max-height: 12.8em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}
.pp-ld-more { margin-top: 6px; }

.pp-ld-notes { margin: 0; padding-left: 1.2em; list-style: disc; }
.pp-ld-notes li { margin: 2px 0; }

/* 옮기면 들어가는 값 — 이름 | 값 2열. */
.pp-ld-values { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
.pp-ld-values dt { color: var(--md-sys-color-on-surface-variant, #475569); }
.pp-ld-values dd { margin: 0; font-weight: 600; }
.pp-ld-memo { margin-top: 8px; font-size: 14px; color: var(--md-sys-color-on-surface-variant, #475569); }

/* [매물이동] — 맨 아래 크게. */
.pp-ld-road { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--md-sys-color-on-surface-variant, #64748b); }
.pp-ld-actions { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.db-btn.pp-ld-move { min-height: 48px; padding: 10px 36px; font-size: 18px; font-weight: 700; }

/* 광고매물 상단 진행 카드 — 옮김/남음 막대 + 남음·옮김·새 광고·옮긴 뒤 바뀜(누르면 거름). 양희 2026-10-17. */
.pp-progress { padding: 10px 12px; border: 1px solid var(--md-sys-color-outline-variant, #e2e8f0); border-radius: 10px;
  background: var(--md-sys-color-surface-container-low, #f8fafc); }
.pp-progress-bar { margin-top: 6px; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--md-sys-color-surface-container-high, #e2e8f0); }
.pp-progress-bar > span { display: block; height: 100%; background: var(--md-sys-color-primary, #1d4ed8); }
.pp-chip--warn:not(.pp-chip--on) { color: var(--md-sys-color-error, #b91c1c); }

/* 광고매물 헤더 3칸 — 1칸 권역·광고·출처 / 2칸 거래·토지·건물 / 3칸(맨 오른쪽) 진행표. 양희 2026-10-17
 * 「3칸으로 나눠서 세로 높이를 최대한 줄여. 진행표를 제일 우측으로. 줄 맞춰」.
 * 행 높이를 grid 로 고정해 1·2칸의 줄이 맞고, 진행표는 세 줄을 통째로 쓴다. 칩·세그먼트는 이 헤더 안에서만 얇게. */
.pp-listing-head { display: grid; grid-template-columns: max-content max-content minmax(0, 1fr);
  grid-template-rows: repeat(3, 28px); grid-auto-flow: column; column-gap: 16px; row-gap: 4px; }
.pp-head-row { display: flex; align-items: center; gap: 8px; min-width: 0; height: 28px; }
.pp-head-progress { grid-column: 3; grid-row: 1 / span 3; justify-self: end; min-width: 340px; }
.pp-listing-head .pp-chips { padding: 2px; flex-wrap: nowrap; }
.pp-listing-head .pp-chip { padding: 3px 8px; }
.pp-listing-head .pp-seg-btn { padding: 3px 10px; }
.pp-head-progress .pp-progress { height: 100%; padding: 6px 10px; display: flex; flex-direction: column; justify-content: space-between; }
.pp-head-progress .pp-progress-bar { margin-top: 0; height: 6px; }
.pp-head-progress .pp-chips { margin-top: 0; }
/* 좁은 창: 세 칸이 안 들어가면 줄을 넘겨 쌓는다(가로 스크롤을 만들지 않는다). */
@media (max-width: 1365px) {
  .pp-listing-head { display: flex; flex-wrap: wrap; gap: 4px 20px; }
  .pp-head-progress { min-width: 0; }
}

/* Advertisement choice flow: readable type and one clear field-by-field list. */
.pp-readable { font-size: 16px; }
.pp-readable .pp-chip, .pp-readable .pp-seg-btn {
  min-height: 44px; padding: 8px 12px; font-size: 16px; line-height: 1.4;
  display: inline-flex; align-items: center; justify-content: center;
}
.pp-readable .pp-listing-head {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(260px, .9fr);
  grid-template-rows: repeat(3, minmax(44px, auto)); gap: 8px 16px;
}
.pp-readable .pp-head-row { height: auto; min-height: 44px; flex-wrap: wrap; }
.pp-readable .pp-listing-head .pp-chips { flex-wrap: wrap; }
.pp-readable .pp-chips, .pp-readable .pp-seg { max-width: 100%; flex-wrap: wrap; }
.pp-readable .pp-head-row > span { font-size: 14px; color: var(--md-sys-color-on-surface-variant, #475569); }
.pp-readable .pp-head-progress { min-width: 0; justify-self: stretch; }
.pp-readable .pp-chip-count, .pp-readable .pp-seg-count { font-size: 14px; opacity: 1; }
.pp-detail-dialog--listing { font-size: 16px; line-height: 1.6; }
.pp-detail-dialog--listing .db-btn, .pp-detail-dialog--listing a.pp-ld-moved-link {
  min-height: 44px; padding: 8px 12px; font-size: 16px; display: inline-flex; align-items: center;
}
.pp-detail-dialog--listing .pp-ld-section, .pp-detail-dialog--listing .pp-ld-table { font-size: 16px; }
.pp-detail-dialog--listing .pp-ld-table td, .pp-detail-dialog--listing .pp-ld-table th { padding: 10px 12px; }
.af-listing-preview { font-size: 16px; line-height: 1.6; color: var(--md-sys-color-on-surface, #0f172a); }
.af-listing-preview .text-xs, .af-listing-preview .text-sm { font-size: 16px; line-height: 1.6; }
.af-listing-preview button, .af-listing-preview select, .af-listing-preview input:not([type=radio]):not([type=checkbox]) {
  min-height: 44px; font-size: 16px; padding: 8px 12px;
}
.af-listing-preview select, .af-listing-preview input:not([type=radio]):not([type=checkbox]) {
  border: 2px solid var(--md-sys-color-outline, #64748b); background: var(--md-sys-color-surface, #fff);
}
.af-value-choices { margin: 16px 0; padding: 0; border: 0; min-width: 0; }
.af-value-choices legend { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.af-value-choice {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: center;
  min-height: 56px; padding: 12px; margin-top: 8px; border: 2px solid var(--md-sys-color-outline-variant, #cbd5e1);
  border-radius: 6px; cursor: pointer; background: var(--md-sys-color-surface, #fff);
}
.af-value-choice input { width: 22px; height: 22px; accent-color: var(--md-sys-color-primary, #1d4ed8); }
.af-value-choice--selected { border-color: var(--md-sys-color-primary, #1d4ed8); background: #eff6ff; color: #0f172a; }
.af-value-choice-source { display: block; font-weight: 600; }
.af-value-choice-value { display: block; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.af-value-choice-state { display: block; margin-top: 4px; color: #1e40af; font-weight: 700; }
.pp-readable a:focus-visible, .pp-detail-dialog--listing button:focus-visible,
.af-listing-preview button:focus-visible, .af-listing-preview input:focus-visible, .af-listing-preview select:focus-visible {
  outline: 3px solid var(--md-sys-color-primary, #1d4ed8); outline-offset: 3px;
}
@media (max-width: 1000px) {
  .pp-readable .pp-listing-head { display: flex; flex-direction: column; align-items: stretch; }
  .pp-readable .pp-head-progress { width: 100%; }
}
@media (max-width: 480px) {
  .pp-detail-dialog.pp-detail-dialog--listing { width: 96vw; padding: 12px; }
  .pp-detail-dialog--listing .pp-ld-head-actions { flex-wrap: wrap; }
}

/* Top controls share one readable scale; dense filters leave room for the table. */
.pp-readable .pp-list-toolbar { flex-wrap: wrap; gap: 4px 16px; min-width: 0; }
.pp-readable .pp-list-toolbar-main {
  flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 6px 16px; flex: 1 1 auto;
}
.pp-readable .pp-list-search { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; }
.pp-readable .pp-list-search-label { font-size: 15px; font-weight: 600; white-space: nowrap; }
.pp-readable .pp-list-search .db-input--search {
  width: 290px; max-width: 100%; min-width: 0; height: 40px; margin: 0;
  padding: 6px 10px; font-size: 15px; line-height: 1.4;
  border: 1px solid var(--db-color-text-sub); background: var(--db-color-card);
}
.pp-readable .pp-list-search .db-btn, .pp-readable .pp-list-search a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 10px; font-size: 15px;
}
.pp-readable .pp-list-total { font-size: 14px; white-space: nowrap; }
.pp-readable #prospects-pager { max-width: 100%; flex-wrap: wrap; gap: 6px 10px; }
.pp-readable #prospects-pager .tabulator-paginator { flex-wrap: wrap; gap: 4px; }
.pp-readable #prospects-pager .tabulator-page-counter,
.pp-readable #prospects-pager .tabulator-paginator label { font-size: 14px; }
.pp-readable #prospects-pager .tabulator-page,
.pp-readable #prospects-pager .tabulator-page-size { height: 40px; font-size: 15px; }
.pp-readable #prospects-pager .tabulator-page { min-width: 40px; padding: 0 8px; }
.pp-readable #prospects-pager :focus-visible,
.pp-readable .pp-complex-filter summary:focus-visible {
  outline: 3px solid var(--db-color-primary); outline-offset: 2px;
}
.pp-readable .pp-list-filters { padding: 6px 16px; }
.pp-readable .pp-filter-groups { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.pp-readable .pp-filter-group { display: flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; }
.pp-readable .pp-filter-group > span { width: auto; font-size: 13px; }
.pp-readable .pp-list-filters .pp-chips { padding: 2px; border-radius: 10px; }
.pp-readable .pp-list-filters .pp-chip,
.pp-readable .pp-list-filters .pp-seg-btn { min-height: 34px; padding: 5px 9px; font-size: 14px; line-height: 1.4; }
.pp-readable .pp-list-filters .pp-chip-count,
.pp-readable .pp-list-filters .pp-seg-count { font-size: 12px; }
.pp-readable .pp-complex-filter { min-width: 0; max-width: 100%; }
.pp-readable .pp-complex-filter summary {
  min-height: 36px; padding: 6px 10px; border: 1px solid var(--db-color-outline);
  border-radius: 8px; font-size: 14px; cursor: pointer;
}
.pp-readable .pp-complex-selection { margin-left: 8px; font-weight: 600; overflow-wrap: anywhere; }
.pp-readable .pp-complex-filter[open] { flex-basis: 100%; }
.pp-readable .pp-complex-filter[open] summary { width: fit-content; max-width: 100%; margin-bottom: 4px; }
.pp-readable .pp-complex-filter > .pp-chips { max-height: 160px; overflow-y: auto; border-radius: 8px; }
.pp-readable .pp-list-filters .pp-listing-head {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(280px, .85fr);
  grid-template-rows: repeat(3, minmax(36px, auto)); gap: 4px 16px;
}
.pp-readable .pp-list-filters .pp-head-row { min-height: 36px; gap: 4px 8px; }
.pp-readable .pp-list-filters .pp-head-row > span { font-size: 13px; }
.pp-readable .pp-head-progress .pp-progress { gap: 4px; }
.pp-readable .pp-head-progress dl { margin-top: 4px; font-size: 13px; line-height: 1.4; }
[data-prospects-listing-mode-value="true"] .pp-bulk-bar .db-btn,
[data-prospects-listing-mode-value="true"] .pp-list-move {
  height: 44px; min-height: 44px; padding: 8px 10px; font-size: 16px; line-height: 1.25;
}
[data-prospects-listing-mode-value="true"] .pp-list-move { width: 100%; }
[data-prospects-listing-mode-value="true"] .pp-list-move:focus-visible {
  outline: 3px solid var(--db-color-primary); outline-offset: 2px;
}
@media (max-width: 700px) {
  .pp-readable .pp-list-search { flex: 1 1 100%; }
  .pp-readable .pp-list-search-label { flex-basis: 100%; }
  .pp-readable .pp-list-search .db-input--search { flex: 1 1 180px; width: auto; }
  .pp-readable .pp-list-hint { display: none; }
  .pp-readable .pp-filter-group { flex-wrap: wrap; }
}
@media (pointer: coarse) {
  .pp-readable .pp-list-filters .pp-chip, .pp-readable .pp-list-filters .pp-seg-btn,
  .pp-readable .pp-complex-filter summary { min-height: 44px; }
}

/* Equipment filters open over the list without adding another permanent row. */
.pp-readable .pp-list-toolbar { position: relative; }
.pp-equipment-filter { margin-left: auto; }
.pp-equipment-filter summary { cursor: pointer; min-height: 36px; padding: 6px 10px; border: 1px solid var(--db-color-outline); border-radius: 8px; font-size: 14px; white-space: nowrap; }
.pp-equipment-filter summary span { margin-left: 6px; font-weight: 600; }
.pp-equipment-form { position: absolute; z-index: 60; top: 100%; right: 16px; width: min(660px, calc(100% - 32px)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 8px; padding: 12px; border: 1px solid var(--db-color-outline); border-radius: 8px; background: var(--db-color-card); box-shadow: 0 4px 12px #0002; }
.pp-equipment-form label { display: block; font-size: 13px; margin-bottom: 4px; }
.pp-equipment-form select { width: 100%; height: 40px; padding: 4px 8px; border: 1px solid var(--db-color-outline); border-radius: 6px; background: var(--db-color-card); font-size: 14px; }
.pp-equipment-form .db-btn { min-height: 40px; }
.pp-equipment-filter summary:focus-visible, .pp-equipment-form select:focus-visible { outline: 3px solid var(--db-color-primary); outline-offset: 2px; }
@media (max-width: 700px) { .pp-equipment-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Async listing scopes keep old rows/counts out of the new selection. */
.pp-grid-shell { position: relative; min-height: 0; }
.pp-grid-status { position: absolute; inset: 42px 12px 12px; z-index: 2; overflow: hidden; pointer-events: none; }
.pp-grid-status.pp-grid-error { inset: 4rem 1rem auto; text-align: center; padding: 1rem; background: var(--md-sys-color-surface, #fff); pointer-events: auto; }
.pp-grid-placeholder > div { display: grid; grid-template-columns: 56px minmax(180px, 3fr) repeat(4, minmax(60px, 1fr)); gap: 24px; align-items: center; height: 72px; padding: 8px 16px; border-bottom: 1px solid var(--db-color-outline, #e2e8f0); background: #fff; }
.pp-grid-placeholder > div:nth-child(odd) { background: #f1f5f9; }
.pp-grid-placeholder span { display: block; width: 72%; height: 10px; border-radius: 3px; background: #dce4ed; }
.pp-grid-placeholder span:first-child { width: 48px; height: 38px; }
@media (prefers-reduced-motion: no-preference) { .pp-grid-placeholder { animation: pp-grid-arrive .15s ease-out; } }
@keyframes pp-grid-arrive { from { opacity: .65; } to { opacity: 1; } }
.pp-grid-status[hidden] { display: none; }
.pp-grid-pending #prospects-grid .tabulator-tableholder { visibility: hidden; }
.pp-grid-pending #prospects-pager { visibility: hidden; }
.pp-counts-pending .pp-chip-count, .pp-counts-pending .pp-seg-count { visibility: hidden; }
.pp-counts-pending .pp-head-progress .pp-progress > :not(.pp-chips), .pp-counts-pending [aria-label="수집 신선도"] { visibility: hidden; }

.pp-readable .pp-list-hint.pp-list-count-summary { display: block; font-size: 12px; line-height: 1.3; color: var(--md-sys-color-on-surface-variant, #475569); }

.pp-list-moved-actions { display:flex; flex-direction:column; align-items:flex-start; gap:2px; }
.pp-list-moved-actions .pp-list-undo { min-height:24px; padding:0 2px; border:0; background:transparent; color:var(--md-sys-color-error, #b42318); font-size:12px; line-height:1.3; cursor:pointer; }
.pp-list-moved-actions .pp-list-undo:hover { text-decoration:underline; }
.pp-list-moved-actions .pp-list-undo:focus-visible { outline:2px solid currentColor; outline-offset:2px; }

/* Company browsing: consistent controls and a separate paging row. */
.pp-company-toolbar { display:flex; align-items:center; gap:10px; padding:10px 16px; min-width:0; flex-shrink:0; }
.pp-readable .pp-company-search { flex:0 1 320px; flex-wrap:nowrap; }
.pp-readable .pp-company-search .db-input--search { width:240px; flex:1 1 auto; height:40px; }
.pp-company-facets { flex:1 1 auto; min-width:0; }
.pp-company-controls { display:flex; align-items:center; flex-wrap:wrap; gap:6px; min-width:0; }
.pp-company-filter, .pp-company-collection { position:relative; min-width:0; }
.pp-company-filter summary, .pp-company-collection summary, .pp-company-reset {
  display:flex; align-items:center; gap:8px; height:40px; padding:0 10px;
  border:1px solid var(--db-color-outline, #cbd5e1); border-radius:7px;
  background:var(--db-color-card, #fff); cursor:pointer; font-size:13px; white-space:nowrap;
}
.pp-company-filter summary { list-style:none; }
.pp-company-filter summary::-webkit-details-marker { display:none; }
.pp-company-filter summary::after { content:"▾"; color:var(--md-sys-color-on-surface-variant); }
.pp-company-filter-label { color:var(--md-sys-color-on-surface-variant); }
.pp-company-filter-value { max-width:135px; overflow:hidden; text-overflow:ellipsis; font-weight:600; }
.pp-company-filter--active summary { border-color:var(--db-color-primary); background:color-mix(in srgb, var(--db-color-primary) 6%, var(--db-color-card)); }
.pp-company-filter--active .pp-company-filter-value { color:var(--db-color-primary); }
.pp-company-menu {
  position:absolute; z-index:70; top:calc(100% + 6px); left:0; min-width:190px;
  max-width:min(340px, calc(100vw - 48px)); max-height:min(320px, 50vh); overflow:auto;
  padding:5px; border:1px solid var(--db-color-outline); border-radius:8px;
  background:var(--db-color-card); box-shadow:0 5px 18px #0002;
}
.pp-readable .pp-company-menu .pp-chip { display:flex; justify-content:space-between; gap:12px; min-height:36px; padding:7px 10px; border-radius:5px; font-size:13px; white-space:normal; }
.pp-company-filter-count { font-size:12px; color:var(--db-color-primary); white-space:nowrap; }
.pp-company-filter-count:empty, .pp-company-reset[hidden] { display:none; }
.pp-company-reset { color:var(--md-sys-color-on-surface-variant); }
.pp-company-collection { margin-left:auto; }
.pp-company-collection summary { border:0; font-size:12px; color:var(--md-sys-color-on-surface-variant); }
.pp-company-collection .pp-company-menu { left:auto; right:0; }
.pp-company-collection .pp-pipeline-strip { display:flex; flex-direction:column; align-items:flex-start; margin:4px; }
.pp-company-meta { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; padding:6px 16px; border-block:1px solid var(--db-color-outline); flex-shrink:0; min-width:0; }
.pp-company-hint { margin-left:auto; font-size:11px; color:var(--md-sys-color-on-surface-variant); }
.pp-company-filter summary:focus-visible, .pp-company-collection summary:focus-visible { outline:3px solid var(--db-color-primary); outline-offset:2px; }
@media (max-width:1400px) { .pp-company-toolbar { align-items:flex-start; } .pp-readable .pp-company-search { flex-basis:270px; } .pp-company-collection { margin-left:0; } }
@media (max-width:900px) { .pp-company-toolbar { flex-wrap:wrap; } .pp-readable .pp-company-search { flex:1 1 100%; } .pp-company-facets { flex-basis:100%; } .pp-company-hint { display:none; } }
@media (max-width:480px) { .pp-company-toolbar, .pp-company-meta { padding-inline:10px; } .pp-company-filter-value { max-width:90px; } .pp-company-menu { position:fixed; left:16px; right:16px; top:auto; width:auto; max-width:none; } }
@media (pointer:coarse) { .pp-company-filter summary, .pp-company-collection summary, .pp-company-reset, .pp-readable .pp-company-menu .pp-chip { min-height:44px; } }

/* The library keeps one scroll owner inside the app shell. */
.pl-library-toolbar, .pl-library-toolbar-main { flex-wrap:wrap; }
.pl-library-toolbar-main { flex:1 1 auto; }
.pl-library .js-grid-footer { max-width:100%; flex-wrap:wrap; }
.pl-library .js-grid-footer .tabulator-paginator { flex-wrap:wrap; }
@media (max-width:600px) { .pl-library-toolbar-main form { flex:1 1 100%; min-width:0; } .pl-library-toolbar-main .tabulator-pages { display:none; } }

/* Public-file provenance stays within the library's existing flex boundaries. */
.pl-library .pp-chips { flex-wrap: wrap; }
.pl-library-source-status { max-height: 42%; overflow-y: auto; }
.pl-library-source-status summary { line-height: 1.6; }
.pl-library-source-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 16px; }
.pl-library-source-facts > div { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.pl-library-source-facts dt { font-weight: 600; }
.pl-library-source-facts dd { margin: 0; overflow-wrap: anywhere; }

/* Expanded source provenance stays scrollable without consuming the whole grid. */
.pl-library-source-status[open] { max-height: 48dvh; overflow-y: auto; }


/* Immediate advertising-only feedback while Turbo is still fetching the page HTML. */
main:has(> .pp-navigation-loading) { position: relative; }
.pp-navigation-loading { position: absolute; inset: 0; z-index: 30; padding: 20px; overflow: hidden; border: 1px solid var(--db-color-outline, #e2e8f0); border-radius: 12px; background: var(--md-sys-color-surface, #fff); }
.pp-navigation-loading h1 { margin: 0 0 8px; font-size: 20px; font-weight: 700; }
.pp-navigation-loading p { margin: 0 0 16px; color: var(--md-sys-color-on-surface-variant, #475569); font-size: 14px; }
.pp-navigation-loading .pp-grid-placeholder { border: 1px solid var(--db-color-outline, #e2e8f0); border-radius: 8px; overflow: hidden; }
.pp-grid-loading-label { display: block; margin: 0 0 12px; color: var(--md-sys-color-on-surface-variant, #475569); font-size: 14px; font-weight: 500; }
