/* =========================================================================
   반부(banbu) 신규 레이아웃 디자인 토큰 + 공통 컴포넌트
   - 나리야/그누보드 테마 CSS 를 상속하지 않는다. 모든 선택자는 bb- 접두사.
   - 모바일(375px) 우선, 768px 이상에서 데스크톱 배치.
   - 테마 페이지(홈)에도 같이 로드되므로 전역 요소(body, h1 ...)는 건드리지 않고
     .bb-app 아래에서만 기본 스타일을 준다.
   ========================================================================= */
:root {
  /* 색 */
  --bb-bg: #f4f5f7;
  --bb-surface: #ffffff;
  --bb-border: #e5e7eb;
  --bb-text: #111827;
  --bb-text-2: #374151;
  --bb-text-3: #6b7280;
  --bb-primary: #1f5eff;
  --bb-primary-ink: #1746b8;
  --bb-primary-soft: #e9f0ff;
  --bb-up: #d93025;        /* 상승: 국내 관례상 빨강 */
  --bb-up-soft: #fdecea;
  --bb-down: #1a56db;      /* 하락: 파랑 */
  --bb-down-soft: #e6eefc;
  --bb-flat: #6b7280;
  --bb-flat-soft: #f3f4f6;
  --bb-warn: #b45309;
  --bb-warn-soft: #fef3c7;
  --bb-chart-1: #1f5eff;   /* 차트 단일 계열 */
  --bb-chart-2: #0f766e;
  --bb-chart-grid: #eef0f3;

  /* 간격 (4px 배수) */
  --bb-sp-1: 4px;
  --bb-sp-2: 8px;
  --bb-sp-3: 12px;
  --bb-sp-4: 16px;
  --bb-sp-5: 20px;
  --bb-sp-6: 24px;
  --bb-sp-8: 32px;

  /* 타이포 */
  --bb-font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --bb-font-num: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", system-ui, sans-serif;
  --bb-fs-xs: 12px;
  --bb-fs-sm: 13px;
  --bb-fs-md: 15px;
  --bb-fs-lg: 17px;
  --bb-fs-xl: 22px;
  --bb-fs-2xl: 28px;
  --bb-lh: 1.45;

  /* 형태 */
  --bb-radius: 12px;
  --bb-radius-sm: 8px;
  --bb-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
  --bb-header-h: 52px;
  --bb-tabbar-h: 60px;
  --bb-content-max: 960px;
}

/* ---------- 페이지 셸 (.bb-app 아래에서만) ---------- */
body.bb-body {
  margin: 0;
  background: var(--bb-bg);
  color: var(--bb-text);
  font-family: var(--bb-font);
  font-size: var(--bb-fs-md);
  line-height: var(--bb-lh);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
.bb-app { min-height: 100vh; display: flex; flex-direction: column; }
.bb-app *, .bb-app *::before, .bb-app *::after { box-sizing: border-box; }
.bb-app a { color: inherit; text-decoration: none; }
.bb-app h1, .bb-app h2, .bb-app h3, .bb-app p { margin: 0; }
.bb-app button { font: inherit; }
.bb-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 헤더 */
.bb-header {
  position: sticky; top: 0; z-index: 20;
  height: var(--bb-header-h);
  background: var(--bb-surface);
  border-bottom: 1px solid var(--bb-border);
}
.bb-header__in {
  max-width: var(--bb-content-max); margin: 0 auto; height: 100%;
  padding: 0 var(--bb-sp-4);
  display: flex; align-items: center; gap: var(--bb-sp-3);
}
.bb-header__brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; font-size: 21px; letter-spacing: -0.03em; color: #12476b; text-decoration: none; }
.bb-logo { width: 30px; height: 30px; display: block; }
.bb-header__title { font-size: var(--bb-fs-md); font-weight: 600; color: var(--bb-text-2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-header__nav { display: none; }
.bb-header__user { font-size: var(--bb-fs-sm); color: var(--bb-text-3); white-space: nowrap; }

/* 본문 */
.bb-main {
  flex: 1; width: 100%; max-width: var(--bb-content-max); margin: 0 auto;
  padding: var(--bb-sp-4) var(--bb-sp-4) var(--bb-sp-6);
}
.bb-page-title { font-size: var(--bb-fs-xl); font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--bb-sp-1); }
.bb-page-sub { font-size: var(--bb-fs-sm); color: var(--bb-text-3); margin-bottom: var(--bb-sp-5); }
.bb-section { margin-bottom: var(--bb-sp-8); }
.bb-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--bb-sp-3); margin-bottom: var(--bb-sp-3); }
.bb-section__title { font-size: var(--bb-fs-lg); font-weight: 700; letter-spacing: -0.01em; }
.bb-section__more { font-size: var(--bb-fs-sm); color: var(--bb-primary); font-weight: 600; white-space: nowrap; }
.bb-section__more:hover { text-decoration: underline; }

/* 하단 탭바 (모바일) */
.bb-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--bb-tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bb-surface); border-top: 1px solid var(--bb-border);
  display: flex;
}
.bb-tabbar__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 11px; color: var(--bb-text-3); font-weight: 500;
}
.bb-tabbar__item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bb-tabbar__item.is-active { color: var(--bb-primary); font-weight: 700; }
.bb-tabbar__item.is-disabled { opacity: 0.45; pointer-events: none; }

/* 푸터 */
.bb-footer { max-width: var(--bb-content-max); margin: 0 auto; padding: 0 var(--bb-sp-4) calc(var(--bb-tabbar-h) + var(--bb-sp-4) + env(safe-area-inset-bottom, 0px)); font-size: var(--bb-fs-xs); color: var(--bb-text-3); }

/* ---------- 상태 ---------- */
.bb-notice {
  display: flex; gap: var(--bb-sp-2); align-items: flex-start;
  padding: var(--bb-sp-3) var(--bb-sp-4); border-radius: var(--bb-radius-sm);
  background: var(--bb-warn-soft); color: var(--bb-warn); font-size: var(--bb-fs-sm);
  margin-bottom: var(--bb-sp-4);
}
.bb-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; border: 1px dashed var(--bb-border); border-radius: var(--bb-radius);
  color: var(--bb-text-3); font-size: var(--bb-fs-sm); background: var(--bb-surface);
}

/* ---------- 출처 ---------- */
.bb-source { font-size: var(--bb-fs-xs); color: var(--bb-text-3); margin-top: var(--bb-sp-2); line-height: 1.5; }
.bb-source b { font-weight: 600; color: var(--bb-text-2); }

/* ---------- KPI 카드 ---------- */
.bb-kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bb-sp-3); }
.bb-kpi-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--bb-sp-2); }
.bb-kpi {
  display: block; min-width: 0;
  background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius);
  padding: var(--bb-sp-3) var(--bb-sp-4); box-shadow: var(--bb-shadow);
}
a.bb-kpi:hover { border-color: var(--bb-primary); }
.bb-kpi__label { font-size: var(--bb-fs-sm); color: var(--bb-text-3); font-weight: 600; margin-bottom: var(--bb-sp-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-kpi__value { font-family: var(--bb-font-num); font-size: var(--bb-fs-xl); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.bb-kpi__unit { font-size: var(--bb-fs-sm); font-weight: 600; color: var(--bb-text-3); margin-left: 2px; }
.bb-kpi__value.is-empty { font-size: var(--bb-fs-md); color: var(--bb-text-3); font-weight: 600; }
.bb-kpi__change {
  display: inline-flex; align-items: center; gap: 3px; margin-top: var(--bb-sp-1);
  padding: 1px 7px; border-radius: 999px; font-size: var(--bb-fs-xs); font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bb-kpi__change.is-up { color: var(--bb-up); background: var(--bb-up-soft); }
.bb-kpi__change.is-down { color: var(--bb-down); background: var(--bb-down-soft); }
.bb-kpi__change.is-flat { color: var(--bb-flat); background: var(--bb-flat-soft); }
.bb-kpi__meta { font-size: var(--bb-fs-xs); color: var(--bb-text-3); margin-top: var(--bb-sp-2); line-height: 1.4; }
/* 컴팩트(홈 3열) */
.bb-kpi--compact { padding: var(--bb-sp-2) 10px; border-radius: var(--bb-radius-sm); }
.bb-kpi--compact .bb-kpi__label { font-size: var(--bb-fs-xs); }
.bb-kpi--compact .bb-kpi__value { font-size: var(--bb-fs-lg); }
.bb-kpi--compact .bb-kpi__unit { font-size: 11px; }
.bb-kpi--compact .bb-kpi__change { font-size: 11px; padding: 0 6px; }
.bb-kpi--compact .bb-kpi__meta { display: none; }

/* ---------- 차트 프레임 ---------- */
.bb-chart {
  background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius);
  padding: var(--bb-sp-4); box-shadow: var(--bb-shadow); margin-bottom: var(--bb-sp-4);
}
.bb-chart__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--bb-sp-2); margin-bottom: var(--bb-sp-2); }
.bb-chart__title { font-size: var(--bb-fs-md); font-weight: 700; }
.bb-chart__latest { font-family: var(--bb-font-num); font-size: var(--bb-fs-md); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bb-chart__latest small { font-size: var(--bb-fs-xs); color: var(--bb-text-3); font-weight: 500; margin-left: 4px; }
.bb-chart__canvas { position: relative; height: 200px; }
.bb-chart__canvas canvas { width: 100% !important; height: 100% !important; }

/* ---------- 홈 "오늘의 시장" 블록 (테마 페이지 안에서 사용) ---------- */
.bb-today { font-family: var(--bb-font); color: var(--bb-text); margin: 0 0 var(--bb-sp-4); padding: 0 var(--bb-sp-3); }
.bb-today .bb-section__head { margin-bottom: var(--bb-sp-2); }
.bb-today .bb-section__title { font-size: var(--bb-fs-md); }
.bb-today .bb-source { margin-top: var(--bb-sp-1); }

/* ---------- 데스크톱 ---------- */
@media (min-width: 768px) {
  .bb-header__nav { display: flex; gap: var(--bb-sp-1); margin-left: var(--bb-sp-4); }
  .bb-header__nav a { padding: 6px 12px; border-radius: 999px; font-size: var(--bb-fs-sm); font-weight: 600; color: var(--bb-text-2); }
  .bb-header__nav a.is-active { background: var(--bb-primary-soft); color: var(--bb-primary-ink); }
  .bb-header__nav a.is-disabled { opacity: 0.45; pointer-events: none; }
  .bb-header__title { display: none; }
  .bb-tabbar { display: none; }
  .bb-main { padding: var(--bb-sp-6) var(--bb-sp-6) var(--bb-sp-8); }
  .bb-footer { padding-bottom: var(--bb-sp-6); }
  .bb-kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--bb-sp-4); }
  .bb-kpi-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--bb-sp-3); }
  .bb-chart__canvas { height: 260px; }
  .bb-chart-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bb-sp-4); }
  .bb-chart-row .bb-chart { margin-bottom: 0; }
  .bb-today { padding: 0; }
}

