/* ════════════════════════════════════════════════════════════════
   상세 데이터베이스 (Detail DB) — 전용 스타일
   · 모든 토큰(--brand/--sage 등)은 index.html :root에서 정의됨 → 참조만(재정의 금지).
   · 클래스 프리픽스 `ddb-` 로 기존 .enc-* 와 충돌 회피.
   · 세이지 절제(화이트리스트): 현재 선택 바/배경·활성 조상 텍스트·활성 탭 언더라인·
     weight=high 칩·NEW 칩·포커스 링. 나머지 무채색. best/bad는 --pos/--neg(라인+아이콘+텍스트만).
   ════════════════════════════════════════════════════════════════ */

/* 뷰 전환 — view-cost/view-encyclopedia 패턴 모방.
   .container.view-detaildb 활성 시 #detaildbView만 표시, 나머지 섹션·배너·빈상태 숨김. */
.container.view-detaildb > .section:not(#detaildbView),
.container.view-detaildb > #bannerSlot,
.container.view-detaildb > #emptySlot { display: none; }

#detaildbView { padding: 0; }

/* ── 셸 ───────────────────────────────────────────────────────── */
.ddb-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── 페이지 헤더 (56px) ───────────────────────────────────────── */
.ddb-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 4px 14px;
}
.ddb-head-tt {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}
.ddb-head-sub {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

/* ── 탭 토글 (언더라인형 2탭) ─────────────────────────────────── */
.ddb-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.ddb-tab {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 10px 14px 11px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: 0;
  transition: color .14s ease;
}
.ddb-tab::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px;
  background: transparent;
  border-radius: 2px;
}
.ddb-tab:hover { color: var(--text-2); }
.ddb-tab.is-active { color: var(--text); }
.ddb-tab.is-active::after { background: var(--brand); }   /* 활성 탭 언더라인 = 세이지(brand) */
.ddb-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* ── 탭 패널 ──────────────────────────────────────────────────── */
.ddb-panel { display: none; }
.ddb-panel.is-active { display: block; }

/* ── 탭B placeholder (다음 단계 진입점) ───────────────────────── */
.ddb-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 280px;
  text-align: center;
  color: var(--muted);
}
.ddb-placeholder-tt { font-size: 14px; font-weight: 600; color: var(--text-2); }
.ddb-placeholder-sub { font-size: 13px; font-weight: 400; color: var(--muted); }

/* ════════════════════════════════════════════════════════════════
   3-pane (탭A)  — ≥1440: 280 / 1fr / 320
   ════════════════════════════════════════════════════════════════ */
.ddb-3pane {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 0;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}

/* ── 좌: 계층 트리 ────────────────────────────────────────────── */
.ddb-tree {
  border-right: 1px solid var(--line);
  padding: 8px 0;
  align-self: stretch;
}
.ddb-tree-scroll {
  max-height: calc(100vh - 230px);
  overflow-y: auto;
  padding: 0 4px;
}
.ddb-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* 수직 가이드선 (children 영역) */
.ddb-tree-children {
  position: relative;
}
.ddb-tree-children::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--line);
}
.ddb-node {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  position: relative;
  color: var(--text-2);
  transition: background .12s ease, color .12s ease;
}
.ddb-node:hover { background: var(--surface-2); }
.ddb-node:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 레벨별 행 높이 / 들여쓰기 / 폰트 */
.ddb-node-major {
  min-height: 40px;
  padding: 4px 8px 4px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.ddb-node-mid {
  min-height: 36px;
  padding: 4px 8px 4px 28px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
}
.ddb-node-sub {
  min-height: 36px;
  padding: 4px 8px 4px 44px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
}

/* caret (대·중만) — 기존 대시보드 .ctb-caret 톤 통일: CSS 보더 셰브론 */
.ddb-caret {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin: 0 5px 0 2px;
  pointer-events: none;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  /* 접힘 = 오른쪽(▸) */
  transform: translateX(-2px) rotate(-45deg);
  transition: transform .16s ease, border-color .16s ease;
}
/* 펼침 = 아래(▾) + 브랜드 색 (aria-expanded는 트리 버튼 .ddb-node에 있음) */
.ddb-node[aria-expanded="true"] .ddb-caret {
  transform: translateY(-2px) rotate(45deg);
  border-color: var(--brand);
}
.ddb-node-sub .ddb-caret { visibility: hidden; }

.ddb-node-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 카운트 뱃지 (대·중) */
.ddb-count {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-left: 4px;
}

/* NEW 칩 (소분류) */
.ddb-new {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--brand-ink);
  background: var(--sage-tint-2);
  padding: 1px 5px;
  border-radius: 999px;
  margin-left: 4px;
}

/* 활성 조상(대·중) — brand-ink 600 승격 */
.ddb-node.is-ancestor {
  color: var(--brand-ink);
  font-weight: 600;
}
/* 현재 선택 소분류 — 배경 sage-tint + 좌측 3px brand 바 + brand-ink 600 */
.ddb-node-sub.is-selected {
  background: var(--sage-tint);
  color: var(--brand-ink);
  font-weight: 600;
}
.ddb-node-sub.is-selected::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--brand);
}

/* ── 가운데: 본문 ─────────────────────────────────────────────── */
.ddb-main {
  padding: 28px 32px 48px;
  min-width: 0;
}
.ddb-main-inner { max-width: none; }

.ddb-crumb {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
}
.ddb-crumb-sep { padding: 0 6px; color: var(--line-strong); }
.ddb-h1 {
  margin: 0 0 10px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
}
.ddb-lead {
  margin: 0 0 4px;
  font-size: 16.5px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-2);
}

