/* ==========================================================================
   listing-modal.css — 매물 팝업 카드(P1~P6)의 시각 레이어.

   정본은 W2 시안 보드(`05_홈페이지/design-board/` 의 P1·P2·D1 프레임과 board.css
   B·F·G 절)다. 보드의 `bd-*` 수식어를 여기 `bn-lm-*` 로 옮긴 것이고, 보드에만
   있던 장치(기기 프레임·safe-area 흉내 막대·주석 카드)는 옮기지 않았다.

   값은 design.md 토큰 변수(`--ink`·`--bone`·`--card`·`--background`·`--foreground`·
   `--border`·`--muted-foreground`·`--gold-deep`·`--shadow-soft`·`--shadow-elegant`)만
   쓰고 색을 새로 짓지 않는다. 여기 있는 클래스는 `card-detail-html.test.ts` 의
   class-audit 대상이다.

   1. 팝업 껍데기(listing-modal.js 가 만든다)   2. 상단 바   3. 스켈레톤
   4. 조각 배치 — 모바일 전체 화면 시트        5. 사진      6. 요약·CTA·표·중개사무소
   7. 하단 고정 바                              8. 데스크톱(≥1024px) 2단 카드
   9. 전환                                     10. 상세 페이지(같은 조각, 다른 그릇)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 팝업 껍데기 — `hidden` 이 곧 닫힘이다(클래스를 따로 갈아끼우지 않는다 —
      두 곳이 갈라지면 스크린리더가 읽는 상태와 보이는 상태가 달라진다).
   -------------------------------------------------------------------------- */
.bn-lm-root[hidden] {
  display: none;
}

.bn-lm-root {
  position: fixed;
  inset: 0;
  /* 사이트 크롬 전부보다 위. 본문(`content/pages/*.body.html`)과 `app.js` 에 실재하는 값을
     읽어 정했다: 「전화 상담」 FAB·모바일 내비 40 · 헤더 50 · 상담 초대 60 · **스크롤 진행선
     70** · lux 라이트박스 80 · 첫 로드 암막 90. 50 이면 진행선(70)이 팝업 위에 3px 짜리
     금을 긋는다. 라이트박스(80)와는 같은 화면에 서지 않지만 그 아래 칸을 비워 둔다. */
  z-index: 75;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 한 사이트에 모달 언어는 하나다 — 하이엔드 모달(`custom.css` `.he-modal__backdrop`)과
   같은 톤(밝은 bone 반투명 + 블러)을 쓴다. 시안 D1 의 어두운 막은 쓰지 않는다. */
.bn-lm-backdrop {
  position: absolute;
  inset: 0;
  background: oklch(97.5% 0.008 90 / 0.72);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
}

/* 상단 바가 사진 위에 떠 있어야 하므로 **스크롤은 안쪽 `.bn-lm-content` 가 맡는다** —
   껍데기가 직접 스크롤하면 상단 바도 같이 흘러가 스크롤 끝에서 닫을 길이 사라진다. */
.bn-lm-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--card);
  color: var(--foreground);
  outline: none;
}

/* 조각이 들어오는 자리. listing-modal.js 가 서버 조각을 여기에 넣는다. */
.bn-lm-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* --------------------------------------------------------------------------
   2. 상단 바 — 사진 위에서는 투명(반투명 원 버튼만 보인다), 사진을 지나 스크롤하면
      면이 차고 제목이 나타난다. 스크롤 끝까지 가도 닫을 길이 남아 있어야 한다.
   -------------------------------------------------------------------------- */