/* =========================================================================
   홈 화면 (page/home.php)
   ========================================================================= */
.bb-home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.bb-home .bb-section { margin-bottom: var(--bb-sp-6); }
.bb-section__desc { font-size: var(--bb-fs-sm); color: var(--bb-text-3); margin: calc(-1 * var(--bb-sp-1)) 0 var(--bb-sp-3); }
.bb-home__full { grid-column: 1 / -1; }

/* 히어로 + 검색 */
.bb-hero { padding: var(--bb-sp-2) 0 var(--bb-sp-6); }
.bb-hero__title { font-size: var(--bb-fs-xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.bb-hero__sub { font-size: var(--bb-fs-sm); color: var(--bb-text-3); margin: var(--bb-sp-1) 0 var(--bb-sp-4); }
.bb-search {
  display: flex; align-items: stretch; gap: 0;
  background: var(--bb-surface); border: 1.5px solid var(--bb-border); border-radius: 14px;
  box-shadow: var(--bb-shadow); overflow: hidden;
}
.bb-search:focus-within { border-color: var(--bb-primary); box-shadow: 0 0 0 3px var(--bb-primary-soft); }
.bb-search__city {
  border: 0; border-right: 1px solid var(--bb-border); background: var(--bb-bg); color: var(--bb-text-2);
  font: inherit; font-size: var(--bb-fs-sm); font-weight: 600; padding: 0 var(--bb-sp-2) 0 var(--bb-sp-3); max-width: 86px;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 14px; padding-right: 22px;
}
.bb-search__input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: var(--bb-fs-md); padding: 13px var(--bb-sp-3); background: transparent; color: var(--bb-text); }
.bb-search__input::placeholder { color: var(--bb-text-3); }
.bb-search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.bb-search__btn { border: 0; background: var(--bb-primary); color: #fff; width: 50px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.bb-search__btn:hover { background: var(--bb-primary-ink); }
.bb-search__btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.bb-chips { display: flex; gap: var(--bb-sp-2); margin-top: var(--bb-sp-3); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bb-chips::-webkit-scrollbar { display: none; }
.bb-chip { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; background: var(--bb-surface); border: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); font-weight: 600; color: var(--bb-text-2); white-space: nowrap; }
.bb-chip:hover { border-color: var(--bb-primary); color: var(--bb-primary-ink); }

/* 인라인 셀렉트 (섹션 헤더용) */
.bb-inline-form { margin: 0; }
.bb-select {
  font: inherit; font-size: var(--bb-fs-sm); font-weight: 600; color: var(--bb-text-2);
  border: 1px solid var(--bb-border); border-radius: 999px; background: var(--bb-surface);
  padding: 4px 26px 4px 12px; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}

/* 스파크라인 */
.bb-spark-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bb-sp-2); margin-top: var(--bb-sp-2); }
.bb-spark { display: flex; flex-direction: column; gap: 4px; background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-sm); padding: 10px 12px; box-shadow: var(--bb-shadow); min-width: 0; }
.bb-spark:hover { border-color: var(--bb-primary); }
.bb-spark__head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.bb-spark__label { font-size: var(--bb-fs-xs); color: var(--bb-text-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-spark__value { font-family: var(--bb-font-num); font-size: var(--bb-fs-lg); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bb-spark__canvas { position: relative; height: 44px; display: block; }
.bb-spark__canvas canvas { width: 100% !important; height: 100% !important; }
.bb-spark__foot { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--bb-text-3); flex-wrap: wrap; }
.bb-spark__foot .bb-kpi__change { margin-top: 0; }

/* 순위 리스트 */
.bb-rank-list { background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow); overflow: hidden; }
.bb-rank { display: flex; align-items: center; gap: var(--bb-sp-3); padding: 12px var(--bb-sp-4); border-top: 1px solid var(--bb-border); min-width: 0; }
.bb-rank:first-child { border-top: 0; }
.bb-rank:hover { background: var(--bb-primary-soft); }
.bb-rank__no { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; font-family: var(--bb-font-num); font-size: var(--bb-fs-sm); font-weight: 800; color: var(--bb-text-3); background: var(--bb-flat-soft); }
.bb-rank__no.is-top { color: #fff; background: var(--bb-text); }
.bb-rank__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bb-rank__name { font-weight: 700; font-size: var(--bb-fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-rank__meta { font-size: var(--bb-fs-xs); color: var(--bb-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-rank__price { font-size: var(--bb-fs-sm); color: var(--bb-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-rank__price s { color: var(--bb-text-3); }
.bb-rank__price b { color: var(--bb-text); font-weight: 800; }
.bb-rank__price small { color: var(--bb-text-3); font-size: 11px; }
.bb-badge { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: var(--bb-fs-xs); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bb-badge.is-down { color: var(--bb-down); background: var(--bb-down-soft); }
.bb-badge.is-up { color: var(--bb-up); background: var(--bb-up-soft); }
.bb-badge.is-primary { color: var(--bb-primary-ink); background: var(--bb-primary-soft); }
.bb-badge.is-warn { color: var(--bb-warn); background: var(--bb-warn-soft); }

/* 가로 스크롤 카드 (청약) */
.bb-scroll { display: flex; gap: var(--bb-sp-3); overflow-x: auto; padding: 2px 2px var(--bb-sp-2); margin: 0 calc(-1 * var(--bb-sp-4)); padding-left: var(--bb-sp-4); padding-right: var(--bb-sp-4); scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.bb-scroll::-webkit-scrollbar { display: none; }
.bb-lotto { flex: 0 0 236px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 6px; background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius); padding: var(--bb-sp-3) var(--bb-sp-4); box-shadow: var(--bb-shadow); min-width: 0; }
.bb-lotto:hover { border-color: var(--bb-primary); }
.bb-lotto__top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.bb-lotto__name { font-weight: 700; font-size: var(--bb-fs-md); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.bb-lotto__meta { font-size: var(--bb-fs-xs); color: var(--bb-text-3); }
.bb-lotto__date { font-size: var(--bb-fs-sm); color: var(--bb-text-2); font-variant-numeric: tabular-nums; }
.bb-dday { font-family: var(--bb-font-num); font-size: var(--bb-fs-xs); font-weight: 800; color: var(--bb-text-2); font-variant-numeric: tabular-nums; }
.bb-dday.is-soon { color: var(--bb-warn); }
.bb-dday.is-hot { color: var(--bb-up); }
.bb-dday.is-muted { color: var(--bb-text-3); }

/* 단순 리스트 (뉴스·커뮤니티) */
.bb-list { background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow); overflow: hidden; }
.bb-news { display: flex; align-items: baseline; gap: var(--bb-sp-3); padding: 11px var(--bb-sp-4); border-top: 1px solid var(--bb-border); min-width: 0; }
.bb-news:first-child { border-top: 0; }
.bb-news:hover { background: var(--bb-primary-soft); }
.bb-news__title { flex: 1; min-width: 0; font-size: var(--bb-fs-sm); color: var(--bb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-news__time { flex: 0 0 auto; font-size: var(--bb-fs-xs); color: var(--bb-text-3); font-variant-numeric: tabular-nums; }
.bb-tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--bb-primary-ink); background: var(--bb-primary-soft); border-radius: 4px; padding: 0 5px; margin-right: 2px; vertical-align: 1px; }
.bb-count { font-style: normal; font-size: 11px; font-weight: 700; color: var(--bb-primary); margin-left: 2px; }

/* 바로가기 타일 */
.bb-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bb-sp-2); }
.bb-tile { display: flex; flex-direction: column; gap: 2px; background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-sm); padding: 12px; box-shadow: var(--bb-shadow); min-width: 0; }
.bb-tile:hover { border-color: var(--bb-primary); }
.bb-tile svg { width: 22px; height: 22px; stroke: var(--bb-primary); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 4px; }
.bb-tile__label { font-size: var(--bb-fs-sm); font-weight: 700; }
.bb-tile__desc { font-size: 11px; color: var(--bb-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (min-width: 768px) {
  .bb-home { grid-template-columns: minmax(0, 1fr) 320px; column-gap: var(--bb-sp-6); align-items: start; }
  .bb-hero { grid-column: 1 / -1; padding: var(--bb-sp-4) 0 var(--bb-sp-8); text-align: center; }
  .bb-hero__title { font-size: 32px; }
  .bb-hero__sub { font-size: var(--bb-fs-md); }
  .bb-search { max-width: 640px; margin: 0 auto; }
  .bb-search__city { max-width: 110px; }
  .bb-chips { justify-content: center; }
  .bb-home__market, .bb-home__quick, .bb-home__community { grid-column: 2; }
  .bb-home__top10, .bb-home__lotto, .bb-home__news { grid-column: 1; }
  .bb-home__market { grid-row: 2; }
  .bb-home__top10 { grid-row: 2 / span 2; }
  .bb-home__quick { grid-row: 3; }
  .bb-home__lotto { grid-row: 4; }
  .bb-home__community { grid-row: 4; }
  .bb-home__news { grid-row: 5; }
  .bb-home .bb-kpi-grid--3 { grid-template-columns: 1fr; gap: var(--bb-sp-2); }
  .bb-home .bb-kpi--compact { display: flex; align-items: baseline; justify-content: space-between; gap: var(--bb-sp-2); padding: 10px 14px; }
  .bb-home .bb-kpi--compact .bb-kpi__label { margin: 0; }
  .bb-home .bb-kpi--compact .bb-kpi__change { margin: 0 0 0 auto; }
  .bb-spark-row { grid-template-columns: 1fr; }
  .bb-scroll { margin: 0; padding-left: 2px; padding-right: 2px; }
  .bb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .bb-home { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 480px) {
  .bb-rank__price small { display: none; }
}

/* ---------- 상품 메뉴바 (헤더 아래, 모든 화면) ---------- */
.bb-header { height: auto; }
.bb-header__in { height: var(--bb-header-h); }
.bb-header__brand-sub { display: none; font-size: var(--bb-fs-xs); font-weight: 600; color: var(--bb-text-3); margin-left: 6px; letter-spacing: 0; }
.bb-menubar { border-top: 1px solid var(--bb-border); background: var(--bb-surface); }
.bb-menubar__in {
  max-width: var(--bb-content-max); margin: 0 auto; padding: 0 var(--bb-sp-3);
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.bb-menubar__in::-webkit-scrollbar { display: none; }
.bb-menubar__item {
  flex: 0 0 auto; padding: 9px 10px; font-size: var(--bb-fs-sm); font-weight: 600; color: var(--bb-text-2);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.bb-menubar__item.is-active { color: var(--bb-primary-ink); border-bottom-color: var(--bb-primary); }
.bb-menubar__item:hover { color: var(--bb-primary-ink); }
/* 모바일: 가로 스크롤 + 오른쪽 끝 페이드로 "더 있음" 표시 */
.bb-menubar { position: relative; }
.bb-menubar::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 36px; pointer-events: none;
  background: linear-gradient(to right, rgba(255,255,255,0), var(--bb-surface) 80%); }
.bb-menubar.is-end::after { opacity: 0; }
@media (min-width: 768px) {
  .bb-header__brand-sub { display: inline; }
  /* 데스크톱: 잘리지 않게 줄바꿈 허용 (스크롤 없음) */
  .bb-menubar__in { padding: 0 var(--bb-sp-6); gap: 0 var(--bb-sp-1); flex-wrap: wrap; overflow: visible; justify-content: center; }
  .bb-menubar__item { padding: 10px 11px; }
  .bb-menubar::after { display: none; }
}
@media (min-width: 1200px) {
  .bb-menubar__item { padding: 10px 13px; }
}

/* =========================================================================
   탐색기 (page/explore.php)
   ========================================================================= */
.bb-explore { display: flex; flex-direction: column; gap: var(--bb-sp-3); }
.bb-seg { display: inline-flex; background: var(--bb-flat-soft); border-radius: 999px; padding: 3px; gap: 2px; }
.bb-seg a { padding: 6px 14px; border-radius: 999px; font-size: var(--bb-fs-sm); font-weight: 700; color: var(--bb-text-3); white-space: nowrap; }
.bb-seg a.is-active { background: var(--bb-surface); color: var(--bb-text); box-shadow: var(--bb-shadow); }
.bb-explore__tabs { display: flex; gap: var(--bb-sp-2); flex-wrap: wrap; align-items: center; justify-content: space-between; }
.bb-filters { display: flex; flex-wrap: wrap; gap: var(--bb-sp-2); align-items: center; }
.bb-filters .bb-select, .bb-filters .bb-input { height: 36px; }
.bb-input { font: inherit; font-size: var(--bb-fs-sm); border: 1px solid var(--bb-border); border-radius: 999px; background: var(--bb-surface); padding: 4px 12px; min-width: 0; color: var(--bb-text); }
.bb-input:focus, .bb-select:focus { outline: 2px solid var(--bb-primary-soft); border-color: var(--bb-primary); }
.bb-filters__q { flex: 1 1 160px; }
.bb-btn { font: inherit; font-size: var(--bb-fs-sm); font-weight: 700; border-radius: 999px; padding: 7px 16px; border: 1px solid var(--bb-primary); background: var(--bb-primary); color: #fff; cursor: pointer; white-space: nowrap; }
.bb-btn:hover { background: var(--bb-primary-ink); }
.bb-btn--ghost { background: var(--bb-surface); color: var(--bb-text-2); border-color: var(--bb-border); }
.bb-btn--ghost:hover { background: var(--bb-flat-soft); }
.bb-result-bar { display: flex; justify-content: space-between; align-items: baseline; gap: var(--bb-sp-3); font-size: var(--bb-fs-sm); color: var(--bb-text-3); }
.bb-result-bar b { color: var(--bb-text); font-weight: 800; font-variant-numeric: tabular-nums; }
.bb-explore__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--bb-sp-3); }
.bb-map { position: relative; height: 240px; border-radius: var(--bb-radius); overflow: hidden; border: 1px solid var(--bb-border); background: var(--bb-flat-soft); }
.bb-map__el { position: absolute; inset: 0; width: 100%; height: 100%; } /* 네이버 SDK 가 컨테이너를 position:relative 로 바꿔 inset 만으로는 높이가 0 이 된다 */
.bb-map__note { position: absolute; left: 8px; bottom: 8px; font-size: 11px; color: var(--bb-text-2); background: rgba(255,255,255,.9); padding: 2px 8px; border-radius: 999px; z-index: 2; }
.bb-map.is-collapsed { height: 0; border: 0; }
.bb-view-toggle { display: inline-flex; gap: 2px; }
.bb-deal { display: flex; gap: var(--bb-sp-3); align-items: flex-start; padding: 12px var(--bb-sp-4); border-top: 1px solid var(--bb-border); background: var(--bb-surface); min-width: 0; position: relative; }
.bb-deal:first-child { border-top: 0; }
.bb-deal:hover, .bb-deal.is-focus { background: var(--bb-primary-soft); }
.bb-deal__no { flex: 0 0 22px; font-family: var(--bb-font-num); font-size: var(--bb-fs-xs); font-weight: 800; color: var(--bb-text-3); padding-top: 3px; text-align: right; }
.bb-deal__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bb-deal__name { font-weight: 700; font-size: var(--bb-fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-deal__meta { font-size: var(--bb-fs-xs); color: var(--bb-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-deal__price { font-size: var(--bb-fs-sm); color: var(--bb-text-2); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.bb-deal__price b { color: var(--bb-text); font-weight: 800; }
.bb-deal__price s { color: var(--bb-text-3); }
.bb-deal__price small { color: var(--bb-text-3); font-size: 11px; }
.bb-deal__side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bb-deal__near { font-size: 11px; color: var(--bb-text-3); white-space: nowrap; }
.bb-deal-list { border: 1px solid var(--bb-border); border-radius: var(--bb-radius); overflow: hidden; box-shadow: var(--bb-shadow); }
.bb-pager { display: flex; justify-content: center; align-items: center; gap: 4px; padding: var(--bb-sp-3) 0; flex-wrap: wrap; }
.bb-pager a, .bb-pager span { min-width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: var(--bb-fs-sm); font-weight: 600; color: var(--bb-text-2); padding: 0 8px; font-variant-numeric: tabular-nums; }
.bb-pager a:hover { background: var(--bb-flat-soft); }
.bb-pager .is-current { background: var(--bb-text); color: #fff; }
.bb-pager .is-disabled { opacity: .35; pointer-events: none; }
.bb-chips--filters { margin: 0; }
details.bb-more > summary { list-style: none; cursor: pointer; font-size: var(--bb-fs-sm); font-weight: 700; color: var(--bb-primary); padding: 6px 0; }
details.bb-more > summary::-webkit-details-marker { display: none; }
details.bb-more[open] > summary { color: var(--bb-text-3); }
.bb-more__body { display: flex; flex-wrap: wrap; gap: var(--bb-sp-2); padding: var(--bb-sp-2) 0; }
.bb-legend { display: flex; gap: var(--bb-sp-3); flex-wrap: wrap; font-size: 11px; color: var(--bb-text-3); }
.bb-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
@media (min-width: 900px) {
  .bb-explore__body { grid-template-columns: minmax(0, 1fr) minmax(360px, 44%); align-items: start; }
  .bb-explore__list { grid-column: 1; grid-row: 1; }
  .bb-explore__map { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--bb-header-h) + 44px + var(--bb-sp-3)); }
  .bb-map { height: calc(100vh - var(--bb-header-h) - 44px - var(--bb-sp-6) - 48px); min-height: 480px; }
  .bb-view-toggle { display: none; }
  .bb-map.is-collapsed { height: calc(100vh - var(--bb-header-h) - 44px - var(--bb-sp-6) - 48px); border: 1px solid var(--bb-border); }
}
/* 탐색기 필터: 모바일은 한 줄 가로 스크롤, 데스크톱은 줄바꿈 */
.bb-filters { flex-direction: column; align-items: stretch; gap: var(--bb-sp-2); }
.bb-filters__row { display: flex; gap: var(--bb-sp-2); align-items: center; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; margin: 0 calc(-1 * var(--bb-sp-4)); padding-left: var(--bb-sp-4); padding-right: var(--bb-sp-4); }
.bb-filters__row::-webkit-scrollbar { display: none; }
.bb-filters__row > * { flex: 0 0 auto; }
.bb-filters__row--search > .bb-filters__q { flex: 1 1 120px; }
@media (min-width: 768px) {
  .bb-filters { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .bb-filters__row { overflow: visible; margin: 0; padding: 0; flex-wrap: wrap; }
  .bb-filters__row--search { flex: 1 1 260px; }
}

/* =========================================================================
   단지 360 (page/apt.php)
   ========================================================================= */
.bb-cx { display: flex; flex-direction: column; gap: var(--bb-sp-5); }
.bb-cx__head { padding-top: var(--bb-sp-2); }
.bb-cx__crumb { font-size: var(--bb-fs-sm); color: var(--bb-text-3); display: flex; gap: 6px; margin-bottom: var(--bb-sp-2); }
.bb-cx__crumb a { color: var(--bb-primary); font-weight: 600; }
.bb-cx__name { font-size: var(--bb-fs-2xl); font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.bb-cx__addr { font-size: var(--bb-fs-sm); color: var(--bb-text-2); margin-top: var(--bb-sp-1); }
.bb-cx__road { color: var(--bb-text-3); }
.bb-cx__facts { list-style: none; margin: var(--bb-sp-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 8px; }
.bb-cx__facts li { font-size: var(--bb-fs-xs); font-weight: 700; color: var(--bb-text-2); background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.bb-cx__facts li small { font-weight: 500; color: var(--bb-text-3); }
.bb-cx__kpis .bb-kpi--compact .bb-kpi__value { font-size: var(--bb-fs-xl); }
.bb-cx__kpi-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; font-size: 11px; color: var(--bb-text-3); }
.bb-cx__kpi-foot .bb-kpi__change { margin-top: 0; font-size: 11px; padding: 0 6px; }
.bb-kpi__value.is-danger { color: var(--bb-up); }
.bb-kpi__value.is-caution { color: var(--bb-warn); }
@media (max-width: 480px) {
  .bb-cx__kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bb-cx__kpis .bb-kpi--compact .bb-kpi__value { font-size: var(--bb-fs-lg); }
  .bb-cx__kpi-foot small { display: none; }
}

/* 면적 선택 칩 */
.bb-areas { display: flex; gap: var(--bb-sp-2); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--bb-sp-4)); padding: 2px var(--bb-sp-4) 6px; }
.bb-areas::-webkit-scrollbar { display: none; }
.bb-area-chip { flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 4px; background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: 10px; padding: 7px 12px; font-size: var(--bb-fs-sm); color: var(--bb-text-2); box-shadow: var(--bb-shadow); }
.bb-area-chip b { font-weight: 800; color: var(--bb-text); font-variant-numeric: tabular-nums; }
.bb-area-chip span { font-size: var(--bb-fs-xs); color: var(--bb-text-3); }
.bb-area-chip small { font-size: 11px; color: var(--bb-text-3); margin-left: 2px; }
.bb-area-chip:hover { border-color: var(--bb-primary); }
.bb-area-chip.is-active { background: var(--bb-text); border-color: var(--bb-text); color: #fff; }
.bb-area-chip.is-active b, .bb-area-chip.is-active span, .bb-area-chip.is-active small { color: #fff; }
.bb-area-chip.is-active span, .bb-area-chip.is-active small { opacity: .8; }

/* 차트 카드 */
.bb-chart-card { background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow); padding: var(--bb-sp-4); }
.bb-chart-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--bb-sp-3); flex-wrap: wrap; }
.bb-chart-card__ctl { display: flex; align-items: center; gap: var(--bb-sp-2); }
.bb-seg--sm a { padding: 4px 10px; font-size: var(--bb-fs-xs); }
.bb-chart-card__legend { margin: var(--bb-sp-3) 0 var(--bb-sp-2); align-items: center; }
.bb-chart-card__legend label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; color: var(--bb-text-2); font-weight: 600; }
.bb-chart-card__legend input { margin: 0 2px 0 0; accent-color: var(--bb-primary); }
.bb-legend__hint { margin-left: auto; }
.bb-chart-card__canvas { position: relative; height: 240px; }
@media (min-width: 768px) { .bb-chart-card__canvas { height: 320px; } }

/* 절 바로가기 */
.bb-subnav { position: sticky; top: calc(var(--bb-header-h) + 44px); z-index: 10; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; background: var(--bb-bg); margin: 0 calc(-1 * var(--bb-sp-4)); padding: 6px var(--bb-sp-4); border-bottom: 1px solid var(--bb-border); }
.bb-subnav::-webkit-scrollbar { display: none; }
.bb-subnav a { flex: 0 0 auto; font-size: var(--bb-fs-sm); font-weight: 700; color: var(--bb-text-3); padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.bb-subnav a.is-active { color: var(--bb-primary-ink); background: var(--bb-primary-soft); }
.bb-cx .bb-section { scroll-margin-top: calc(var(--bb-header-h) + 44px + 52px); margin-bottom: 0; }
.bb-section__count { font-size: var(--bb-fs-sm); font-weight: 600; color: var(--bb-text-3); margin-left: 4px; }
.bb-cx__subtitle { font-size: var(--bb-fs-sm); font-weight: 700; color: var(--bb-text-2); margin: 0 0 var(--bb-sp-2); }

/* 이력 표 (거래 이력·전월세) */
.bb-hist { background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow); overflow: hidden; }
.bb-hist__row { display: grid; grid-template-columns: 92px 48px 1fr 92px; gap: 8px; align-items: center; padding: 10px var(--bb-sp-4); border-top: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); font-variant-numeric: tabular-nums; }
.bb-hist__row--3 { grid-template-columns: 92px 48px 1fr; }
.bb-hist__row:first-child { border-top: 0; }
.bb-hist__row--head { font-size: 11px; font-weight: 700; color: var(--bb-text-3); background: var(--bb-flat-soft); padding-top: 7px; padding-bottom: 7px; }
.bb-hist__row.is-hidden { display: none; }
.bb-hist__row b { font-weight: 800; }
.bb-hist__row .bb-kpi__change { margin-top: 0; font-size: 11px; padding: 0 6px; }
.bb-hist__row small { color: var(--bb-text-3); font-size: 11px; }
.t-r { text-align: right; }
.bb-tag--muted { color: var(--bb-text-3); background: var(--bb-flat-soft); }
.bb-more-btn { display: block; width: 100%; margin-top: var(--bb-sp-2); }
@media (max-width: 400px) { .bb-hist__row { grid-template-columns: 78px 40px 1fr 80px; gap: 6px; padding-left: 12px; padding-right: 12px; } .bb-hist__row--3 { grid-template-columns: 78px 40px 1fr; } }

/* 면적별 시세 표 */
.bb-tbl { background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow); overflow: hidden; }
.bb-tbl__row { display: grid; grid-template-columns: 1.1fr .5fr 1fr 1fr 1fr; gap: 6px; align-items: center; padding: 10px var(--bb-sp-3); border-top: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); font-variant-numeric: tabular-nums; color: var(--bb-text); }
.bb-tbl__row:first-child { border-top: 0; }
.bb-tbl__row--head { font-size: 11px; font-weight: 700; color: var(--bb-text-3); background: var(--bb-flat-soft); padding-top: 7px; padding-bottom: 7px; }
a.bb-tbl__row:hover { background: var(--bb-primary-soft); }
.bb-tbl__row.is-active { background: var(--bb-primary-soft); box-shadow: inset 3px 0 0 var(--bb-primary); }
.bb-tbl__row > span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.bb-tbl__row > span.t-r { align-items: flex-end; }
.bb-tbl__row b { font-weight: 800; }
.bb-tbl__row small { font-size: 11px; color: var(--bb-text-3); }
.bb-tbl__area { font-weight: 700; }
.bb-tbl__area small { font-weight: 500; }
.bb-tbl__row .bb-badge { padding: 0 6px; font-size: 11px; }
@media (max-width: 560px) {
  .bb-tbl__row { grid-template-columns: 1fr .45fr 1fr 1fr; }
  .bb-tbl__row > span:nth-child(5) { display: none; }
  .bb-tbl__row > span:nth-child(4) { display: none; }
  .bb-tbl__row { grid-template-columns: 1.1fr .5fr 1.2fr 1.2fr; }
  .bb-tbl__row > span:nth-child(5) { display: flex; }
}

/* 2단 (전월세·입지) */
.bb-cx__two { display: grid; grid-template-columns: 1fr; gap: var(--bb-sp-4); }
@media (min-width: 768px) { .bb-cx__two { grid-template-columns: 1fr 1fr; } .bb-cx__two--place { grid-template-columns: 1.3fr 1fr; } }
.bb-cx__map { height: 260px; }
@media (min-width: 768px) { .bb-cx__map { height: 320px; } }
.bb-poi { display: flex; flex-direction: column; gap: var(--bb-sp-3); }
.bb-poi__group ul { list-style: none; margin: 0; padding: 0; background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-sm); overflow: hidden; }
.bb-poi__group li { display: flex; justify-content: space-between; gap: var(--bb-sp-3); padding: 8px 12px; border-top: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); }
.bb-poi__group li:first-child { border-top: 0; }
.bb-poi__group li span { color: var(--bb-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-poi__group li b { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 주변 단지 */
.bb-nearby { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bb-sp-2); }
@media (min-width: 768px) { .bb-nearby { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bb-nearby__card { display: flex; flex-direction: column; gap: 3px; background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-sm); padding: 12px; box-shadow: var(--bb-shadow); min-width: 0; }
.bb-nearby__card:hover { border-color: var(--bb-primary); }
.bb-nearby__name { font-weight: 700; font-size: var(--bb-fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-nearby__meta { font-size: 11px; color: var(--bb-text-3); }
.bb-nearby__price { font-size: var(--bb-fs-sm); font-variant-numeric: tabular-nums; margin-top: 2px; }
.bb-nearby__price b { font-weight: 800; }
.bb-nearby__price small { color: var(--bb-text-3); font-size: 11px; }
.bb-nearby__card .bb-badge { align-self: flex-start; margin-top: 4px; }

/* 시장 맥락 */
.bb-cx__verdict { background: var(--bb-surface); border: 1px solid var(--bb-border); border-left: 3px solid var(--bb-primary); border-radius: var(--bb-radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--bb-sp-3); font-size: var(--bb-fs-sm); color: var(--bb-text-2); line-height: 1.55; }
.bb-cx__verdict b { color: var(--bb-text); }
.bb-cx__verdict .bb-kpi__change { margin-top: 0; vertical-align: 1px; }
.bb-cx__notes { padding-bottom: var(--bb-sp-4); }
.bb-badge.is-flat { color: var(--bb-flat); background: var(--bb-flat-soft); }

/* 단지 360 · 호재 */
.bb-gtx { list-style: none; margin: 0; padding: 0; background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-sm); overflow: hidden; }
.bb-gtx li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); }
.bb-gtx li:first-child { border-top: 0; }
.bb-gtx li b { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--bb-text-3); }
.bb-gtx li.is-near b { color: var(--bb-primary-ink); }
.bb-gtx__line { font-size: 11px; font-weight: 800; color: #fff; border-radius: 6px; padding: 2px 7px; letter-spacing: .02em; background: #6b7280; }
.bb-gtx__line--a { background: #d9480f; }
.bb-gtx__line--b { background: #1c7ed6; }
.bb-gtx__line--c { background: #2f9e44; }
.bb-gtx__name { font-weight: 600; color: var(--bb-text-2); }
.bb-plan { list-style: none; margin: 0; padding: 0; background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius-sm); overflow: hidden; }
.bb-plan li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-top: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); min-width: 0; }
.bb-plan li:first-child { border-top: 0; }
.bb-plan__zone { font-weight: 700; }
.bb-plan__zone small { font-weight: 500; color: var(--bb-text-3); }
.bb-plan__loc { font-size: var(--bb-fs-xs); color: var(--bb-text-2); }
.bb-plan__desc { font-size: var(--bb-fs-xs); color: var(--bb-text-3); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bb-plan__notice { font-size: 11px; color: var(--bb-text-3); }

/* =========================================================================
   메뉴 화면들 (뉴스·청약·지역 통계·도시계획·GTX·내 자산)
   ========================================================================= */
.bb-chip.is-active { background: var(--bb-text); border-color: var(--bb-text); color: #fff; }
.bb-newsx-list { margin-top: var(--bb-sp-4); }
.bb-newsx { display: flex; flex-direction: column; gap: 3px; padding: 12px var(--bb-sp-4); border-top: 1px solid var(--bb-border); min-width: 0; }
.bb-newsx:first-child { border-top: 0; }
.bb-newsx:hover { background: var(--bb-primary-soft); }
.bb-newsx__title { font-size: var(--bb-fs-md); font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bb-newsx__desc { font-size: var(--bb-fs-sm); color: var(--bb-text-3); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bb-newsx__meta { font-size: 11px; color: var(--bb-text-3); }
.bb-lottop .bb-explore__tabs { display: flex; gap: var(--bb-sp-2); flex-wrap: wrap; margin-bottom: var(--bb-sp-3); }
.bb-lottop .bb-kpi-grid { margin: var(--bb-sp-4) 0 var(--bb-sp-6); }
.bb-sub { display: grid; grid-template-columns: 1fr; gap: var(--bb-sp-2); }
@media (min-width: 640px) { .bb-sub { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .bb-sub { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bb-sub__card { display: flex; flex-direction: column; gap: 4px; background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius); padding: var(--bb-sp-3) var(--bb-sp-4); box-shadow: var(--bb-shadow); min-width: 0; }
.bb-sub__card:hover { border-color: var(--bb-primary); }
.bb-sub__top { display: flex; align-items: center; gap: 6px; }
.bb-sub__top .bb-dday { margin-left: auto; }
.bb-sub__name { font-weight: 700; font-size: var(--bb-fs-md); line-height: 1.3; }
.bb-sub__addr { font-size: var(--bb-fs-xs); color: var(--bb-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-sub__meta { font-size: var(--bb-fs-xs); color: var(--bb-text-2); }
.bb-sub__date { font-size: var(--bb-fs-sm); color: var(--bb-text-2); font-variant-numeric: tabular-nums; }
.bb-statp__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--bb-sp-3); margin-bottom: var(--bb-sp-4); }
.bb-stat-grid { display: grid; grid-template-columns: 1fr; gap: var(--bb-sp-4); }
@media (min-width: 900px) { .bb-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.bb-stat__range { font-size: var(--bb-fs-xs); color: var(--bb-text-3); font-variant-numeric: tabular-nums; }
.bb-stat__canvas { position: relative; margin-top: var(--bb-sp-2); }
.bb-ranklist { background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius); box-shadow: var(--bb-shadow); overflow: hidden; }
.bb-ranklist__row { display: flex; align-items: center; gap: var(--bb-sp-3); padding: 9px var(--bb-sp-4); border-top: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); }
.bb-ranklist__row:first-child { border-top: 0; }
.bb-ranklist__row:hover, .bb-ranklist__row.is-active { background: var(--bb-primary-soft); }
.bb-ranklist__label { flex: 0 0 120px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-ranklist__bar { flex: 1; height: 8px; background: var(--bb-flat-soft); border-radius: 999px; overflow: hidden; }
.bb-ranklist__bar i { display: block; height: 100%; background: var(--bb-primary); border-radius: 999px; }
.bb-ranklist__row b { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 800; min-width: 48px; text-align: right; }
.bb-planp .bb-filters { margin: var(--bb-sp-2) 0 var(--bb-sp-5); }
.bb-gtxp .bb-page-sub { margin-bottom: var(--bb-sp-3); }
.bb-gtxp .bb-deal__near .bb-gtx__line { margin-right: 2px; }
.bb-gate { background: var(--bb-surface); border: 1px solid var(--bb-border); border-radius: var(--bb-radius); padding: var(--bb-sp-6) var(--bb-sp-4); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--bb-sp-3); }
.bb-gate p { color: var(--bb-text-2); }
.bb-asset { display: flex; align-items: center; gap: var(--bb-sp-3); padding: 12px var(--bb-sp-4); border-top: 1px solid var(--bb-border); }
.bb-asset:first-child { border-top: 0; }
.bb-asset__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bb-asset__name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bb-asset__name small { font-weight: 500; color: var(--bb-text-3); }
.bb-asset__meta { font-size: var(--bb-fs-xs); color: var(--bb-text-3); }
.bb-asset__price { font-size: var(--bb-fs-sm); color: var(--bb-text-2); font-variant-numeric: tabular-nums; }
.bb-asset__price b { color: var(--bb-text); font-weight: 800; }
.bb-asset__price small { color: var(--bb-text-3); font-size: 11px; }
.bb-asset__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.bb-asset__sell { padding: 4px 12px; font-size: var(--bb-fs-xs); }
.bb-kpi__value.is-blue { color: var(--bb-down); }
.bb-cx__actions { display: flex; gap: var(--bb-sp-2); margin-top: var(--bb-sp-3); flex-wrap: wrap; }

/* 광고 자리 */
.bb-ad { position: relative; margin: var(--bb-sp-4) 0; padding-top: 14px; min-height: 0; }
.bb-ad__label { position: absolute; top: 0; left: 0; font-size: 10px; color: var(--bb-text-3); letter-spacing: .04em; }
.bb-ad ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.bb-ad:has(ins[data-ad-status="unfilled"]) { display: none; }
.bb-ad--row { margin: 0; padding: 14px var(--bb-sp-4) 8px; border-top: 1px solid var(--bb-border); background: var(--bb-surface); }
.bb-ad--row .bb-ad__label { left: var(--bb-sp-4); top: 2px; }
.bb-ad--span { grid-column: 1 / -1; margin: 0; }

/* 관심(♥) */
.bb-fav { position: absolute; right: 10px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--bb-border); background: var(--bb-surface); color: var(--bb-text-3); font-size: 15px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; z-index: 2; }
.bb-fav:hover { color: var(--bb-up); border-color: var(--bb-up); }
.bb-fav.is-on { color: #fff; background: var(--bb-up); border-color: var(--bb-up); }
.bb-deal { padding-bottom: 12px; }
.bb-watch-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--bb-surface); color: var(--bb-text-2); border-color: var(--bb-border); }
.bb-watch-btn small { font-weight: 500; color: var(--bb-text-3); }
.bb-watch-btn__icon { color: var(--bb-text-3); font-size: 14px; }
.bb-watch-btn:hover { background: var(--bb-up-soft); border-color: var(--bb-up); color: var(--bb-up); }
.bb-watch-btn:hover .bb-watch-btn__icon { color: var(--bb-up); }
.bb-watch-btn.is-on { background: var(--bb-up); border-color: var(--bb-up); color: #fff; }
.bb-watch-btn.is-on .bb-watch-btn__icon, .bb-watch-btn.is-on small { color: #fff; }

/* 알림 */
.bb-tab-badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--bb-up); color: #fff; font-style: normal; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; }
.bb-tabbar__item { position: relative; }
.bb-header__nav__item { position: relative; }
.bb-header__nav__item .bb-tab-badge { position: static; display: inline-block; margin-left: 4px; vertical-align: 2px; }
.bb-alert { display: flex; flex-direction: column; gap: 3px; padding: 12px var(--bb-sp-4); border-top: 1px solid var(--bb-border); }
.bb-alert:first-child { border-top: 0; }
.bb-alert:hover { background: var(--bb-primary-soft); }
.bb-alert.is-new { box-shadow: inset 3px 0 0 var(--bb-primary); }
.bb-alert__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bb-alert__when { font-size: 11px; color: var(--bb-text-3); }
.bb-alert__title { font-weight: 700; font-size: var(--bb-fs-md); line-height: 1.35; }
.bb-alert__body { font-size: var(--bb-fs-sm); color: var(--bb-text-2); }
.bb-watch .bb-asset__price { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.bb-watch .bb-badge { padding: 0 6px; font-size: 11px; }

/* 스크리너 */
.bb-result-bar__actions { display: flex; align-items: center; gap: var(--bb-sp-2); flex: 0 0 auto; }
.bb-save-btn { padding: 5px 12px; font-size: var(--bb-fs-xs); }
.bb-notice--screener { margin: var(--bb-sp-2) 0 var(--bb-sp-3); font-size: var(--bb-fs-sm); }
.bb-notice--screener a { color: var(--bb-primary); font-weight: 700; }
.bb-deal__name .bb-tag { vertical-align: 2px; }

/* ---- 참조 데이터 기준일 캡션 (단지 360 입지·호재) ---- */
.bb-source--ref { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.bb-source--ref.is-stale b { color: var(--bb-warn, #b45309); }
.bb-tag--warn { color: #fff; background: var(--bb-warn, #b45309); }

/* ---- 주식 봇 판단 기록 (stocks / stock / scorecard) ---- */
.bb-stocks .bb-page-head { margin-bottom: var(--bb-sp-3); }
.bb-stocks .bb-seg { margin-bottom: var(--bb-sp-3); }
.bb-stocks .is-up { color: var(--bb-up, #c2410c); }
.bb-stocks .is-down { color: var(--bb-down, #1d4ed8); }
.bb-stock-notice { background: var(--bb-warn-soft); color: var(--bb-text-2); border-left: 3px solid var(--bb-warn); border-radius: 8px; padding: 10px 14px; margin: 0 0 var(--bb-sp-4); font-size: var(--bb-fs-sm); line-height: 1.55; }
.bb-stock-notice p { margin: 0; }
.bb-stock-notice b { color: var(--bb-text-1); }
.bb-stock-notice__src { display: block; margin-top: 4px; font-size: var(--bb-fs-xs); color: var(--bb-text-3); }
.bb-stock-notice--compact { padding: 8px 12px; font-size: var(--bb-fs-xs); }
.bb-chips--dates { margin-bottom: var(--bb-sp-3); }
.bb-regime { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 1px 7px; vertical-align: 2px; margin-left: 6px; }
.bb-regime--ok { background: var(--bb-primary-soft); color: var(--bb-primary-ink); }
.bb-regime--warn { background: var(--bb-warn-soft); color: var(--bb-warn); }
.bb-regime--bad { background: #fee2e2; color: #b91c1c; }
.bb-brief-head__top { display: flex; flex-wrap: wrap; gap: var(--bb-sp-3); justify-content: space-between; align-items: flex-start; }
.bb-brief-head__date { font-size: var(--bb-fs-lg); font-weight: 700; }
.bb-brief-head__model { font-size: var(--bb-fs-xs); color: var(--bb-text-3); margin-top: 2px; }
.bb-brief-head__kpis { flex: 1 1 320px; max-width: 480px; }
.bb-brief-head__analysis { margin: var(--bb-sp-3) 0 0; padding: 12px 14px; background: var(--bb-surface-2, #f8fafc); border-radius: 10px; font-size: var(--bb-fs-sm); line-height: 1.6; color: var(--bb-text-2); }
.bb-brief-head__label { display: block; font-size: var(--bb-fs-xs); color: var(--bb-text-3); font-weight: 600; margin-bottom: 4px; }
.bb-dec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--bb-sp-3); }
.bb-dec { display: block; border: 1px solid var(--bb-border); border-radius: 12px; padding: 12px 14px; background: var(--bb-surface); color: inherit; text-decoration: none; }
.bb-dec--buy { border-color: var(--bb-primary); box-shadow: 0 0 0 1px var(--bb-primary-soft) inset; }
.bb-dec__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bb-dec__name { font-weight: 700; }
.bb-dec__name small { color: var(--bb-text-3); font-weight: 500; }
.bb-dec__badge { font-size: 11px; font-weight: 800; color: var(--bb-primary-ink); background: var(--bb-primary-soft); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.bb-dec__nums { display: flex; gap: 18px; margin: 8px 0 6px; }
.bb-dec__nums span { display: flex; flex-direction: column; }
.bb-dec__nums small { font-size: var(--bb-fs-xs); color: var(--bb-text-3); }
.bb-dec__nums b { font-size: var(--bb-fs-lg); }
.bb-dec__reason { margin: 0; font-size: var(--bb-fs-sm); color: var(--bb-text-2); line-height: 1.5; }
.bb-rej { list-style: none; margin: 0; padding: 0; }
.bb-rej li { display: grid; grid-template-columns: minmax(120px, 1.2fr) 90px 70px 3fr; gap: 10px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); }
.bb-rej__name { font-weight: 600; color: inherit; text-decoration: none; }
.bb-rej__name small { color: var(--bb-text-3); font-weight: 500; }
.bb-rej__stage { font-size: var(--bb-fs-xs); color: var(--bb-text-3); }
.bb-rej__reason { color: var(--bb-text-2); }
.bb-tbl { border-top: 1px solid var(--bb-border); }
.bb-tbl__row { display: grid; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); color: inherit; text-decoration: none; align-items: center; }
.bb-tbl__row--head { font-size: var(--bb-fs-xs); color: var(--bb-text-3); font-weight: 600; }
.bb-tbl__row em { font-style: normal; color: var(--bb-text-3); }
.bb-tbl--outcome .bb-tbl__row { grid-template-columns: 1.3fr 60px 90px 1.6fr 90px; }
.bb-tbl--trades .bb-tbl__row { grid-template-columns: 90px 1.2fr 1.2fr 1.4fr 1fr; }
.bb-tbl--score .bb-tbl__row { grid-template-columns: 1.4fr 1.4fr 80px 60px 1.1fr 1fr; }
.bb-tbl--monthly .bb-tbl__row { grid-template-columns: 80px 60px 60px 1fr 1fr; }
.bb-score-bar { display: inline-block; width: 70px; height: 6px; background: var(--bb-flat-soft); border-radius: 3px; vertical-align: middle; margin-right: 6px; overflow: hidden; }
.bb-score-bar i { display: block; height: 100%; background: var(--bb-primary); }
.bb-stock__head { margin-bottom: var(--bb-sp-3); }
.bb-stock__head .bb-page-title small { font-size: var(--bb-fs-sm); color: var(--bb-text-3); font-weight: 500; margin-left: 6px; }
.bb-stock__chips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bb-stock__chips li { display: flex; flex-direction: column; border: 1px solid var(--bb-border); border-radius: 8px; padding: 5px 10px; min-width: 72px; }
.bb-stock__chips small { font-size: 10px; color: var(--bb-text-3); }
.bb-stock__chips b { font-size: var(--bb-fs-sm); }
.bb-stock__chips em { font-style: normal; font-weight: 400; color: var(--bb-text-3); font-size: 10px; }
.bb-timeline { list-style: none; margin: 0; padding: 0; }
.bb-timeline li { display: grid; grid-template-columns: 92px 90px 70px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); align-items: baseline; }
.bb-timeline__date { color: var(--bb-text-3); font-variant-numeric: tabular-nums; }
.bb-timeline__reason { color: var(--bb-text-2); line-height: 1.5; }
.bb-trade-stat { border: 1px solid var(--bb-border); border-radius: 12px; padding: 12px 14px; }
.bb-trade-stat h3 { margin: 0 0 8px; font-size: var(--bb-fs-md); }
.bb-trade-stat h3 small { color: var(--bb-text-3); font-weight: 500; }
.bb-trade-stat ul { list-style: none; margin: 0; padding: 0; }
.bb-trade-stat li { display: flex; justify-content: space-between; padding: 4px 0; font-size: var(--bb-fs-sm); border-bottom: 1px dashed var(--bb-border); }
.bb-empty--tall { padding: 40px 16px; text-align: center; }
@media (max-width: 640px) {
  .bb-rej li { grid-template-columns: 1fr 80px 60px; }
  .bb-rej__reason { grid-column: 1 / -1; }
  .bb-tbl--outcome .bb-tbl__row { grid-template-columns: 1.2fr 50px 70px 80px; }
  .bb-tbl--outcome .bb-tbl__row span:nth-child(4) { display: none; }
  .bb-tbl--trades .bb-tbl__row { grid-template-columns: 60px 1fr 1fr 1fr; }
  .bb-tbl--trades .bb-tbl__row span:nth-child(4) { display: none; }
  .bb-tbl--score .bb-tbl__row { grid-template-columns: 1.3fr 1.3fr 70px 1fr; }
  .bb-tbl--score .bb-tbl__row span:nth-child(4), .bb-tbl--score .bb-tbl__row span:nth-child(6) { display: none; }
  .bb-timeline li { grid-template-columns: 80px 80px 60px; }
  .bb-timeline__reason { grid-column: 1 / -1; }
}

/* ---- 주식 브리핑 2차: 관문 흐름·점수 구성·반려 그룹·분석 방법 ---- */
.bb-page-head--row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: var(--bb-sp-3); }
.bb-page-head--row .bb-seg { margin-bottom: 0; }
.bb-funnel { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; align-items: stretch; }
.bb-funnel li { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 96px; padding: 8px 14px 8px 18px; background: var(--bb-surface-2, #f1f5f9); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%); }
.bb-funnel li:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 14px; }
.bb-funnel li.is-last { background: var(--bb-primary-soft); color: var(--bb-primary-ink); }
.bb-funnel b { font-size: var(--bb-fs-xl, 22px); line-height: 1.1; }
.bb-funnel span { font-size: 10px; color: var(--bb-text-3); white-space: nowrap; }
.bb-funnel li.is-last span { color: var(--bb-primary-ink); }
.bb-sub { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 6px 0 8px; align-items: center; }
.bb-sub__item { display: grid; grid-template-columns: 34px 56px auto; align-items: center; gap: 5px; font-size: var(--bb-fs-xs); }
.bb-sub__item small { color: var(--bb-text-3); }
.bb-sub__bar { display: block; height: 6px; background: var(--bb-flat-soft); border-radius: 3px; overflow: hidden; }
.bb-sub__bar i { display: block; height: 100%; background: var(--bb-primary); }
.bb-sub__item b { font-variant-numeric: tabular-nums; }
.bb-sub__flag { font-size: 10px; color: var(--bb-text-3); border: 1px solid var(--bb-border); border-radius: 4px; padding: 0 5px; }
.bb-sub__flag.is-on { color: var(--bb-primary-ink); border-color: var(--bb-primary-soft); background: var(--bb-primary-soft); }
.bb-sub--chips span { font-size: 10px; border: 1px solid var(--bb-border); border-radius: 4px; padding: 1px 6px; color: var(--bb-text-2); }
.bb-dec__reason-l { display: block; font-size: 10px; color: var(--bb-text-3); font-weight: 600; margin-bottom: 2px; }
.bb-dec__more { display: inline-block; margin-top: 8px; font-size: var(--bb-fs-xs); color: var(--bb-primary-ink); text-decoration: none; }
.bb-dec__name { color: inherit; text-decoration: none; }
.bb-rej-group { margin-bottom: var(--bb-sp-4); }
.bb-rej-group .bb-cx__subtitle small { color: var(--bb-text-3); font-weight: 500; }
.bb-rej li { grid-template-columns: minmax(130px, 1.2fr) 64px 44px 3fr; }
.bb-rej li .bb-sub { grid-column: 1 / -1; margin: 0 0 2px; }
.bb-rej__score { font-size: var(--bb-fs-xs); color: var(--bb-text-3); font-variant-numeric: tabular-nums; }
.bb-tbl--score .bb-tbl__row { grid-template-columns: 1.4fr 1.5fr 90px 90px 70px 1fr; }
.bb-steps { list-style: none; margin: 0 0 var(--bb-sp-4); padding: 0; counter-reset: s; }
.bb-step { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--bb-border); }
.bb-step__n { width: 30px; height: 30px; border-radius: 50%; background: var(--bb-primary); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.bb-step h2 { margin: 2px 0 6px; font-size: var(--bb-fs-md); }
.bb-step h2 small { color: var(--bb-text-3); font-weight: 500; font-size: var(--bb-fs-xs); margin-left: 6px; }
.bb-step p { margin: 0 0 6px; font-size: var(--bb-fs-sm); line-height: 1.6; color: var(--bb-text-2); }
.bb-step__why { color: var(--bb-text-3) !important; font-size: var(--bb-fs-xs) !important; border-left: 2px solid var(--bb-border); padding-left: 8px; }
.bb-step__list { margin: 0 0 6px; padding-left: 18px; font-size: var(--bb-fs-sm); color: var(--bb-text-2); line-height: 1.6; }
.bb-step__list--loose li { margin-bottom: 6px; }
.bb-weights { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 8px; }
.bb-weights div { border: 1px solid var(--bb-border); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.bb-weights b { font-size: var(--bb-fs-xl, 22px); color: var(--bb-primary-ink); }
.bb-weights span { font-weight: 600; font-size: var(--bb-fs-sm); }
.bb-weights small { color: var(--bb-text-3); font-size: 11px; }
.bb-regimes { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: var(--bb-fs-sm); color: var(--bb-text-2); }
.bb-regimes .bb-regime { margin-left: 0; }

/* ---- 지역 리포트 ---- */
.bb-statp__form { display: flex; gap: 6px; }
.bb-region .bb-kpi-grid { margin-bottom: var(--bb-sp-2); }
.bb-region__charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--bb-sp-3); }
.bb-region__lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--bb-sp-3); }
.bb-region__list .bb-cx__subtitle small { color: var(--bb-text-3); font-weight: 500; }
.bb-ranklist--links { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.bb-ranklist--links li { counter-increment: r; }
.bb-ranklist--links .bb-ranklist__row { color: inherit; text-decoration: none; display: grid; grid-template-columns: 18px minmax(110px, 1.3fr) 1fr auto; align-items: center; }
.bb-ranklist--links .bb-ranklist__row::before { content: counter(r); font-size: 11px; color: var(--bb-text-3); font-weight: 700; }
.bb-ranklist--links .bb-ranklist__label { flex: none; }
.bb-ranklist__label small { display: block; font-weight: 400; color: var(--bb-text-3); font-size: 10px; }
.bb-ranklist__bar--down i { background: var(--bb-down); }
.bb-ranklist__val { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.bb-ranklist__val small { display: block; font-weight: 400; color: var(--bb-text-3); font-size: 10px; }
.bb-ranklist__val.is-up { color: var(--bb-up); }
.bb-ranklist__val.is-down { color: var(--bb-down); }
.bb-list--tight { list-style: none; margin: 0; padding: 0; }
.bb-list--tight li { padding: 7px 0; border-bottom: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); line-height: 1.45; }
.bb-list--tight a { color: inherit; text-decoration: none; }
.bb-list--tight small { color: var(--bb-text-3); display: block; }
.bb-infra { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--bb-sp-3); }
.bb-infra__card { border: 1px solid var(--bb-border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; background: var(--bb-surface); }
.bb-infra__card--wide { grid-column: 1 / -1; }
.bb-infra__n { font-size: 26px; font-weight: 800; line-height: 1.1; }
.bb-infra__l { font-weight: 700; font-size: var(--bb-fs-sm); }
.bb-infra__card small { color: var(--bb-text-2); font-size: var(--bb-fs-xs); }
.bb-infra__card em { font-style: normal; color: var(--bb-text-3); font-size: 10px; margin-top: 4px; }
.bb-src-inline { white-space: nowrap; }
.bb-delta { font-weight: 700; font-size: var(--bb-fs-xs); }
.bb-delta.is-up { color: var(--bb-up); }
.bb-delta.is-down { color: var(--bb-down); }
.bb-delta--na { color: var(--bb-text-3); font-weight: 400; }
@media (max-width: 640px) {
  .bb-funnel li { min-width: 78px; padding: 6px 10px 6px 14px; }
  .bb-rej li { grid-template-columns: 1fr 60px 40px; }
  .bb-tbl--score .bb-tbl__row { grid-template-columns: 1.2fr 1.4fr 70px; }
  .bb-tbl--score .bb-tbl__row span:nth-child(4), .bb-tbl--score .bb-tbl__row span:nth-child(5), .bb-tbl--score .bb-tbl__row span:nth-child(6) { display: none; }
  .bb-ranklist--links .bb-ranklist__row { grid-template-columns: 16px 1.4fr auto; }
  .bb-ranklist--links .bb-ranklist__bar { display: none; }
}


/* ---- 탐색기: 상세 조건 · 지도 펼치기 ---- */
.bb-filters__more { width: 100%; }
.bb-filters__more > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: var(--bb-fs-sm); font-weight: 600; color: var(--bb-text-2); padding: 4px 0; }
.bb-filters__more > summary::-webkit-details-marker { display: none; }
.bb-filters__more > summary::before { content: "＋"; font-weight: 700; color: var(--bb-primary); }
.bb-filters__more[open] > summary::before { content: "－"; }
.bb-filters__more > .bb-filters__row { margin-top: 6px; }
.bb-map-toggle { margin-left: 6px; }
.bb-map-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 22px 16px; border: 1px dashed var(--bb-border); border-radius: var(--bb-radius); color: inherit; text-decoration: none; background: var(--bb-surface); }
.bb-map-placeholder:hover { border-color: var(--bb-primary); }
.bb-map-placeholder__ico { font-size: 22px; }
.bb-map-placeholder b { color: var(--bb-primary-ink); }
.bb-map-placeholder small { color: var(--bb-text-3); font-size: var(--bb-fs-xs); max-width: 260px; }

/* ---- 홈 청약: 지역·구분 필터 + 격자 ---- */
.bb-lotto-filter { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: var(--bb-sp-3); }
.bb-lotto-filter .bb-chips { margin: 0; }
.bb-lotto-filter .bb-chip small { font-weight: 500; opacity: .7; margin-left: 2px; }
.bb-lotto-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bb-sp-3); }
.bb-lotto-grid .bb-lotto { flex: none; scroll-snap-align: unset; min-width: 0; }
@media (min-width: 768px) { .bb-lotto-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bb-lotto-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: var(--bb-sp-3); font-size: var(--bb-fs-sm); color: var(--bb-text-3); }

/* ---- 단지 360 지도 범례 ---- */
.bb-map-legend { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--bb-fs-xs); color: var(--bb-text-2); align-items: center; }
.bb-map-legend li { display: inline-flex; align-items: center; gap: 5px; }
.bb-map-legend__dot { width: 10px; height: 10px; border-radius: 3px; background: #111827; }
.bb-map-legend__ring { width: 12px; height: 12px; border-radius: 50%; border: 1.5px dashed var(--bb-primary); background: rgba(31,94,255,.06); }
.bb-map-legend__pin { width: 4px; height: 12px; border-radius: 2px; }
.bb-map-legend__note { color: var(--bb-text-3); }


/* ---- 홈 청약 지역 칩: 잘리지 않게 (데스크톱 줄바꿈, 모바일 스크롤+페이드) ---- */
.bb-lotto-filter .bb-chips { flex: 1 1 100%; justify-content: flex-start; padding-right: 28px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.bb-lotto-filter .bb-chips.is-end { -webkit-mask-image: none; mask-image: none; padding-right: 0; }
@media (min-width: 768px) {
  .bb-lotto-filter .bb-chips { flex-wrap: wrap; overflow: visible; -webkit-mask-image: none; mask-image: none; padding-right: 0; }
}

/* ---- 커뮤니티 (새 레이아웃) ---- */
.bb-comm__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: var(--bb-sp-3); }
.bb-comm__search { display: flex; gap: 6px; }
.bb-comm__search .bb-input { height: 36px; min-width: 180px; }
.bb-post-list { border-top: 1px solid var(--bb-border); }
.bb-post { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 4px; border-bottom: 1px solid var(--bb-border); color: inherit; text-decoration: none; }
.bb-post:hover { background: var(--bb-primary-soft); }
.bb-post__subject { font-weight: 600; font-size: var(--bb-fs-md); line-height: 1.4; }
.bb-post__subject .bb-tag { vertical-align: 2px; }
.bb-post__meta { grid-column: 1 / -1; font-size: var(--bb-fs-xs); color: var(--bb-text-3); display: flex; gap: 10px; }
.bb-post__cmt { font-size: var(--bb-fs-xs); color: var(--bb-primary-ink); font-weight: 700; white-space: nowrap; align-self: start; }
.bb-postv__head { padding-bottom: var(--bb-sp-3); border-bottom: 1px solid var(--bb-border); margin-bottom: var(--bb-sp-4); }
.bb-postv__head h1 { margin: 6px 0 8px; font-size: var(--bb-fs-xl, 22px); line-height: 1.35; }
.bb-postv__meta { font-size: var(--bb-fs-sm); color: var(--bb-text-3); display: flex; flex-wrap: wrap; gap: 10px; }
.bb-postv__body { font-size: var(--bb-fs-md); line-height: 1.8; color: var(--bb-text-1); word-break: break-word; }
.bb-postv__body img { max-width: 100%; height: auto; border-radius: 8px; }
.bb-postv__body p { margin: 0 0 1em; }
.bb-postv__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--bb-sp-5) 0 var(--bb-sp-4); }
.bb-cmt { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--bb-border); }
.bb-cmt li { padding: 10px 4px; border-bottom: 1px solid var(--bb-border); font-size: var(--bb-fs-sm); line-height: 1.6; }
.bb-cmt li.is-reply { padding-left: 24px; background: var(--bb-surface-2, #f8fafc); }
.bb-cmt__meta { font-size: var(--bb-fs-xs); color: var(--bb-text-3); margin-bottom: 2px; display: flex; gap: 8px; }