/* 개요(대/중 클릭 시) 카드 그리드 */
.ddb-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.ddb-ov-card {
  appearance: none;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 14px 16px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .12s ease, background .12s ease;
}
.ddb-ov-card:hover { background: var(--surface-2); border-color: var(--line-strong); }
.ddb-ov-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ddb-ov-card-tt {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.ddb-ov-card-meta { font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 4px; }

/* 체크포인트 목록 — 카드 중첩 금지, 디바이더로 구분 */
.ddb-cps { margin-top: 24px; }
.ddb-cp {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.ddb-cp:first-child { border-top: 0; padding-top: 4px; }

.ddb-cp-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ddb-cp-point {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

/* weight 칩 */
.ddb-wt {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.ddb-wt-high { background: var(--sage-tint-2); color: var(--brand-ink); }
.ddb-wt-mid  { background: var(--surface-2); color: var(--text-2); }
.ddb-wt-low  {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  padding: 1px 7px;
}

/* check 라인 */
.ddb-cp-check {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-2);
}
.ddb-check-lab {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 6px;
}

/* best / bad — 좌측 라인 + 아이콘 + 텍스트 라벨 (면 채우기 금지) */
.ddb-case {
  margin-top: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--line-strong);
}
.ddb-case-best { border-left-color: var(--pos); }
.ddb-case-bad  { border-left-color: var(--neg); }
.ddb-case-lab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 3px;
}
.ddb-case-best .ddb-case-lab { color: var(--pos); }
.ddb-case-bad  .ddb-case-lab { color: var(--neg); }
.ddb-case-ico {
  display: inline-flex;
  width: 13px; height: 13px;
  align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; line-height: 1;
}
.ddb-case-body {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--text-2);
}

/* 예시 이미지(ref) — 2열 그리드 */
.ddb-refs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 14px;
  align-items: start;   /* 이미지 없는 카드가 다른 카드 높이로 늘어나지 않게 */
}
.ddb-ref {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.ddb-ref-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--surface-2);
  cursor: zoom-in;
}
.ddb-ref-cap { padding: 8px 10px 10px; }
.ddb-ref-brand { font-size: 12px; font-weight: 600; color: var(--text); }
.ddb-ref-note {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
  margin-top: 2px;
}
/* img 없을 때 캡션만 — 카드 패딩 보정 */
.ddb-ref.is-noimg .ddb-ref-cap { padding-top: 12px; }