.bn-lm-topbar {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bn-lm-topbar[data-solid="true"] {
  border-bottom-color: var(--border);
  background: color-mix(in oklab, var(--card) 96%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.bn-lm-topbar-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bn-lm-topbar[data-solid="true"] .bn-lm-topbar-title {
  opacity: 1;
}

/* 사진 프레임 위의 원 버튼 — 어두운 반투명 바탕은 사진 위에서만 쓴다(design.md 의
   「다크 면 금지」 예외: 사진이 배경인 프레임). */
.bn-lm-iconbtn {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 55%, transparent);
  color: var(--bone);
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.bn-lm-topbar[data-solid="true"] .bn-lm-iconbtn {
  background: transparent;
  color: var(--foreground);
}

.bn-lm-iconbtn--light {
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--card) 90%, transparent);
  color: var(--foreground);
  box-shadow: var(--shadow-soft);
}

.bn-lm-iconbtn:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

/* 복사 직후 한 번 뜨는 확인 말풍선. 문구는 조각이 정하고(`data-bn-lm-copy-done`)
   JS 가 여기 실어 준다 — 같은 문장을 CSS 에 다시 적지 않는다. */
.bn-lm-copy {
  position: relative;
}

.bn-lm-copy[data-copied-label]::after {
  content: attr(data-copied-label);
  position: absolute;
  top: 46px;
  right: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 82%, transparent);
  font-size: 0.75rem;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--bone);
}

/* --------------------------------------------------------------------------
   3. 스켈레톤 — 「뭔가 오고 있다」를 시안 톤의 단색 블록으로. 새 색을 짓지 않는다.
   -------------------------------------------------------------------------- */
.bn-lm-skeleton {
  display: grid;
  gap: 14px;
  padding-bottom: 24px;
}

.bn-lm-sk-media {
  aspect-ratio: 4 / 3;
  background: color-mix(in oklab, var(--foreground) 8%, var(--card));
}

.bn-lm-sk-line {
  height: 14px;
  margin-inline: 24px;
  border-radius: 4px;
  background: color-mix(in oklab, var(--foreground) 8%, var(--card));
}

.bn-lm-sk-line--title {
  height: 30px;
  width: 72%;
}

.bn-lm-sk-line--short {
  width: 42%;
}

/* 불러오는 동안에도 dialog 의 이름이 비지 않게 — 눈에는 안 보이고 이름은 있다. */
.bn-lm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   4. 조각 배치 — 모바일(<768px) 전체 화면 시트.
      여섯 덩어리가 한 줄로 쌓이고, 「상세 페이지로 보기」만 표 뒤로 내려간다.
   -------------------------------------------------------------------------- */
.bn-lm-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "media"
    "summary"
    "info"
    "ctas"
    "agency";
  /* 하단 고정 바(12+56+12) + 홈 인디케이터 + 숨 쉴 자리 */
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px) + 24px);
}

.bn-lm-media {
  grid-area: media;
}
/* 모바일에서는 이 묶음이 없는 것처럼 — 요약과 CTA 가 각자의 자리로 흩어진다. */
.bn-lm-side {
  display: contents;
}
.bn-lm-thumbs {
  display: none; /* 썸네일은 데스크톱에서만 — 모바일은 스와이프다 */
}
.bn-lm-summary {
  grid-area: summary;
}
.bn-lm-ctas {
  grid-area: ctas;
}
.bn-lm-info {
  grid-area: info;
}
.bn-lm-agency {
  grid-area: agency;
}

/* --------------------------------------------------------------------------
   5. 사진 — 가로 스와이프(scroll-snap). 좌우 버튼은 데스크톱에서만.
   -------------------------------------------------------------------------- */
.bn-lm-media {
  position: relative;
  background-color: var(--ink);
}

.bn-lm-media.bg-ink {
  aspect-ratio: 4 / 3;
}

.bn-lm-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.bn-lm-track::-webkit-scrollbar {
  display: none;
}

.bn-lm-slide {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  scroll-snap-align: start;
}

/* 시트가 사진 아래끝을 16px 덮으므로 그만큼 더 띄운다 — 장수가 시트 모서리에 물리지 않게. */
.bn-lm-count {
  position: absolute;
  right: 12px;
  bottom: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 72%, transparent);
  font-size: 0.8125rem;
  line-height: 1.3;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--bone);
}

