/* ============================================================
   v35 — Supabase-Style Navigation & Design System
   1차 사이드바: 아이콘 전용 (49px), 호버 시 텍스트 툴팁
   2차 사이드바: 240px 패널, 섹션 헤더 + 아이템 리스트
   전체 컴포넌트: Supabase 디자인 시스템 기반 리디자인
   ============================================================ */

/* ── 레이아웃 토큰 오버라이드 ── */
:root {
  --nav-w: 49px;             /* 1차 사이드바: 아이콘 전용 */
  --nav-w-collapsed: 49px;   /* 접혀도 동일 (항상 아이콘) */
  --sub-nav-w: 0px;          /* 동적으로 설정됨 */
  --top-h: 48px;             /* 탑바 약간 낮춤 */
}

/* ── 스크롤 수정: body 스크롤 차단, .view-root 내부 스크롤 ── */
html, body {
  height: 100% !important;
  overflow: hidden !important;   /* 페이지 전체 스크롤 차단 — .view-root 가 스크롤 컨테이너 */
}

/* ── 앱 그리드 재정의 ── */
.app {
  grid-template-areas:
    "nav subnav top"
    "nav subnav main";
  grid-template-columns: var(--nav-w) var(--sub-nav-w, 0px) 1fr;
  grid-template-rows: var(--top-h) 1fr;
  height: 100vh !important;      /* min-height → height: 뷰포트에 고정하여 내부 스크롤 유도 */
  max-height: 100vh !important;
  overflow: hidden !important;   /* 그리드 자체는 넘치지 않음 */
}
/* v42: data-nav="collapsed" 는 레거시 참조용 — 2차 패널 제어는 hover/pin 시스템으로 이관
   (sub-nav-panel 표시는 .show 클래스 + --sub-nav-w JS 변수로만 제어) */

/* ============================================================
   1차 사이드바 — 흰색 배경, 3가지 모드 지원
   모드: expanded (아이콘+텍스트) / collapsed (아이콘만) / hover (호버 시 확장)
   ============================================================ */