/* ── 우: 메타 ─────────────────────────────────────────────────── */
.ddb-meta {
  border-left: 1px solid var(--line);
  padding: 28px 20px;
  align-self: stretch;
  font-size: 13px;
}
.ddb-meta-block { padding: 14px 0; border-top: 1px solid var(--line); }
.ddb-meta-block:first-child { border-top: 0; padding-top: 0; }
.ddb-meta-lab {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.ddb-meta-val { font-size: 13px; font-weight: 600; color: var(--text); }

/* 위치 브레드크럼 */
.ddb-meta-loc { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.5; }
.ddb-meta-loc .ddb-crumb-sep { color: var(--line-strong); }

/* weight 분포 미니 막대 */
.ddb-wbar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface-2);
  margin: 8px 0 6px;
}
.ddb-wbar-high { background: var(--brand); }
.ddb-wbar-mid  { background: var(--sage); }
.ddb-wbar-low  { background: var(--line-strong); }
.ddb-wlegend {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.ddb-wlegend b { font-weight: 600; color: var(--text); }

/* structural rules */
.ddb-srule { padding: 8px 0; }
.ddb-srule + .ddb-srule { border-top: 1px solid var(--line); }
.ddb-srule-id {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 1px 7px;
  border-radius: 4px;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.ddb-srule-rule {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-2);
}

/* ════════════════════════════════════════════════════════════════
   모바일 경로(트리→드롭다운) — 기본 숨김, 좁은 폭에서 노출
   ════════════════════════════════════════════════════════════════ */
.ddb-mobnav { display: none; }
.ddb-mobnav-back {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  padding: 8px 12px;
  min-height: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ddb-mobnav-crumb {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 2px;
}
/* 모바일 단계 드롭다운 — 터치 타깃 ≥44px. 네이티브 화살표 제거 후 가는 선 ∨ 커스텀 */
.ddb-mobnav-sel {
  min-height: 44px;
  font-family: inherit;
  font-size: 13px;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background-color: var(--surface);
  padding: 0 36px 0 14px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%2379818B' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}
.ddb-mobnav-sel:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ════════════════════════════════════════════════════════════════
   반응형
   ════════════════════════════════════════════════════════════════ */

/* 1024~1439: 우 메타 → 본문 하단 스택 (좌 트리 + 본문 2-pane) */
@media (max-width: 1439px) {
  .ddb-3pane { grid-template-columns: 280px minmax(0, 1fr); }
  .ddb-meta {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 32px;
  }
}

/* ≤1023: 좌 트리도 접고(데스크톱 3-pane 해제는 아래 768에서) — 중간 구간은 2-pane 유지 */
@media (max-width: 1023px) {
  .ddb-tree-scroll { max-height: calc(100vh - 200px); }
}

/* ≤768: 좌 트리 → 상단 경로 드롭다운 + 단계 드릴다운. 우 메타 본문 하단 스택. */
@media (max-width: 768px) {
  .ddb-3pane {
    display: block;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .ddb-tree { display: none; }      /* 데스크톱 트리 숨김 */
  .ddb-mobnav {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }
  .ddb-main {
    padding: 4px 0 32px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    padding: 20px 18px 28px;
  }
  .ddb-meta {
    grid-column: auto;
    border-left: 0;
    border-top: 0;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 18px;
  }
  .ddb-refs { gap: 12px; }
}

/* ≤375: 예시 이미지 1열 */
@media (max-width: 420px) {
  .ddb-refs { grid-template-columns: 1fr; }
  .ddb-overview { grid-template-columns: 1fr; }
}

/* 모션 최소화 */
@media (prefers-reduced-motion: reduce) {
  .ddb-tab, .ddb-node, .ddb-caret, .ddb-ov-card { transition: none; }
  .ddb-own-prod, .ddb-own-tnode, .ddb-own-card, .ddb-own-sortbtn { transition: none; }
  .ddb-jumplink, .ddb-jumplink-hint { transition: none; }
}

/* ════════════════════════════════════════════════════════════════
   탭B — 자사 상세 점검 (own)
   · 공용 셸(.ddb-3pane/.ddb-tree/.ddb-main/.ddb-meta)을 재사용 → 반응형 상속.
   · 세이지 화이트리스트: 선택 제품/분류 바·배경, 게이지/막대 채움, 활성 강조, 포커스 링.
   · taxonomy color 미사용.
   ════════════════════════════════════════════════════════════════ */

/* ── 좌: 제품 선택 + 트리 ─────────────────────────────────────── */
.ddb-own-mobsel { display: none; }            /* 좁은 폭에서만 노출 */

.ddb-own-products {
  display: flex;
  flex-direction: column;
  padding: 0 4px;
}
.ddb-own-prod {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 10px 4px 12px;
  color: var(--text-2);
  transition: background .12s ease, color .12s ease;
}
.ddb-own-prod:hover { background: var(--surface-2); }
.ddb-own-prod:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ddb-own-prod-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ddb-own-prod-cnt {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* 선택 제품: 좌측 3px brand 바 + sage-tint 배경 + brand-ink */
.ddb-own-prod.is-active {
  background: var(--sage-tint);
}
.ddb-own-prod.is-active .ddb-own-prod-name { color: var(--brand-ink); }
.ddb-own-prod.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--brand);
}

.ddb-own-divider {
  height: 1px;
  background: var(--line);
  margin: 8px 8px;
}

/* 대>중 트리 */
.ddb-own-tree { list-style: none; margin: 0; padding: 0 4px; }
.ddb-own-tree ul { list-style: none; margin: 0; padding: 0; }
.ddb-own-tree-children { position: relative; }
.ddb-own-tnode {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-2);
  transition: background .12s ease, color .12s ease;
}
.ddb-own-tnode:hover { background: var(--surface-2); }
.ddb-own-tnode:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ddb-own-tnode-all,
.ddb-own-tnode-major {
  min-height: 36px;
  padding: 4px 8px 4px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
.ddb-own-tnode-mid {
  min-height: 32px;
  padding: 3px 8px 3px 28px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
}
.ddb-own-tnode-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ddb-own-tnode-cnt {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* 보유 0 분류 — muted + 점선 카운트 */
.ddb-own-tnode.is-empty { color: var(--muted); }
.ddb-own-tnode.is-empty .ddb-own-tnode-label { color: var(--muted); }
.ddb-own-tnode.is-empty .ddb-own-tnode-cnt {
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  padding: 0 5px;
  color: var(--muted);
}
/* 선택 분류 — sage-tint 배경 + 좌측 3px brand 바 + brand-ink */
.ddb-own-tnode.is-active {
  background: var(--sage-tint);
  color: var(--brand-ink);
}
.ddb-own-tnode.is-active .ddb-own-tnode-label { color: var(--brand-ink); font-weight: 600; }
.ddb-own-tnode.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--brand);
}

/* ── 가운데: 본문 ─────────────────────────────────────────────── */
/* 가로형 카드가 가용 폭을 전부 쓰도록 본문 최대폭 제한 해제 */
.ddb-own-main-inner { max-width: none; }
.ddb-own-head { margin-bottom: 16px; }
.ddb-own-headmeta {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

/* 정렬 토글 + 필터 칩 */
.ddb-own-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.ddb-own-sort {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ddb-own-sortbtn {
  appearance: none;
  border: 0;
  background: var(--surface);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 7px 14px;
  min-height: 36px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.ddb-own-sortbtn + .ddb-own-sortbtn { border-left: 1px solid var(--line); }
.ddb-own-sortbtn:hover { color: var(--text-2); background: var(--surface-2); }
.ddb-own-sortbtn:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ddb-own-sortbtn.is-active { background: var(--sage-tint); color: var(--brand-ink); }

.ddb-own-filterchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 5px 6px 5px 10px;
}
.ddb-own-filterchip-lab {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 2px;
}
.ddb-own-filterclear {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  width: 20px; height: 20px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ddb-own-filterclear:hover { color: var(--text); background: var(--surface); }
.ddb-own-filterclear:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.ddb-own-empty {
  padding: 40px 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* 분류별 그룹 — 스티키 미니 헤더 */
.ddb-own-group-head {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 0;
  margin-top: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.ddb-own-group-head:first-child { margin-top: 0; }

/* 아이템 그리드 — 1열(가로형 카드: 이미지 좌 · 정보 우) */
.ddb-own-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0 8px;
}
.ddb-own-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  transition: border-color .12s ease;
}
.ddb-own-card:hover { border-color: var(--line-strong); }
/* 이미지 오른쪽: 본문 + 베스트를 한 열로 (가로형 카드의 우측 영역) */
.ddb-own-card-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ddb-own-thumb {
  flex: 0 0 280px;
  width: 280px;
  align-self: flex-start;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--surface-2);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  overflow: hidden;
  padding: 8px;
}
/* 이미지는 원본 비율 유지 + 확대(업스케일) 안 함. 박스(200×360) 안에서 축소만. */
.ddb-own-thumb-img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 480px;
  cursor: zoom-in;
  border-radius: 4px;
}
/* 이미지 원본 크게 보기(라이트박스) */
.ddb-lb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .82);
  cursor: zoom-out;
}
.ddb-lb.is-open { display: flex; }
.ddb-lb-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .5);
}