.bn-lm-nav {
  display: none;
}

/* --------------------------------------------------------------------------
   6. 요약 · CTA · 정보 표 · 중개사무소
   -------------------------------------------------------------------------- */
.bn-lm-summary {
  position: relative;
  z-index: 1;
  margin-top: -16px;
  padding: 22px 24px 0;
  border-radius: 14px 14px 0 0;
  background-color: var(--card);
}

/* 팝업 속 크림슨 라벨(동·「매물 정보」)은 캡션 하한 13px — 사이트 `.eyebrow.ko` 는 12px */
.bn-lm-eyebrow.eyebrow,
.bn-lm-h.eyebrow {
  font-size: 0.8125rem;
}

.bn-lm-title {
  margin-top: 12px;
  font-size: 1.875rem;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.bn-lm-price {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.bn-lm-price-k {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.bn-lm-price-v {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--foreground);
}

.bn-lm-facts {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}

.bn-lm-facts > div {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.bn-lm-facts > div:nth-child(odd) {
  padding-right: 12px;
}

.bn-lm-facts > div:nth-child(even) {
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.bn-lm-facts dt {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.bn-lm-facts dd {
  margin-top: 2px;
  font-size: 1rem;
  color: var(--foreground);
}

.bn-lm-info {
  padding: 0 24px;
  margin-top: 32px;
}

.bn-lm-rows {
  margin-top: 16px;
  border-top: 1px solid var(--border);
}

/* 정보 표의 글자만 모바일에서 키운다(dt 13 · dd 16) — 행 마크업은 상세와 같다. */
.bn-lm-rows dt.eyebrow {
  font-size: 0.8125rem;
}

.bn-lm-rows dd {
  font-size: 1rem;
}

/* 같은 평형·층의 다른 조건 — 행은 정보 표와 같은 마크업이다. 줄글 높이의 링크는 손가락으로
   누르기 어려우므로 행을 44px 로 세우고 그 높이를 링크가 받는다(`.bn-lm-textlink` 와 같은 모양). */
.bn-lm-variants:not(:first-child) {
  margin-top: 32px;
}

.bn-lm-variants .bn-lm-rows > div {
  align-items: center;
  min-height: 44px;
  padding-block: 0;
}

.bn-lm-variants dd a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--foreground) 35%, transparent);
  text-underline-offset: 4px;
}

.bn-lm-variants dd a:hover {
  color: var(--gold-deep);
}

.bn-lm-variants [aria-current="true"] dt {
  color: var(--gold-deep);
}

/* 모바일에서는 상담·전화가 하단 바로, 복사가 상단 원 버튼으로 내려간다 —
   이 묶음에서 화면에 남는 것은 「상세 페이지로 보기」 하나다. */
.bn-lm-ctas {
  padding: 0 24px;
}

.bn-lm-ctas .bn-lm-cta,
.bn-lm-ctas .bn-lm-textbtn {
  display: none;
}

.bn-lm-textlink {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 1rem;
  color: var(--foreground);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--foreground) 35%, transparent);
  text-underline-offset: 4px;
}

.bn-lm-textlink:hover {
  color: var(--gold-deep);
}

/* Z8(b) — ↗ 는 「새 탭에서 열린다」는 약속이다. 그 약속을 지키는 폭(≥1024)에서만 보인다.
   탭 결정과 같은 곳(`listing-gallery.js` 의 `applyNewTab`)이 이 클래스를 얹는다 —
   결정이 한 곳이면 표식도 한 곳이다. JS 가 없으면 팝업 자체가 열리지 않는다. */
.bn-lm-textlink--sametab svg {
  display: none;
}

.bn-lm-agency {
  margin: 20px 24px 8px;
  padding: 18px;
}

.bn-lm-agency-h {
  font-size: 0.875rem;
  font-weight: 600;
}

.bn-lm-agency dl {
  margin-top: 8px;
}