:root {
  --nav-w-expanded: 200px;
  --nav-w-collapsed: 49px;
}
.sidenav {
  grid-area: nav;
  width: var(--nav-w);
  background: var(--c-surface, #fff);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 6px 8px;   /* 상단 패딩 제거 — brand-row가 y=0에서 시작해야 divider 맞춤 */
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100dvh;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 60;
  border-right: 1px solid var(--c-line, #e5e7eb);
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: width 0.2s ease, background 0.2s;
}
.sidenav::-webkit-scrollbar { display: none; }

[data-theme="dark"] .sidenav {
  background: var(--c-surface, #1a1a1a);
  border-right-color: var(--c-line, #333);
}

/* ── Collapsed 모드: 아이콘만 (49px) ── */
/* 아이콘 고정 원칙: sidenav padding·align 구조를 Expanded와 동일하게 유지 → 아이콘이 한 픽셀도 안 움직임
   레이블·워드마크·ctrl 라벨만 display:none 으로 토글 */
.app[data-sidebar="collapsed"] { --nav-w: var(--nav-w-collapsed); }
.app[data-sidebar="collapsed"] .sidenav { align-items: stretch; padding: 0 6px 8px; }
.app[data-sidebar="collapsed"] .nav-item { width: 100%; justify-content: flex-start; padding: 8px 10px; }
.app[data-sidebar="collapsed"] .nav-item .nav-lbl { display: none; }
.app[data-sidebar="collapsed"] .sidebar-brand .brand-wordmark { display: none !important; }
.app[data-sidebar="collapsed"] .sidebar-brand-row { justify-content: flex-start !important; padding: 0 !important; }
.app[data-sidebar="collapsed"] .sidebar-ctrl-label { display: none; }
.app[data-sidebar="collapsed"] .sidebar-footer { align-items: stretch; padding: 6px; }
.app[data-sidebar="collapsed"] .sidebar-ctrl-btn { width: 100%; justify-content: flex-start; }

/* Collapsed 호버 툴팁 */
.app[data-sidebar="collapsed"] .nav-item::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--c-text, #333);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.app[data-sidebar="collapsed"] .nav-item:hover::after { opacity: 1; }

/* ── Expanded 모드: 아이콘+텍스트 (200px) — 좌측 정렬 강제 ── */
.app[data-sidebar="expanded"] { --nav-w: var(--nav-w-expanded); }
.app[data-sidebar="expanded"] .sidenav { align-items: stretch; padding: 0 6px 8px; }
.app[data-sidebar="expanded"] .nav-item { width: 100%; justify-content: flex-start; }
.app[data-sidebar="expanded"] .nav-item .nav-lbl { display: inline; }
.app[data-sidebar="expanded"] .sidebar-brand .brand-wordmark { display: inline !important; }
.app[data-sidebar="expanded"] .sidebar-brand-row { justify-content: flex-start !important; padding: 0 !important; }
.app[data-sidebar="expanded"] .nav-item::after { display: none; }
.app[data-sidebar="expanded"] .sidebar-footer { align-items: stretch; padding: 6px; }
.app[data-sidebar="expanded"] .sidebar-ctrl-btn { width: 100%; justify-content: flex-start; }
.app[data-sidebar="expanded"] .sidebar-ctrl-label { display: inline; }

/* ── Hover 모드: 평소 collapsed, 마우스 올리면 expanded ── */
/* 아이콘 고정 원칙: sidenav padding·align 구조를 Expanded와 동일하게 유지 → 아이콘 픽셀 고정
   레이블·워드마크만 hidden, 구조(padding/align)는 변경하지 않음 */
.app[data-sidebar="hover"] { --nav-w: var(--nav-w-collapsed); }
.app[data-sidebar="hover"] .sidenav { align-items: stretch; padding: 0 6px 8px; }
.app[data-sidebar="hover"] .nav-item { width: 100%; justify-content: flex-start; padding: 8px 10px; }
.app[data-sidebar="hover"] .nav-item .nav-lbl { display: none; }
.app[data-sidebar="hover"] .sidebar-brand .brand-wordmark { display: none !important; }
.app[data-sidebar="hover"] .sidebar-brand-row { justify-content: flex-start !important; padding: 0 !important; }
.app[data-sidebar="hover"] .sidebar-ctrl-label { display: none; }
.app[data-sidebar="hover"] .sidebar-footer { align-items: stretch; padding: 6px; }
.app[data-sidebar="hover"] .sidebar-ctrl-btn { width: 100%; justify-content: flex-start; }

/* Hover 모드 — 툴팁 (non-hover 상태) */
.app[data-sidebar="hover"] .nav-item::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--c-text, #333);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.app[data-sidebar="hover"] .nav-item:hover::after { opacity: 1; }

/* Hover 모드 — sidenav 마우스 올렸을 때 확장 */
.app[data-sidebar="hover"] .sidenav:hover {
  width: var(--nav-w-expanded);
  align-items: stretch;
  padding: 0 6px 8px;
  box-shadow: 4px 0 16px rgba(0,0,0,0.08);
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
}
.app[data-sidebar="hover"] .sidenav:hover .nav-item {
  width: 100%;
  justify-content: flex-start;
  padding: 8px 10px;
}
.app[data-sidebar="hover"] .sidenav:hover .nav-item .nav-lbl { display: inline; }
.app[data-sidebar="hover"] .sidenav:hover .sidebar-brand .brand-wordmark { display: inline !important; }
.app[data-sidebar="hover"] .sidenav:hover .sidebar-brand-row { justify-content: flex-start !important; padding: 0 !important; }
.app[data-sidebar="hover"] .sidenav:hover .sidebar-ctrl-label { display: inline; }
.app[data-sidebar="hover"] .sidenav:hover .nav-item::after { display: none; }

/* ── Hover 모드: 사이드바 확장 시 2차 패널을 fixed sidenav 바로 옆에 배치 ── */
/* sidenav가 position:fixed(200px)로 확장될 때, 2차 패널도 fixed로 200px 뒤에 위치 */
.app[data-sidebar="hover"] .sidenav:hover ~ #sub-nav-panel.show {
  position: fixed !important;
  left: var(--nav-w-expanded, 200px);
  top: 0;
  height: 100dvh;
  height: 100vh;
  z-index: 55;
  box-shadow: 4px 0 16px rgba(0,0,0,0.08);
}

/* ── Expanded 모드: grid nav 컬럼을 항상 --nav-w-expanded(200px)로 강제 ──
   v34의 [data-nav="collapsed"] 규칙이 nav 컬럼을 49px로 덮어쓰는 충돌 방지 */
.app[data-sidebar="expanded"] {
  grid-template-columns: var(--nav-w-expanded) var(--sub-nav-w, 0px) 1fr !important;
}

/* ── Expanded 모드: 2차 패널을 grid 컬럼에 올바르게 배치 ── */
.app[data-sidebar="expanded"] #sub-nav-panel.show {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

/* ── Collapsed 모드: grid nav 컬럼 강제 ── */
.app[data-sidebar="collapsed"] {
  grid-template-columns: var(--nav-w-collapsed) var(--sub-nav-w, 0px) 1fr !important;
}

/* ── Collapsed 모드: 2차 패널을 grid 컬럼에 배치 ── */
.app[data-sidebar="collapsed"] #sub-nav-panel.show {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

/* ── 패널 실제 너비를 CSS 변수와 동기화 ── */
#sub-nav-panel.show {
  width: var(--sub-nav-w, 180px);
}

/* ============================================================
   v68: Collapsed 모드 — 아이콘 전용 + 아이콘 호버 시에만 펼침
   빈 영역 호버 제외: :has() 선택자 사용
   ============================================================ */

/* ── 1차 사이드바: Collapsed 기본 (아이콘 중앙정렬) ── */
.app[data-sidebar="collapsed"] .nav-collapse-btn { display: none !important; }
.app[data-sidebar="collapsed"] .sidebar-brand-row {
  justify-content: center !important;
  padding: 0 !important;
}
.app[data-sidebar="collapsed"] .sidebar-brand { justify-content: center; }
.app[data-sidebar="collapsed"] .nav-item {
  width: 100%;
  justify-content: center;
  padding: 8px 0;
}
.app[data-sidebar="collapsed"] .sidebar-ctrl-btn {
  width: 100%;
  justify-content: center;
  padding: 8px 0;
}
.app[data-sidebar="collapsed"] .sidebar-footer {
  align-items: stretch;
  padding: 4px 0;
}
.app[data-sidebar="collapsed"] .sidebar-setting-title {
  text-align: center;
  font-size: 9px;
  padding: 6px 0 2px;
}

/* ── 1차 사이드바: .hover-open 클래스 시 확장 (JS 디바운스로 제어) ── */
.app[data-sidebar="collapsed"] .sidenav.hover-open {
  width: var(--nav-w-expanded, 200px);
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 65;
  overflow-y: auto; overflow-x: hidden;
  box-shadow: 4px 0 16px rgba(0,0,0,0.1);
}
.app[data-sidebar="collapsed"] .sidenav.hover-open .nav-item {
  justify-content: flex-start;
  padding: 8px 10px;
}
.app[data-sidebar="collapsed"] .sidenav.hover-open .nav-lbl {
  display: inline !important;
}
.app[data-sidebar="collapsed"] .sidenav.hover-open .brand-wordmark {
  display: inline !important;
}
.app[data-sidebar="collapsed"] .sidenav.hover-open .sidebar-brand-row {
  justify-content: flex-start !important;
  padding: 0 !important;   /* Expanded와 동일하게 맞춤 — 로고 위치 고정 */
}
.app[data-sidebar="collapsed"] .sidenav.hover-open .sidebar-ctrl-btn {
  justify-content: flex-start;
  padding: 8px 10px;
}
.app[data-sidebar="collapsed"] .sidenav.hover-open .sidebar-ctrl-label {
  display: inline !important;
}
.app[data-sidebar="collapsed"] .sidenav.hover-open .sidebar-setting-title {
  text-align: left;
  font-size: 11px;
  padding: 6px 8px 2px;
}
/* hover-open: footer 영역 복원 (collapsed 값 → expanded 값으로 리셋) */
.app[data-sidebar="collapsed"] .sidenav.hover-open .sidebar-footer {
  align-items: stretch;
  padding: 6px;
}
.app[data-sidebar="collapsed"] .sidenav.hover-open .sidebar-ctrl-group {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.app[data-sidebar="collapsed"] .sidenav.hover-open .sidebar-ctrl-btn {
  width: 100%;
  justify-content: flex-start;
  padding: 8px 10px;
}
.app[data-sidebar="collapsed"] .sidenav.hover-open .sidebar-footer-divider {
  width: 100%;
}
/* nav-collapse-btn: hover-open 에서도 숨김 유지 (Expanded 기준 일관성) */
.app[data-sidebar="collapsed"] .sidenav.hover-open .nav-collapse-btn {
  display: none !important;
}

/* hover-open: Sidebar Setting / Security 타이틀 표시 */
.app[data-sidebar="collapsed"] .sidenav.hover-open .sidebar-setting-title {
  display: block;
}

/* 1차 확장 시 툴팁 숨기기 (텍스트가 보이므로) */
.app[data-sidebar="collapsed"] .sidenav.hover-open .nav-item::after {
  display: none !important;
}

/* ── 1차 확장 시 → 2차 패널을 fixed로 우측에 배치 ── */
.app[data-sidebar="collapsed"] #sub-nav-panel.show.nav-hover-push {
  position: fixed;
  left: var(--nav-w-expanded, 200px);
  top: 0;
  height: 100dvh;
  height: 100vh;
  z-index: 60;
  width: 48px;
  max-width: 48px;
}

/* ── 2차 패널: Collapsed 기본 (아이콘 전용, 가로스크롤 차단) ── */
.app[data-sidebar="collapsed"] #sub-nav-panel.show {
  width: 48px;
  max-width: 48px;
  overflow-x: hidden;
  overflow-y: auto;
}
.app[data-sidebar="collapsed"] .sub-nav-text { display: none !important; }
.app[data-sidebar="collapsed"] .sub-nav-header span { display: none !important; }
.app[data-sidebar="collapsed"] .sub-nav-header {
  justify-content: center;
  padding: 12px 0;
  overflow: hidden;
}
.app[data-sidebar="collapsed"] .sub-nav-btn {
  justify-content: center;
  padding: 8px 0;
  margin: 0 4px;
  overflow: hidden;
}

/* ── 2차 패널: .hover-open 클래스 시 확장 (JS 디바운스로 제어) ── */
.app[data-sidebar="collapsed"] #sub-nav-panel.show.hover-open {
  width: 220px;
  max-width: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  position: fixed;
  left: var(--nav-w-collapsed, 49px);
  top: 0;
  height: 100dvh;
  height: 100vh;
  z-index: 55;
  box-shadow: 4px 0 16px rgba(0,0,0,0.1);
}
.app[data-sidebar="collapsed"] #sub-nav-panel.show.hover-open .sub-nav-text {
  display: inline !important;
}
.app[data-sidebar="collapsed"] #sub-nav-panel.show.hover-open .sub-nav-header span {
  display: inline !important;
}
.app[data-sidebar="collapsed"] #sub-nav-panel.show.hover-open .sub-nav-header {
  justify-content: flex-start;
  padding: 14px 16px 10px;
  overflow: visible;
}
.app[data-sidebar="collapsed"] #sub-nav-panel.show.hover-open .sub-nav-btn {
  justify-content: flex-start;
  padding: 7px 14px;
  margin: 0 6px;
  overflow: visible;
}
/* 확장 시 툴팁 숨기기 */
.app[data-sidebar="collapsed"] #sub-nav-panel.show.hover-open .sub-nav-btn::after {
  display: none !important;
}