/* 떠다니는 팝업 접기/펼치기 헤더 */
.ddb-meta-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -14px -16px 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.ddb-meta-toggle-tt { font-size: 12.5px; font-weight: 800; color: var(--brand-ink); }
.ddb-meta-toggle-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  width: 26px;
  height: 24px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1;
  flex: none;
}
.ddb-meta-toggle-btn:hover { border-color: var(--line-strong); color: var(--text); }
/* 접힘: 헤더만 남기고 본문 숨김 */
.is-meta-collapsed > *:not(.ddb-meta-toggle) { display: none; }
.is-meta-collapsed .ddb-meta-toggle { margin-bottom: -14px; border-bottom: 0; }

/* ════════════════════════════════════════════════════════════════
   탭C — 자사 상세페이지 개선 (제품 서브탭 + 7단계 스텝탭 + 기획 문서)
   ════════════════════════════════════════════════════════════════ */
.ddb-improve { padding-top: 4px; }

/* 제품 서브탭(언더라인형) */
.ddb-improve-prodbar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.ddb-improve-prodtab {
  appearance: none;
  border: 0;
  background: none;
  padding: 8px 14px 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.ddb-improve-prodtab:hover { color: var(--text-2); }
.ddb-improve-prodtab.is-active { color: var(--brand-ink); border-bottom-color: var(--brand); }
.ddb-improve-prodtab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* 7단계 스텝탭(알약형, 줄바꿈 허용) */
.ddb-improve-stepbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.ddb-improve-steptab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  padding: 7px 14px 7px 7px;
  cursor: pointer;
  color: var(--text-2);
  min-height: 40px;
  transition: border-color .12s ease, background .12s ease;
}
.ddb-improve-steptab:hover { border-color: var(--line-strong); }
.ddb-improve-steptab.is-active { border-color: var(--brand); background: var(--sage-tint); color: var(--brand-ink); }
.ddb-improve-steptab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ddb-improve-stepnum {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 800;
  flex: none;
}
.ddb-improve-steptab.is-active .ddb-improve-stepnum { background: var(--brand); color: #fff; }
.ddb-improve-steptt { font-size: 13px; font-weight: 600; }

/* 콘텐츠 영역 */
.ddb-improve-content { min-height: 200px; }
/* 0단계 기획 문서 — iframe 격리 임베드(JS가 내용 높이에 맞춰 height 조정) */
.ddb-improve-frame {
  width: 100%;
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #f4f6fa;
  display: block;
}
/* 1~6단계 준비 중 플레이스홀더 */
.ddb-improve-empty {
  text-align: center;
  padding: 64px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--muted);
}
.ddb-improve-empty-ic { font-size: 30px; margin-bottom: 10px; }
.ddb-improve-empty-tt { font-size: 16px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.ddb-improve-empty-sub { font-size: 13px; }
.ddb-improve-empty-tag { font-size: 12.5px; color: var(--text-2); margin-top: 10px; }

/* 각 단계 상단 공통 헤더: 번호·제목 + 목적/목표 */
.ddb-improve-stephead {
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.ddb-improve-stephead-tt {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}
.ddb-improve-stephead-tt .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex: none;
}
.ddb-improve-aim { display: flex; flex-direction: column; gap: 8px; }
.ddb-improve-aim .aim { display: flex; gap: 10px; align-items: flex-start; }
.ddb-improve-aim .lab {
  flex: none;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--brand-ink);
  background: var(--sage-tint);
  border-radius: 6px;
  padding: 3px 10px;
  margin-top: 1px;
}
.ddb-improve-aim .txt { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* ── 단계 본문(기획 내용 정리) — 대시보드 톤 네이티브 스타일 ─────── */
.ddb-doc { font-size: 14px; color: var(--text); line-height: 1.7; }
.ddb-doc .mut { color: var(--muted); }
.ddb-doc .neg { color: var(--neg); }
.ddb-doc .pos { color: var(--pos); }
.ddb-doc-sec { margin-bottom: 26px; }
.ddb-doc-h { font-size: 16px; font-weight: 700; color: var(--text); margin: 0 0 12px; }
.ddb-doc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.ddb-doc-bt { font-size: 12.5px; font-weight: 800; letter-spacing: .02em; color: var(--brand-ink); margin: 0 0 12px; }
.ddb-doc-bt.mt { margin-top: 22px; }

.ddb-doc-callout {
  background: var(--sage-tint);
  border: 1px solid var(--sage-tint-2);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.75;
}
.ddb-doc-callout strong { color: var(--brand-ink); }

.ddb-doc-funnel { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.ddb-doc-stat { flex: 1; min-width: 124px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 12px; text-align: center; }
.ddb-doc-stat .big { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.05; }
.ddb-doc-stat .sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.ddb-doc-stat.bad { background: #fbecec; border-color: #f1cfcf; }
.ddb-doc-stat.bad .big { color: var(--neg); }
.ddb-doc-arrow { display: flex; align-items: center; color: var(--muted); font-size: 20px; font-weight: 700; }

.ddb-doc-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.ddb-doc-insight { background: var(--sage-tint); border: 1px solid var(--sage-tint-2); border-left: 4px solid var(--sage); border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 14px; font-size: 13.5px; line-height: 1.7; }
.ddb-doc-insight b { color: var(--brand-ink); }
.ddb-doc-warn { background: #fdf2e8; border: 1px solid #f3dcbd; border-left: 4px solid #c97a12; border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 14px; font-size: 13.5px; line-height: 1.7; }
.ddb-doc-warn b { color: #a96410; }
.ddb-doc-src { font-size: 11px; color: var(--muted); margin: 12px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); line-height: 1.6; }
.ddb-doc-src code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; font-size: 11px; }

.ddb-doc-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ddb-doc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ddb-doc-table th { background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 11.5px; padding: 8px 10px; text-align: right; border-bottom: 2px solid var(--line); white-space: nowrap; }
.ddb-doc-table th:first-child { text-align: left; }
.ddb-doc-table td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ddb-doc-table td:first-child { text-align: left; font-weight: 600; white-space: normal; }
.ddb-doc-table tr.grp td { background: var(--brand); color: #fff; font-weight: 700; font-size: 11.5px; text-align: left; }
.ddb-doc-table tr.total td { background: var(--sage-tint); font-weight: 800; border-top: 2px solid var(--sage-tint-2); }
.ddb-doc-table .cvr { color: var(--neg); font-weight: 800; }
.ddb-doc-table .na { color: var(--muted); font-style: italic; }
.ddb-doc-table .mut { color: var(--muted); font-weight: 400; }
.ddb-doc-table .th-sub { display: block; font-size: 10px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.ddb-doc-basis {
  margin: 0 0 10px;
  padding: 8px 12px;
  background: #fdf2e8;
  border: 1px solid #f3dcbd;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
}
.ddb-doc-basis b { color: #a96410; }

.ddb-doc-kpi { width: 100%; border-collapse: collapse; }
.ddb-doc-kpi th { width: 150px; text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 11px 12px 11px 0; vertical-align: top; }
.ddb-doc-kpi td { text-align: left; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ddb-doc-kpi tr:last-child th, .ddb-doc-kpi tr:last-child td { border-bottom: 0; }
.ddb-doc-pill { display: inline-block; font-size: 13px; font-weight: 800; padding: 3px 11px; border-radius: var(--radius-pill); }
.ddb-doc-pill.green { background: var(--sage-tint); color: var(--pos); }
.ddb-doc-pill.amber { background: #fdf2e8; color: #a96410; }

.ddb-doc-bar { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.ddb-doc-bar-lab { width: 130px; flex: none; font-size: 13px; }
.ddb-doc-bar-track { flex: 1; background: var(--surface-2); border-radius: 6px; height: 24px; overflow: hidden; }
.ddb-doc-bar-fill { height: 100%; border-radius: 6px; display: flex; align-items: center; padding: 0 10px; color: #fff; font-size: 12.5px; font-weight: 700; white-space: nowrap; }

@media (max-width: 768px) {
  .ddb-doc-kpi th { width: auto; display: block; padding-bottom: 2px; }
  .ddb-doc-kpi td { display: block; padding-top: 4px; }
}

/* 상단 한눈 요약 박스 */
.ddb-doc-summary {
  border: 2px solid var(--brand);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 18px 20px 20px;
  margin-bottom: 22px;
  box-shadow: 0 3px 14px rgba(62, 77, 65, .12);
}
.ddb-doc-summary-h {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .03em;
  color: #fff;
  background: var(--brand);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}
.ddb-doc-summary-metrics { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.ddb-doc-summary-metrics .m {
  flex: 1;
  min-width: 130px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.ddb-doc-summary-metrics .k { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ddb-doc-summary-metrics .v { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2; margin-top: 2px; }
.ddb-doc-summary-metrics .v.neg { color: var(--neg); }
.ddb-doc-summary-metrics .v.pos { color: var(--pos); }
.ddb-doc-summary-metrics .s { font-size: 11px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.ddb-doc-summary-pts { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.75; color: var(--text-2); }
.ddb-doc-summary-pts li { margin: 5px 0; }
.ddb-doc-summary-pts b { color: var(--brand-ink); }
.ddb-doc-summary-goal {
  margin: 0 0 14px;
  padding: 11px 14px;
  background: var(--sage-tint);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-2);
}
.ddb-doc-summary-goal b { color: var(--brand-ink); }
.ddb-own-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ddb-own-card-el {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.ddb-own-card-desc {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ddb-own-card-chip {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 소분류 베스트 프랙티스 비교 (우리 카드 ↔ 베스트) ──────────────
   우리 요소(위)와 시각 구분: 상단 디바이더 + 세이지 라벨. 같은 톤 유지. */
.ddb-own-best {
  margin-top: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ddb-own-best-lab { display: flex; align-items: center; }
.ddb-own-best-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--brand-ink);
  background: var(--sage-tint);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
}
.ddb-own-best-point {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-2);
}
/* 카드 안에서 case/refs 여백은 살짝 축소(중첩 과하지 않게) */
.ddb-own-best .ddb-case { margin-top: 2px; }
.ddb-own-best .ddb-refs { margin-top: 6px; gap: 10px; }

/* ── 미보유 소분류 — 베스트 참고(본문 하단 접기) ───────────────────── */
.ddb-own-miss-sec {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.ddb-own-miss-sec-sum {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  padding: 4px 0;
}
.ddb-own-miss-sec-sum::-webkit-details-marker { display: none; }
.ddb-own-miss-sec-sum::before {
  content: "▸";
  color: var(--muted);
  font-size: 11px;
  transition: transform .12s ease;
}
.ddb-own-miss-sec[open] .ddb-own-miss-sec-sum::before { transform: rotate(90deg); }
.ddb-own-miss-sec-sum:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.ddb-own-miss-sec-tt {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.ddb-own-miss-sec-cnt {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ddb-own-miss-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.ddb-own-misscard {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 12px;
  display: flex;
  flex-direction: column;
}
.ddb-own-misscard-hd {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.ddb-own-misscard-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* ── 탭B → 탭A 베스트 점프 링크(미보유 카드 이름 / 보유 카드 분류 칩) ──
   세이지 화이트리스트만 사용. hover/포커스 시 색·밑줄·힌트로 어포던스. */
.ddb-jumplink {
  cursor: pointer;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.ddb-jumplink:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
/* 미보유 카드 이름: 이름 + "베스트 보기 →" 힌트 한 줄 */
.ddb-own-misscard-name.ddb-jumplink {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.ddb-own-misscard-name.ddb-jumplink:hover .ddb-jumplink-tx,
.ddb-own-misscard-name.ddb-jumplink:focus-visible .ddb-jumplink-tx {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ddb-jumplink-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  opacity: 0;
  transition: opacity .12s ease, color .12s ease;
}
.ddb-own-misscard-name.ddb-jumplink:hover .ddb-jumplink-hint,
.ddb-own-misscard-name.ddb-jumplink:focus-visible .ddb-jumplink-hint {
  opacity: 1;
  color: var(--brand);
}
/* 보유 카드 분류 칩(링크형): hover/포커스 시 세이지 강조 */
.ddb-own-card-chip--link:hover,
.ddb-own-card-chip--link:focus-visible {
  color: var(--brand-ink);
  background: var(--sage-tint);
}
.ddb-own-misscard-flag {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  line-height: 1.3;
}
/* 미보유 카드 안 베스트는 위 디바이더 생략(이미 카드로 구분됨) */
.ddb-own-best--inmiss {
  border-top: 0;
  padding: 10px 0 0;
  margin-top: 8px;
}

/* ── 우: 보유율 메타 ──────────────────────────────────────────── */
.ddb-own-bignum {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.ddb-own-bignum b { font-weight: 700; }
.ddb-own-gauge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.ddb-own-gauge {
  flex: 1 1 auto;
  height: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
}
.ddb-own-gauge-fill {
  height: 100%;
  background: var(--brand);
  border-radius: var(--radius-sm);
}
.ddb-own-gauge-pct {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-ink);
  font-variant-numeric: tabular-nums;
}

/* 대분류별 보유율 막대 */
.ddb-own-mbar-row { margin-top: 12px; }
.ddb-own-mbar-row:first-of-type { margin-top: 4px; }
.ddb-own-mbar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.ddb-own-mbar-lab {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ddb-own-mbar-num {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ddb-own-mbar {
  height: 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
}
.ddb-own-mbar-fill {
  height: 100%;
  background: var(--sage);
  border-radius: var(--radius-sm);
}
.ddb-own-mbar.is-strong .ddb-own-mbar-fill { background: var(--brand); }
/* 0% — 트랙 + 점선 */
.ddb-own-mbar.is-empty {
  background: transparent;
  border: 1px dashed var(--line-strong);
  height: 6px;
}

/* 미보유 소분류 — 대분류별 그룹 + 점선 칩 */
.ddb-own-miss-grp { margin-top: 12px; }
.ddb-own-miss-grp:first-of-type { margin-top: 4px; }
.ddb-own-miss-grphead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.ddb-own-miss-grpcnt {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ddb-own-miss-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ddb-own-miss-chip {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  line-height: 1.3;
}
/* 미보유 소분류 칩(링크형): hover/포커스 시 세이지 강조 — 보유 카드 칩 링크와 동일 어포던스
   (커서/트랜지션/포커스 링은 .ddb-jumplink 공용 규칙 상속) */
.ddb-own-miss-chip--link:hover,
.ddb-own-miss-chip--link:focus-visible {
  color: var(--brand-ink);
  background: var(--sage-tint);
  border-color: var(--brand);
}

/* ════════════════════════════════════════════════════════════════
   탭B 반응형 — 공용 셸(.ddb-3pane 등)이 1439/768 미디어를 상속.
   아이템 그리드 열수 + 모바일 좌측(제품 드롭다운) 처리만 추가.
   ════════════════════════════════════════════════════════════════ */

/* 가로형 카드라 좁은 폭에서도 1열 유지 */
@media (max-width: 1439px) {
  .ddb-own-grid { grid-template-columns: 1fr; }
}

/* 미보유 베스트 그리드: 좁은 폭에서 1열(카드 내용 가독성) */
@media (max-width: 768px) {
  .ddb-own-miss-grid { grid-template-columns: 1fr; }
}

/* ≤768: 좌 트리 → 상단 제품 드롭다운 + 가로 분류 칩. 공용 규칙이
   .ddb-tree를 display:none 처리하므로 own-left만 다시 노출. */
@media (max-width: 768px) {
  .ddb-own .ddb-own-left {
    display: block;
    border-right: 0;
    padding: 0;
    margin-bottom: 12px;
  }
  .ddb-own .ddb-own-left .ddb-tree-scroll {
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  .ddb-own-mobsel {
    display: block;
    width: 100%;
    min-height: 44px;
    margin-bottom: 10px;
  }
  /* 데스크톱 제품 리스트·디바이더 숨기고, 트리는 가로 칩으로 */
  .ddb-own-products,
  .ddb-own-divider { display: none; }
  .ddb-own-tree {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
  }
  .ddb-own-tree > li { display: contents; }
  .ddb-own-tree-children { display: contents; }
  .ddb-own-tnode {
    width: auto;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
  }
  .ddb-own-tnode-all,
  .ddb-own-tnode-major,
  .ddb-own-tnode-mid {
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 500;
  }
  .ddb-own-tnode.is-active::before { display: none; }
  .ddb-own-tnode.is-active { border-color: var(--brand); }
}

/* ≤420: 1열 유지 + 썸네일 폭 축소(가로형 카드가 좁은 화면에 맞게) */
@media (max-width: 420px) {
  .ddb-own-grid { grid-template-columns: 1fr; gap: 10px; }
  .ddb-own-thumb { flex: 0 0 120px; width: 120px; }
}

/* ── 자사 점검(데스크톱 ≥769) — 좌측 패널을 상단 내비로, 본문 전체폭 ─────
   3단 그리드(.ddb-3pane)는 베스트 탭과 공용이라 .ddb-own 에만 한정해 재배치한다.
   제품=가로 알약, 분류(요소)=가로 칩(클릭 시 본문 필터), 우 보유율은 본문 하단으로. */
@media (min-width: 769px) {
  .ddb-3pane.ddb-own {
    display: block;
    border: 0;
    background: transparent;
    overflow: visible;
  }
  /* 상단 내비(기존 좌측 패널) — 제품 탭은 투명, 분류(전체~)만 흰 카드 */
  .ddb-own > .ddb-own-left {
    border-right: 0;
    padding: 0;
    margin-bottom: 14px;
  }
  .ddb-own .ddb-own-left .ddb-tree-scroll {
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  .ddb-own .ddb-own-mobsel { display: none; }
  /* 제품 = 밑줄 탭(개선 탭 제품탭과 동일), 한 줄 가로 */
  .ddb-own .ddb-own-products {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }
  .ddb-own .ddb-own-prod {
    width: auto;
    flex: 0 0 auto;
    min-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    border: 0;
    border-radius: 0;
    background: none;
    padding: 8px 16px 10px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
  }
  .ddb-own .ddb-own-prod:hover { background: none; color: var(--text-2); }
  .ddb-own .ddb-own-prod.is-active { background: none; color: var(--brand-ink); border-bottom-color: var(--brand); }
  .ddb-own .ddb-own-prod.is-active .ddb-own-prod-name { color: var(--brand-ink); }
  .ddb-own .ddb-own-prod.is-active::before { display: none; }
  .ddb-own .ddb-own-prod-name { font-size: 14px; font-weight: 600; flex: 0 0 auto; }
  .ddb-own .ddb-own-prod-cnt { display: none; }
  /* 제품탭 밑줄이 구분선 역할 → 별도 디바이더 숨김 */
  .ddb-own .ddb-own-divider { display: none; }

  /* 분류(요소) = 대분류(라벨) → 중분류(칩) 계층 표현 (전체~ 흰 카드 배경) */
  .ddb-own .ddb-own-tree {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px 16px;
  }
  .ddb-own .ddb-own-tree > li { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
  .ddb-own .ddb-own-tnode { width: auto; min-height: 0; }
  /* '전체' = 단독 칩 */
  .ddb-own .ddb-own-tnode-all {
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
  }
  /* 대분류 = 왼쪽 굵은 라벨(고정폭으로 정렬 → 계층 가독) */
  .ddb-own .ddb-own-tnode-major {
    flex: 0 0 auto;
    min-width: 150px;
    border: 0;
    background: none;
    border-radius: 0;
    padding: 6px 0;
    justify-content: flex-start;
    font-weight: 700;
    color: var(--text);
  }
  .ddb-own .ddb-own-tnode-major:hover { background: none; color: var(--brand-ink); }
  .ddb-own .ddb-own-tnode-major.is-active { background: none; color: var(--brand-ink); }
  .ddb-own .ddb-own-tnode-major .ddb-own-tnode-label { white-space: normal; }
  /* 중분류 묶음 = 오른쪽 칩들 */
  .ddb-own .ddb-own-tree-children {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
    padding: 0;
  }
  .ddb-own .ddb-own-tnode-mid {
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    padding: 5px 12px;
    font-size: 12.5px;
  }
  .ddb-own .ddb-own-tnode.is-active::before { display: none; }
  .ddb-own .ddb-own-tnode-all.is-active,
  .ddb-own .ddb-own-tnode-mid.is-active { border-color: var(--brand); background: var(--sage-tint); color: var(--brand-ink); }
  /* 본문 = 전체폭 */
  .ddb-own .ddb-own-main { padding: 4px 0 0; }
  /* 보유 현황 → 오른쪽 상단 떠다니는 작은 팝업(내부 스크롤) */
  .ddb-own .ddb-own-meta {
    position: fixed;
    top: 88px;
    right: 20px;
    width: 240px;
    max-height: 400px;
    overflow-y: auto;
    margin: 0;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
    z-index: 40;
  }
}

/* ── 요소별 베스트(데스크톱 ≥769) — 좌 트리를 상단 계층 내비로, 본문 전체폭 ──
   대분류 라벨 → 중분류 칩 → (선택 시) 소분류 칩. 좌 트리는 모바일용으로 숨김. */
@media (min-width: 769px) {
  .ddb-3pane.ddb-best {
    display: block;
    border: 0;
    background: transparent;
    overflow: visible;
  }
  .ddb-best > .ddb-tree { display: none; }       /* 데스크톱: 좌 트리 숨김(상단 내비로 대체) */
  .ddb-best .ddb-main {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 22px 26px;
  }
  /* 위치·가중치분포·참고사례·구조규칙 → 오른쪽 상단 떠다니는 팝업(내부 스크롤) */
  .ddb-best .ddb-meta {
    position: fixed;
    top: 88px;
    right: 20px;
    width: 260px;
    max-height: 400px;
    overflow-y: auto;
    margin: 0;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
    z-index: 40;
  }
  /* 상단 계층 내비 */
  .ddb-bestnav { margin-bottom: 18px; }
  .ddb-bestnav-cats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px 16px;
  }
  .ddb-bestnav-catrow { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
  .ddb-bestnav-major {
    flex: 0 0 auto;
    min-width: 150px;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
  }
  .ddb-bestnav-mids { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 0; min-width: 0; }
  .ddb-bestnav-mid {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text-2);
    padding: 5px 12px;
    font-size: 12.5px;
    cursor: pointer;
  }
  .ddb-bestnav-mid:hover { border-color: var(--line-strong); }
  .ddb-bestnav-mid:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
  .ddb-bestnav-mid.is-active { border-color: var(--brand); background: var(--sage-tint); color: var(--brand-ink); font-weight: 600; }
  .ddb-bestnav-cnt { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .ddb-bestnav-mid.is-active .ddb-bestnav-cnt { color: var(--brand-ink); }
  /* 선택된 중분류의 소분류 바 */
  .ddb-bestnav-subbar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }
  .ddb-bestnav-subbar-lab {
    flex: 0 0 auto;
    min-width: 140px;
    padding: 5px 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-ink);
  }
  .ddb-bestnav-subs { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 0; min-width: 0; }
  .ddb-bestnav-sub {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text-2);
    padding: 5px 12px;
    font-size: 12.5px;
    cursor: pointer;
  }
  .ddb-bestnav-sub:hover { border-color: var(--line-strong); }
  .ddb-bestnav-sub:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
  .ddb-bestnav-sub.is-active { border-color: var(--brand); background: var(--sage-tint); color: var(--brand-ink); font-weight: 600; }
  .ddb-bestnav-new { font-size: 9px; font-weight: 800; color: var(--pos); letter-spacing: .03em; }
}
@media (max-width: 768px) {
  .ddb-bestnav { display: none; }   /* 모바일: 상단 내비 숨김(기존 모바일 내비 사용) */
}

/* ════════ [탭C · step1] 우리 현황 진단 — step0과 동일한 ddb-doc 톤 확장 ════════ */
/* 51컷 썸네일 그리드 */
.ddb-doc-cuts { display:grid; grid-template-columns:repeat(auto-fill,minmax(90px,1fr)); gap:7px; margin-top:4px; }
.ddb-doc-cut { border:2px solid var(--line); border-radius:var(--radius-sm); overflow:hidden; background:var(--surface); }
.ddb-doc-cut img { width:100%; height:78px; object-fit:cover; object-position:top; display:block; background:var(--surface-2); cursor:zoom-in; }
.ddb-doc-cut .cl { font-size:10px; padding:3px 5px 5px; line-height:1.25; color:var(--muted); }
.ddb-doc-cut .cl b { color:var(--text); }
.ddb-doc-cut.f { outline:2px solid var(--neg); outline-offset:1px; }
.ddb-doc-grp { font-size:12.5px; font-weight:800; margin:16px 0 8px; padding:5px 12px; border-radius:var(--radius-sm); background:var(--surface-2); border-left:4px solid var(--muted); color:var(--text); }
.ddb-doc-grp:first-child { margin-top:0; }
.ddb-doc-grp .c { font-weight:600; color:var(--muted); font-size:11.5px; }
.ddb-doc-grp.g-main { border-left-color:var(--brand); }
/* 후기·Q&A 인용 */
.ddb-doc-quotes { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:8px; }
.ddb-doc-quote { background:var(--surface-2); border:1px solid var(--line); border-radius:var(--radius-sm); padding:11px 13px; font-size:12.5px; line-height:1.6; color:var(--text-2); }
.ddb-doc-quote b { color:var(--text); }
.ddb-doc-quote .qc { display:block; margin-top:7px; font-size:10.5px; font-weight:800; color:var(--brand-ink); }
/* 레퍼런스 개선안 */
.ddb-doc-ref { display:flex; gap:14px; padding:14px 0; border-bottom:1px solid var(--line); align-items:flex-start; }
.ddb-doc-ref:last-child { border-bottom:0; padding-bottom:0; }
.ddb-doc-ref-img { flex:none; width:116px; }
.ddb-doc-ref-img img { width:100%; border-radius:var(--radius-sm); border:1px solid var(--line); cursor:zoom-in; display:block; background:var(--surface-2); }
.ddb-doc-ref-img .cap { font-size:10.5px; color:var(--muted); margin-top:4px; text-align:center; line-height:1.3; }
.ddb-doc-ref-tx { flex:1; }
.ddb-doc-ref-tx .gp { display:inline-block; font-size:11px; font-weight:700; background:#fbecec; color:var(--neg); padding:2px 8px; border-radius:5px; margin-bottom:6px; }
.ddb-doc-ref-tx .pr { font-size:13.5px; font-weight:800; color:var(--text); margin:0 0 5px; }
.ddb-doc-ref-tx .rf { font-size:12.5px; color:var(--text-2); margin:0 0 7px; line-height:1.55; }
.ddb-doc-ref-tx .ap { font-size:12.5px; background:var(--sage-tint); border-left:3px solid var(--sage); padding:8px 11px; border-radius:6px; margin:0; line-height:1.55; }
.ddb-doc-ref-tx .ap b { color:var(--brand-ink); }
/* 긍정(good) 박스 */
.ddb-doc-good { background:var(--sage-tint); border:1px solid var(--sage-tint-2); border-left:4px solid var(--pos); border-radius:var(--radius-sm); padding:14px 16px; margin-top:14px; font-size:13.5px; line-height:1.7; }
.ddb-doc-good b { color:var(--pos); }
@media(max-width:680px){ .ddb-doc-quotes{grid-template-columns:1fr;} .ddb-doc-ref{flex-direction:column;} .ddb-doc-ref-img{width:100%;max-width:200px;} }