/**
 * **한 줄에 라벨과 값을 나란히 두지 않는다**(2026-09-20 개정).
 *
 * 전에는 `6.5rem 1fr` 2열 격자였다. 그러면 값이 쓸 수 있는 폭이 「칸 폭 − 라벨 트랙」이
 * 되는데, 이 카드는 데스크톱에서 오른쪽 칸(768 폭에서 264px)에 서므로 값에 98px 밖에
 * 남지 않았다 — 상호가 「빌딩나비강남역쉐 / 르빌부동산중개 / (주)」로 **고유명사 한가운데서**
 * 세 번 끊겼다. 폭마다 분기를 더하거나 container query 를 얹는 것은 같은 2열을 지키려고
 * 조항을 쌓는 일이다. 2열 자체가 원인이라 그것을 없앤다: 어느 폭에서든 dt 위 · dd 아래다.
 *
 * 값에는 칸 전체 폭이 온다(264px). `overflow-wrap: anywhere` 는 그래도 남는 마지막 수단
 * 으로 둔다 — 공백 없는 긴 어절이 min-content 를 키워 팝업을 가로로 넘치게 하던 원결함
 * (실측 768×1024 에서 12px)을 막는 것은 여전히 이 선언이다.
 */
.bn-lm-agency dl > div {
  padding: 5px 0;
  font-size: 0.875rem;
  line-height: 1.55;
}

/* 라벨은 카드 안의 다른 소형 라벨(`.bn-lm-facts dt`·`.bn-lm-price-k`)과 같은 값이다 —
   13px · muted. 새 색도 새 크기도 만들지 않는다. */
.bn-lm-agency dt {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.bn-lm-agency dd {
  margin-top: 2px;
}

.bn-lm-agency dt,
.bn-lm-agency dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   7. 하단 고정 바 — 왼쪽은 지금 보는 금액, 오른쪽은 행동 둘.
   -------------------------------------------------------------------------- */
/* 화면이 아니라 **팝업 상자**에 붙인다. 모바일에서 상자가 화면 전체라 결과는 같지만,
   기준이 분명하다 — `position: fixed` 로 두면 껍데기의 등장 애니메이션이 남긴
   `transform` 이 기준 상자를 말없이 바꿔 버린다(위저드에서 실측한 결함과 같은 원인). */
.bn-lm-bar {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 94%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.bn-lm-bar-sum {
  flex: 1 1 auto;
  min-width: 0;
}

.bn-lm-bar-main {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--foreground);
}

.bn-lm-bar-sub {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--muted-foreground);
}

/* 사이트 CTA(buttons.ts 정본 문자열)의 모바일 치수 — 높이 56·라벨 14px.
   `custom.css` 의 `a.press.ko[class*="text-[0.66rem]"]`(12px)보다 특이도를 한 칸
   높여, 스타일시트 순서와 무관하게 이긴다. */
/* `display` 는 건드리지 않는다 — 어느 CTA 가 보이는지는 배치가 정하고(모바일은 하단 바,
   데스크톱은 오른쪽 묶음), 여기서는 치수만 덧댄다. */
a.press.bn-lm-cta[class][class] {
  min-height: 56px;
  padding-block: 0;
  padding-inline: 1rem;
  font-size: 0.875rem;
  letter-spacing: 0.14em;
}

.bn-lm-bar .bn-lm-bar-tel,
.bn-lm-bar .bn-lm-bar-cta {
  flex: 0 0 auto;
  width: auto;
}

/* **전화는 아이콘 하나다**(`refs-mobile/BRIEF.md` (B)4 — 주 CTA 1개 + 보조 아이콘 1개).
   360px 폭에서 이름표 단 버튼을 둘 세우면 둘의 합이 306px 라 금액이 설 자리가 74px 밖에
   남지 않는다. 이름이 사라지는 것은 아니다 — `aria-label` 이 「전화 상담」이다.
   높이는 주 CTA(56)와 맞춰 바의 두 덩어리가 같은 선에 선다. */