/* ── 브랜드 마크 ── */
.sidebar-brand-row {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 0 10px;
  height: var(--top-h);        /* 탑바 높이와 정확히 일치 → 구분선 y 좌표 동기화 */
  box-sizing: border-box;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--c-line, #e5e7eb);
  flex-shrink: 0;
}
[data-theme="dark"] .sidebar-brand-row {
  border-bottom-color: var(--c-line, #333);
}
.sidebar-brand {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  /* sidenav(6px) + brand-row(10px) + padding-left(0) = 16px
     nav-item 아이콘: sidenav(6px) + nav-item-padding(10px) = 16px → 수직선 일치 */
  padding: 8px 10px 8px 0;
  border-radius: 6px;
  transition: background 0.12s;
  width: 100%;
}
.sidebar-brand:hover {
  background: var(--c-surface-2, #f3f4f6);
}

/* ── 로고 위치 고정 규칙 (스크린샷 기준) ──
   심볼 x좌표 = sidenav-left(6px) + brand-row-left(0px) + brand-link-left(10px) = 16px
   nav-item 아이콘 x좌표 = sidenav-left(6px) + nav-item-left(10px) = 16px → 수직선 일치
   brand-row padding=0 으로 제거, brand-link padding-left=10px 으로 nav-item과 동일하게 맞춤
   Expanded / Hover 확장 / Collapsed hover-open 모두 동일하게 고정 (모든 다른 규칙 오버라이드) */
.app[data-sidebar="expanded"] .sidebar-brand,
.app[data-sidebar="hover"] .sidenav:hover .sidebar-brand,
.app[data-sidebar="collapsed"] .sidenav.hover-open .sidebar-brand {
  justify-content: flex-start !important;
  padding: 8px 10px !important;   /* nav-item과 동일한 좌우 패딩 → 아이콘 수직선 일치 */
}

/* Collapsed / Hover 기본 상태: 심볼 가로 중앙 정렬 (RULE: 심볼은 49px 사이드바 내 정중앙) */
.app[data-sidebar="collapsed"] .sidebar-brand-row,
.app[data-sidebar="hover"] .sidebar-brand-row {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.app[data-sidebar="collapsed"] .sidebar-brand,
.app[data-sidebar="hover"] .sidebar-brand {
  justify-content: center !important;
  padding: 8px 0 !important;
}
.sidebar-brand .brand-mark {
  width: 28px !important;
  height: 28px !important;
  flex-shrink: 0;
}
.sidebar-brand .brand-wordmark {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
}
/* nav-collapse 버튼 숨기기 — sidebar control 로 대체 */
.nav-collapse-btn {
  display: none !important;
}

/* ── 1차 네비 아이템 ── */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: var(--c-text-soft, #555);
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  margin: 1px 0;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  text-align: left;
}
.nav-item:hover {
  background: var(--c-surface-2, #f3f4f6);
  color: var(--c-text, #333);
}
.nav-item.active {
  background: var(--c-primary-soft, rgba(136,199,20,0.12));
  color: var(--c-primary-strong, #5a8a0a);
  font-weight: 500;
}

/* 아이콘 사이즈 */
.nav-item .nav-ico {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-item .nav-ico svg,
.nav-item .nav-ico [data-lucide] {
  width: 20px !important;
  height: 20px !important;
  stroke-width: 1.5;
}

/* 라벨 */
.nav-item .nav-lbl {
  font-size: 13px;
  line-height: 1;
}

/* ── 사이드바 푸터 (Sidebar Control) ── */
.sidebar-footer {
  margin-top: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  /* border-top 제거 — 핀버튼/Sidebar Setting 사이 구분선으로 대체 */
}

/* Sidebar Control 버튼 */
.sidebar-ctrl-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: var(--c-text-mute, #999);
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.12s;
  white-space: nowrap;
}
.sidebar-ctrl-btn:hover {
  background: var(--c-surface-2, #f3f4f6);
  color: var(--c-text, #333);
}
.sidebar-ctrl-btn.active {
  color: var(--c-primary, #88c714);
  background: var(--c-primary-soft, rgba(136,199,20,0.08));
}
.sidebar-ctrl-btn svg,
.sidebar-ctrl-btn [data-lucide] {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
}
.sidebar-ctrl-label {
  font-size: 12px;
  line-height: 1;
}

/* ── 2차메뉴 열기 버튼 (1차 사이드바 하단) ── */
.subnav-open-btn {
  margin-top: 4px;
  color: var(--c-text-mute, #999) !important;
  font-size: 12px !important;
}
.subnav-open-btn:hover {
  color: var(--c-primary, #88c714) !important;
}

/* ── 하위메뉴 펼치기 타이틀 (ctrl 버튼 아래, 구분선 위) ── */
.sidebar-setting-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-text-muted, #9ca3af);
  padding: 6px 10px 2px;
  white-space: nowrap;
  overflow: hidden;
}
/* Collapsed 모드: 타이틀 숨김 (아이콘 전용 상태) */
.app[data-sidebar="collapsed"] .sidebar-setting-title { display: none; }
/* Hover 모드: 기본 숨김, 호버 시 표시 */
.app[data-sidebar="hover"] .sidebar-setting-title { display: none; }
.app[data-sidebar="hover"] .sidenav:hover .sidebar-setting-title { display: block; }

/* ── 사이드바 구분선 ── */
.sidebar-footer-divider {
  width: calc(100% - 20px);
  margin: 6px 10px;
  height: 1px;
  background: var(--c-line, #e5e7eb);
  flex-shrink: 0;
}
[data-theme="dark"] .sidebar-footer-divider {
  background: var(--c-line, #333);
}

/* ── 사이드바 프라이버시 / 화면잠금 버튼 ── */
.nav-privacy,
.nav-screen-lock {
  color: var(--c-text-soft, #6b7280);
}
.nav-privacy:hover { background: var(--c-sidebar-hover); color: var(--c-primary, #88c714); }
.nav-screen-lock:hover { background: var(--c-sidebar-hover); color: var(--c-text, #222); }

/* Collapsed 모드에서 footer 중앙 정렬 */
.app[data-sidebar="collapsed"] .sidebar-footer { align-items: center; padding: 6px 0; }
.app[data-sidebar="collapsed"] .sidebar-ctrl-btn { width: 36px; height: 36px; justify-content: center; padding: 0; }
.app[data-sidebar="hover"] .sidebar-footer { align-items: center; padding: 6px 0; }
.app[data-sidebar="hover"] .sidebar-ctrl-btn { width: 36px; height: 36px; justify-content: center; padding: 0; }
.app[data-sidebar="hover"] .sidenav:hover .sidebar-footer { align-items: stretch; padding: 6px; }
.app[data-sidebar="hover"] .sidenav:hover .sidebar-ctrl-btn { width: 100%; height: auto; justify-content: flex-start; padding: 6px 8px; }
/* Collapsed/Hover 모드에서 구분선 폭 조정 */
.app[data-sidebar="collapsed"] .sidebar-footer-divider,
.app[data-sidebar="hover"] .sidebar-footer-divider { width: 32px; margin: 6px auto; }
.app[data-sidebar="hover"] .sidenav:hover .sidebar-footer-divider { width: calc(100% - 20px); margin: 6px 10px; }

/* ============================================================
   2차 사이드 패널 — Supabase 스타일
   ============================================================ */
.sub-nav-panel {
  grid-area: subnav;
  display: none;
  flex-direction: column;
  background: var(--c-surface);
  border-right: 1px solid var(--c-line);
  overflow-y: auto;
  overflow-x: hidden;
  height: 100dvh;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 40;
  width: 220px;
  scrollbar-width: thin;
  transition: width 0.15s ease;
}
.sub-nav-panel.show {
  display: flex;
}

/* 2차 패널 헤더 — 탑바 높이와 정확히 일치 → 구분선 y 좌표 동기화 */
.sub-nav-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--top-h);        /* 탑바·1차 로고행과 동일 높이 */
  box-sizing: border-box;
  font-size: 16px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--c-text, #111);
  flex-shrink: 0;
  border-bottom: 1px solid var(--c-line, #e5e7eb);
  margin-bottom: 4px;
}
.sub-nav-header span {
  font-size: 16px;
  font-weight: 800;
  color: var(--c-text, #111);
  line-height: 1.2;
}
.sub-nav-header i,
.sub-nav-header svg {
  color: var(--c-primary, #88c714);
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0;
}
[data-theme="dark"] .sub-nav-header {
  color: var(--c-text, #f0f0f0);
  border-bottom-color: var(--c-line, #333);
}
[data-theme="dark"] .sub-nav-header span {
  color: var(--c-text, #f0f0f0);
}

/* 2차 패널 아이템 리스트 */
.sub-nav-list {
  display: flex;
  flex-direction: column;
  padding: 4px 8px;
  gap: 1px;
  flex: 1;
  overflow-y: auto;
}

/* 2차 패널 버튼 */
.sub-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--c-text-soft);
  font-size: 13px;
  font-weight: 400;
  text-align: left;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.1s;
  position: relative;
}
.sub-nav-btn:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}
.sub-nav-btn.active {
  background: var(--c-primary-soft);
  color: var(--c-primary-strong);
  font-weight: 600;
}
/* active 좌측 인디케이터 제거 — Supabase는 배경색만 사용 */
.sub-nav-btn.active::before {
  display: none;
}

.sub-nav-ico {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.6;
}
.sub-nav-btn.active .sub-nav-ico {
  opacity: 1;
}

/* 2차 패널 하단 사이드바 컨트롤 */
.sub-nav-footer {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--c-line-soft);
  margin-top: auto;
  flex-shrink: 0;
}
.sub-nav-collapse-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--c-text-mute);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.12s;
  width: 100%;
}
.sub-nav-collapse-btn:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
}
.sub-nav-collapse-btn svg,
.sub-nav-collapse-btn [data-lucide] {
  width: 14px !important;
  height: 14px !important;
}

/* ============================================================
   Topbar Path — 경로 브레드크럼 + 드롭다운 네비게이션
   ============================================================ */

/* 컨테이너 */
.topbar-path {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  max-width: 360px;
}

/* 각 세그먼트 (버튼 + 드롭다운 한 쌍) */
.tp-segment {
  position: relative;
  display: flex;
  align-items: center;
}

/* 그룹·서브메뉴 버튼 공통 */
.tp-group-btn,
.tp-route-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text, #222);
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
  line-height: 1;
}
.tp-group-btn:hover,
.tp-route-btn:hover {
  background: var(--c-surface-2, #f3f4f6);
  color: var(--c-primary, #88c714);
}

/* 그룹 아이콘 (라임 컬러) */
.tp-group-btn [data-lucide]:not(.tp-chevron),
.tp-group-btn svg:not(.tp-chevron) {
  width: 15px !important;
  height: 15px !important;
  color: var(--c-primary, #88c714);
  flex-shrink: 0;
}

/* 아래 화살표 */
.tp-chevron {
  width: 13px !important;
  height: 13px !important;
  color: var(--c-text-muted, #9ca3af);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.tp-group-btn[aria-expanded="true"] .tp-chevron,
.tp-route-btn[aria-expanded="true"] .tp-chevron {
  transform: rotate(180deg);
}

/* / 구분자 */
.tp-sep {
  display: flex;
  align-items: center;
  color: var(--c-text-muted, #9ca3af);
  margin: 0 2px;
  font-size: 14px;
  font-weight: 300;
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}

/* ── 드롭다운 패널 ── */
.tp-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--c-surface, #fff);
  border: 1px solid var(--c-line, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13), 0 2px 6px rgba(0,0,0,0.06);
  padding: 4px;
  z-index: 9999;
  scrollbar-width: thin;
}
.tp-dropdown.tp-dd-open {
  display: flex;
  flex-direction: column;
  animation: tpFadeIn 0.12s ease;
}
@keyframes tpFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

[data-theme="dark"] .tp-dropdown {
  background: var(--c-card, #1e2228);
  border-color: var(--c-line, #333);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

/* 드롭다운 항목 */
.tp-dd-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--c-text, #222);
  text-align: left;
  white-space: nowrap;
  width: 100%;
  transition: background 0.1s;
  flex-shrink: 0;
}
.tp-dd-item:hover {
  background: var(--c-surface-2, #f3f4f6);
}
.tp-dd-item.active {
  background: rgba(136,199,20,0.10);
  color: var(--c-primary, #88c714);
  font-weight: 600;
}

/* 드롭다운 아이템 아이콘 */
.tp-dd-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.tp-dd-icon [data-lucide],
.tp-dd-icon svg {
  width: 14px !important;
  height: 14px !important;
  color: var(--c-text-muted, #9ca3af);
}
.tp-dd-item.active .tp-dd-icon [data-lucide],
.tp-dd-item.active .tp-dd-icon svg {
  color: var(--c-primary, #88c714);
}

[data-theme="dark"] .tp-dd-item:hover {
  background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .tp-dd-item.active {
  background: rgba(136,199,20,0.15);
}

/* ============================================================
   탑바 — 더 깔끔하게
   ============================================================ */
.topbar {
  height: var(--top-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--c-line);
  background: var(--c-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
[data-theme="dark"] .topbar {
  background: var(--c-surface);
}

/* 검색 박스 — Supabase 스타일 (⌘K) */
.search-box {
  background: var(--c-surface-2);
  border: 1px solid var(--c-line);
  border-radius: 6px;
  height: 32px;
  max-width: 320px;
}
.search-box:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px var(--c-primary-soft);
}

/* ============================================================
   탭 — Supabase 언더라인 스타일
   ============================================================ */
.itab {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: 16px;
  padding: 0;
  overflow-x: auto;
}
.itab button,
.itab a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--c-text-soft);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s;
  border-radius: 0;
}
.itab button:hover,
.itab a:hover {
  color: var(--c-text);
  background: transparent;
}
.itab button.active,
.itab a.active {
  color: var(--c-text);
  font-weight: 600;
  background: transparent;
}
.itab button.active::after,
.itab a.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--c-primary);
  border-radius: 2px 2px 0 0;
}

/* owner-tabs 도 동일 */
.owner-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--c-line);
  margin-bottom: 12px;
}
.owner-tabs button {
  position: relative;
  padding: 6px 12px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--c-text-soft);
  cursor: pointer;
  border-radius: 0;
  transition: color 0.12s;
}
.owner-tabs button:hover {
  color: var(--c-text);
  background: transparent;
}
.owner-tabs button.active {
  color: var(--c-text);
  font-weight: 600;
}
.owner-tabs button.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--c-primary);
  border-radius: 2px 2px 0 0;
}

/* ============================================================
   버튼 — Supabase 스타일
   ============================================================ */
/* 기본 버튼: 아웃라인 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:hover {
  background: var(--c-surface-2);
  border-color: var(--c-text-mute);
}

/* Primary 버튼: 라임 배경 */
.btn.primary,
.btn-primary,
.btn-add {
  background: var(--c-primary) !important;
  color: #fff !important;
  border-color: var(--c-primary) !important;
}
.btn.primary:hover,
.btn-primary:hover,
.btn-add:hover {
  background: var(--c-primary-hover) !important;
  border-color: var(--c-primary-hover) !important;
}

/* Danger 버튼 */
.btn.danger {
  background: transparent;
  border-color: var(--c-bad);
  color: var(--c-bad);
}
.btn.danger:hover {
  background: rgba(226,85,85,0.06);
}
[data-theme="dark"] .btn.danger {
  color: #f87171;
  border-color: #f87171;
}

/* Ghost 버튼 */
.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.ghost:hover {
  background: var(--c-surface-2);
}

/* ============================================================
   카드 — 깔끔한 1px 보더
   ============================================================ */
.card,
.stat-card,
.kpi-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: none;
}

/* ============================================================
   테이블 — Supabase 스타일 (클린 보더, 컴팩트)
   ============================================================ */
table {
  width: 100%;
  border-collapse: collapse;
}
table thead th {
  background: var(--c-surface-2);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-soft);
  text-align: left;
  border-bottom: 1px solid var(--c-line);
  text-transform: none;
  letter-spacing: 0;
}
table tbody td {
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--c-line-soft);
  color: var(--c-text);
}
table tbody tr:hover {
  background: var(--c-surface-2);
}
table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================
   Input / Select — 통일된 폼 스타일
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="url"],
input[type="tel"],
input[type="search"],
textarea,
select {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--c-text);
  transition: border-color 0.12s, box-shadow 0.12s;
  outline: none;
  font-family: var(--f-sans);
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px var(--c-primary-soft);
}

/* ============================================================
   페이지 헤더 — Supabase 스타일
   ============================================================ */
.section-head {
  margin-top: 16px;
}
.section-head h2,
.page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.section-head .section-desc {
  font-size: 13px;
  color: var(--c-text-mute);
  margin: 0;
}

/* ============================================================
   브레드크럼 — 제거됨 (상단 Path와 중복)
   ============================================================ */
.breadcrumb-bar {
  display: none !important;
}
.bc-trail {
  display: flex;
  align-items: center;
  gap: 2px;
}
.bc-item {
  padding: 2px 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-mute);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s;
}
.bc-item:hover {
  color: var(--c-text);
  background: var(--c-surface-2);
}
.bc-sep {
  color: var(--c-text-mute);
  opacity: 0.4;
  padding: 0 1px;
}

/* ============================================================
   콘텐츠 영역
   ============================================================ */
.view-root {
  max-width: none !important;
  padding: 20px 32px !important;
  width: 100%;
  background: var(--c-bg);
}

/* ============================================================
   모달/다이얼로그 — 깔끔한 디자인
   ============================================================ */
.crud-overlay {
  background: rgba(0,0,0,0.5);
}
.crud-modal {
  border-radius: 8px;
  border: 1px solid var(--c-line);
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

/* ============================================================
   기존 sub-nav-strip (가로 2차메뉴) 확실히 숨기기
   ============================================================ */
.sub-nav-strip {
  display: none !important;
}

/* ============================================================
   모바일 대응 (< 900px)
   ============================================================ */
@media (max-width: 899px) {
  :root {
    --nav-w: 0px;
    --top-h: 48px;
  }

  .app {
    grid-template-areas: "top" "main" !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: var(--top-h) 1fr !important;
    height: 100vh !important;
    height: 100dvh !important;  /* 모바일 주소창 대응 */
    max-height: 100vh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }

  /* 1차 사이드바 → 모바일에서는 드로어 */
  .sidenav {
    position: fixed;
    left: -260px;
    top: 0;
    width: 260px;
    height: 100dvh;
    background: #1c1c1c;
    z-index: 200;
    transition: left 0.25s ease;
    padding: 12px 0;
    align-items: stretch;
  }
  [data-theme="dark"] .sidenav {
    background: #111;
  }
  [data-nav="open"] .sidenav {
    left: 0;
  }

  /* 모바일에서는 아이콘+텍스트 보이기 (RULE #3) */
  [data-nav="open"] .nav-item {
    width: 100%;
    height: auto;
    justify-content: flex-start;
    padding: 10px 16px;
    gap: 12px;
    border-radius: 0;
    margin: 0;
  }
  [data-nav="open"] .nav-item .nav-lbl {
    display: inline !important;
    color: #ccc;
    font-size: 14px;
    font-weight: 500;
  }
  [data-nav="open"] .nav-item.active .nav-lbl {
    color: var(--lime-400, #a3d92e);
  }
  [data-nav="open"] .nav-item::after {
    display: none !important; /* 툴팁 숨김 */
  }

  /* 워드마크 모바일에서 표시 */
  [data-nav="open"] .sidebar-brand .brand-wordmark {
    display: inline-flex !important;
  }
  [data-nav="open"] .sidebar-brand-row {
    justify-content: flex-start;
    padding: 8px 16px 12px;
  }

  .sub-nav-panel {
    display: none !important;
  }

  .view-root {
    padding: 12px !important;
  }

  .breadcrumb-bar {
    margin-bottom: 6px;
  }
}

/* 태블릿 */
@media (min-width: 900px) and (max-width: 1200px) {
  .sub-nav-panel { width: 180px; }
  .view-root {
    padding: 16px 24px !important;
  }
}

/* 와이드 스크린 */
@media (min-width: 1600px) {
  .view-root {
    padding: 24px 48px !important;
  }
}

/* ============================================================
   다크모드 보정
   ============================================================ */
[data-theme="dark"] .sub-nav-panel {
  background: var(--c-surface);
  border-right-color: var(--c-line);
}
/* [data-theme="dark"] .sub-nav-header — 위 새 블록으로 통합됨 */
[data-theme="dark"] .topbar {
  border-bottom-color: var(--c-line);
}
[data-theme="dark"] table thead th {
  background: var(--c-surface-2);
  border-bottom-color: var(--c-line);
}

/* ============================================================
   arrow 아이콘 숨기기
   ============================================================ */
.nav-arrow { display: none !important; }

/* ============================================================
   v42 — 하위메뉴 고정 (Pin) 버튼
   ============================================================ */
.nav-subnav-pin {
  color: var(--c-text-mute, #9ca3af);
  font-size: 12px;
  font-weight: 500;
}
/* 핀 버튼 SVG 크기 통일 */
.nav-subnav-pin .nav-ico svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
}
.nav-subnav-pin:hover {
  background: var(--c-surface-2, #f3f4f6);
  color: var(--c-text-soft, #555);
}
/* 핀 활성화(고정) 상태: 아이콘 라임색 + 텍스트 강조 */
.nav-subnav-pin.pinned {
  color: var(--c-primary, #88c714);
}
.nav-subnav-pin.pinned:hover {
  background: rgba(136, 199, 20, 0.08);
}
.nav-subnav-pin.pinned .nav-ico svg,
.nav-subnav-pin.pinned .nav-ico i {
  color: var(--c-primary, #88c714);
  stroke: var(--c-primary, #88c714);
}
[data-theme="dark"] .nav-subnav-pin:hover {
  background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .nav-subnav-pin.pinned:hover {
  background: rgba(136, 199, 20, 0.12);
}


/* ==============================================================
   v81 — 메모 시스템 전면 개편 (RULE #8 확장)
   - 전역 공지 배너 (#notice-area)
   - 메모 뱃지 (.memo-wrap #memo-badge)
   - drawer 구조 재편 (입력 상단, 목록 하단)
   - expire 날짜 스타일
   ============================================================== */

/* ── 그리드: 2-row (notice는 view-root 내부 정상 흐름으로 이동) ── */
.app {
  grid-template-areas:
    "nav subnav top"
    "nav subnav main" !important;
  grid-template-rows: var(--top-h) 1fr !important;
}

/* ── #notice-area: 레거시 컨테이너 — 공지는 이제 view-root 내부에 직접 주입됨 ── */
#notice-area {
  display: none;
}

/* ── view-root 내부 공지 스택 — 정상 흐름, 스크롤 포함, 콘텐츠 pushdown ──
   RULE #15: 좌측 막대(border-left) → 좌측 모서리 직각, 우측만 라운드
   Flat 디자인: drop shadow 없음, 1px 보더 + 좌측 3px 라임 액센트              */
#view-root > .notice-banner-stack {
  margin-bottom: 28px;
  border: 1px solid rgba(136,199,20,0.28);
  border-left: 3px solid var(--c-primary, #88c714);
  border-radius: 0 8px 8px 0;   /* RULE #15 */
  overflow: hidden;
  box-shadow: none;              /* Flat — shadow 제거 */
  background: var(--c-surface, #fff);
}
[data-theme="dark"] #view-root > .notice-banner-stack {
  background: var(--c-surface, #1e1e1e);
  border-color: rgba(136,199,20,0.2);
}

/* ── 공지 스택 헤더 — 버튼 우측 상단 고정 ── */
.notice-stack-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(136,199,20,0.06);
  border-bottom: 1px solid rgba(136,199,20,0.15);
}
[data-theme="dark"] .notice-stack-header {
  background: rgba(136,199,20,0.08);
  border-bottom-color: rgba(136,199,20,0.12);
}
.notice-stack-icon {
  flex-shrink: 0;
  color: var(--c-primary, #88c714);
  display: inline-flex;
  align-items: center;
}
.notice-stack-icon svg,
.notice-stack-icon i { width: 13px; height: 13px; }
.notice-stack-label {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c-primary-strong, #5a8a0a);
}
[data-theme="dark"] .notice-stack-label {
  color: var(--c-primary, #88c714);
}
.notice-stack-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* ── 공지 스택 바디 — 접기 시 숨김 ── */
.notice-stack-body {
  display: block;
}
.notice-banner-stack.folded .notice-stack-body {
  display: none;
}

/* ── 개별 공지 아이템 ── */
.notice-item {
  padding: 10px 12px;
  background: transparent;
}
.notice-item-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text, #1a1a1a);
  word-break: break-word;
  line-height: 1.5;
}
[data-theme="dark"] .notice-item-text {
  color: var(--c-text-mute, #ccc);
}

/* ── 공지 아이템 구분선 ── */
.notice-divider {
  height: 1px;
  background: rgba(136,199,20,0.15);
  border: none;
  margin: 0;
}
[data-theme="dark"] .notice-divider {
  background: rgba(136,199,20,0.1);
}

/* ── 유효기간 표시 (아이템 내) ── */
.notice-item .notice-expire {
  margin-top: 3px;
  font-size: 11px;
  color: var(--c-text-mute, #888);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ── 공지 배너 스택 ── */
.notice-banner-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* RULE #15: 좌측 막대 있는 카드 → 우측만 라운드 */
.notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: #fffbea;
  border-left: 3px solid var(--c-primary, #88c714);
  border-radius: 0 0 0 0;
  font-size: 13px;
  line-height: 1.5;
  position: relative;
  transition: opacity 0.18s, transform 0.18s;
  border-bottom: 1px solid rgba(136,199,20,0.18);
}
[data-theme="dark"] .notice-banner {
  background: rgba(136,199,20,0.08);
  border-bottom-color: rgba(136,199,20,0.12);
}

.notice-banner.folded .notice-body {
  display: none;
}
.notice-banner.folded .notice-expire {
  display: none;
}

.notice-icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--c-primary, #88c714);
}
.notice-icon svg,
.notice-icon i { width: 14px; height: 14px; }

.notice-body {
  flex: 1;
  min-width: 0;
}
.notice-text {
  word-break: break-word;
  color: var(--c-text, #1a1a1a);
  font-weight: 500;
}
[data-theme="dark"] .notice-text {
  color: var(--c-text-mute, #ccc);
}
.notice-expire {
  margin-top: 3px;
  font-size: 11px;
  color: var(--c-text-mute, #888);
  display: flex;
  align-items: center;
  gap: 3px;
}

.notice-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
/* RULE #16: fold = chevron, dismiss = X (데이터 유지) */
.notice-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  color: var(--c-text-mute, #888);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s;
}
.notice-btn:hover {
  background: rgba(0,0,0,0.07);
  color: var(--c-text, #333);
}
.notice-btn svg,
.notice-btn i { width: 14px; height: 14px; }

/* ── 메모 뱃지 (.memo-wrap) ── */
.memo-wrap {
  position: relative;
  display: inline-flex;
}
#memo-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--c-primary, #88c714);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 4px;
  pointer-events: none;
}

/* ── 드로어 입력 영역 (상단) ── */
.drawer-input-area {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-line-soft, #e8e8e8);
  background: var(--c-surface-1, #fff);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
[data-theme="dark"] .drawer-input-area {
  background: var(--c-surface-1, #1e1e1e);
  border-bottom-color: rgba(255,255,255,0.08);
}

/* 기존 drawer-foot 가 input-area 안으로 이동 — 패딩 재조정 */
.drawer-input-area .drawer-foot {
  padding: 0;
  border-top: none;
  background: transparent;
  display: flex;
  gap: 8px;
}
.drawer-input-area .drawer-foot input[type="text"] {
  flex: 1;
  border: 1px solid var(--c-line-soft, #ddd);
  border-radius: var(--r-pill, 20px);
  padding: 7px 14px;
  font-size: 13px;
  background: var(--c-surface-2, #f5f5f5);
  color: var(--c-text, #222);
  outline: none;
  transition: border-color 0.15s;
}
.drawer-input-area .drawer-foot input[type="text"]:focus {
  border-color: var(--c-primary, #88c714);
  background: #fff;
}
[data-theme="dark"] .drawer-input-area .drawer-foot input[type="text"] {
  background: var(--c-surface-3, #2a2a2a);
  border-color: rgba(255,255,255,0.1);
  color: var(--c-text, #ddd);
}

/* 공지 고정 레이블 */
.drawer-pin-new {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-text-mute, #888);
  cursor: pointer;
  user-select: none;
}
.drawer-pin-new input[type="checkbox"] {
  accent-color: var(--c-primary, #88c714);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.drawer-pin-ico { width: 13px; height: 13px; vertical-align: -2px; }

/* v96 — drawer-head: 가로 flex, 모든 자식 vertical-middle 정렬 */
#memo-drawer .drawer-head {
  display: flex !important;
  align-items: center !important;
  gap: 10px;
}
#memo-drawer .drawer-head .h3 {
  flex: 1;
  min-width: 0;
  align-self: center;
  line-height: 1;
}
#memo-drawer .drawer-head .drawer-pin-head {
  align-self: center;
}
#memo-drawer .drawer-head .icon-btn {
  align-self: center;
  flex-shrink: 0;
}

/* v94 — drawer-head 우측 공지사항 표시 토글 (테두리 없음, 텍스트만) */
.drawer-pin-head {
  font-size: 11px;
  color: var(--c-text-mute, #999);
  gap: 4px;
  white-space: nowrap;
  padding: 0;
  border: none;
  background: transparent;
  flex-shrink: 0;
  transition: color 0.12s;
}
.drawer-pin-head:hover {
  color: var(--c-text, #333);
}
.drawer-pin-head input[type="checkbox"]:checked ~ span {
  color: var(--c-primary, #88c714);
}
[data-theme="dark"] .drawer-pin-head:hover {
  color: var(--c-text, #e5e5e5);
}

/* expire 필드 */
.drawer-expire {
  animation: fade-in 0.18s ease;
}
.drawer-expire.hidden { display: none !important; }
@keyframes fade-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:none; } }

.expire-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-text-mute, #888);
}
.expire-ico { width: 13px; height: 13px; flex-shrink: 0; }
.expire-label input[type="datetime-local"] {
  flex: 1;
  border: 1px solid var(--c-line-soft, #ddd);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  background: var(--c-surface-2, #f5f5f5);
  color: var(--c-text, #222);
  outline: none;
}
.expire-label input[type="datetime-local"]:focus {
  border-color: var(--c-primary, #88c714);
}
[data-theme="dark"] .expire-label input[type="datetime-local"] {
  background: var(--c-surface-3, #2a2a2a);
  border-color: rgba(255,255,255,0.1);
  color: var(--c-text, #ddd);
}

/* 드로어 타이틀 아이콘 — 날씨·알림 패널과 동일하게 중성 색상 (RULE #21 요청) */
.drawer-title-ico {
  width: 18px;
  height: 18px;
  color: var(--c-text-mute, #888);
  flex-shrink: 0;
}

/* 메모 카드 expire 표시 */
.memo-expire-info {
  margin-top: 4px;
  font-size: 11px;
  color: var(--c-text-mute, #999);
  display: flex;
  align-items: center;
  gap: 3px;
}
.expire-info-ico { width: 11px; height: 11px; }
.expired-chip {
  background: #fecaca;
  color: #b91c1c;
  border-radius: 4px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
}
/* ── 메모 카드 개별 유효기간 인라인 피커 (v94: 테두리 제거, 상단 구분선) ── */
.memo-expire-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--c-line, #e5e7eb);   /* 상단 구분선 */
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
}
[data-theme="dark"] .memo-expire-row {
  border-top-color: rgba(255,255,255,0.08);
}

/* ── expire 피커 래퍼 (v101: wrap 전체가 클릭 영역, showPicker() 호출 방식) ── */
.expire-picker-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.expire-picker-wrap:hover .memo-expire-display {
  opacity: 0.75;
}
/* 만료됐어도 재설정 가능 */
.memo-card.expired .expire-picker-wrap {
  cursor: pointer;
  pointer-events: auto;
}
.memo-card.expired .expire-picker-wrap .memo-expire-display.is-expired {
  text-decoration: underline dotted #ef4444;
}

.expire-row-ico {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--c-text-mute, #aaa);
}

/* expire-input-wrap: 기존 호환성을 위해 유지 (실제 사용 안함 — v101부터 wrap 직접 클릭 방식) */
.expire-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 22px;   /* absolute 자식들을 위한 명시적 높이 */
}

/* v101: input은 showPicker() 호출 대상 — 클릭 방해 안 되도록 pointer-events:none
   position:absolute 로 DOM 공간을 차지하지 않음, opacity:0 으로 불보이게 처리
   ★ display:none 금지 — showPicker()가 렌더링된 요소만 허용 */
.memo-expire-input {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  z-index: -1 !important;
}

/* v101: 텍스트 표시 span — wrap 이 클릭 수신, pointer-events:none 유지 */
.memo-expire-display {
  font-size: 11px;
  color: var(--c-text, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  user-select: none;
  flex: 1;
  min-width: 0;
}
.memo-expire-display.is-placeholder {
  color: var(--c-text-mute, #aaa);
  font-style: italic;
}
.memo-expire-display.is-expired {
  color: #ef4444;
  font-weight: 600;
}
[data-theme="dark"] .memo-expire-display {
  color: var(--c-text, #ccc);
}
[data-theme="dark"] .memo-expire-display.is-placeholder {
  color: var(--c-text-mute, #666);
}

.expire-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: var(--c-line-soft, #ddd);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  color: var(--c-text-mute, #888);
}
.expire-clear-btn svg { width: 9px; height: 9px; }
.expire-clear-btn:hover { background: #f87171; color: #fff; }
[data-theme="dark"] .expire-picker-wrap {
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .expire-clear-btn {
  background: rgba(255,255,255,0.1);
  color: var(--c-text-mute, #888);
}

/* 만료된 메모 카드 — 매우 옅은 그레이, 삭제는 사용자가 직접 (RULE #21 요청) */
.memo-card.expired {
  opacity: 1;
  background: var(--c-surface-2, #f8f8f8);
  border-left-color: #d1d5db !important;
}
.memo-card.expired .memo-text,
.memo-card.expired .memo-time {
  color: #c4c9d0;
}
.memo-card.expired .memo-pin-lbl {
  color: #d1d5db;
}
[data-theme="dark"] .memo-card.expired {
  background: rgba(255,255,255,0.03);
  border-left-color: #3a3f47 !important;
}
[data-theme="dark"] .memo-card.expired .memo-text,
[data-theme="dark"] .memo-card.expired .memo-time {
  color: #4a5060;
}
[data-theme="dark"] .memo-card.expired .memo-pin-lbl {
  color: #3a3f47;
}



/* ==============================================================
   활동 로그 뷰 (.al-*) — v83 redesign
   RULE #50: vertical timeline 기반
   RULE #53: 동일 컬럼 폭 통일
   ============================================================== */

.al-wrap { padding: 0 16px 60px; }

/* ── KPI 카드 행 ── */
.al-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0 20px;
}
@media (max-width: 700px) { .al-kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px) { .al-kpi-row { grid-template-columns: 1fr; } }

.al-kpi-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--c-surface-1, #fff);
  border: 1px solid var(--c-line-soft, #eee);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
[data-theme="dark"] .al-kpi-card {
  background: var(--c-surface-2, #1e1e1e);
  border-color: rgba(255,255,255,0.08);
}
.al-kpi-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.al-kpi-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--c-text, #111);
  line-height: 1;
}
.al-kpi-lbl {
  font-size: 11px;
  color: var(--c-text-mute, #999);
  margin-top: 3px;
}

/* ── 검색 행 ── */
.al-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.al-search-box {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--c-surface-2, #f5f5f5);
  border: 1px solid var(--c-line-soft, #e0e0e0);
  border-radius: var(--r-pill, 20px);
  padding: 0 12px;
  gap: 8px;
}
.al-search-ico { width: 15px; height: 15px; color: var(--c-text-mute, #aaa); flex-shrink: 0; }
.al-search-box input {
  flex: 1;
  border: none; background: transparent;
  padding: 8px 0;
  font-size: 13px;
  color: var(--c-text, #222);
  outline: none;
}
.al-search-clear {
  background: none; border: none; padding: 2px;
  cursor: pointer; color: var(--c-text-mute, #aaa);
  display: flex; align-items: center;
}
.al-search-clear.hidden { display: none; }
.al-search-clear i { width: 13px; height: 13px; }
[data-theme="dark"] .al-search-box {
  background: var(--c-surface-3, #2a2a2a);
  border-color: rgba(255,255,255,0.1);
}
.al-total { font-size: 12px; color: var(--c-text-mute, #999); white-space: nowrap; }

/* ── 탭 바 ── */
.al-tab-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--c-surface-2, #f5f5f5);
  border-radius: 12px;
  border: 1px solid var(--c-line-soft, #eee);
}
[data-theme="dark"] .al-tab-bar {
  background: var(--c-surface-2, #1a1a1a);
  border-color: rgba(255,255,255,0.07);
}
.al-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--c-text-mute, #888);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.al-tab-btn:hover { background: var(--c-surface-1, #fff); color: var(--c-text, #222); }
.al-tab-btn.active {
  background: var(--c-surface-1, #fff);
  color: var(--c-primary, #88c714);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
[data-theme="dark"] .al-tab-btn:hover,
[data-theme="dark"] .al-tab-btn.active {
  background: var(--c-surface-3, #2a2a2a);
  color: var(--c-primary, #88c714);
}
.al-tab-icon { width: 13px; height: 13px; flex-shrink: 0; }
.al-tab-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--c-primary, #88c714);
  color: #fff;
  border-radius: 20px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
  display: inline-block;
}
.al-tab-count:empty { display: none; }

/* ── 날짜 구분선 ── */
.al-date-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 12px;
}
.al-date-line {
  flex: 1;
  height: 1px;
  background: var(--c-line-soft, #e8e8e8);
}
[data-theme="dark"] .al-date-line { background: rgba(255,255,255,0.08); }
.al-date-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text-mute, #999);
  background: var(--c-surface-2, #f5f5f5);
  border: 1px solid var(--c-line-soft, #eee);
  border-radius: 20px;
  padding: 3px 12px;
  white-space: nowrap;
  letter-spacing: .02em;
}
.al-date-chip.today {
  background: var(--c-primary, #88c714);
  border-color: var(--c-primary, #88c714);
  color: #fff;
}
[data-theme="dark"] .al-date-chip {
  background: var(--c-surface-3, #252525);
  border-color: rgba(255,255,255,0.1);
  color: var(--c-text-mute, #aaa);
}

/* ── 로그 카드 ── */
.al-timeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.al-log-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--c-surface-1, #fff);
  border: 1px solid var(--c-line-soft, #eee);
  border-left: 3px solid var(--al-color, #9ca3af);
  border-radius: 0 10px 10px 0;
  transition: box-shadow .15s, transform .1s;
}
.al-log-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: translateX(2px);
}
[data-theme="dark"] .al-log-card {
  background: var(--c-surface-2, #1e1e1e);
  border-color: rgba(255,255,255,0.07);
  border-left-color: var(--al-color, #9ca3af);
}

.al-log-icon-wrap {
  width: 34px; height: 34px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.al-log-body { flex: 1; min-width: 0; }

.al-log-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text, #111);
  margin-bottom: 2px;
}

.al-log-detail {
  font-size: 12px;
  color: var(--c-text-soft, #555);
  line-height: 1.5;
  word-break: break-word;
  margin-bottom: 5px;
}
[data-theme="dark"] .al-log-detail { color: var(--c-text-mute, #aaa); }

.al-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.al-meta-pill {
  font-size: 11px;
  background: var(--c-surface-2, #f3f3f3);
  border-radius: 4px;
  padding: 1px 7px;
  color: var(--c-text-mute, #888);
}
.al-meta-pill b { font-weight: 600; margin-right: 3px; color: var(--c-text-soft, #666); }
[data-theme="dark"] .al-meta-pill {
  background: rgba(255,255,255,0.07);
  color: var(--c-text-mute, #aaa);
}

.al-log-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
}

.al-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .02em;
}
.al-owner-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.al-time-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--c-text-mute, #aaa);
  font-variant-numeric: tabular-nums;
}

/* ── 빈 상태 ── */
.al-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 60px 0;
  color: var(--c-text-mute, #bbb);
  font-size: 14px;
  text-align: center;
}

/* ── 더 보기 ── */
.al-more-wrap {
  justify-content: center;
  padding: 16px;
}

@media (max-width: 600px) {
  .al-tab-btn { padding: 6px 10px; font-size: 12px; }
  .al-tab-label { display: none; }
  .al-log-card { padding: 10px 12px; gap: 10px; }
  .al-log-icon-wrap { width: 30px; height: 30px; }
  .al-kpi-num { font-size: 18px; }
}

/* ============================================================
   v92 — 메모 인라인 편집 (Inline Edit)
   RULE #16: pencil = 편집, trash-2 = 삭제, x = 닫기/취소
   ============================================================ */

/* 헤더 우측: 수정 버튼 + 공지 토글을 가로로 나열 */
.memo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.memo-time {
  font-size: 11px;
  color: var(--c-text-mute, #aaa);
  font-variant-numeric: tabular-nums;
  flex: 1;
  min-width: 0;
}
.memo-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 수정 버튼 (연필 아이콘) */
.memo-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: var(--c-text-mute, #aaa);
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
  flex-shrink: 0;
}
.memo-edit-btn:hover {
  color: var(--c-primary, #88c714);
  background: var(--c-primary-soft, rgba(136,199,20,0.1));
}
.memo-edit-btn [data-lucide],
.memo-edit-btn svg {
  width: 13px !important;
  height: 13px !important;
}

/* 편집 모드 카드 상태 */
.memo-card.editing {
  border-left-color: var(--c-primary, #88c714);
  background: var(--c-surface-2, #f8f8f8);
}
[data-theme="dark"] .memo-card.editing {
  background: rgba(136,199,20,0.05);
}

/* 편집 textarea */
.memo-edit-ta {
  width: 100%;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid var(--c-primary, #88c714);
  border-radius: 6px;
  background: var(--c-surface, #fff);
  color: var(--c-text, #1a1a1a);
  font-size: 13px;
  line-height: 1.55;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  box-shadow: 0 0 0 2px var(--c-primary-soft, rgba(136,199,20,0.15));
}
[data-theme="dark"] .memo-edit-ta {
  background: var(--c-surface-2, #1e1e1e);
  color: var(--c-text, #e5e5e5);
}
.memo-edit-ta:focus {
  border-color: var(--c-primary, #88c714);
  box-shadow: 0 0 0 3px var(--c-primary-soft, rgba(136,199,20,0.2));
}

/* 편집 모드 버튼 행 */
.memo-edit-btns {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: flex-end;
}
.memo-edit-btns .btn {
  font-size: 12px;
  padding: 4px 12px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.memo-edit-btns .btn [data-lucide],
.memo-edit-btns .btn svg {
  width: 13px !important;
  height: 13px !important;
}

/* ══════════════════════════════════════════════════════════════
   장소 지도 커스텀 컨트롤 & 리사이즈 (v101 places-map v3)
   ══════════════════════════════════════════════════════════════ */

/* 지도 커스텀 버튼 (현재위치 · 전체화면) */
.places-map-ctrl-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 30px !important;
  height: 30px !important;
  background: #fff !important;
  color: #333 !important;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.places-map-ctrl-btn:hover {
  background: var(--c-primary, #88c714) !important;
  color: #fff !important;
}
.places-map-ctrl-btn svg {
  display: block;
  flex-shrink: 0;
}
[data-theme="dark"] .places-map-ctrl-btn {
  background: #1e1e1e !important;
  color: #ccc !important;
  border-color: #444 !important;
}
[data-theme="dark"] .places-map-ctrl-btn:hover {
  background: var(--c-primary, #88c714) !important;
  color: #fff !important;
}

/* 드래그 리사이즈 핸들 */
.places-map-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.88);
  border-top-left-radius: 6px;
  cursor: se-resize;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  transition: background 0.15s, color 0.15s;
  backdrop-filter: blur(2px);
}
.places-map-resize-handle:hover {
  background: var(--c-primary, #88c714);
  color: #fff;
}
[data-theme="dark"] .places-map-resize-handle {
  background: rgba(30, 30, 30, 0.88);
  color: #aaa;
}

/* 전체화면 시 지도가 뷰포트 꽉 차도록 */
.places-map-card:fullscreen #places-leaflet,
.places-map-card:-webkit-full-screen #places-leaflet {
  height: 100vh !important;
}
