/* ============================================================
   redesign-v2.css — 대시보드 신디자인(프리뷰 룩) opt-in 레이어 (통합본)
   ------------------------------------------------------------
   ★목적: dashboard_v2_preview.php 프리뷰 룩을 실제 앱 대시보드에 코스메틱으로 입힘.
   ★스코프: 모든 규칙이 body.rd2 로 스코프됨(대시보드에서만 켜짐).
   ★원복법: <body>에서 rd2 클래스만 제거 → 즉시 원래 디자인으로 복귀(무손실).
   ★안전원칙: 레이아웃(width/position/display/flex/grid)은 원칙적으로 건드리지 않음.
     색·배경·테두리·radius·그림자·폰트 등 '코스메틱'만 덧입힘 → 반응형 안 깨짐.
     (예외: 탑바 데스크톱 sticky/flatten, 사이드바 폭 236px 은 프리뷰 매칭상 의도적 조정)
   ★로드순서: header.php 의 saas.css 뒤(extra_head)로 로드 → 캐스케이드 우선.
     saas.css / dashboard.css 의 !important 를 이기려 대부분 !important 사용.
   ★색: 브랜드 확정 보라 #6B6198 유지("밝게 금지"). 회색 램프는 시안(쿨그레이).
     ※ 2026-08-08 시안 accent(#705BCD)를 넣어봤으나 "쨍하다"는 판단으로 원복.
     ⇒ 본문 규칙은 색을 하드코딩하지 말 것. 전부 var(--primary/--border/--text-*) 참조로 통일해 두었으니
       팔레트 변경은 (1) 토큰 블록 한 곳만 고치면 전체가 따라온다.
   ------------------------------------------------------------
   구성(논리 순서):
     (1) 베이스 토큰/변수      (2) 사이드바        (3) 탑바
     (4) 툴바 버튼             (5) 표시설정 토글   (6) KPI/헤딩(hero)
     (7) 플레이스 카드         (8) 다크모드(전 구간 일괄)
   ============================================================ */


/* ============================================================
   (1) 베이스 토큰/변수 — 팔레트/폰트/radius/배경 프리뷰 통일
   폰트·radius 는 라이트/다크 공통, 색은 라이트 전용(다크 원래값 보존).
   토큰 재정의는 !important 없이 캐스케이드로 이김(변수는 saas.css 가
   body.rd2 스코프로 안 건드림). 실제 적용 프로퍼티(배경 등)만 !important.
   ============================================================ */

/* ------------------------------------------------------------------
   [2026-08-08] Claude Design 시안(Seller Dashboard standalone)에서 추출한 토큰으로 교체.
   시안은 색을 oklch 로 정의했으나, 구형 브라우저 대비를 위해 hex 로 환산해 넣는다.
     oklch(0.55 0.17 288) = #6B6198  (accent)
   시안 실측 스케일:
     · font-size  19 / 13.5 / 12.5 / 12 / 11.5 / 11 / 10.5   ← 0.5px 단위를 쓴다
     · weight     500·600·700 위주 (800 은 3곳뿐 — 굵기를 아껴 대비를 만든다)
     · radius     10px 기본(26회) · 8~9px · 큰 카드만 14~16px · pill 99px
     · gap        11px 이 기본 단위(23회), padding 9px 11px (19회)
     · shadow     거의 안 씀(41k자 마크업에 9회). 면 분리는 테두리로.
     · letter-spacing 전부 normal
   ------------------------------------------------------------------ */

/* 공통: 베이스 폰트/라운드 스케일 */
body.rd2 {
  font-size: 13.5px;              /* 시안 본문 기본 */
  line-height: 1.45;
  letter-spacing: normal;         /* 시안은 자간 조정을 안 한다 */
  --text-base: 13.5px;
  --text-sm: 12.5px;
  --text-xs: 11.5px;
  --text-2xs: 10.5px;
  --text-lead: 19px;              /* 순위 숫자·KPI 값 등 '주인공' */

  --radius-lg: 14px;              /* 큰 카드 */
  --radius-md: 10px;              /* ★기본 */
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-pill: 99px;

  --gap-base: 11px;               /* 시안 기본 간격 단위 */
  --pad-cell: 9px 11px;

  /* 그림자 — 푸른기 회색(20,20,40) 에 4~5%. 큰 blur + 음수 spread 로 퍼짐 억제 */
  --shadow-rd2: 0 1px 2px rgba(20,20,40,.04), 0 8px 24px -12px rgba(20,20,40,.10);
  --shadow-rd2-lift: 0 2px 4px rgba(20,20,40,.05), 0 18px 40px -18px rgba(20,20,40,.16);

  --font-sans: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
}

/* 라이트 전용: 시안 팔레트 */
html:not([data-theme="dark"]) body.rd2 {
  /* accent — 브랜드 확정 보라. 시안 #705BCD 는 쨍해서 미채택(2026-08-08) */
  --primary: #6B6198;
  --primary-dark: #4E4573;        /* accent-hi */
  --primary-light: #8880AE;
  --primary-soft: #F2F1FF;        /* accent-soft — 선택 배경 */
  --primary-line: #DCD9FE;        /* accent-line — 선택 테두리 */
  --border-focus: #6B6198;

  /* 상승/하락 — 시안 up/down */
  --up: #05893E;      --up-soft: #E0FAE4;
  --down: #D03641;    --down-soft: #FFECEA;
  --amber: #C47D04;

  /* 텍스트 3단 — 시안 tx/tx2/tx3 */
  --text-primary: #15151B;
  --text-secondary: #5B5B6A;
  --text-tertiary: #90909F;
  --text-muted: #90909F;

  /* 선/면 */
  --border: #E8E8EE;              /* line */
  --border-light: #F0F0F4;
  --border-strong: #D9D9E2;       /* line2 */

  --card-bg: #FFFFFF;             /* surface */
  --card-bg-elevated: #FAFAFA;    /* surface2 */
  --sunken: #F0F0F4;              /* 눌린 면 */
  --dark-bg: #F4F4F7;             /* bg */

  color: #5B5B6A;
}