.bn-lm-bar .bn-lm-bar-tel {
  width: 56px;
  height: 56px;
}

/* 텍스트 버튼(링크 복사) — 데스크톱 CTA 묶음에서만 보인다. */
.bn-lm-textbtn {
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 0.9375rem;
  color: var(--foreground);
  cursor: pointer;
}

.bn-lm-textbtn:hover {
  border-color: var(--gold-deep);
  color: var(--gold-deep);
}

/* --------------------------------------------------------------------------
   8. 데스크톱(≥1024px) — 가운데 큰 카드. 왼쪽 사진, 오른쪽 요약+CTA, 아래 표.

   **D4(UX-23) — 전환점은 1024 다(768 에서 올렸다.)** 768 에서 2단으로 접으면 오른쪽
   칸이 228px 밖에 안 돼 「330평(1091 ㎡)」이 줄바꿈되고 사진 아래에 큰 공백이 남았다
   (실측 768×1024). 태블릿은 폭이 아니라 **손가락**으로 쓰는 화면이라 모바일 시트와
   하단 고정 바 쪽이 맞다. `match.css`·`listing-gallery.js` 도 같은 값을 쓴다.
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
  .bn-lm-root {
    padding: 24px;
  }

  .bn-lm-dialog {
    width: min(100%, 1120px);
    height: 90vh;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-elegant);
  }

  .bn-lm-topbar {
    position: absolute;
    inset-inline: auto 16px;
    top: 16px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .bn-lm-topbar[data-solid="true"] {
    border-bottom-color: transparent;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  /* 데스크톱에는 제목 줄도, 상단 복사 버튼도 없다 — 오른쪽 CTA 묶음이 맡는다. */
  .bn-lm-topbar-title,
  .bn-lm-topbar .bn-lm-copy {
    display: none;
  }

  .bn-lm-topbar .bn-lm-iconbtn {
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--card) 90%, transparent);
    color: var(--foreground);
    box-shadow: var(--shadow-soft);
  }

  .bn-lm-card {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-areas:
      "media  side"
      "thumbs side"
      "info   agency";
    align-items: start;
    column-gap: 36px;
    padding: 28px 36px 36px 28px;
  }

  /**
   * D6 — **정보 표가 없는 매물**(요약이 표의 행을 전부 덮는 매물)의 자리 배치.
   *
   * 표가 빠지면 왼쪽 칸이 사진 아래로 텅 비고 중개사무소 카드만 오른쪽 아래에 홀로
   * 남는다 — UX-26 이 「1440 은 사진 아래 좌측 공백」이라고 적은 바로 그 자리이고,
   * 표를 없앤 이 변경이 그걸 더 키웠다. 빈 칸에 여백 규칙을 덧대는 대신 **배치가
   * 스스로 알게** 한다: 표가 없으면 그 행을 중개사무소가 쓴다.
   */
  .bn-lm-card:not(:has(.bn-lm-info)) {
    grid-template-areas:
      "media  side"
      "thumbs side"
      "agency side";
    /* 남는 높이는 **마지막 행**이 받는다. 균등하게 나누면 오른쪽 칸이 왼쪽보다 길 때
       그 차이가 사진과 중개사무소 사이에 빈 띠로 끼어든다(실측 178px). */
    grid-template-rows: auto auto 1fr;
  }

  /* 오른쪽 한 칸 — 요약 바로 밑에 CTA 가 선다(사진 높이에 끌려가지 않는다). */
  .bn-lm-side {
    display: flex;
    flex-direction: column;
    grid-area: side;
    align-self: start;
  }

  /* **닫기 버튼 자리를 비워 둔다.** 상단 바는 상자에 고정(absolute)이고 내용은 그 밑으로
     흐르므로, 오른쪽 칸이 상자 끝까지 차 있으면 스크롤하는 동안 제목·중개사무소 글자가
     버튼 뒤로 지나간다(실측: 844×390·1024×768·1440×900 전부에서 제목이 24×36px 가려졌다
     — 화면 높이가 아니라 「내용이 스크롤된다」가 조건이라 세 크기가 같았다).
     버튼은 상자 오른쪽 끝에서 16px 떨어진 44px 원이다 = 60px. 거기에 숨 쉴 자리 12px. */
  .bn-lm-side,
  .bn-lm-agency {
    padding-right: 36px; /* 카드 오른쪽 여백 36 + 여기 36 = 72 > 60 + 12 */
  }

  .bn-lm-media {
    overflow: hidden;
    border-radius: 8px;
  }

  .bn-lm-thumbs {
    grid-area: thumbs;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
  }

  .bn-lm-thumb {
    width: 72px;
    height: 54px;
    border: 2px solid transparent;
    border-radius: 6px;
    object-fit: cover;
    opacity: 0.72;
    cursor: pointer;
  }

  .bn-lm-thumb.is-on {
    border-color: var(--gold-deep);
    opacity: 1;
  }

  .bn-lm-thumb-more {
    padding-left: 4px;
    font-size: 0.875rem;
    color: var(--muted-foreground);
  }

  .bn-lm-nav {
    display: inline-flex;
    position: absolute;
    top: 50%;
    margin-top: -22px;
  }

  .bn-lm-nav--prev {
    left: 14px;
  }

  .bn-lm-nav--next {
    right: 14px;
  }

  /* 데스크톱에는 겹치는 시트가 없다 — 사진 안쪽으로 되돌린다. */
  .bn-lm-count {
    bottom: 14px;
  }

  .bn-lm-summary {
    margin-top: 0;
    padding: 44px 0 0;
    border-radius: 0;
    background: transparent;
  }

  .bn-lm-ctas {
    display: grid;
    gap: 10px;
    margin-top: 24px;
    padding: 0;
  }

  .bn-lm-ctas .bn-lm-cta,
  .bn-lm-ctas .bn-lm-textbtn {
    display: inline-flex;
  }

  .bn-lm-ctas .bn-lm-textlink {
    justify-self: start;
    margin-top: 2px;
  }

  .bn-lm-info {
    margin-top: 32px;
    padding: 0;
  }

  .bn-lm-agency {
    margin: 32px 0 0;
  }

  .bn-lm-bar {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   9. 전환                                     10. 상세 페이지(같은 조각, 다른 그릇) — 짧게 한 번. 모션 최소화 설정에서는 **같은 길이의 페이드**(P5, 2026-09-20 개정).
      팝업이 열린 동안에는 「전화 상담」 FAB 를 가린다(하단 바의 「전화」가 대신한다).
      `app.js` 는 고치지 않는다 — 잠금 상태 클래스로만 가린다.
   -------------------------------------------------------------------------- */
@keyframes bn-lm-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes bn-lm-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bn-lm-root:not([hidden]) .bn-lm-backdrop {
  animation: bn-lm-fade 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* `backwards` 지 `both` 가 아니다. 끝값(`opacity: 1`·`transform: none`)이 기본 스타일과
   같으므로 `forwards` 성분은 아무것도 더하지 않으면서, 애니메이션이 끝난 뒤에도 상자에
   transform 을 붙들어 둔다 — 그러면 팝업 상자가 `position: fixed` 의 포함 블록으로
   계속 남는다(하단 바를 상자 기준으로 붙인 것이 그 때문이다). */
.bn-lm-root:not([hidden]) .bn-lm-dialog {
  animation: bn-lm-rise 0.28s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* --------------------------------------------------------------------------
   Y15(A-E1) — **닫힘에도 전환이 있다.**

   전에는 팝업이 다음 프레임에 그냥 사라졌다. 그래서 「닫힌 뒤 다시 드러나는 페이지도
   새로 나타나는 입력 대상이다」(P5)를 지키려 해도 **기다릴 신호가 없었고**, 게이트가
   두 프레임(≈33ms)만에 열려 200ms 뒤의 재탭이 그 좌표 아래 햄버거를 눌렀다
   (닫기 X 와 햄버거는 둘 다 좌상단이라 실제로 겹친다).

   들어올 때와 **같은 길이·같은 곡선**으로 나간다(0.24s / 0.28s). 시간을 늘려 검사를
   통과시키는 것이 아니라, 원래 있었어야 할 전환을 넣는 것이다 — 그 전환이 있어야
   `entry-gate.js` 가 셀 신호가 생기고, 방문자도 화면이 어디로 사라지는지 본다.
   `forwards` 로 끝값을 붙들어 둔다: 끝난 뒤에도 투명한 채여야 한 프레임이 번쩍이지 않는다.
   -------------------------------------------------------------------------- */
@keyframes bn-lm-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes bn-lm-sink {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateY(18px);
  }
}

.bn-lm-root[data-closing="true"] .bn-lm-backdrop {
  animation: bn-lm-fade-out 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.bn-lm-root[data-closing="true"] .bn-lm-dialog {
  animation: bn-lm-sink 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.bn-scroll-lock a.press.fixed.bottom-6.right-6[href^="tel:"] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  /* 모션 최소화에서 **애니메이션을 없애지 않는다**(2026-09-20 개정) — 움직임(translateY)만
     뺀 페이드로 바꾼다. 없애 버리면 `animationend` 가 영영 오지 않아 진입 게이트
     (`entry-gate.js`)가 프레임 쪽(rAF×2 ≈ 33ms)으로 떨어지고, 그 33ms 는 더블클릭의 두
     번째 입력(실측 ~40~200ms)보다 짧아 팝업이 뜨자마자 눌린다. 같은 길이·같은 곡선이라
     게이트는 어느 설정에서도 같은 방식으로 풀린다. `match.css` 와 같은 처리다. */
  .bn-lm-root:not([hidden]) .bn-lm-backdrop {
    animation: bn-lm-fade 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
    /* 번들(`styles-BA9J2VGO.css`, 수정 금지)이 모션 최소화에서
       `*,:before,:after { animation-duration: .01ms !important }` 로 **모든** 애니메이션을
       0 으로 눌러 버린다. `!important` 로 되돌리되 **움직임은 없다** — opacity 만 바뀐다.
       선택자 특이도가 번들의 `*`(0,0,0)보다 높아 이 선언이 이긴다. */
    animation-duration: 0.24s !important;
  }

  .bn-lm-root:not([hidden]) .bn-lm-dialog {
    animation: bn-lm-fade 0.28s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    animation-duration: 0.28s !important;
  }

  /* 닫힘도 같은 이유로 **없애지 않는다** — 움직임만 뺀 같은 길이의 페이드다(Y15). */
  .bn-lm-root[data-closing="true"] .bn-lm-backdrop {
    animation: bn-lm-fade-out 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-duration: 0.24s !important;
  }

  .bn-lm-root[data-closing="true"] .bn-lm-dialog {
    animation: bn-lm-fade-out 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-duration: 0.28s !important;
  }

  .bn-lm-track {
    scroll-behavior: auto;
  }

  .bn-lm-topbar,
  .bn-lm-topbar-title {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   10. 상세 페이지(`/listings/{id}`) — **같은 조각, 다른 그릇**.

   D1(UX-09) 로 상세도 팝업과 같은 사진 슬라이더와 하단 고정 바를 쓴다. 마크업은
   `src/lib/listings/detail-shared.ts` 한 곳에서 나오고, 여기서는 「팝업 상자 안」이
   아니라 「문서 안」에 설 때 달라지는 것만 적는다. 클래스를 새로 짓는 것은 셋뿐이다
   (`bn-lm-bar--page` · `bn-detail-gallery` · `bn-detail-eyebrow`).
   -------------------------------------------------------------------------- */

/* 팝업의 바는 **상자**에 붙지만(7절), 상세에는 그 상자가 없다 — 화면에 붙인다.
   z-index 는 헤더(50) 아래 · 전화 FAB(40) 위다. */
.bn-lm-bar--page {
  position: fixed;
  z-index: 45;
}

/* 페이지의 **마지막 요소**가 바 뒤로 숨지 않게 — 바 높이(12+56+12) + safe-area + 숨 쉴 자리.
   `main` 이 아니라 푸터에 준다: 끝까지 내리면 화면 아래를 차지하는 것은 푸터이고, 거기에
   전화·메일·사업자 표시 링크가 있다. 푸터 제 배경이 늘어나므로 빈 띠도 생기지 않는다. */
body:has(.bn-lm-bar--page) footer {
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px) + 24px);
}

/* 고정 요소 둘이 같은 모서리에 서지 않게 하는 일 — 「전화 상담」 FAB 내리기 — 은
   **이 파일에서 나갔다**(Z4). 화면별 앵커 목록이던 규칙이 표식 하나로 합쳐졌다:
   상세 하단 바가 `data-bn-has-tel-cta` 를 달고(`detail-shared.ts`), `custom.css` 의
   규칙 하나가 그것을 본다. 여기 같은 규칙을 남겨 두면 정본이 둘이 된다. */

/* 사진 틀은 본문 컨테이너 안에 서므로 어느 폭에서나 모서리를 둥글린다(팝업의 모바일
   시트는 화면 가장자리까지 꽉 차 있어 각을 남겼다). */
.bn-detail-gallery {
  position: relative;
}

.bn-detail-gallery .bn-lm-media {
  overflow: hidden;
  border-radius: 8px;
}

/* 상세에는 사진 아래끝을 덮는 시트가 없다 — 장수 표시를 사진 안쪽으로 되돌린다. */
.bn-detail-gallery .bn-lm-count {
  bottom: 14px;
}

@media (min-width: 1024px) {
  /* 8절이 `.bn-lm-bar` 를 이미 숨긴다 — 데스크톱에서는 CTA 칸이 같은 행동을 갖는다.
     그래서 바를 위해 비워 둔 아래 여백도 되돌린다. */
  body:has(.bn-lm-bar--page) footer {
    padding-bottom: 0;
  }

  /* 본문 폭(최대 1200px)에서 4:3 은 높이 900px 이라 한 장이 화면을 통째로 먹는다.
     넓은 화면에서만 틀을 눕힌다 — 사진 수와 무관하게 틀을 꽉 채우므로 공백은 0 이다. */
  .bn-detail-gallery .bn-lm-slide {
    aspect-ratio: 16 / 9;
  }
}

/**
 * D2(UX-11) — 히어로의 동 이름 뒤 **불투명 잉크 칩**.
 *
 * eyebrow 색(`--gold` = #E94B73)은 design.md 조항이라 그대로 둔다. 그러면 남는 손잡이는
 * 바탕뿐인데 그라디언트로는 4.5:1 에 닿지 못한다 — 밝은 사진 위에서 88% 잉크가 3.6:1,
 * 95% 가 4.2:1, 4.5 를 넘기려면 98%(= 사실상 불투명)여야 한다. 그 값을 히어로 하단에
 * 통째로 깔면 사진이 죽으므로 **글자가 놓인 자리에만** 깐다. 불투명 잉크 위 #E94B73 은
 * 4.8:1 이고 그 값은 어느 사진에서도 같다.
 *
 * 새 시각 언어가 아니다 — 사진 위 어두운 알약은 이 컴포넌트의 장수 표시(`.bn-lm-count`)와
 * 원 버튼(`.bn-lm-iconbtn`)이 이미 쓰는 모양이고, design.md 의 「`bg-ink` 는 사진이
 * 배경인 프레임에서만」 예외 안이다.
 */
.bn-detail-eyebrow {
  width: fit-content;
  max-width: 100%;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--ink);
}