/* 페이지 배경: saas.css 의 .main-content{background:var(--dark-bg)!important} 를 이겨야 함 */
html:not([data-theme="dark"]) body.rd2 { background: #F4F4F7; }
html:not([data-theme="dark"]) body.rd2 .main-content { background: #F4F4F7 !important; }

/* 공통 카드 표면(코스메틱) — 테두리/라운드/그림자만.
   ★.section 제외: .section 은 여러 페이지에서 '콘텐츠 전체를 감싸는 레이아웃 래퍼'(카드 아님)로 쓰여,
   여기 포함하면 페이지 외곽에 이중 테두리/프레임이 생김(확산 검토 발견: place_stats·keyword_analysis·board).
   실제 카드는 .card/.stat-card/.summary-card 등. */
body.rd2 .card,
body.rd2 .dashboard-card,
body.rd2 .place-card,
body.rd2 .stat-card,
body.rd2 .summary-card {
  border-radius: var(--radius-lg);   /* 14px — 시안의 큰 카드 값 */
  box-shadow: var(--shadow-rd2);
}
/* 테두리 색은 테마 가드 — 다크에서 밝은 색이 튀던 문제 수정(project_management 다크 요약카드 등) */
html:not([data-theme="dark"]) body.rd2 .card,
html:not([data-theme="dark"]) body.rd2 .dashboard-card,
html:not([data-theme="dark"]) body.rd2 .place-card,
html:not([data-theme="dark"]) body.rd2 .stat-card,
html:not([data-theme="dark"]) body.rd2 .summary-card {
  border: 1px solid var(--border);   /* #E8E8EE */
}
:root[data-theme="dark"] body.rd2 .card,
:root[data-theme="dark"] body.rd2 .dashboard-card,
:root[data-theme="dark"] body.rd2 .place-card,
:root[data-theme="dark"] body.rd2 .stat-card,
:root[data-theme="dark"] body.rd2 .summary-card {
  border: 1px solid #30363d;
}

/* 모바일: 베이스 13px 유지(프리뷰 컴팩트값). 토큰만 조정, 레이아웃 불변 */
@media (max-width: 768px) {
  body.rd2 { font-size: 13px; --text-base: 13px; --text-lead: 18px; }
}
@media (max-width: 640px) {
  body.rd2 { font-size: 13px; --text-base: 13px; --text-lead: 18px; }
}


/* ============================================================
   (2) 사이드바 — 프리뷰 픽셀 매칭 (완결 블록)
   레이아웃(fixed/flex/scroll)은 saas.css 그대로 두고 크기·색·패딩만 교정.
   ============================================================ */

/* 컨테이너: 236px + var(--border) 우측선. :not(.collapsed) 로 접힘모드(64px) 보존.
   main-content 는 plain 스코프(0,2,1)라 collapsed 오버라이드(0,3,1)에 양보 → 접힘 정상. */
body.rd2 .sidebar:not(.collapsed) { width: 236px !important; }
body.rd2 .sidebar { background: #ffffff !important; border-right: 1px solid var(--border) !important; }
body.rd2 .main-content { margin-left: 236px !important; }

/* 헤더(로고+브랜드) — 로고 이미지는 유지, 크기만 프리뷰(32px).
   [복원] 사이드바 로고는 원래 셀러닷컴 이미지 그대로(보라 사각 대체 없음).
   padding/gap 은 :not(.collapsed) 로 접힘모드(중앙정렬) 보존. */
body.rd2 .sidebar .sidebar-header { border-bottom: 1px solid var(--border-light) !important; }
body.rd2 .sidebar:not(.collapsed) .sidebar-header { padding: 18px 20px 16px !important; gap: 11px !important; }
body.rd2 .sidebar .sidebar-header img { width: 32px !important; height: 32px !important; border-radius: 9px !important; object-fit: contain !important; }
body.rd2 .sidebar-brand-link { font-size: 15px !important; font-weight: 700 !important; color: var(--text-primary) !important; letter-spacing: -.01em !important; }
body.rd2 .sidebar-brand-sub { font-size: 10.5px !important; font-weight: 500 !important; color: var(--text-muted) !important; letter-spacing: -.01em !important; margin-top: 2px !important; opacity: 1 !important; }

/* 네비 영역 — 프리뷰는 아이템이 full-width, 간격 없음. 접힘모드 패딩 보존 */
body.rd2 .sidebar:not(.collapsed) .nav-menu { padding: 6px 0 16px !important; gap: 0 !important; }
body.rd2 .sidebar .nav-group { margin: 0 !important; }

/* 섹션 접기 화살표 숨김(프리뷰엔 없음) + 항상 펼침 유지 */
body.rd2 .nav-group-arrow { display: none; }
body.rd2 .nav-group.closed .nav-group-items { display: block; }

/* 섹션 라벨(지도/쇼핑/도구/커뮤니티) */
body.rd2 .sidebar .nav-group-title {
  font-size: 11px !important; font-weight: 700 !important; color: #adb1bd !important;
  letter-spacing: .03em !important; text-transform: none !important;
  padding: 14px 20px 6px !important; margin: 0 !important; opacity: 1 !important;
}
body.rd2 .sidebar .nav-group-title:hover { color: #adb1bd !important; opacity: 1 !important; }

/* nav-item — 라운드 제거, 좌측 2px 보더 하이라이트 스타일.
   padding/gap 은 :not(.collapsed) 로 접힘모드(아이콘만 중앙) 보존. */
body.rd2 .sidebar .nav-item {
  color: var(--text-secondary) !important; font-size: 13px !important; font-weight: 500 !important;
  border-radius: 10px !important; border-left: 0 !important;
  margin: 1px 8px !important;
  opacity: 1 !important; letter-spacing: -.01em !important; line-height: 1.45 !important;
}
body.rd2 .sidebar:not(.collapsed) .nav-item { padding: 8px 12px !important; gap: 11px !important; }
body.rd2 .sidebar .nav-item > span:not(.nav-icon):not(.admin-badge) { opacity: 1 !important; }
body.rd2 .sidebar .nav-item:hover { background: var(--sunken) !important; color: var(--text-secondary) !important; }
body.rd2 .sidebar .nav-item.active,
body.rd2 .sidebar .nav-item.active:hover {
  color: var(--primary) !important; font-weight: 600 !important;
  background: color-mix(in srgb, var(--primary) 10%, #fff) !important;
  border-left: 0 !important; border-radius: 10px !important;
}

/* 아이콘(Material Symbols) — 인라인 font-size:19px 를 18px 로 강제 */
body.rd2 .nav-icon { display: inline-flex; align-items: center; justify-content: center; }
body.rd2 .sidebar .nav-item .nav-icon {
  width: 18px !important; height: 18px !important; font-size: 18px !important;
  color: inherit !important; opacity: 1 !important;
}
body.rd2 .sidebar .nav-item .nav-icon .material-symbols-outlined { font-size: 18px !important; color: inherit !important; }
body.rd2 .sidebar .nav-item.active .nav-icon,
body.rd2 .sidebar .nav-item.active .nav-icon .material-symbols-outlined { color: var(--primary) !important; opacity: 1 !important; }

/* 관리자 섹션 — 프리뷰는 일반 아이템과 동일 톤(빨강/흰색 제거) */
body.rd2 .sidebar .sidebar-admin-section { margin-top: 8px !important; padding-top: 8px !important; border-top: 1px solid var(--border-light) !important; }
body.rd2 .sidebar .nav-item-admin,
body.rd2 .sidebar .nav-item-admin:hover { color: var(--text-secondary) !important; font-weight: 500 !important; }
body.rd2 .sidebar .nav-item-admin .nav-icon,
body.rd2 .sidebar .nav-item-admin .nav-icon .material-symbols-outlined { color: inherit !important; opacity: 1 !important; }
body.rd2 .sidebar .nav-item-admin.active,
body.rd2 .sidebar .nav-item-admin.active .nav-icon,
body.rd2 .sidebar .nav-item-admin.active .nav-icon .material-symbols-outlined { color: var(--primary) !important; }

/* admin 뱃지 — 회색 pill */
body.rd2 .sidebar .admin-badge,
body.rd2 .sidebar .nav-item-admin .admin-badge {
  margin-left: auto !important; font-size: 9.5px !important; font-weight: 700 !important;
  color: var(--text-muted) !important; background: var(--sunken) !important; border: none !important;
  border-radius: 4px !important; padding: 2px 5px !important; letter-spacing: .02em !important;
}

/* 모바일: off-canvas 유지 + 컴팩트 스타일이 프리뷰 톤 그대로 */
@media (max-width: 768px) {
  body.rd2 .sidebar:not(.collapsed) { width: 236px !important; }
  body.rd2 .main-content { margin-left: 0 !important; }
  body.rd2 .sidebar .sidebar-header { padding: 16px 18px 14px !important; }
  body.rd2 .sidebar .sidebar-header img { width: 30px !important; height: 30px !important; }
  body.rd2 .sidebar .nav-menu { padding: 6px 0 16px !important; gap: 0 !important; }
  body.rd2 .sidebar .nav-group { margin: 0 !important; }
  body.rd2 .sidebar .nav-group-title { font-size: 11px !important; padding: 14px 18px 6px !important; margin: 0 !important; }
  body.rd2 .sidebar .nav-item { padding: 9px 12px !important; font-size: 13px !important; line-height: 1.4 !important; }
  body.rd2 .sidebar .nav-item .nav-icon,
  body.rd2 .sidebar .nav-item .nav-icon .material-symbols-outlined { width: 18px !important; height: 18px !important; font-size: 18px !important; }
}


/* ============================================================
   (3) 탑바 (TOPBAR) — 프리뷰 픽셀 매칭
   ============================================================ */

/* 헤더 바: 색/블러/보더 (공통) */
body.rd2 .header {
  background: rgba(255,255,255,.98) !important;
  backdrop-filter: blur(8px) !important; -webkit-backdrop-filter: blur(8px) !important;
  border-bottom: 1px solid var(--border) !important;
}
/* 데스크톱 전용 사이징 — 풀블리드 바(라운드/그림자 제거). 스티키 제거(사용자 요청) → 일반 흐름.
   ★스티키+음수마진이 배너 padding-top(헤더↔ADBOX 갭)을 시각적으로 먹던 원인이었음. static 으로 해결. */
@media (min-width: 769px) {
  body.rd2 .header {
    position: static !important;
    height: 52px !important;
    padding: 0 24px !important;
    gap: 18px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    /* ★위쪽 음수마진 제거! (sticky 없인 헤더가 화면 위로 잘려 올라감). 좌우만 음수(-20px)로 full-bleed 유지,
       상단 flush 는 main-content 의 padding-top:0(아래 규칙)으로 처리. 하단 0(갭은 배너 padding-top 28px). */
    margin: 0 calc(var(--space-5, 20px) * -1) 0 !important;
  }
  /* 헤더가 맨 위에 딱 붙게 — main-content 위쪽 패딩만 0 (좌우/아래 패딩은 유지) */
  body.rd2 .main-content { padding-top: 0 !important; }
  body.rd2 .header-left { max-width: 600px !important; }
}

/* 햄버거 토글 */
body.rd2 .toggle-sidebar { color: var(--text-secondary) !important; border-radius: 7px !important; }
body.rd2 .toggle-sidebar .material-symbols-outlined { font-size: 22px !important; }

/* 검색바 — .search-bar 를 보이는 박스로, 아이콘/입력/버튼 인라인 플로우 */
body.rd2 .search-bar {
  background: var(--sunken) !important;
  border: 1px solid #e8e8ee !important;
  border-radius: 9px !important;
  height: 38px !important;
  max-width: 560px !important;
  padding: 0 0 0 12px !important;
  overflow: hidden !important;
}
body.rd2 .search-bar-icon {
  position: static !important; left: auto !important; top: auto !important;
  transform: none !important; margin: 0 !important;
  font-size: 19px !important; color: var(--text-muted) !important;
}
body.rd2 .search-bar input {
  height: 100% !important;
  padding: 0 12px !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: #494d5a !important;
  font-size: 13px !important;
  min-width: 0 !important;
}
body.rd2 .search-bar input:focus { border-color: transparent !important; box-shadow: none !important; }
body.rd2 .search-bar button {
  position: static !important; right: auto !important; top: auto !important;
  transform: none !important;
  height: 100% !important;
  padding: 0 20px !important;
  border-radius: 0 !important;
  background: var(--primary) !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}

/* 상태 pill — 박스/구분선 없이 라벨+값 */
body.rd2 .header-limit-box {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  gap: 14px !important;
}
body.rd2 .header-limit-box .limit-text {
  font-size: 12px !important;
  color: var(--text-tertiary) !important;
  font-variant-numeric: tabular-nums !important;
}
body.rd2 .header-limit-box .limit-text strong { color: var(--text-primary) !important; font-weight: 600 !important; }
body.rd2 .header-limit-box .limit-divider { display: none !important; }

/* ADMIN(등급) 뱃지 — 실제 빨강+왕관을 프리뷰 보라 텍스트뱃지로 */
body.rd2 .user-grade-display {
  background: color-mix(in srgb, var(--primary) 10%, #fff) !important;
  border: none !important;
  border-radius: 5px !important;
  padding: 3px 7px !important;
  gap: 0 !important;
}
body.rd2 .user-grade-display .grade-display-icon { display: none !important; }
body.rd2 .user-grade-display .grade-display-name {
  color: var(--primary) !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: .02em !important;
}

/* LV / EXP — 버튼 박스 벗기고 프리뷰 텍스트로 */
body.rd2 .header-exp-btn {
  background: none !important;
  border: none !important;
  height: auto !important;
  padding: 0 !important;
  gap: 6px !important;
}
/* LV 배지 — 등급(ADMIN) 배지와 동일한 보라 pill (사용자 요청) */
body.rd2 .header-exp-btn .exp-level-badge {
  background: color-mix(in srgb, var(--primary) 10%, #fff) !important;
  color: var(--primary) !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  padding: 3px 7px !important;
  border-radius: 5px !important;
  letter-spacing: .02em !important;
}
:root[data-theme="dark"] body.rd2 .header-exp-btn .exp-level-badge {
  background: color-mix(in srgb, var(--primary) 22%, #161b22) !important;
  color: #c3bce0 !important;
}
/* EXP 텍스트 숨김(레벨만 노출) — 사용자 요청 */
body.rd2 .header-exp-btn .exp-text { display: none !important; }

/* 사용자 드롭다운 트리거 */
body.rd2 .user-dd-trigger {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
  gap: 6px !important;
  color: var(--text-primary) !important;
  font-weight: 600 !important;
  font-size: 12.5px !important;
}
body.rd2 .user-dd-trigger:hover { background: var(--sunken) !important; }
/* 열림 상태에서도 테두리 없이 배경 하이라이트만 (요청: 테두리 제거) */
body.rd2 .user-dd.open .user-dd-trigger { background: var(--sunken) !important; border-color: transparent !important; }
body.rd2 .user-dd-trigger .udd-name { color: var(--text-primary) !important; font-weight: 600 !important; }
body.rd2 .user-dd-trigger .udd-ic { font-size: 18px !important; color: var(--text-secondary) !important; }
body.rd2 .user-dd-trigger .udd-caret { font-size: 16px !important; color: var(--text-muted) !important; }

/* 아이콘 버튼 그룹 */
body.rd2 .header-icon-group .btn-icon {
  color: var(--text-tertiary) !important;
  border-radius: 7px !important;
  background: transparent !important;
  border: none !important;
}
body.rd2 .header-icon-group .btn-icon:hover { background: var(--sunken) !important; color: var(--text-secondary) !important; }
body.rd2 .header-icon-group .btn-icon .material-symbols-outlined { font-size: 20px !important; }


/* ============================================================
   (4) 툴바 버튼 — 프리뷰 값으로 컴팩트화
   대상: #groupFilterSelect / #selectAllMobileBtn(.btn-secondary) /
        .view-toggle-group(A·B타입, 뷰모드) / .toolbar-right .btn-primary(플레이스 추가)
   ============================================================ */

/* 일반 btn-primary 기본 톤(fallback) */
body.rd2 .btn-primary { background: var(--primary); border-radius: 8px; }

/* --- 전체 그룹 select --- */
body.rd2 #groupFilterSelect {
  height: 38px !important;
  min-height: 38px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 38px !important;
  min-width: 150px;
}

/* --- 전체선택 버튼 (.btn.btn-secondary) --- */
body.rd2 #selectAllMobileBtn {
  height: 38px !important;
  padding: 0 14px !important;
  border-radius: 8px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
}

/* --- 세그먼트 그룹 컨테이너 (A/B 타입, 뷰모드) --- */
body.rd2 .view-toggle-group {
  display: inline-flex !important;
  align-items: center !important;
  border-radius: 9px !important;
  padding: 3px !important;
  gap: 2px !important;
}

/* --- 세그먼트 내부 버튼 공통 --- */
body.rd2 .view-toggle-group .btn {
  height: auto !important;
  padding: 6px 14px !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
/* [2026-09-16] C타입이 늘어 토글+분석버튼 묶음이 카드 폭을 넘었다. 이 버튼만 좌우 패딩을 줄인다. */
body.rd2 .view-toggle-group .score-type-btn { padding: 6px 9px !important; font-size: 12px !important; }
body.rd2 .view-toggle-group .btn.active { border-radius: 6px !important; }

/* --- 플레이스 추가 (.btn.btn-primary) --- */
body.rd2 .toolbar-right .btn-primary {
  height: 38px !important;
  padding: 0 16px !important;
  border-radius: 8px !important;
  gap: 6px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 2px rgba(20,20,40,.1) !important;
}

/* --- hover 시 프리뷰처럼 들뜨지 않게(리프트 제거) --- */
body.rd2 .places-toolbar .btn:hover { transform: none !important; }
body.rd2 #selectAllMobileBtn:hover,
body.rd2 .view-toggle-group .btn:not(.active):hover { box-shadow: none !important; }
body.rd2 .view-toggle-group .btn.active:hover { box-shadow: 0 1px 2px rgba(20,20,40,.08) !important; }

/* ── 라이트 전용 색 ── */
html:not([data-theme="dark"]) body.rd2 #groupFilterSelect,
html:not([data-theme="dark"]) body.rd2 #selectAllMobileBtn {
  background: #fff !important;
  border: 1px solid #e2e2e8 !important;
  color: #3d4150 !important;
}
html:not([data-theme="dark"]) body.rd2 .view-toggle-group {
  background: var(--border-light) !important;
  border: 1px solid #e6e6ec !important;
}
html:not([data-theme="dark"]) body.rd2 .view-toggle-group .btn {
  background: none !important;
  color: #6b7080 !important;
}
html:not([data-theme="dark"]) body.rd2 .view-toggle-group .btn.active {
  background: #fff !important;
  color: var(--primary) !important;
  box-shadow: 0 1px 2px rgba(20,20,40,.08) !important;
}
html:not([data-theme="dark"]) body.rd2 .toolbar-right .btn-primary {
  background: var(--primary) !important;
  color: #fff !important;
}

/* ── 모바일: view-toggle-group/select 가 flex:1 로 늘어나도 컴팩트 유지(밸룬 방지) ── */
@media (max-width: 768px) {
  body.rd2 #groupFilterSelect,
  body.rd2 #selectAllMobileBtn,
  body.rd2 .toolbar-right .btn-primary { height: 38px !important; }
  body.rd2 .view-toggle-group { padding: 3px !important; gap: 2px !important; }
  body.rd2 .view-toggle-group .btn { padding: 6px 12px !important; font-size: 12.5px !important; }
  /* [2026-09-16] 좁은 화면은 자리가 더 없다. C타입이 늘어 분석버튼이 아래로 떨어지므로 더 줄인다. */
  body.rd2 .view-toggle-group .score-type-btn { padding: 6px 7px !important; font-size: 11.5px !important; }
}


/* ============================================================
   (5) 표시설정 토글 (display-toggle) — 프리뷰 대조
   컨테이너 배경/보더/패딩 제거(투명), 배지 28px 고정.
   ============================================================ */

body.rd2 .data-toggle-group {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* 라벨 '표시설정' : 12px / var(--text-tertiary) / 500, 배지그룹과 간격(gap 4 + margin 6 = 10px) */
body.rd2 .data-toggle-group .toggle-label {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--text-tertiary) !important;
  margin-right: 6px !important;
}

/* 배지 래퍼 라벨 */
body.rd2 .data-toggle-group .toggle-switch-label {
  display: inline-flex !important;
  align-items: center !important;
  cursor: pointer !important;
}

/* 체크박스 숨김 */
body.rd2 .data-toggle-group .toggle-switch-label input {
  display: none !important;
}

/* 배지(span) 공통 — 컴팩트 고정 */
body.rd2 .data-toggle-group .toggle-switch-label span {
  min-width: 28px !important;
  height: 28px !important;
  padding: 0 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: background .12s ease, color .12s ease, border-color .12s ease !important;
}

/* 꺼짐 상태 (라이트) */
html:not([data-theme="dark"]) body.rd2 .data-toggle-group .toggle-switch-label span {
  background: #fff !important;
  color: var(--text-muted) !important;
  border: 1px solid #e2e2e8 !important;
}

/* 켜짐 상태 (라이트) — dashboard-premium.css 의 gradient !important 덮기 */
html:not([data-theme="dark"]) body.rd2 .data-toggle-group .toggle-switch-label input:checked + span {
  background: color-mix(in srgb, var(--primary) 10%, #fff) !important;
  color: var(--primary) !important;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, #fff) !important;
  font-weight: 600 !important;
}

/* hover — 미세한 강조만 (opacity 잔재 제거) */
body.rd2 .data-toggle-group .toggle-switch-label:hover span {
  opacity: 1 !important;
}
html:not([data-theme="dark"]) body.rd2 .data-toggle-group .toggle-switch-label:hover span {
  border-color: #d4d4dc !important;
}

/* focus 링 제거(프리뷰엔 없음) */
body.rd2 .data-toggle-group .toggle-switch-label input:focus + span {
  box-shadow: none !important;
  outline: none !important;
}

/* 모바일 — 컴팩트 유지 */
@media (max-width: 768px) {
  body.rd2 .data-toggle-group {
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    width: 100% !important;
    gap: 4px !important;
  }
  body.rd2 .data-toggle-group .toggle-label {
    white-space: nowrap !important;
    margin-right: auto !important;
  }
  body.rd2 .data-toggle-group .toggle-switch-label {
    flex-shrink: 0 !important;
  }
  body.rd2 .data-toggle-group .toggle-switch-label span {
    min-width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
  }
}


/* ============================================================
   (6) KPI / 헤딩 (hero) — 프리뷰 픽셀 매칭
   ============================================================ */

/* ── 헤딩 정렬: 제목·KPI그리드가 같은 좌측선에 정렬(들여쓰기 0) ── */
body.rd2 .hero-section { padding: 0 !important; margin: 0 0 18px !important; background: transparent !important; border-bottom: none !important; }
body.rd2 .hero-section .hero-top { padding: 0 !important; }
body.rd2 .hero-top { margin-bottom: 18px !important; }

/* ── 날짜 ── */
body.rd2 .hero-date {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--text-tertiary) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  margin-bottom: 6px !important;
}

/* ── 제목 (크기/weight 는 인라인 !important 로 잠겨 CSS 불가 → 색만) ── */
body.rd2 .dash-hero-title { color: var(--text-primary) !important; }
html:not([data-theme="dark"]) body.rd2 .hero-accent { color: var(--primary) !important; }

/* ── KPI 그리드 (PC 4열, 프리뷰 gap 14px) ── */
body.rd2 .hero-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 14px !important;
}

/* ── KPI 카드 ── */
html:not([data-theme="dark"]) body.rd2 .hero-kpi {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 1px 2px rgba(20,20,40,.03) !important;
}
body.rd2 .hero-kpi {
  border-radius: 11px !important;
  padding: 16px 18px 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  overflow: hidden !important;
}
body.rd2 .hero-kpi:hover { transform: none !important; box-shadow: 0 1px 2px rgba(20,20,40,.03) !important; }
html:not([data-theme="dark"]) body.rd2 .hero-kpi:hover { border-color: var(--border) !important; }

/* ── 라벨 (아이콘은 saas 에서 이미 숨김) ── */
html:not([data-theme="dark"]) body.rd2 .hero-kpi .kpi-label,
html:not([data-theme="dark"]) body.rd2 .hero-kpi .kpi-label-text {
  color: #6b7080 !important;
}
body.rd2 .hero-kpi .kpi-label,
body.rd2 .hero-kpi .kpi-label-text {
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: -.01em !important;
}

/* ── 숫자 ── */
body.rd2 .hero-kpi .kpi-value {
  display: flex !important;
  align-items: baseline !important;
  gap: 4px !important;
  margin-top: 0 !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  letter-spacing: -.01em !important;
  line-height: 1.1 !important;
  font-variant-numeric: tabular-nums !important;
  font-family: 'Pretendard', -apple-system, sans-serif !important;
}
html:not([data-theme="dark"]) body.rd2 .hero-kpi .kpi-value { color: var(--text-primary) !important; }

/* ── 단위 ── */
body.rd2 .hero-kpi .kpi-unit {
  font-size: 12px !important;
  font-weight: 400 !important;
  letter-spacing: normal !important;
}
html:not([data-theme="dark"]) body.rd2 .hero-kpi .kpi-unit { color: #787e8b !important; }

/* ── 스파크라인 ── */
body.rd2 .hero-kpi .kpi-spark {
  width: 100% !important;
  height: 42px !important;
  margin-top: 0 !important;
  display: block !important;
  overflow: hidden !important;
  opacity: 1 !important;
}

/* KPI별 프리뷰 색 (아이콘 클래스로 매칭; 마크업엔 data-kpi 없음) */
body.rd2 .hero-kpi:has(.kpi-ico-ok)      { --kpi-accent: #6B6198; }
body.rd2 .hero-kpi:has(.kpi-ico-up)      { --kpi-accent: #E74C3C; }
body.rd2 .hero-kpi:has(.kpi-ico-down)    { --kpi-accent: #3498DB; }
body.rd2 .hero-kpi:has(.kpi-ico-primary) { --kpi-accent: var(--primary); }
/* JS 는 setAttribute('stroke'/'fill') = presentation attribute → CSS 가 승리 */
body.rd2 .hero-kpi .kpi-spark polyline {
  stroke: var(--kpi-accent, var(--primary)) !important;
  stroke-width: 2 !important;
  fill: none !important;
}
body.rd2 .hero-kpi .kpi-spark polygon {
  fill: var(--kpi-accent, var(--primary)) !important;
  opacity: .08 !important;
  stroke: none !important;
}
body.rd2 .hero-kpi .kpi-spark circle { opacity: 0 !important; fill: transparent !important; stroke: none !important; }

/* 모바일 (2열 유지) */
@media (max-width: 768px) {
  body.rd2 .hero-section { margin-bottom: 12px !important; }
  body.rd2 .hero-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  body.rd2 .hero-kpi { padding: 14px 14px 0 !important; gap: 6px !important; border-radius: 11px !important; }
  body.rd2 .hero-kpi .kpi-value { font-size: 20px !important; }
  body.rd2 .hero-kpi .kpi-label,
  body.rd2 .hero-kpi .kpi-label-text { font-size: 12px !important; }
  body.rd2 .hero-kpi .kpi-unit { font-size: 11px !important; }
  body.rd2 .hero-kpi .kpi-spark { height: 30px !important; }
}


/* ============================================================
   (7) 플레이스 카드 — 헤더/메타 (dashboard.js 렌더)
   ★캘린더 셀(.calendar-cell 등)은 이미 일치 → 절대 안 건드림.
   ★레이아웃(flex/grid/방향)은 유지, 색·크기·뱃지·정렬만 코스메틱.
   [취소] 키워드 칩 → 원래 콤마 텍스트로(사용자 지시). kw-chip 스타일 없음.
   ============================================================ */

/* 매장명: 14.5px / 700 / var(--text-primary) (기존 15px var(--text-md) !important 덮음) */
html:not([data-theme="dark"]) body.rd2 .place-name {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  letter-spacing: -.01em;
}

/* 카테고리: 뱃지배경 없는 플레인 텍스트 #6b7080 (인라인 10px/padding 덮음) */
html:not([data-theme="dark"]) body.rd2 .category-badge {
  background: transparent !important;
  color: #6b7080 !important;
  font-weight: 500 !important;
  font-size: 12px !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* [수정] 보라 pill 제거 → 순위 배지를 빨강(상승)/파랑(하락) stat-change pill로 전 뷰 통일(사용자 요청).
   .place-rank 는 단순 flex 컨테이너로만 두고, 색/배경은 내부 stat-change 가 담당. */
html:not([data-theme="dark"]) body.rd2 .place-rank {
  display: inline-flex !important;
  align-self: center;
  background: transparent !important;
  padding: 0 !important;
}
/* 상승/하락 배지 = 전 뷰 통일(크기 13px · 굵기 600 · 박스 동일). 뷰마다 base/모바일override로 달라지던 것 고정. */
body.rd2 .stat-change { font-size: 13px !important; font-weight: 600 !important; padding: 2px 7px !important; }
/* [모바일 전용] 테이블뷰·그래프뷰에서만 키워드·검색량 줄(h4) 위 여백 — 헤더와 붙는 것 완화. 캘린더뷰/데스크톱은 안 건드림. */
@media (max-width: 768px) {
  body.rd2 .rank-history-container > h4.view-table,
  body.rd2 .rank-history-container > h4.view-graph,
  body.rd2 .place-history-grid > h4.view-table,
  body.rd2 .place-history-grid > h4.view-graph { margin-top: 16px !important; }
}

/* 헤더 날짜(card-hdr-time): var(--text-tertiary) / 12px / tabular-nums (인라인 11px 덮음) */
html:not([data-theme="dark"]) body.rd2 .card-hdr-time {
  color: #787e8b !important;
  font-size: 12px !important;
  font-variant-numeric: tabular-nums;
}

/* 검색키워드(그룹): place-keyword 첫 span — 14.5px / 700 / var(--text-primary) */
html:not([data-theme="dark"]) body.rd2 .place-keyword > span:first-child {
  font-size: 14.5px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
}

/* 카운트 h4 (PC/모바일/상점 + fa-tag + 키워드 콤마텍스트).
   그리드카드는 .place-history-grid > h4, 그 외 .rank-history-container > h4 */
body.rd2 .rank-history-container > h4,
body.rd2 .place-history-grid > h4 {
  font-size: 12.5px;
  color: var(--text-primary);
}
/* 카운트 숫자: 프리뷰 var(--text-primary) (인라인 color:var(--primary) 덮음) */
html:not([data-theme="dark"]) body.rd2 .rank-history-container > h4 > span > span,
html:not([data-theme="dark"]) body.rd2 .place-history-grid > h4 > span > span {
  color: #3d4150 !important;
  font-weight: 600 !important;
  font-size: 12.5px;
}
/* 카운트 아이콘 + fa-tag: var(--text-muted) (인라인 var(--text-secondary) 덮음) */
html:not([data-theme="dark"]) body.rd2 .rank-history-container > h4 > span > i,
html:not([data-theme="dark"]) body.rd2 .rank-history-container > h4 > i.fa-tag,
html:not([data-theme="dark"]) body.rd2 .place-history-grid > h4 > span > i,
html:not([data-theme="dark"]) body.rd2 .place-history-grid > h4 > i.fa-tag {
  color: var(--text-muted) !important;
}
/* 키워드 콤마 텍스트(칩 아님, 유지): #4a4f5c */
html:not([data-theme="dark"]) body.rd2 .rank-history-container > h4 > span.capture-target-keyword,
html:not([data-theme="dark"]) body.rd2 .place-history-grid > h4 > span.capture-target-keyword {
  color: #4a4f5c;
}

/* 모바일 (place cards) — 실제앱 브레이크포인트(768px) 컴팩트 복원.
   body.rd2 스코프가 앱의 모바일 !important(11~13px)을 이겨버리므로 재선언 필수 */
@media (max-width: 768px) {
  body.rd2 .place-name { font-size: 13px !important; }
  body.rd2 .place-keyword > span:first-child { font-size: 11px !important; }
  body.rd2 .category-badge {
    font-size: 11px !important;
    max-width: 92px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* card-hdr-time 은 앱 규칙(display:none !important)으로 모바일 숨김 유지 — 건드리지 않음 */
  body.rd2 .place-rank { padding: 0 !important; }
}


/* ============================================================
   (8) 다크모드 — data-theme 는 <html>에 붙음. body.rd2 와 조합.
   전 구간(베이스~플레이스카드) 다크 오버라이드를 여기 일괄.
   레이아웃 안 건드림, 색만.
   ============================================================ */

/* --- 베이스 --- */
:root[data-theme="dark"] body.rd2 .main-content { background: #0d1117 !important; }

/* --- 사이드바 --- */
:root[data-theme="dark"] body.rd2 .sidebar { background: #161b22 !important; border-right: 1px solid #30363d !important; }
:root[data-theme="dark"] body.rd2 .sidebar .sidebar-header { border-bottom: 1px solid #21262d !important; }
:root[data-theme="dark"] body.rd2 .sidebar-brand-link { color: #f0f3f6 !important; }
:root[data-theme="dark"] body.rd2 .sidebar-brand-sub { color: #7d828e !important; }
:root[data-theme="dark"] body.rd2 .sidebar .nav-group-title { color: #6e7681 !important; }
:root[data-theme="dark"] body.rd2 .sidebar .nav-item { color: #b0b8c1 !important; }
:root[data-theme="dark"] body.rd2 .sidebar .nav-item:hover { background: #21262d !important; color: #f0f3f6 !important; }
:root[data-theme="dark"] body.rd2 .sidebar .nav-item.active,
:root[data-theme="dark"] body.rd2 .sidebar .nav-item.active:hover {
  color: #b9b2e0 !important; font-weight: 600 !important;
  background: color-mix(in srgb, var(--primary) 22%, #161b22) !important;
  border-left: 0 !important; border-radius: 10px !important;
}
:root[data-theme="dark"] body.rd2 .sidebar .nav-item.active .nav-icon,
:root[data-theme="dark"] body.rd2 .sidebar .nav-item.active .nav-icon .material-symbols-outlined { color: #b9b2e0 !important; }
:root[data-theme="dark"] body.rd2 .sidebar .nav-item-admin,
:root[data-theme="dark"] body.rd2 .sidebar .nav-item-admin:hover { color: #b0b8c1 !important; }
:root[data-theme="dark"] body.rd2 .sidebar .nav-item-admin .nav-icon,
:root[data-theme="dark"] body.rd2 .sidebar .nav-item-admin .nav-icon .material-symbols-outlined { color: inherit !important; }
:root[data-theme="dark"] body.rd2 .sidebar .sidebar-admin-section { border-top: 1px solid #21262d !important; }
:root[data-theme="dark"] body.rd2 .sidebar .admin-badge,
:root[data-theme="dark"] body.rd2 .sidebar .nav-item-admin .admin-badge { color: #8b949e !important; background: #21262d !important; border: none !important; }

/* --- 탑바 --- */
:root[data-theme="dark"] body.rd2 .header { background: rgba(22,27,34,.98) !important; border-bottom-color: #30363d !important; }
:root[data-theme="dark"] body.rd2 .search-bar { background: #0d1117 !important; border-color: #30363d !important; }
:root[data-theme="dark"] body.rd2 .search-bar input { color: #e6edf3 !important; }
:root[data-theme="dark"] body.rd2 .header-limit-box .limit-text { color: var(--text-secondary) !important; }
:root[data-theme="dark"] body.rd2 .header-limit-box .limit-text strong { color: #f0f3f6 !important; }
:root[data-theme="dark"] body.rd2 .user-grade-display { background: color-mix(in srgb, var(--primary) 22%, #161b22) !important; }
:root[data-theme="dark"] body.rd2 .user-grade-display .grade-display-name { color: #b9b2e0 !important; }
:root[data-theme="dark"] body.rd2 .user-dd-trigger { background: transparent !important; border-color: transparent !important; color: #f0f3f6 !important; }
:root[data-theme="dark"] body.rd2 .user-dd-trigger .udd-name { color: #f0f3f6 !important; }
:root[data-theme="dark"] body.rd2 .header-icon-group .btn-icon:hover { background: #21262d !important; color: #f0f3f6 !important; }

/* --- 툴바 버튼 --- */
:root[data-theme="dark"] body.rd2 #groupFilterSelect,
:root[data-theme="dark"] body.rd2 #selectAllMobileBtn {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
}
:root[data-theme="dark"] body.rd2 .view-toggle-group {
  background: var(--dark-bg) !important;
  border: 1px solid var(--border) !important;
}
:root[data-theme="dark"] body.rd2 .view-toggle-group .btn { color: var(--text-secondary) !important; }
:root[data-theme="dark"] body.rd2 .view-toggle-group .btn.active {
  background: var(--card-bg) !important;
  color: #b9b2e0 !important;
}

/* --- 표시설정 토글 --- */
:root[data-theme="dark"] body.rd2 .data-toggle-group .toggle-switch-label span {
  background: #161b22 !important;
  color: #8b909c !important;
  border: 1px solid #2a2f3a !important;
}
:root[data-theme="dark"] body.rd2 .data-toggle-group .toggle-switch-label input:checked + span {
  background: color-mix(in srgb, var(--primary) 22%, #161b22) !important;
  color: #b3a9e0 !important;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, #161b22) !important;
  font-weight: 600 !important;
}

/* --- KPI / 헤딩 (hero) --- */
:root[data-theme="dark"] body.rd2 .hero-date { color: #8b949e !important; }
:root[data-theme="dark"] body.rd2 .dash-hero-title { color: #f0f3f6 !important; }
:root[data-theme="dark"] body.rd2 .hero-kpi {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
  box-shadow: none !important;
}
:root[data-theme="dark"] body.rd2 .hero-kpi:hover { border-color: #3a3d44 !important; box-shadow: none !important; }
:root[data-theme="dark"] body.rd2 .hero-kpi .kpi-label,
:root[data-theme="dark"] body.rd2 .hero-kpi .kpi-label-text { color: #8b949e !important; }
:root[data-theme="dark"] body.rd2 .hero-kpi .kpi-value { color: #f0f3f6 !important; }
:root[data-theme="dark"] body.rd2 .hero-kpi .kpi-unit { color: #8b949e !important; }
:root[data-theme="dark"] body.rd2 .hero-kpi .kpi-spark polygon { opacity: .14 !important; }

/* --- 플레이스 카드 --- */
:root[data-theme="dark"] body.rd2 .place-name { color: #f0f3f6 !important; font-size: 14.5px !important; font-weight: 700 !important; letter-spacing: -.01em; }
:root[data-theme="dark"] body.rd2 .category-badge { background: transparent !important; color: #8b929e !important; font-weight: 500 !important; font-size: 12px !important; padding: 0 !important; border-radius: 0 !important; }
:root[data-theme="dark"] body.rd2 .place-rank {
  display: inline-flex !important; align-self: center;
  background: transparent !important; padding: 0 !important;
}
:root[data-theme="dark"] body.rd2 .card-hdr-time { color: #8b929e !important; font-size: 12px !important; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] body.rd2 .place-keyword > span:first-child { color: #f0f3f6 !important; font-size: 14.5px !important; font-weight: 700 !important; }
:root[data-theme="dark"] body.rd2 .rank-history-container > h4 > span > span,
:root[data-theme="dark"] body.rd2 .place-history-grid > h4 > span > span { color: #e6e8eb !important; font-weight: 600 !important; font-size: 12.5px; }
:root[data-theme="dark"] body.rd2 .rank-history-container > h4 > span > i,
:root[data-theme="dark"] body.rd2 .rank-history-container > h4 > i.fa-tag,
:root[data-theme="dark"] body.rd2 .place-history-grid > h4 > span > i,
:root[data-theme="dark"] body.rd2 .place-history-grid > h4 > i.fa-tag { color: #6e7681 !important; }
:root[data-theme="dark"] body.rd2 .rank-history-container > h4 > span.capture-target-keyword,
:root[data-theme="dark"] body.rd2 .place-history-grid > h4 > span.capture-target-keyword { color: #adb5bd; }

/* ============================================================
   (9) 추가 픽스 — 보라 카드 테두리 제거 + ADBOX 버튼 프리뷰 매칭
   플레이스 카드는 .data-table 행이라 dashboard.css 가 var(--primary)(보라) !important
   테두리를 그린다. 프리뷰=연회색. 원본보다 높은 명시도(+html:not)로 이긴다.
   ============================================================ */

/* --- 라이트: 플레이스 카드(.data-table 행) 보라 테두리 → 연회색 --- */
html:not([data-theme="dark"]) body.rd2 .data-table tbody tr:not(.is-expanded):not(.rank-history-row):not(.empty-result-row) td,
html:not([data-theme="dark"]) body.rd2 .data-table tbody tr:not(.is-expanded):not(.rank-history-row):not(.empty-result-row) td:first-child,
html:not([data-theme="dark"]) body.rd2 .data-table tbody tr:not(.is-expanded):not(.rank-history-row):not(.empty-result-row) td:last-child,
html:not([data-theme="dark"]) body.rd2 .data-table tbody tr:not(.is-expanded):not(.rank-history-row):not(.empty-result-row):first-child td,
html:not([data-theme="dark"]) body.rd2 .data-table tr.is-expanded td,
html:not([data-theme="dark"]) body.rd2 .data-table tr.is-expanded td:first-child,
html:not([data-theme="dark"]) body.rd2 .data-table tr.is-expanded td:last-child {
  border-color: var(--border) !important;
}

/* --- 다크: 동일 셀렉터, 다크 테두리 --- */
:root[data-theme="dark"] body.rd2 .data-table tbody tr:not(.is-expanded):not(.rank-history-row):not(.empty-result-row) td,
:root[data-theme="dark"] body.rd2 .data-table tbody tr:not(.is-expanded):not(.rank-history-row):not(.empty-result-row) td:first-child,
:root[data-theme="dark"] body.rd2 .data-table tbody tr:not(.is-expanded):not(.rank-history-row):not(.empty-result-row) td:last-child,
:root[data-theme="dark"] body.rd2 .data-table tbody tr:not(.is-expanded):not(.rank-history-row):not(.empty-result-row):first-child td,
:root[data-theme="dark"] body.rd2 .data-table tr.is-expanded td,
:root[data-theme="dark"] body.rd2 .data-table tr.is-expanded td:first-child,
:root[data-theme="dark"] body.rd2 .data-table tr.is-expanded td:last-child {
  border-color: #30363d !important;
}

/* --- ADBOX 버튼 → 프리뷰 고스트(흰배경+보라테두리+보라글씨) --- */
body.rd2 #mainBannerSection .adbox-btn,
body.rd2 #mainBannerSection .adbox-btn-primary,
body.rd2 .adbox .adbox-btn,
body.rd2 .adbox .adbox-btn-primary {
  background: #fff !important; color: var(--primary) !important;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, #fff) !important;
  font-weight: 600 !important; box-shadow: none !important;
}
:root[data-theme="dark"] body.rd2 #mainBannerSection .adbox-btn,
:root[data-theme="dark"] body.rd2 #mainBannerSection .adbox-btn-primary,
:root[data-theme="dark"] body.rd2 .adbox .adbox-btn,
:root[data-theme="dark"] body.rd2 .adbox .adbox-btn-primary {
  background: #161b22 !important; color: #b9b2e0 !important;
  border-color: color-mix(in srgb, var(--primary) 40%, #161b22) !important;
}


/* ============================================================
   (10) polish 잔여 — ADBOX 배너 컨테이너/버튼 모서리·색 (프리뷰 매칭)
   프리뷰(promo)는 accent 6% 틴트 배너 + radius 11px + padding 13px 18px,
   버튼은 흰배경 고스트 + radius 8px + padding 7px 14px.
   실제 마크업 인라인(#mainBannerSection .adbox{radius12/pad11 16},
   .adbox-btn{radius999/pad6 14})은 !important 없음 → !important 로 승리.
   ★툴바 버튼(전체그룹/전체선택/플레이스추가)·KPI 카드는 (4)·(6)에서 이미
     매칭됨(중복 회피). 여기선 ADBOX만 마저 맞춘다.
   ============================================================ */

/* --- 컨테이너: 라운드/패딩 (공통) --- */
body.rd2 #mainBannerSection .adbox {
  border-radius: 11px !important;
  padding: 13px 18px !important;
  box-shadow: none !important;
}
/* 라이트: 박스 안 순백 + 중립 회색 테두리(사용자 요청 "박스 안 희게") */
html:not([data-theme="dark"]) body.rd2 #mainBannerSection .adbox,
html:not([data-theme="dark"]) body.rd2 .adbox {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
}
html:not([data-theme="dark"]) body.rd2 #mainBannerSection .adbox-msg,
html:not([data-theme="dark"]) body.rd2 .adbox .adbox-msg {
  color: #3d4150 !important;
}
/* 다크: 어두운 카드 톤 + 중립 테두리(다크에서 잘 적응). ★#mainBannerSection(dashboard) + 공유 .adbox(타 페이지) 공통 */
:root[data-theme="dark"] body.rd2 #mainBannerSection .adbox,
:root[data-theme="dark"] body.rd2 .adbox {
  background: #161b22 !important;
  border: 1px solid #30363d !important;
}
:root[data-theme="dark"] body.rd2 #mainBannerSection .adbox-msg,
:root[data-theme="dark"] body.rd2 .adbox .adbox-msg {
  color: #e6edf3 !important;
}

/* --- 버튼: pill(999px) → 프리뷰 radius 8px + padding 7px 14px + 12.5px --- */
body.rd2 #mainBannerSection .adbox-btn,
body.rd2 #mainBannerSection .adbox-btn-primary,
body.rd2 .adbox .adbox-btn,
body.rd2 .adbox .adbox-btn-primary {
  border-radius: 8px !important;
  padding: 7px 14px !important;
  font-size: 12.5px !important;
}

/* 모바일(≤640px): 인라인 컴팩트 패딩 복원(밸룬 방지) */
@media (max-width: 640px) {
  body.rd2 #mainBannerSection .adbox { padding: 12px 14px !important; }
  body.rd2 #mainBannerSection .adbox-btn,
  body.rd2 #mainBannerSection .adbox-btn-primary {
    padding: 6px 10px !important;
  }
  /* 모바일에서 메시지 아래로 내려온 버튼 묶음(.adbox-actions: flex 1 1 100%)을 우측 정렬.
     dashboard.php 인라인(#mainBannerSection .adbox-actions=1,1,0)엔 justify 가 없어 좌측이었음 →
     body.rd2(1,2,1)로 flex-end.
     ★[2026-07-29] 타 페이지(전역 adbox.php의 .adbox)도 dashboard처럼 우측정렬되도록 셀렉터 확장. */
  body.rd2 #mainBannerSection .adbox-actions,
  body.rd2 .adbox .adbox-actions {
    justify-content: flex-end !important;
  }
}





/* ═══════════════════════════════════════════════════════════════
   (11) 잔여 픽스 2차 — 보라테두리(펼침컨테이너)/뱃지/세그먼트/검색개행
   ★스코프: 전 규칙 body.rd2 (대시보드에서만). ADBOX(구 10.4)와 ADBOX
     ≤640 미디어는 이미 (10) 섹션(라인 910~960)에 동일 규칙 존재 →
     중복이라 이 블록에서 제외함. (9)/(10) 유지, 여기선 신규분만.
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────
   11.1 purple-border — 펼침 캘린더 컨테이너 외곽선(.rank-history-container)
   dashboard.css 1451/1460/3296 의 var(--primary)!important 를
   라이트 var(--border) / 다크 #30363d 로 덮음. border-*-color 만 바꿔
   width/style(1px solid)은 원본 유지. 상단은 원본대로 none.
   명시도: 라이트(0,3,2)>원본(0,1,0) / 다크(0,4,1)>원본(0,2,0). 승리.
   ───────────────────────────────────────────────────────────── */
html:not([data-theme="dark"]) body.rd2 .rank-history-container {
  border-top-color: var(--border) !important;
  border-left-color: var(--border) !important;
  border-right-color: var(--border) !important;
  border-bottom-color: var(--border) !important;
}
:root[data-theme="dark"] body.rd2 .rank-history-container {
  border-top-color: #30363d !important;
  border-left-color: #30363d !important;
  border-right-color: #30363d !important;
  border-bottom-color: #30363d !important;
}

/* ─────────────────────────────────────────────────────────────
   11.2 display-badges — 표시설정 뱃지(방/블/저/N1/N2/N3)
   pill → radius 7px 각진 사각. 체크상태 = input:checked + span.
   dashboard-premium `input:checked + span`(0,2,2)!important 를
   라이트(0,5,4)/다크(0,6,3) 로 제압. 라이트/다크가 모든 상태 커버.
   ───────────────────────────────────────────────────────────── */
body.rd2 .data-toggle-group {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
body.rd2 .data-toggle-group .toggle-label {
  font-size: 12px !important;
  font-weight: 500 !important;
  color: var(--text-tertiary) !important;
  margin-right: 6px !important;
}
body.rd2 .data-toggle-group .toggle-switch-label {
  display: inline-flex !important;
  align-items: center !important;
  cursor: pointer !important;
}
body.rd2 .data-toggle-group .toggle-switch-label input {
  display: none !important;
}
body.rd2 .data-toggle-group .toggle-switch-label span {
  min-width: 28px !important;
  height: 28px !important;
  padding: 0 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: none !important;
  transition: background .12s ease, color .12s ease, border-color .12s ease !important;
}
body.rd2 .data-toggle-group .toggle-switch-label:hover span {
  opacity: 1 !important;
}
body.rd2 .data-toggle-group .toggle-switch-label input:focus + span {
  box-shadow: none !important;
  outline: none !important;
}
/* 라이트 */
html:not([data-theme="dark"]) body.rd2 .data-toggle-group .toggle-switch-label span {
  background: #fff !important;
  color: var(--text-muted) !important;
  border: 1px solid #e2e2e8 !important;
}
html:not([data-theme="dark"]) body.rd2 .data-toggle-group .toggle-switch-label input:checked + span {
  background: color-mix(in srgb, var(--primary) 10%, #fff) !important;
  color: var(--primary) !important;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, #fff) !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
html:not([data-theme="dark"]) body.rd2 .data-toggle-group .toggle-switch-label:hover span {
  border-color: #d4d4dc !important;
}
/* 다크 */
:root[data-theme="dark"] body.rd2 .data-toggle-group .toggle-switch-label span {
  background: #161b22 !important;
  color: #8b909c !important;
  border: 1px solid #2a2f3a !important;
}
:root[data-theme="dark"] body.rd2 .data-toggle-group .toggle-switch-label input:checked + span {
  background: color-mix(in srgb, var(--primary) 22%, #161b22) !important;
  color: #b3a9e0 !important;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, #161b22) !important;
  font-weight: 600 !important;
}

/* ─────────────────────────────────────────────────────────────
   11.3 segment-track — A타입/B타입·뷰모드 세그먼트 컨트롤
   .view-toggle-group > .btn(.score-type-btn|.view-toggle-btn).
   회색 트랙 안 알약 버튼. dashboard-premium 그라데이션 !important
   (`.view-toggle-group .btn.active`(0,3,0)) 를 (0,4,1) 로 제압.
   ───────────────────────────────────────────────────────────── */
body.rd2 .view-toggle-group {
  display: inline-flex !important;
  align-items: center !important;
  border-radius: 9px !important;
  padding: 3px !important;
  gap: 2px !important;
}
body.rd2 .view-toggle-group .btn {
  height: auto !important;
  padding: 6px 14px !important;
  border: none !important;
  border-radius: 6px !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}
/* [2026-09-16] C타입이 늘어 토글+분석버튼 묶음이 카드 폭을 넘었다. 이 버튼만 좌우 패딩을 줄인다. */
body.rd2 .view-toggle-group .score-type-btn { padding: 6px 9px !important; font-size: 12px !important; }
body.rd2 .view-toggle-group .btn.active { border-radius: 6px !important; }
body.rd2 .view-toggle-group .btn:not(.active):hover { box-shadow: none !important; }
body.rd2 .view-toggle-group .btn.active:hover { box-shadow: 0 1px 2px rgba(20,20,40,.08) !important; }
/* 라이트 */
html:not([data-theme="dark"]) body.rd2 .view-toggle-group {
  background: var(--border-light) !important;
  border: 1px solid #e6e6ec !important;
}
html:not([data-theme="dark"]) body.rd2 .view-toggle-group .btn {
  background: none !important;
  color: #6b7080 !important;
}
html:not([data-theme="dark"]) body.rd2 .view-toggle-group .btn.active {
  background: #fff !important;
  color: var(--primary) !important;
  box-shadow: 0 1px 2px rgba(20,20,40,.08) !important;
}
/* 다크 */
:root[data-theme="dark"] body.rd2 .view-toggle-group {
  background: var(--dark-bg) !important;
  border: 1px solid var(--border) !important;
}
:root[data-theme="dark"] body.rd2 .view-toggle-group .btn {
  background: none !important;
  color: var(--text-secondary) !important;
}
:root[data-theme="dark"] body.rd2 .view-toggle-group .btn.active {
  background: var(--card-bg) !important;
  color: #b9b2e0 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,.35) !important;
}

/* ─────────────────────────────────────────────────────────────
   11.4 search-wrap — 탑바 2줄 개행 방지 (데스크톱 1줄 강제, ≥769px)
   .search-bar 에 min-width:0 부재로 긴 placeholder가 shrink 방해 → 개행.
   데스크톱 전용: 검색바가 shrink 흡수, 액션 폭 보존. 모바일(≤768) wrap 보존.
   ───────────────────────────────────────────────────────────── */
@media (min-width: 769px) {
  body.rd2 .header {
    flex-wrap: nowrap !important;
  }
  body.rd2 .header-left {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  body.rd2 .search-bar {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 560px !important;
  }
  body.rd2 .search-bar input {
    min-width: 0 !important;
  }
  body.rd2 .header-actions {
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    min-width: 0 !important;
  }
}

/* ─────────────────────────────────────────────────────────────
   11.5 모바일(≤768px) 잔여 — 카드 tr 보라테두리 + 뱃지 + 세그먼트 컴팩트
   모바일 카드모드는 tr 자체에 border(4073 tr.is-expanded (0,3,1),
   4104 tr.rank-history-row (0,3,2))를 그림 → 여기서 tr-레벨로 덮음.
   (일반 행 td 테두리는 (9) 섹션이 전폭 커버.)
   ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* purple-border: 카드 외곽 tr-레벨 보라 테두리 덮기 */
  html:not([data-theme="dark"]) body.rd2 .data-table tr.is-expanded,
  html:not([data-theme="dark"]) body.rd2 .data-table tr.is-expanded + tr.rank-history-row,
  html:not([data-theme="dark"]) body.rd2 #places-section .data-table tbody tr.is-expanded:not(.rank-history-row) {
    border-color: var(--border) !important;
  }
  :root[data-theme="dark"] body.rd2 .data-table tr.is-expanded,
  :root[data-theme="dark"] body.rd2 .data-table tr.is-expanded + tr.rank-history-row,
  :root[data-theme="dark"] body.rd2 #places-section .data-table tbody tr.is-expanded:not(.rank-history-row) {
    border-color: #30363d !important;
  }

  /* display-badges: 컴팩트 유지, 우측 정렬 래핑 */
  body.rd2 .data-toggle-group {
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    width: 100% !important;
    gap: 4px !important;
  }
  body.rd2 .data-toggle-group .toggle-label {
    white-space: nowrap !important;
    margin-right: auto !important;
  }
  body.rd2 .data-toggle-group .toggle-switch-label {
    flex-shrink: 0 !important;
  }

  /* segment-track: flex 확장 시에도 컴팩트(밸룬 방지) */
  body.rd2 .view-toggle-group { padding: 3px !important; gap: 2px !important; }
  body.rd2 .view-toggle-group .btn { padding: 6px 12px !important; font-size: 12.5px !important; }
  /* [2026-09-16] 좁은 화면은 자리가 더 없다. C타입이 늘어 분석버튼이 아래로 떨어지므로 더 줄인다. */
  body.rd2 .view-toggle-group .score-type-btn { padding: 6px 7px !important; font-size: 11.5px !important; }
}


/* (12) 잔여 픽스 3차 */

/* ============================================================
   [header-pills] 탑바 우측 상태영역 간격/구분선 — 프리뷰 매칭
   그룹 간 18px, 그룹B(ADMIN·LV·EXP) 내부 8px, 한도그룹↔등급그룹
   사이 세로선 1개. 데스크톱(≥769px) 전용 — 모바일 wrap/카드 불변.
   ============================================================ */
@media (min-width: 769px) {
  /* 그룹 기본 간격 8px — saas.css .header-actions(0,1,0) gap:6px 를 (0,2,0) 로 제압 */
  body.rd2 .header-actions {
    gap: 8px !important;
  }

  /* 그룹 경계 → 18px (base 8 + margin 10) */
  body.rd2 .header-actions > .user-dd { margin-left: 10px !important; }
  body.rd2 .header-actions > .header-icon-group { margin-left: 10px !important; }
  /* 등급(ADMIN) ↔ 레벨(LV) 간격 넓힘 — base 8 + 8 = 16px (사용자 요청) */
  body.rd2 .header-actions > .header-exp-btn { margin-left: 8px !important; }

  /* 한도그룹 끝 세로 구분선 1개 (마크업 .limit-divider 는 rd2 251줄에서 숨김 유지).
     rd2 .header-limit-box 는 padding:0·투명(252줄)이라 ::after 가 한도그룹 우측
     경계선으로 렌더됨. inline-flex 이므로 flex 자식으로 정상 배치. — 라이트 */
  html:not([data-theme="dark"]) body.rd2 .header-actions .header-limit-box::after {
    content: "";
    flex: none;
    align-self: center;
    width: 1px;
    height: 20px;
    background: #e8e8ee;
    margin-left: 4px;
    margin-right: 10px;
  }

  /* 다크: 구분선 톤을 rd2 헤더 보더(#30363d)에 맞춤 */
  :root[data-theme="dark"] body.rd2 .header-actions .header-limit-box::after {
    content: "";
    flex: none;
    align-self: center;
    width: 1px;
    height: 20px;
    background: #30363d;
    margin-left: 4px;
    margin-right: 10px;
  }
}

/* ============================================================
   [action-icons] 카드/리스트 액션버튼(.action-buttons .btn-icon)
   padding 5 · radius 6 · 무배경/무테두리 · 18px · var(--text-muted) · gap 1
   hover bg #f2f2f5 + var(--primary)(삭제만 #d15b5b). 리스트·카드 공통.
   ★스코프: body.rd2 #places-section — 대시보드 모바일의 ID 셀렉터
     (#places-section .data-table .btn-icon = (1,2,0),
      td[data-label="관리"] .action-buttons = (1,3,2)) 를 이기려면
     ID 를 반드시 포함해야 함. 카드/리스트 모두 #places-section 하위.
   ============================================================ */
/* gap: 데스크톱 .data-table .action-buttons(0,2,0) 제압 */
body.rd2 #places-section .action-buttons {
  gap: 1px !important;
}
/* gap: 모바일 리스트 ID 경쟁자 td[data-label="관리"] .action-buttons(1,3,2) 제압 → (1,4,2) */
body.rd2 #places-section .data-table tbody td[data-label="관리"] .action-buttons {
  gap: 1px !important;
}

/* btn-icon 본체: (1,3,0) — 데스크톱 .data-table .btn-icon(0,2,0) +
   모바일 #places-section .data-table .btn-icon(1,2,0) 둘 다 제압 */
body.rd2 #places-section .action-buttons .btn-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 5px !important;
  border: none !important;
  border-radius: 6px !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  font-size: 18px !important;
  line-height: 1 !important;
  transition: background-color .12s ease, color .12s ease !important;
}

body.rd2 #places-section .action-buttons .btn-icon i,
body.rd2 #places-section .action-buttons .btn-icon svg {
  font-size: 18px !important;
  line-height: 1 !important;
}

body.rd2 #places-section .action-buttons .btn-icon:focus,
body.rd2 #places-section .action-buttons .btn-icon:focus:not(:focus-visible) {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* 라이트 */
html:not([data-theme="dark"]) body.rd2 #places-section .action-buttons .btn-icon {
  color: var(--text-muted) !important;
}
html:not([data-theme="dark"]) body.rd2 #places-section .action-buttons .btn-icon:hover {
  background: #f2f2f5 !important;
  background-color: #f2f2f5 !important;
  border-color: transparent !important;
  color: var(--primary) !important;
}
html:not([data-theme="dark"]) body.rd2 #places-section .action-buttons .btn-icon[title="삭제"]:hover {
  background: #f2f2f5 !important;
  background-color: #f2f2f5 !important;
  border-color: transparent !important;
  color: #d15b5b !important;
}

/* 다크 */
:root[data-theme="dark"] body.rd2 #places-section .action-buttons .btn-icon {
  color: #8b929e !important;
}
:root[data-theme="dark"] body.rd2 #places-section .action-buttons .btn-icon:hover {
  background: #21262d !important;
  background-color: #21262d !important;
  border-color: transparent !important;
  color: #a89ed4 !important;
}
:root[data-theme="dark"] body.rd2 #places-section .action-buttons .btn-icon[title="삭제"]:hover {
  background: #21262d !important;
  background-color: #21262d !important;
  border-color: transparent !important;
  color: #e07070 !important;
}

/* ============================================================
   [keyword-position] 카운트 + sell 아이콘 + 키워드 칩 메타행
   h4 를 flex+세로가운데, 상하 padding 12px 확보(좌우 인덴트 유지).
   (기존 rd2 718줄 h4 규칙과 상보적 — font/color 는 그쪽, 레이아웃은 여기)
   ============================================================ */
body.rd2 .rank-history-container > h4,
body.rd2 .place-history-grid > h4 {
  /* [수정] display:flex → block: flex+flex-wrap이면 자식(키워드 span)이 flex 아이템 1개로 통째 취급돼
     줄1에 자리가 남아도 통째로 줄2로 내려감(키워드 display:inline 도 flex 안에선 무시됨).
     block 으로 바꿔 지표(inline-flex)·아이콘·키워드가 인라인으로 흐름 → 키워드가 지표 뒤에 붙고 콤마마다 자연 줄바꿈 */
  display: block;
  line-height: 1.4;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

body.rd2 .rank-history-container > h4 > span.capture-target-keyword,
body.rd2 .place-history-grid > h4 > span.capture-target-keyword {
  /* [수정] inline-flex → inline: 예전 '칩 여러개'용 flex-wrap 잔재. 지금은 콤마 텍스트 한 덩어리라
     inline-flex면 flex 아이템 1개로 취급돼 콤마마다 안 쪼개지고 통째로 개행됨. inline 으로 자연 줄바꿈 */
  display: inline;
}

/* ============================================================
   [search-button] 탑바 '검색' 버튼 텍스트 2줄 개행 방지(1줄 강제)
   body.rd2 .search-bar button (0,2,1) > .search-bar button (0,1,1) 제압
   ============================================================ */
body.rd2 .search-bar button {
  white-space: nowrap !important;
  flex: none !important;
  min-width: auto !important;
  width: auto !important;
  padding: 0 20px !important;
  line-height: 1 !important;
  word-break: keep-all !important;
}

/* ============================================================
   [remove-checkbox] 툴바 아래 단독 전체선택 체크박스 제거
   thead #selectAllCheckbox 만. 카드 개별 .place-checkbox 는 불변.
   ============================================================ */
body.rd2 th.th-checkbox #selectAllCheckbox {
  display: none !important;
}
body.rd2 table.data-table thead th.th-checkbox {
  padding: 0 !important;
  width: 0 !important;
}

/* ============================================================
   [outer-container] 툴바+플레이스카드 감싸는 바깥 카드 제거
   프리뷰처럼 카드들이 회색 배경 위에 바로 뜨도록.
   개별 카드(.data-table 행)·KPI(.hero-section)는 불변.
   dashboard-premium .tabs-container(0,1,0)!important 를
   body.rd2 #places-section .tabs-container(1,2,0)!important 로 제압.
   ============================================================ */
body.rd2 #places-section .tabs-container {
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-bottom: 0 !important;
}
body.rd2 #places-section.section {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 !important;
}

/* ============================================================
   모바일(≤768px) — 잔여 픽스 3차 통합
   ============================================================ */
@media (max-width: 768px) {
  /* action-icons: 6버튼이 좁은 폭에 들어오도록 축소.
     ID 경쟁자(#places-section .data-table .btn-icon (1,2,0),
     3667줄 .data-table .btn-icon (0,2,0)) 를 (1,3,0) 로 제압 —
     base 와 동일 명시도이나 소스순서상 뒤라 승리. */
  body.rd2 #places-section .action-buttons .btn-icon {
    padding: 4px !important;
    font-size: 16px !important;
    width: auto !important;
    height: auto !important;
    border: none !important;
  }
  body.rd2 #places-section .action-buttons .btn-icon i,
  body.rd2 #places-section .action-buttons .btn-icon svg {
    font-size: 16px !important;
  }

  /* keyword-position: 앱 컴팩트 규칙(padding:0)과 정합되게 세로 padding 원복 */
  body.rd2 .rank-history-container > h4,
  body.rd2 .place-history-grid > h4 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    row-gap: 4px;
  }

  /* search-button: 모바일에서도 1줄 유지 */
  body.rd2 .search-bar button {
    white-space: nowrap !important;
    flex: none !important;
    min-width: auto !important;
    padding: 0 16px !important;
  }

  /* remove-checkbox: 모바일에서도 단독 전체선택 숨김 */
  body.rd2 th.th-checkbox #selectAllCheckbox {
    display: none !important;
  }

  /* outer-container: 모바일에서도 바깥 컨테이너 없이 유지
     ( .tabs-container 모바일 padding(0,1,0) 을 (1,2,0) 로 제압 ) */
  body.rd2 #places-section .tabs-container {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  body.rd2 #places-section.section {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
  }
}

/* (13a) 다크모드 키워드 칩 — 인라인 라이트(#f4f4f7/#4a4f5c) 를 !important 로 덮음 */
:root[data-theme="dark"] body.rd2 .kw-chip { background: #21262d !important; color: #b0b8c1 !important; }


/* (14) 간격/크기 미세조정 4차 */
/* ============================================================
   redesign-v2.css 말미 append 블록. 4개 이슈 합성:
   action-icon-size / adbox-topbar-gap / toolbar-card-gap / card-card-gap
   전부 body.rd2 스코프. 데스크톱(≥769px)·모바일(≤768px)·라이트/다크 공용
   (색 토큰 미변경 → 다크모드 안전). 순수 CSS-only, 마크업/JS 변경 없음.
   ============================================================ */

/* ── 데스크톱 전용(≥769px) 묶음 ─────────────────────────────── */
@media (min-width: 769px) {

  /* [action-icon-size] → 섹션(15)로 이전. 액션버튼이 Material 스팬으로 바뀌었고(데스크톱/모바일·리스트뷰 공용)
     사이징을 미디어쿼리 밖에서 처리해야 해서 여기선 비움. */

  /* [adbox-topbar-gap] 탑바(.header) ↔ ADBOX(.banner-section-wrapper) 세로 갭 축소.
     헤더 하단마진 20→12(line 204 shorthand 의 top/right 음수 flush 유지),
     배너 상단 8→0·하단 20→12(saas.css:124). → 세로 갭 ≈12px.
     html body.rd2 (0,2,2) 로 원본(0,2,1 / 0,1,0) 제압. 데스크톱 한정:
     header full-bleed 음수마진은 데스크톱에서만 걸리므로 모바일 카드 헤더 불변. */
  /* ★헤더↔콘텐츠 일반 갭 20px — 모든 rd2 페이지 공통. sticky 제거 후 static 이라 margin-bottom 이
     정상 작동함(전엔 sticky+음수마진이 먹었음). dashboard 는 밑에 ADBOX, 다른 페이지는 첫 콘텐츠 → 어디서나 20px. */
  html body.rd2 .main-content > .header,
  html body.rd2 .header {
    margin-bottom: 20px !important;
  }
  /* ★헤더↔ADBOX 갭: margin-top 은 헤더(sticky+음수마진)와 margin-collapse 로 계속 먹혀서 안 벌어짐.
     → 배너 wrapper 의 'padding-top' 으로 준다(padding 은 collapse 불가·sticky 무관 = 100% 확실).
     wrapper 배경 투명이라 이 패딩이 헤더와 흰 ADBOX 박스 사이 순수 여백으로 보임.
     saas.css:125 `.banner-section-wrapper{padding:0}` 는 (0,1,0), 여기는 (1,2,3) 이라 이김. */
  /* 배너(#mainBannerSection)만 스코프 — '.header + *'(일반) 제거해서 다른 페이지 첫 콘텐츠 마진 안 건드림.
     갭은 위 헤더 margin-bottom:20px 가 담당. */
  html body.rd2 #mainBannerSection.banner-section-wrapper,
  html body.rd2 .banner-section-wrapper {
    margin-top: 0 !important;
    margin-bottom: 18px !important;
    /* padding-top(헤더↔ADBOX 갭)은 dashboard.php 인라인 <style> 단일소스로 이관.
       (redesign-v2.css 미업로드/캐시 시에도 확실히 먹게 — 인라인은 문서와 함께 로드됨) */
  }
}

/* ── 공용(데스크톱·모바일) ─────────────────────────────────── */

/* [toolbar-card-gap] 툴바(전체선택 행) ↔ 첫 플레이스 카드 간격 축소.
   갭 소스 2개:
   (1) dashboard.css:2799 .places-toolbar { margin-bottom:20px }
   (2) 빈 thead 밴드 — dashboard.php 320~326 (th 전부 빈칸, selectAllCheckbox 는
       redesign-v2.css:1370 에서 display:none) + dashboard.css:1183 height:36px!important
       로 ~37px 공백 밴드 생성(데스크톱 캘린더뷰의 진짜 주범).
   해법: 빈 thead 밴드를 0 으로 접고 툴바 하단마진 6px.
   ※ 체크박스가 display:none 이라 밴드가 실제로 0 까지 접힘(입력 min-height 없음).
   width(th-expand 30/checkbox 40/actions 150)는 별도 프로퍼티라 유지 → 컬럼 불변.
   스코프 body.rd2 #places-section 로 한정 → 다른 .data-table 불변.
   명시도: dashboard.css .data-table th(0,1,1)! 을
   body.rd2 #places-section table.data-table>thead>tr>th(1,2,5)! 로 제압.
   모바일은 dashboard.css:3601 .data-table thead{display:none} 이므로 밴드가 없어
   thead 규칙 불필요 — 모바일 블록에서는 툴바 마진만 조정. */
body.rd2 #places-section .places-toolbar {
  margin-bottom: 20px !important;
}
body.rd2 #places-section table.data-table > thead > tr > th {
  height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  border-top: none !important;
  border-bottom: none !important;
}

/* [card-card-gap] 그리드(테이블/그래프 뷰) 카드 세로 간격 촘촘화.
   dashboard.css:2413-2417 #places-grid-container{gap:var(--space-4)=16px}(1,0,0) 의
   세로 성분만 row-gap:11px 로 축소(column-gap 16px·카드 내부 padding 유지).
   캘린더(기본)뷰는 .data-table(border-spacing:0)라 이미 촘촘 → 손대지 않음. */
body.rd2 #places-grid-container {
  row-gap: 11px !important;
}

/* ── 모바일 전용(≤768px) 묶음 ─────────────────────────────── */
@media (max-width: 768px) {

  /* [toolbar-card-gap] 카드형 전환 시에도 툴바 마진 축소 유지(세로 스택 gap 조화).
     thead 는 dashboard.css:3601 에서 display:none 이라 별도 접기 불필요. */
  body.rd2 #places-section .places-toolbar {
    margin-bottom: 12px !important;
  }

  /* [card-card-gap] 단일 컬럼에서도 동일하게 촘촘 — 레이아웃 안 깨짐 */
  body.rd2 #places-grid-container {
    row-gap: 10px !important;
  }
}


/* (15) 4차 후속: 액션버튼 Material 통일사이징 + 상호간격 + 캘린더셀 gap */
/* ============================================================
   섹션(14) 이후 사용자 피드백 반영. 마크업 변경(dashboard.js): 카드/빈행/리스트뷰/공유목록의
   액션버튼 아이콘을 FontAwesome→Material Symbols 로 교체(segment/edit/bar_chart/autorenew/
   photo_camera/delete = 프리뷰와 동일 글리프). 여기선 그 글리프 사이즈·버튼 padding·상호 gap 만 담당.
   전부 body.rd2 스코프, 색 토큰 미변경 → 다크·반응형 안전. 데스크톱/모바일 공용(미디어쿼리 밖). */

/* 액션버튼 상호 간격 — 프리뷰(gap:1px)보다 살짝 넉넉히(사용자 "간격 늘려") */
body.rd2 #places-section .action-buttons { gap: 5px !important; }

/* 버튼 padding — 아이콘 히트영역(프리뷰 padding:5px 매칭) */
body.rd2 #places-section .action-buttons .btn-icon { padding: 5px !important; }

/* Material 글리프 크기 — 프리뷰 18px 매칭(카드/테이블/리스트뷰 공용) */
body.rd2 #places-section .action-buttons .btn-icon .material-symbols-outlined,
body.rd2 .lv-action-btn .material-symbols-outlined {
  font-size: 18px !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

/* [calendar-cell-gap] 캘린더 날짜타일 사이 간격 8→6 (사용자 "캘린더끼리 아주 조금더 줄여").
   dashboard.css:2259 .calendar-grid{gap:var(--space-2)=8px} 를 6px 로. 그리드 컬럼/레이아웃 불변. */
body.rd2 .calendar-grid { gap: 4px !important; }
/* 날짜타일 안쪽 여백 축소(var(--space-2)=8px → 5px 6px) → 타일이 더 촘촘·컴팩트 */
body.rd2 .calendar-cell { padding: 5px 6px !important; }


/* (16) bulk 액션버튼(선택 갱신/선택 삭제) 톤 정리 + 아이콘 Material 토글 */
/* ============================================================
   전체선택 시 노출되는 노랑(btn-warning)/빨강(btn-danger) 버튼을 우리 톤(퍼플/머티드 레드
   소프트 틴트)으로 고급스럽게. ID 스코프라 다른 btn-warning/danger 불변.
   아이콘: dashboard.php 에서 FA + Material 병행 마크업 → rd2 에서 FA 숨기고 Material 표시
   (비-rd2 는 .bulk-ico 숨김 → FA 유지, 무손실 복원). 라이트/다크 각각 정의. */

/* 아이콘 토글 (기본은 Material 숨김 → FA 유지) */
.bulk-ico { display: none; }
/* FA 아이콘은 '해당 버튼에 .bulk-ico(Material 대체)가 있을 때만' 숨김.
   :has 로 한정 → dashboard(=.bulk-ico 있음)만 FA 숨기고 Material 표시.
   s_dashboard 등 .bulk-ico 마크업 없는 페이지는 FA 그대로 유지(아이콘 사라짐 방지). */
body.rd2 #updateSelectedBtn:has(> .bulk-ico) > i.fa-solid,
body.rd2 #deleteSelectedBtn:has(> .bulk-ico) > i.fa-solid { display: none !important; }
body.rd2 .bulk-ico {
  display: inline-block !important;
  font-size: 17px !important;
  line-height: 1 !important;
  vertical-align: -3px !important;
}

/* 공통 shape */
body.rd2 #updateSelectedBtn,
body.rd2 #deleteSelectedBtn {
  border-radius: 8px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  /* ⚠ display 는 절대 강제하지 않음 — JS 가 style.display 로 선택시(inline-flex)/미선택시(none) 토글.
     여기서 display:!important 걸면 display:none 을 이겨 '항상 보임' 버그. align/gap 은 JS 가 inline-flex 로 켤 때 적용됨. */
  align-items: center !important;
  gap: 5px !important;
}

/* 라이트 — 갱신: 퍼플 소프트 틴트 */
html:not([data-theme="dark"]) body.rd2 #updateSelectedBtn {
  background: color-mix(in srgb, var(--primary) 10%, #fff) !important;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, #fff) !important;
  color: #5b5288 !important;
}
html:not([data-theme="dark"]) body.rd2 #updateSelectedBtn:hover {
  background: color-mix(in srgb, var(--primary) 16%, #fff) !important;
}
/* 라이트 — 삭제: 머티드 레드(위험 신호 유지, 톤다운) */
html:not([data-theme="dark"]) body.rd2 #deleteSelectedBtn {
  background: color-mix(in srgb, #e5484d 8%, #fff) !important;
  border: 1px solid color-mix(in srgb, #e5484d 22%, #fff) !important;
  color: #cf3438 !important;
}
html:not([data-theme="dark"]) body.rd2 #deleteSelectedBtn:hover {
  background: color-mix(in srgb, #e5484d 14%, #fff) !important;
}

/* 다크 */
:root[data-theme="dark"] body.rd2 #updateSelectedBtn {
  background: color-mix(in srgb, var(--primary) 22%, #161b22) !important;
  border: 1px solid color-mix(in srgb, var(--primary) 42%, #161b22) !important;
  color: #c3bce0 !important;
}
:root[data-theme="dark"] body.rd2 #updateSelectedBtn:hover {
  background: color-mix(in srgb, var(--primary) 30%, #161b22) !important;
}
:root[data-theme="dark"] body.rd2 #deleteSelectedBtn {
  background: color-mix(in srgb, #e5484d 18%, #161b22) !important;
  border: 1px solid color-mix(in srgb, #e5484d 36%, #161b22) !important;
  color: #f0a6a8 !important;
}
:root[data-theme="dark"] body.rd2 #deleteSelectedBtn:hover {
  background: color-mix(in srgb, #e5484d 26%, #161b22) !important;
}


/* (17) 인사말/날짜 bold · 테이블뷰 보라 헤더 중립화 · 갱신중 인디케이터 퍼플톤 */
/* ============================================================
   (a) hero 날짜 bold(인사말 본문 weight 는 dashboard.php 인라인 500→700 로 별도 처리),
   (b) 테이블뷰 히스토리 테이블 헤더(.history-table th) 보라 배경/글자/보더 → 중립 회색.
       그래프뷰 추세선(url(#lineGradient)·area fill)은 데이터/브랜드 액센트라 의도 보존.
   (c) 갱신 진행중(.spinner-inline / .card-updating-badge / .updating) 오렌지 → 퍼플톤.
   전부 body.rd2 스코프, 라이트/다크 각각. 색만 변경(레이아웃 불변). ============================ */

/* (a) hero 날짜 bold */
body.rd2 .hero-date { font-weight: 700 !important; }

/* (b) 테이블뷰 히스토리 테이블 헤더 — 보라 → 중립 */
html:not([data-theme="dark"]) body.rd2 .history-table th {
  background-color: #f6f6f9 !important;
  color: #5b606d !important;
  border-bottom: 1px solid var(--border) !important;
}
:root[data-theme="dark"] body.rd2 .history-table th {
  background-color: #21262d !important;
  color: #b0b8c1 !important;
  border-bottom: 1px solid #30363d !important;
}

/* (c) 갱신 진행중 — 원래 오렌지(--warning)로 원복 (사용자 요청: 색 임의변경 취소) */
body.rd2 .spinner-inline {
  border: 2px solid color-mix(in srgb, var(--warning) 25%, transparent) !important;
  border-top-color: var(--warning) !important;
}
html:not([data-theme="dark"]) body.rd2 .place-card-grid-item.updating .card-updating-badge,
:root[data-theme="dark"] body.rd2 .place-card-grid-item.updating .card-updating-badge {
  color: var(--warning) !important;
  font-weight: bold !important;
}
html:not([data-theme="dark"]) body.rd2 .updating {
  background: linear-gradient(90deg, var(--card-bg) 0%, rgba(245,158,11,0.10) 50%, var(--card-bg) 100%) !important;
  background-size: 200% 100% !important;
}
:root[data-theme="dark"] body.rd2 .updating {
  background: linear-gradient(90deg, var(--card-bg) 0%, rgba(245,158,11,0.16) 50%, var(--card-bg) 100%) !important;
  background-size: 200% 100% !important;
}


/* (18) 페이지 콘텐츠 톤 매칭 — 다른 페이지의 '보라 테이블 헤더'(옛 컨벤션)를 대시보드처럼 중립 회색으로.
   대시보드는 .history-table th 를 섹션17에서 이미 중립화함. 같은 톤으로 통일(라이트/다크). */
/* 비교분석(place_comparison): 메인 비교표 + 이력 모달 테이블 헤더 */
/* 비교분석/쇼핑비교/카카오비교(.comparison-table·.comp-history-table) + 추세분석(.trend-table) 공용 */
/* 은은한 보라 헤더 복원(사용자 요청) — 강했던 옛 보라(10%+진한글자)보다 소프트하게 */
html:not([data-theme="dark"]) body.rd2 .comparison-table th,
html:not([data-theme="dark"]) body.rd2 .comp-history-table th,
html:not([data-theme="dark"]) body.rd2 .trend-table th {
  background-color: color-mix(in srgb, var(--primary) 7%, #fff) !important;
  color: var(--primary) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 20%, #fff) !important;
}
:root[data-theme="dark"] body.rd2 .comparison-table th,
:root[data-theme="dark"] body.rd2 .comp-history-table th,
:root[data-theme="dark"] body.rd2 .trend-table th {
  background-color: color-mix(in srgb, var(--primary) 15%, #161b22) !important;
  color: #c3bce0 !important;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 30%, #161b22) !important;
}


/* (19) 전면 확산 톤 마감 — 신규 rd2 페이지들의 옛 컨벤션(보라 헤더/뱃지·그라데이션 버튼·옛 카드·하드코딩색)을
   대시보드 톤으로 통일. 페이지별 실제 클래스만 타깃(확산 검토 워크플로우 결과). 라이트/다크 구분. */

/* ── ai_feedback: 고정높이 채팅(:has(.aic))엔 헤더 갭 제거 + 타입뱃지 소프트틴트 ── */
body.rd2 .main-content:has(.aic) > .header { margin-bottom: 0 !important; }
html:not([data-theme="dark"]) body.rd2 .etag { background: color-mix(in srgb, var(--primary) 10%, #fff); color: var(--primary); }
:root[data-theme="dark"] body.rd2 .etag { background: color-mix(in srgb, var(--primary) 22%, #161b22); color: #c3bce0; }

/* ── ai_keyword: 결과표 헤더 중립 + 주요버튼 플랫 ── */
html:not([data-theme="dark"]) body.rd2 .ai-table th { background: #f6f6f9; color: #5b606d; border-bottom: 1px solid var(--border); }
:root[data-theme="dark"] body.rd2 .ai-table th { background: #21262d; color: #b0b8c1; border-bottom: 1px solid #30363d; }
body.rd2 .btn-add { background: var(--primary); }

/* ── blog_checker: 카드 라운드/그림자 대시보드 톤 ── */
body.rd2 .bc-card { border-radius: 12px; box-shadow: 0 1px 2px rgba(20,20,40,.03); }

/* ── blog_deploy: 표 헤더 중립 + 모달 하드코딩색 토큰화 ── */
html:not([data-theme="dark"]) body.rd2 .bd-table thead th { background: #f6f6f9; color: #5b606d; border-bottom-color: var(--border); }
:root[data-theme="dark"] body.rd2 .bd-table thead th { background: #21262d; color: #b0b8c1; border-bottom-color: #30363d; }
body.rd2 #copyCostPreview { background: var(--dark-bg) !important; border-color: var(--border) !important; }
body.rd2 #copyCostPreview span { color: var(--text-secondary) !important; }
body.rd2 #copyCostRemaining { color: var(--text-primary) !important; }
body.rd2 #copyCostPreview [style*="border-top"] { border-top-color: var(--border) !important; }
body.rd2 #copyCostWarning { background: rgba(239,68,68,0.10) !important; border-color: rgba(239,68,68,0.28) !important; color: var(--danger) !important; }
body.rd2 #copyCostWarning span { color: var(--danger) !important; }
body.rd2 #deployCopyModal [style*="#f8f9fa"] { background: var(--dark-bg) !important; border-color: var(--border) !important; color: var(--text-secondary) !important; }

/* ── board_view: 댓글수 뱃지 소프트틴트 + 등록버튼 플랫 ── */
html:not([data-theme="dark"]) body.rd2 .comments-count { background: color-mix(in srgb, var(--primary) 10%, #fff); color: var(--primary); }
:root[data-theme="dark"] body.rd2 .comments-count { background: color-mix(in srgb, var(--primary) 22%, #161b22); color: #b9b2e0; }
body.rd2 .comment-submit { background: var(--primary); box-shadow: 0 1px 2px rgba(20,20,40,.1); }
body.rd2 .comment-submit:hover { transform: none; box-shadow: 0 1px 2px rgba(20,20,40,.12); }

/* ── board_write: 도움말 콜아웃 중립 + 등록버튼 플랫 ── */
html:not([data-theme="dark"]) body.rd2 .editor-help { background: #f6f6f9; border-color: var(--border); }
:root[data-theme="dark"] body.rd2 .editor-help { background: #21262d; border-color: #30363d; }
body.rd2 .btn-submit { background: var(--primary); }
body.rd2 .btn-submit:hover { transform: none; box-shadow: 0 1px 2px rgba(20,20,40,.12); }

/* ── place_trend: 트렌드 카드 대시보드 톤 ── */
body.rd2 .pt-card, body.rd2 .pt-chart-card, body.rd2 .pt-table-card, body.rd2 .pt-diag { border-radius: 12px; box-shadow: 0 1px 2px rgba(20,20,40,.03); }

/* ── s_dashboard: 시간 서브라벨 중립(FA아이콘은 섹션16 :has 로 근본해결) ── */
html:not([data-theme="dark"]) body.rd2 .cell-timeslot, html:not([data-theme="dark"]) body.rd2 .slot-label { color: #787e8b; }
:root[data-theme="dark"] body.rd2 .cell-timeslot, :root[data-theme="dark"] body.rd2 .slot-label { color: #8b929e; }

/* ── shop: 비용 미리보기 표면 중립 + 선택행 브랜드퍼플 ── */
body.rd2 .cost-preview { background: var(--dark-bg); border-color: var(--border); }
body.rd2 .slot-table tbody tr.selected { background: rgba(107,97,152, 0.12); }

/* ── support_board: 카테고리 뱃지 중립 + 관리자답변 다크 교정 ── */
html:not([data-theme="dark"]) body.rd2 .sup-cat { background:#f6f6f9; color:#5b606d; }
:root[data-theme="dark"] body.rd2 .sup-cat { background:#21262d; color:#b0b8c1; }
:root[data-theme="dark"] body.rd2 .sup-reply.admin { background:color-mix(in srgb,var(--primary) 22%,#161b22); border-color:color-mix(in srgb,var(--primary) 42%,#161b22); }

/* ── user_settings: 섹션제목 중립 + 카드표면 + 추천표 헤더 중립 ── */
body.rd2 .section-title { color: var(--text-primary); }
body.rd2 .settings-section { border-radius: 12px; box-shadow: 0 1px 2px rgba(20,20,40,.03); }
html:not([data-theme="dark"]) body.rd2 .referral-table th { background-color: #f6f6f9; color: #5b606d; }
:root[data-theme="dark"] body.rd2 .referral-table th { background-color: #21262d; color: #b0b8c1; }

/* ── view-toggle-group 이 인라인 display:none(숨김)인 경우 리디자인의 display:inline-flex!important 가
   되살리던 버그 교정 → 숨김 존중. (예: keyword_viewer 상단 중복 A/B 토글이 되살아나던 문제) ── */
body.rd2 .view-toggle-group[style*="display: none"],
body.rd2 .view-toggle-group[style*="display:none"] { display: none !important; }

/* ── keyword_analysis 모드탭 활성 ──
   [2026-08] 소프트 틴트로 낮췄던 규칙(사용자 요청)을 [2026-09-04] 되돌린다.
   shop.php 기준으로 탭바 톤을 통일하기로 해서, 여기만 연하면 오히려 튄다(사용자 지적).
   → 페이지 자체 CSS(.bulk-mode-tab.active)의 그라데이션이 그대로 적용되도록 오버라이드 삭제.
   ※ 그림자는 아래 'box-shadow:none' 공통 규칙(.campaign-tab 등과 동일)에서 함께 처리된다. */

/* ── 모바일 사이드바: 항목(버튼) 사이 간격 넓히기 (사용자 요청) ──
   nav-menu 가 gap:0 이라 메뉴들이 붙어있었음 → gap:8px 로 각 항목 사이 여백. ≤768 한정. */
@media (max-width: 768px) {
  body.rd2 .sidebar:not(.collapsed) .nav-menu { gap: 8px !important; padding: 8px 0 16px !important; }
  body.rd2 .sidebar:not(.collapsed) .nav-item { padding: 9px 12px !important; gap: 11px !important; }
}

/* ── 액션버튼 간격(사용자 요청): 캘린더뷰 + 리스트뷰만 16px. 테이블·그래프는 손 안 댐.
   ★핵심: 뷰별 실제 렌더 컨테이너가 다름(renderPlacesView) —
     캘린더 = .data-table (updatePlacesTable, 모바일은 td[data-label="관리"] 안)
     리스트  = .lv-actions
     테이블·그래프 = .place-card-grid-item .action-buttons  ← 여긴 안 건드림
   모바일 캘린더는 dashboard.css:4405(#places-section .data-table td[data-label=관리] .action-buttons, gap6)을
   이겨야 해서 그 셀렉터 + body.rd2 로 명시도 상향. 데스크톱 캘린더도 .data-table 규칙으로 커버. ── */
@media (max-width: 768px) {
  body.rd2 #places-section .data-table tbody td[data-label="관리"] .action-buttons { gap: 13px !important; }
  body.rd2 .lv-actions { gap: 13px !important; }
}
body.rd2 #places-section .data-table .action-buttons { gap: 13px !important; }

/* ── 테이블·그래프 카드(.place-card-grid-item) 겉 "보라 테두리" 제거 → 중립(캘린더와 동일 톤).
   dashboard-premium.css:794 의 border:1px solid var(--primary)(보라)가 dashboard.css 중립설정을 나중에 덮어서
   보라로 보였음. 여기서 재제압. hover 시 보라 액센트는 그대로 둠. ── */
html:not([data-theme="dark"]) body.rd2 .place-card-grid-item { border-color: var(--border) !important; }
:root[data-theme="dark"] body.rd2 .place-card-grid-item { border-color: #30363d !important; }

/* ── PC(≥769px) 캘린더뷰: 업체명 본행(=.is-expanded, 바로 아래 .rank-history-row 있음)의 아래 패딩 축소 →
   업체명 ↔ 검색량 사이 빈 여백 조금 줄임. ★본행이 .is-expanded 라 그걸 직접 잡아야 함. (사용자 요청) ── */
@media (min-width: 769px) {
  body.rd2 .data-table tbody tr.is-expanded:has(+ tr.rank-history-row) td {
    padding-bottom: 1px !important;
  }
}


/* ── 모바일 '표시설정': 라벨 + 방블저N1N2N3 뱃지를 한 덩어리로 오른쪽 끝에 붙임(사용자 요청).
   justify-content:flex-end(width:100%)로 전체 우측 정렬, 라벨-뱃지 사이는 6px만. ── */
@media (max-width: 768px) {
  body.rd2 .data-toggle-group { justify-content: flex-end !important; flex-wrap: wrap !important; width: 100% !important; }
  body.rd2 .data-toggle-group .toggle-label { margin-right: 6px !important; margin-left: 0 !important; }
}

/* ── ai_keyword: 워크스페이스 자체 padding-top:10px 를 0 으로 → 위 여백은 헤더 margin-bottom(20px)만
   = 다른 페이지와 정확히 동일. (헤더 마진과 안 나누고 워크스페이스 패딩만 제거해 픽셀 일치) ── */
body.rd2 .ai-workspace { padding-top: 0 !important; }


/* ============================================================
   (19) [2026-08-07] 헤더 아이콘 = Material Symbols 통일 보정
   topbar.php 의 ico() 인라인 SVG → Material Symbols 로 교체했는데,
   기존 크기/색 규칙이 전부 'svg' 선택자 기준(saas.css:1284, common.css:248)이라
   Material(글꼴 아이콘)에는 안 먹는다. 동일 픽셀로 맞추는 보정.
   ※ 전역(비-rd2 페이지도 topbar 공용)이라 body.rd2 스코프를 걸지 않는다.
   ============================================================ */
.header-icon-group .btn-icon .material-symbols-outlined { font-size: 20px; line-height: 1; }
.toggle-sidebar .material-symbols-outlined { font-size: 20px; line-height: 1; }
.search-bar-icon .material-symbols-outlined { font-size: 18px; line-height: 1; display: block; }
.udd-ic .material-symbols-outlined { font-size: 17px; line-height: 1; display: block; }
.udd-caret .material-symbols-outlined { font-size: 16px; line-height: 1; display: block; }
.user-dd-item .material-symbols-outlined {
  font-size: 17px; line-height: 1; width: 16px; flex: 0 0 auto; color: var(--text-tertiary);
}
.theme-icon .material-symbols-outlined { font-size: 20px; line-height: 1; display: block; }


/* ============================================================
   (20) [2026-08-08] 버튼 그림자 전면 제거 — 통일
   ------------------------------------------------------------
   문제: 버튼 그림자가 css/ 29곳 + 각 페이지 <style> 41종에 제각각 흩어져 있어
        같은 화면 안에서도 어떤 버튼은 뜨고 어떤 버튼은 평평했다.
   방침: 장식용 그림자는 전부 제거(사용자 결정). 면 분리는 배경색·테두리로만 한다.
   ★focus-visible 링은 남긴다 — 그건 장식이 아니라 키보드 접근성 표시라,
     없애면 탭 이동 시 지금 어디 있는지 안 보인다.
   ------------------------------------------------------------
   구현: 페이지별 <style> 이 header.php 의 이 파일보다 뒤에 로드되므로
        !important 만으로는 못 이긴다 → body 를 앞에 붙여 특정도를 한 단계 올린다.
        (예: shop.php 의 .wallet-bar-btn.charge(0,2,0) < body .wallet-bar-btn(0,2,1))
   ※ 비-rd2 페이지도 같이 통일되도록 body.rd2 가 아닌 body 스코프.
   ============================================================ */
body .btn,
body .btn:hover,
body .btn:active,
body .btn-primary,
body .btn-primary:hover,
body .btn-danger,
body .btn-danger:hover,
body .btn-icon,
body .btn-icon:hover,
body button.btn,
body .submit-btn,
body .submit-btn:hover,
body .action-btn,
body .action-btn:hover,
body .bulk-btn,
body .bulk-btn:hover,
body .bulk-btn-primary,
body .bulk-btn-primary:hover,
body .hero-cta-btn,
body .hero-cta-btn:hover,
body .pc-order-btn,
body .pc-order-btn:hover,
body .wallet-bar-btn,
body .wallet-bar-btn:hover,
body .cr-btn,
body .cr-btn:hover,
body .adbox-btn,
body .adbox-btn:hover,
body .bd-btn,
body .bd-btn:hover,
body .eu-btn,
body .eu-btn:hover,
body .err-btn,
body .err-btn:hover,
body .btn-write,
body .btn-write:hover,
body .btn-submit,
body .btn-submit:hover,
body .comment-submit,
body .comment-submit:hover,
body .btn-login,
body .btn-login:hover,
body .btn-kakao,
body .btn-kakao:hover,
body .btn-download,
body .btn-download:hover,
body .nchat-btn,
body .nchat-btn:hover,
body .sf-cta,
body .sf-cta:hover,
body .floating-btn,
body .floating-btn:hover,
body .tab-btn,
body .tab-btn.active,
body .hk-mode-btn,
body .hk-mode-btn.active,
body .hk-toggle-btn,
body .hk-toggle-btn.active,
body .rv-kind-btn,
body .rv-kind-btn.active,
body .score-type-btn,
body .score-type-btn.active,
body .view-toggle-group .btn,
body .view-toggle-group .btn.active,
body .view-toggle-group .btn.active:hover,
body .search-bar button,
body .search-bar button:hover,
body .btn-history-more,
body .btn-history-more:hover,
body .campaign-tab,
body .campaign-tab.active,
body .bulk-mode-tab,
body .bulk-mode-tab.active,
body .bc-tab,
body .bc-tab.active,
body .cr-tab,
body .cr-tab.active,
body .mission-pill,
body .mission-pill.active {
  box-shadow: none !important;
}

/* 접근성: 키보드 포커스 링만 유지 (마우스 클릭엔 안 뜸) */
body .btn:focus-visible,
body .btn-primary:focus-visible,
body .btn-icon:focus-visible,
body .submit-btn:focus-visible,
body button:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent) !important;
}

/* ═══════════════════════════════════════════════════════════════
   [2026-08-16] 카드 언어 통일 + KPI 채움 (사용자 승인: ①통일 ②허전함)
   기준 = rd2 일반카드(radius 14 + --shadow-rd2). KPI/애드박스/리스트 정렬.
   ═══════════════════════════════════════════════════════════════ */
/* radius 통일(양 테마) */
body.rd2 .hero-kpi,
body.rd2 .adbox,
body.rd2 #mainBannerSection .adbox { border-radius: 14px !important; }
/* 그림자 통일 — 라이트만(다크는 기존 플랫 유지) */
html:not([data-theme="dark"]) body.rd2 .hero-kpi,
html:not([data-theme="dark"]) body.rd2 .hero-kpi:hover,
html:not([data-theme="dark"]) body.rd2 .adbox,
html:not([data-theme="dark"]) body.rd2 #mainBannerSection .adbox,
html:not([data-theme="dark"]) body.rd2 .place-card-grid-item { box-shadow: var(--shadow-rd2) !important; }
/* KPI 채움 — 허전함은 큰 숫자(30px)가 담당. 추이선은 은은한 배경으로만. */
body.rd2 .hero-kpi .kpi-value { font-size: 30px !important; }
body.rd2 .hero-kpi .kpi-spark { height: 40px !important; }
/* 추이선 얇게 고정 — non-scaling-stroke 로 세로늘림에도 두께 안 굵어짐(사용자: 선 굵고 시선끌림) */
body.rd2 .hero-kpi .kpi-spark polyline,
body.rd2 .hero-kpi .kpi-spark path {
  stroke-width: 1.25 !important;
  vector-effect: non-scaling-stroke !important;
}
@media (max-width: 768px) {
  body.rd2 .hero-kpi .kpi-value { font-size: 22px !important; }
  body.rd2 .hero-kpi .kpi-spark { height: 34px !important; }
}


/* ══════════════════════════════════════════════════════════════
   [2026-08-20] 업체 표기 통일 — 캘린더뷰 기준 (전 뷰 + 쉐어드뷰)
   ★여기에 두는 이유: redesign-v2.css 가 dashboard.css·saas.css 보다 뒤에 로드되고
     body.rd2 스코프로 !important 를 걸어 앞의 규칙을 전부 덮는다.
     특히 .category-badge 를 #6b7080(회색)으로 고정하고 있어 보라색이 안 먹었다.
     같은 스코프로 뒤에서 다시 선언해야 적용된다.
   ══════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════
   [2026-08-21] 카드(테이블·그래프·쉐어드뷰)를 캘린더뷰 값에 정확히 맞춘다.
   실측한 캘린더뷰 값(모바일 390):
       그룹명   rgb(107,97,152) / 600 / 11px
       키워드   rgb(21,21,27)   / 700 / 15px
       매장명   rgb(21,21,27)   / 700 / 15px
       카테고리 rgb(107,97,152) / 700 / 14px
       날짜     rgb(107,97,152) / 700 / 13px
   ★html 접두로 구체성을 올린다. rd2 원본이
     `html:not([data-theme="dark"]) body.rd2 .category-badge` (0,3,2) 라
     그보다 낮으면 진다(실측).
   ══════════════════════════════════════════════════════════════ */

/* 매장명 · 키워드 — 15px / 700 / 본문색 */
html body.rd2 .place-card-grid-item .place-summary-grid .place-name,
html body.rd2 .place-card-grid-item .place-summary-grid .place-keyword > span:first-child {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--text-primary) !important;
}

/* 카테고리 — 검정 14px, 굵기는 보통(전 뷰 동일).
   ★색·크기·굵기만 맞춘다. background/padding 리셋은 카드의 배지에만 건다.
     <td> 에까지 padding:0 을 걸었더니 표 칸 여백이 사라져 네모 박스처럼 보였다(실측). */
html body.rd2 #places-section .data-table tbody td[data-col="category"],
html body.rd2 .place-card-grid-item .place-summary-grid .category-badge {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
}
/* 카드의 배지만 배경·여백 제거 (캘린더 td 는 제외) */
html body.rd2 .place-card-grid-item .place-summary-grid .category-badge {
    background: transparent !important;
    padding: 0 !important;
    max-width: none !important;
}

/* 그룹명 — 보라 11px / 600 */
html body.rd2 .place-card-grid-item .place-summary-grid .card-group {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: var(--primary) !important;
    background: transparent !important;
    padding: 0 !important;
}

/* 날짜 — 보라 13px / 700 (모바일에서도 보이게) */
/* [2026-09-15] 보라 -> 캘린더뷰와 같은 var(--text-secondary). 이 규칙이 최종으로 덮는다. */
html body.rd2 .place-card-grid-item .place-summary-grid .card-hdr-time {
    display: block !important;
    font-size: 13px !important;
    /* [2026-09-15] 날짜/시간만 회색으로. 굵기는 원래대로 700. */
    font-weight: 700 !important;
    color: var(--text-secondary) !important;
    /* 위 776행이 .card-hdr-time 에 tabular-nums 를 걸어 숫자 폭이 표 셀과 달랐다.
       캘린더뷰 td 는 이 설정이 없으므로 끈다(완전 동일하게). */
    font-variant-numeric: normal !important;
}

/* 썸네일 ↔ 매장명 간격 8px — 전 뷰 동일.
   ★모바일에서 이 div 가 display:block 으로 덮여 gap 이 무시됐다(실측 PC 8px / 모바일 0px).
     gap 은 flex/grid 에서만 동작하므로 display 도 같이 강제한다. */
html body.rd2 #places-section .data-table tbody td[data-col="name"] > div {
    display: flex !important;
    align-items: center !important;
}
html body.rd2 #places-section .data-table tbody td[data-col="name"] > div,
html body.rd2 .place-card-grid-item .place-summary-grid a:has(.place-name),
html body.rd2 .place-card-grid-item .place-summary-grid span:has(> .place-name) {
    gap: 8px !important;
}
html body.rd2 #places-section .data-table tbody img[src*="img_proxy"],
html body.rd2 .place-card-grid-item img[src*="img_proxy"] {
    margin-right: 0 !important;
}

/* ── [2026-09-28] 모바일: 갱신 아이콘 줄 ↔ 검색량 줄 사이 가로선 제거 + 그 자리 여백 축소(사장님 요청) ──
   ★PC 는 선을 그대로 둔다(한 줄은 있어야 함 — 사장님).
   · 테이블·그래프뷰 = 카드(.place-card-grid-item). 선은 윗부분 .place-summary-grid 의 border-bottom(dashboard.css 2346).
     선이 빠진 만큼 검색량 줄(h4.view-table/graph)의 위 여백 16px(이 파일 '모바일 전용 … margin-top:16px') → 4px 로 당긴다.
   · 모바일 캘린더뷰 = 표 카드. 선은 맨 아래 '관리'(갱신 버튼) 칸의 border-bottom(dashboard.css 모바일 tr.is-expanded td). */
@media (max-width: 768px) {
    html body.rd2 .place-card-grid-item .place-summary-grid {
        border-bottom: none !important;
    }
    html body.rd2 .place-card-grid-item .rank-history-container > h4.view-table,
    html body.rd2 .place-card-grid-item .rank-history-container > h4.view-graph,
    html body.rd2 .place-card-grid-item .place-history-grid > h4.view-table,
    html body.rd2 .place-card-grid-item .place-history-grid > h4.view-graph {
        margin-top: 4px !important;
    }
    html body.rd2 #places-section .data-table tbody tr.is-expanded td[data-label="관리"] {
        border-bottom: none !important;
    }
}

/* [2026-10-11] 사이드바 로고 글씨(지마켓 산스 SVG, sc_wordmark): 예전 글자 크기 그대로(15px → 높이 .86em),
   색은 예전 글자처럼 진한색 → 보라 그라데이션(dashboard-premium 의 글자 그라데이션과 같은 두 색) */
.sidebar-brand-link .sc-wordmark{display:block;height:.86em;width:auto;overflow:visible;--wm-a:var(--text-primary);--wm-b:var(--primary-light)}
.sidebar-brand-link:has(.sc-wordmark){display:flex;align-items:center;height:21.8px}
