/* =================================================================
   I-MAP Theme Override — network-study-shiny 디자인 시스템 적용
   이 파일은 mobile.css / ui.R css_code 이후에 로드되어 덮어씁니다.
================================================================= */

/* ── 구글 폰트: Syne + Outfit ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=Outfit:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

/* ── 디자인 토큰 ─────────────────────────────────────────────── */
:root {
  /* 색상 팔레트 (network-study-shiny) */
  --bg:       #F6F4F1;
  --bg2:      #EDEAE5;
  --bg3:      #E3DFD8;
  --surface:  #FFFFFF;
  --ink:      #12100E;
  --ink2:     #3A3430;
  --ink3:     #7A746E;
  --ink4:     #B4AFA9;
  --rule:     rgba(18,16,14,0.08);
  --rule-md:  rgba(18,16,14,0.12);

  /* 브랜드 컬러 */
  --navy:     #0F2340;
  --navy2:    #1A3A5C;
  --navy3:    #2A5380;
  --amber:    #B87316;
  --green:    #165C35;

  /* 기존 imap 변수 → 새 팔레트로 재매핑 */
  --acc:      #0F2340;
  --acc2:     #1A3A5C;
  --bg-primary: #F6F4F1;
  --bg-card:    #FFFFFF;
  --surf:       #FFFFFF;
  --surf2:      #EDEAE5;
  --t1:         #12100E;
  --t2:         #3A3430;
  --t3:         #7A746E;
  --bd:         rgba(18,16,14,0.10);
  --primary:    #0F2340;
  --success:    #165C35;
  --warning:    #B87316;
  --danger:     #ef4444;
  --border:     rgba(18,16,14,0.10);
  --gradient-primary: linear-gradient(135deg, #0F2340 0%, #1A3A5C 100%);

  /* I-MAP 분류 색상 유지 */
  --cnc:        #165C35;
  --upc:        #B87316;
  --ucc:        #C0392B;

  /* 그림자 */
  --shadow-sm:  0 1px 3px rgba(18,16,14,.05);
  --shadow-md:  0 1px 8px rgba(18,16,14,.06), 0 4px 20px rgba(18,16,14,.05);
  --shadow-lg:  0 2px 16px rgba(18,16,14,.09), 0 8px 40px rgba(18,16,14,.07);

  /* 반경 */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;

  /* 타이포그래피 */
  --font-display: 'Syne', 'Noto Sans KR', sans-serif;
  --font-body:    'Outfit', 'Noto Sans KR', sans-serif;
  --fs-2xs:  10px;
  --fs-xs:   11px;
  --fs-sm:   12px;
  --fs-base: 13px;
  --fs-md:   14px;
  --fs-lg:   15px;
  --fs-xl:   17px;
  --fs-2xl:  22px;
}

/* ── 베이스 ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--bg) !important;
  color:       var(--ink) !important;
  font-family: var(--font-body) !important;
  -webkit-font-smoothing: antialiased;
}

/* Grain texture (배경 노이즈) */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ── 사이드바 (레거시 Shiny 사이드바 기본 숨김) ────────────────── */
.sidebar,
#sidebar,
.sidebar-nav,
.sidebar-panel {
  background: var(--navy)  !important;
  border-right: 1px solid var(--navy2) !important;
}

/* ── 레이어컨트롤 사이드바 — 헤더 ──────────────────────────────── */
.sidebar-header {
  background: linear-gradient(155deg, #0F2340 0%, #1A3A5C 100%) !important;
  padding: 13px 14px 11px !important;           /* 압축: 22→13, 18→11 */
  text-align: center !important;
  position: relative !important;
  flex-shrink: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
}

/* 헤더 노이즈 텍스처 */
.sidebar-header::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 120px; opacity: .04; pointer-events: none;
}

.sidebar-logo {
  font-size: 20px !important;
  color: rgba(255,255,255,.9) !important;
  margin-bottom: 4px !important;
  margin-top: 34px !important;                  /* 닫기 버튼(top:8+height:24=32px) 아래로 충분히 밀기 */
  display: block !important;
}
.sidebar-title {
  font-family: var(--font-display) !important;
  font-size: 13px !important;                   /* 15 → 13 */
  font-weight: 800 !important;
  color: #fff !important;
  letter-spacing: .04em !important;
  line-height: 1.2 !important;
  display: block !important;
}
.sidebar-subtitle {
  font-family: var(--font-body) !important;
  font-size: 9px !important;
  color: rgba(255,255,255,.45) !important;
  letter-spacing: .05em !important;
  margin-top: 2px !important;                   /* 3 → 2 */
  display: block !important;
}

.sidebar-tagline {
  font-family: var(--font-body) !important;
  font-size: 7.5px !important;
  color: rgba(255,255,255,.22) !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
  margin-top: 4px !important;
  display: block !important;
}

/* I-MAP 분류 배지 행 */
.sidebar-badge-row {
  display: flex !important; justify-content: center !important;
  gap: 4px !important; margin-top: 7px !important;  /* 5 → 4, 11 → 7 */
}
.sidebar-badge {
  font-family: var(--font-body) !important;
  font-size: 8px !important; font-weight: 700 !important;
  letter-spacing: .05em !important;
  padding: 2px 6px !important; border-radius: 100px !important;
}
.sidebar-badge.cnc-badge { background: rgba(22,92,53,.3); color: #7ee8a2; border: 1px solid rgba(22,92,53,.5); }
.sidebar-badge.upc-badge { background: rgba(184,115,22,.3); color: #fcd16b; border: 1px solid rgba(184,115,22,.5); }
.sidebar-badge.ucc-badge { background: rgba(192,57,43,.3); color: #fca5a5; border: 1px solid rgba(192,57,43,.5); }

/* 닫기 버튼 */
.sidebar-close-btn {
  position: absolute !important; top: 8px !important; right: 8px !important;
  width: 24px !important; height: 24px !important;
  border: 1px solid rgba(255,255,255,.15) !important;
  background: rgba(255,255,255,.07) !important; color: rgba(255,255,255,.6) !important;
  border-radius: 5px !important; cursor: pointer !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  transition: all .18s !important; padding: 0 !important; z-index: 1 !important;
}
.sidebar-close-btn:hover { background: rgba(255,255,255,.18) !important; color: #fff !important; }

/* ── 레이어컨트롤 사이드바 — 콘텐츠 영역 ───────────────────────── */
.sidebar-content {
  padding: 6px 8px 8px !important;
  background: var(--bg) !important;
  flex: 1 !important; overflow-y: auto !important;
  display: flex !important; flex-direction: column !important;
}

/* 섹션 제목 */
.sidebar-section-title {
  font-family: var(--font-body) !important;
  font-size: 8px !important; font-weight: 700 !important;
  color: var(--ink4) !important;
  text-transform: uppercase !important; letter-spacing: .1em !important;
  margin: 6px 2px 3px !important;              /* 10/5 → 6/3 */
  display: flex !important; align-items: center !important; gap: 4px !important;
}
.sidebar-section-title i { color: var(--navy); opacity: .5; font-size: 8px !important; }

/* 구분선 */
.sidebar-divider {
  border: none !important; border-top: 1px solid var(--rule) !important;
  margin: 5px 0 !important;                    /* 8 → 5 */
}

/* 필터 그룹 카드 */
.filter-group {
  margin-bottom: 4px !important;               /* 6 → 4 */
  padding: 5px 8px !important;                 /* 8/10 → 5/8 */
  background: #fff !important;
  border-radius: 8px !important;
  border: 1px solid rgba(18,16,14,.07) !important;
  box-shadow: 0 1px 3px rgba(18,16,14,.03) !important;
  transition: border-color .18s, box-shadow .18s !important;
}
.filter-group:hover { border-color: rgba(15,35,64,.16) !important; }

/* 필터 라벨 */
.filter-label {
  font-size: 9px !important; font-weight: 700 !important;   /* 10 → 9 */
  color: var(--ink3) !important;
  text-transform: uppercase !important; letter-spacing: .07em !important;
  margin-bottom: 4px !important;               /* 6 → 4 */
  display: flex !important; align-items: center !important; gap: 4px !important;
}
.filter-label i { color: var(--navy); opacity: .55; font-size: 9px !important; }

/* fileInput 내부 압축 */
.filter-group .shiny-input-container { margin-bottom: 0 !important; }
.filter-group .form-group { margin-bottom: 0 !important; }
.filter-group .input-group { height: 26px !important; }
.filter-group .btn-file,
.filter-group .input-group-btn .btn {
  background: var(--navy) !important; color: #fff !important;
  border: none !important; border-radius: 0 5px 5px 0 !important;
  font-size: 10px !important; font-family: var(--font-body) !important;
  padding: 2px 8px !important; height: 26px !important; line-height: 22px !important;
}
.filter-group .form-control[readonly] {
  font-size: 10px !important; background: var(--bg2) !important;
  border-radius: 5px 0 0 5px !important; color: var(--ink3) !important;
  height: 26px !important; padding: 2px 6px !important; line-height: 22px !important;
}
/* 업로드 진행바 숨기기 — 공간 절약 */
.filter-group .progress { display: none !important; }

/* selectInput 압축 — 드롭박스 높이 통일 */
.filter-group .selectize-input,
.filter-group .form-control:not([readonly]) {
  min-height: 28px !important; height: 28px !important;
  padding: 3px 8px !important; font-size: 11px !important;
  line-height: 22px !important;
}
.filter-group .selectize-control { min-height: 28px !important; margin-bottom: 0 !important; }

/* ── 드롭박스 이상 모양(FOUC) 수정 ─────────────────────────────── */
/* Selectize 초기화 전 네이티브 <select> 플래시 완전 차단 */
.sidebar-content .shiny-input-container .form-group > select.form-control,
.sidebar-content .shiny-input-container > select.form-control,
.filter-group .form-group > select.form-control {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  opacity: 0 !important; pointer-events: none !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important;
}
/* Selectize가 .selectized 클래스 추가 후 완전히 숨김 */
.sidebar-content select.selectized,
.filter-group select.selectized {
  display: none !important;
}
/* Selectize 컨트롤 자체 정상화 */
.sidebar-content .selectize-control,
.filter-group .selectize-control {
  margin-bottom: 0 !important;
}
.sidebar-content .shiny-input-container,
.filter-group .shiny-input-container {
  margin-bottom: 0 !important;
}
.sidebar-content .form-group,
.filter-group .form-group {
  margin-bottom: 0 !important;
}
/* 기간 그리드: 두 드롭박스 동일 너비 + 정렬 */
.filter-group > div[style*="grid-template-columns:1fr 1fr"] > .shiny-input-container,
.filter-group > div[style*="grid-template-columns:1fr 1fr"] > .shiny-input-container > .form-group {
  margin-bottom: 0 !important; width: 100% !important;
}

/* CNC/UPC/UCC/미분류 체크박스 — 커스텀 스타일 (네이티브 네모 제거) */
.imap-filter-chips .shiny-input-checkboxgroup > .shiny-options-group {
  display: flex !important; flex-direction: column !important; gap: 2px !important;
}
.imap-filter-chips .checkbox-inline {
  display: flex !important; align-items: center !important; gap: 6px !important;
  cursor: pointer !important; padding-left: 0 !important;
  margin-left: 0 !important; margin-right: 0 !important;
  font-size: 11px !important; font-weight: 600 !important;
  user-select: none !important;
}
/* 네이티브 체크박스 완전 커스텀 */
.imap-filter-chips input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: 13px !important; height: 13px !important;
  border: 1.5px solid rgba(15,35,64,.22) !important;
  border-radius: 3px !important;
  background: rgba(255,255,255,.9) !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  position: static !important;
  transition: background .15s, border-color .15s !important;
  display: inline-grid !important; place-items: center !important;
}
.imap-filter-chips input[type="checkbox"]:checked {
  background: var(--navy) !important;
  border-color: var(--navy) !important;
}
.imap-filter-chips input[type="checkbox"]:checked::after {
  content: '' !important; display: block !important;
  width: 4px !important; height: 7px !important;
  border: 1.5px solid #fff !important;
  border-top: none !important; border-left: none !important;
  transform: rotate(45deg) translateY(-1px) !important;
}
/* 분류별 텍스트 색상 */
.imap-filter-chips .checkbox-inline:nth-child(1) { color: var(--green)  !important; }
.imap-filter-chips .checkbox-inline:nth-child(2) { color: var(--amber)  !important; }
.imap-filter-chips .checkbox-inline:nth-child(3) { color: #C0392B      !important; }
.imap-filter-chips .checkbox-inline:nth-child(4) { color: var(--ink3)  !important; font-weight: 500 !important; }
/* 분류에 따른 체크 색상 */
.imap-filter-chips .checkbox-inline:nth-child(1) input:checked { background: var(--green) !important; border-color: var(--green) !important; }
.imap-filter-chips .checkbox-inline:nth-child(2) input:checked { background: var(--amber) !important; border-color: var(--amber) !important; }
.imap-filter-chips .checkbox-inline:nth-child(3) input:checked { background: #C0392B !important; border-color: #C0392B !important; }
.imap-filter-chips .checkbox-inline:nth-child(4) input:checked { background: var(--ink3) !important; border-color: var(--ink3) !important; }

/* 필터 적용 안내 박스 */
.filter-info-box {
  background: linear-gradient(145deg, rgba(15,35,64,.05), rgba(15,35,64,.03)) !important;
  border: 1px solid rgba(15,35,64,.12) !important;
  border-radius: 8px !important; padding: 6px 8px !important;  /* 9/10 → 6/8 */
  margin-top: 2px !important;
}
.filter-info-title {
  color: var(--navy) !important; font-family: var(--font-body) !important;
  font-size: 10px !important; font-weight: 700 !important;     /* 11 → 10 */
  margin-bottom: 2px !important;
  display: flex !important; align-items: center !important; gap: 4px !important;
}
.filter-info-title i { color: var(--green); font-size: 10px !important; }
.filter-info-desc {
  color: var(--ink3) !important; font-family: var(--font-body) !important;
  font-size: 9px !important; line-height: 1.4 !important;      /* 10 → 9 */
}

/* ── 사이드바 하단 고정 푸터 (버튼 항상 노출) ────────────── */
.sidebar-sticky-footer {
  flex-shrink: 0 !important;
  background: var(--bg) !important;
  border-top: 1px solid var(--rule) !important;
  padding: 5px 8px 8px !important;
}

.sidebar-actions {
  display: flex !important; flex-direction: column !important;
  gap: 4px !important;
  padding-top: 4px !important;
}
.sidebar-btn {
  width: 100% !important; display: flex !important;
  align-items: center !important; justify-content: center !important;
  gap: 5px !important; padding: 6px 10px !important;           /* 8/12 → 6/10 */
  border-radius: 8px !important; font-family: var(--font-body) !important;
  font-size: 11px !important; font-weight: 600 !important;     /* 12 → 11 */
  border: none !important; cursor: pointer !important;
  transition: all .18s !important;
}
.sidebar-btn-ghost {
  background: transparent !important;
  border: 1px solid rgba(15,35,64,.15) !important; color: var(--ink2) !important;
}
.sidebar-btn-ghost:hover { background: rgba(15,35,64,.06) !important; color: var(--navy) !important; }
.sidebar-btn-word {
  background: linear-gradient(135deg, #1e3a6e 0%, #2b5797 100%) !important; color: #fff !important;
}
.sidebar-btn-word:hover { opacity: .88 !important; }
.sidebar-btn-primary {
  background: linear-gradient(135deg, #0F2340 0%, #1A3A5C 100%) !important; color: #fff !important;
}
.sidebar-btn-primary:hover { opacity: .88 !important; }
.sidebar-btn-summary {
  background: linear-gradient(135deg, #065F46 0%, #059669 100%) !important; color: #fff !important;
}
.sidebar-btn-summary:hover { opacity: .88 !important; }

/* 2열 버튼 행 */
.sidebar-btn-row {
  display: flex !important;
  gap: 4px !important;
  width: 100% !important;
}
.sidebar-btn-half {
  flex: 1 !important;
  min-width: 0 !important;
  font-size: 10px !important;
  padding: 6px 4px !important;
}

/* 보고서 기간 설정 */
.sidebar-report-period {
  padding: 0 0 4px;
}
.sidebar-period-label {
  font-family: var(--font-body) !important;
  font-size: 8px !important;
  font-weight: 700 !important;
  color: var(--ink4) !important;
  text-transform: uppercase !important;
  letter-spacing: .1em !important;
  margin-bottom: 4px !important;
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.sidebar-period-label i { color: var(--navy); opacity: .5; font-size: 8px !important; }
.sidebar-report-period .form-group { margin-bottom: 0 !important; }
.sidebar-report-period .shiny-input-container { width: 100% !important; }
.sidebar-report-period .input-daterange,
.sidebar-report-period .input-daterange.input-group {
  display: flex !important;
  align-items: center !important;
  gap: 2px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.sidebar-report-period .input-daterange > input,
.sidebar-report-period .input-daterange.input-group > input,
.sidebar-report-period input[type="text"] {
  height: 26px !important;
  font-size: 10px !important;
  font-family: var(--font-body) !important;
  border: 1px solid var(--rule-md) !important;
  border-radius: 5px !important;
  padding: 0 5px !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  background: #fff !important;
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: 0 !important;
  max-width: none !important;
  box-sizing: border-box !important;
  display: block !important;
}
.sidebar-report-period .input-group-addon {
  background: transparent !important;
  border: none !important;
  padding: 0 3px !important;
  font-size: 9px !important;
  font-family: var(--font-body) !important;
  color: var(--ink4) !important;
  flex-shrink: 0 !important;
  display: block !important;
  float: none !important;
  width: auto !important;
}

/* 사이드바 내 탭 버튼 */
.nav-item-btn,
.sidebar-nav-item {
  border-radius: var(--radius-sm) !important;
  font-family: var(--font-body) !important;
  font-size: var(--fs-sm) !important;
  transition: background .18s, color .18s !important;
}

.nav-item-btn.active,
.nav-item-btn:hover,
.sidebar-nav-item.active {
  background: rgba(255,255,255,.12) !important;
  color: #fff !important;
}

/* ── 헤더 바 ─────────────────────────────────────────────────── */
.top-header,
.main-header,
#main-header {
  background: rgba(246,244,241,.94) !important;
  backdrop-filter: blur(20px) saturate(1.5) !important;
  border-bottom: 1px solid var(--rule) !important;
  box-shadow: 0 1px 0 var(--rule) !important;
}

.header-title,
.page-title {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  color: var(--navy) !important;
  letter-spacing: .01em;
}

/* ── 카드 ────────────────────────────────────────────────────── */
.card,
.kpi-card,
.chart-card,
.panel-card,
.info-card,
.stat-card,
.hospital-card,
.recommend-card,
.dispatch-card,
.filter-card,
.section-card,
.summary-card {
  background:    var(--surface) !important;
  border:        1px solid var(--rule) !important;
  border-radius: var(--radius-md) !important;
  box-shadow:    var(--shadow-md) !important;
  transition:    box-shadow .25s, transform .25s !important;
}

.card:hover,
.kpi-card:hover,
.chart-card:hover {
  box-shadow: var(--shadow-lg) !important;
  transform: translateY(-1px) !important;
}

/* 카드 타이틀 */
.card-title,
.chart-title,
.section-title,
.kpi-label {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  color: var(--navy) !important;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: var(--fs-xs) !important;
}

/* KPI 숫자 */
.kpi-value,
.stat-value,
.kpi-number {
  font-family: var(--font-display) !important;
  font-weight: 800 !important;
  color: var(--navy) !important;
}

/* ── 버튼 ────────────────────────────────────────────────────── */
.btn-primary,
.btn-main,
.action-btn,
button[class*="btn-rec"],
button[class*="btn-ai"] {
  background:    var(--navy) !important;
  border-color:  var(--navy) !important;
  color:         #fff !important;
  font-family:   var(--font-body) !important;
  font-weight:   600 !important;
  border-radius: var(--radius-sm) !important;
  transition:    all .18s !important;
}

.btn-primary:hover,
.btn-main:hover {
  background:   var(--navy2) !important;
  border-color: var(--navy2) !important;
  transform:    translateY(-1px) !important;
}

.btn-secondary {
  background:    transparent !important;
  border:        1px solid var(--rule-md) !important;
  color:         var(--ink2) !important;
  font-family:   var(--font-body) !important;
  border-radius: var(--radius-sm) !important;
}

/* ── I-MAP 분류 배지 ──────────────────────────────────────────── */
.badge-cnc, .tag-cnc { background: rgba(22,92,53,.1)  !important; color: var(--green)  !important; border: 1px solid rgba(22,92,53,.2) !important; border-radius: 100px !important; }
.badge-upc, .tag-upc { background: rgba(184,115,22,.1)!important; color: var(--amber)  !important; border: 1px solid rgba(184,115,22,.2)!important; border-radius: 100px !important; }
.badge-ucc, .tag-ucc { background: rgba(192,57,43,.1) !important; color: #C0392B       !important; border: 1px solid rgba(192,57,43,.2) !important; border-radius: 100px !important; }

/* ── 모바일 탭 네비게이션 ──────────────────────────────────────── */
.mobile-nav,
.bottom-nav,
.tab-nav {
  background: rgba(246,244,241,.96) !important;
  backdrop-filter: blur(20px) saturate(1.4) !important;
  border-top: 1px solid var(--rule) !important;
}

.mobile-nav-btn,
.tab-btn {
  font-family: var(--font-body) !important;
  color: var(--ink3) !important;
  transition: color .18s !important;
}

.mobile-nav-btn.active,
.tab-btn.active {
  color: var(--navy) !important;
  font-weight: 600 !important;
}

/* 탭 활성 인디케이터 */
.mobile-nav-btn.active::before,
.tab-btn.active::before {
  background: var(--navy) !important;
}

/* ── 입력 요소 ────────────────────────────────────────────────── */
.form-control,
.selectize-input,
input[type="text"],
input[type="number"],
select,
textarea {
  background: var(--surface) !important;
  border: 1px solid var(--rule-md) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--ink) !important;
  font-family: var(--font-body) !important;
  font-size: var(--fs-sm) !important;
}

.form-control:focus,
.selectize-input.focus {
  border-color: var(--navy) !important;
  box-shadow: 0 0 0 3px rgba(15,35,64,.08) !important;
  outline: none !important;
}

/* selectize 내부 커서 input — 전체 input[type="text"] 규칙이 적용되어
   선택값 옆에 네모 박스로 보이는 오류 수정 */
.selectize-input > input,
.selectize-input > input[type="text"] {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  min-height: unset !important;
  font-size: inherit !important;
  color: inherit !important;
  width: auto !important;
  line-height: inherit !important;
}

/* ── 레이블 ─────────────────────────────────────────────────── */
.control-label,
.filter-label,
label {
  font-family: var(--font-body) !important;
  font-size: var(--fs-xs) !important;
  font-weight: 600 !important;
  color: var(--ink3) !important;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ── Leaflet 지도 ─────────────────────────────────────────────── */
.leaflet-container {
  background: var(--bg2) !important;
  border-radius: var(--radius-md) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  border: 1px solid var(--rule) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  font-family: var(--font-body) !important;
}

.leaflet-popup-tip {
  background: var(--surface) !important;
}

/* ── 모달 ────────────────────────────────────────────────────── */
.modal-content {
  background:    var(--surface) !important;
  border:        1px solid var(--rule) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow:    var(--shadow-lg) !important;
}

.modal-header {
  border-bottom: 1px solid var(--rule) !important;
  font-family:   var(--font-display) !important;
}

.modal-title {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  color:        var(--navy) !important;
}

/* ── 테이블 (DT) ─────────────────────────────────────────────── */
.dataTables_wrapper,
table.dataTable {
  font-family: var(--font-body) !important;
  font-size: var(--fs-sm) !important;
}

table.dataTable thead th {
  background: var(--bg2) !important;
  color: var(--ink2) !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
  font-size: var(--fs-xs) !important;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule-md) !important;
}

table.dataTable tbody tr:hover {
  background: var(--bg2) !important;
}

/* ── 프로그레스 바 ────────────────────────────────────────────── */
.progress-bar,
.bar-fill {
  background: var(--navy) !important;
}

/* ── 스크롤바 ────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 2px; }

/* ── 뱃지 / 태그 공통 ────────────────────────────────────────── */
.badge, .tag {
  font-family: var(--font-body) !important;
  font-size: var(--fs-2xs) !important;
  font-weight: 700 !important;
  border-radius: 100px !important;
  letter-spacing: .04em;
}

/* ── 로딩 스피너 ─────────────────────────────────────────────── */
.load-container .load-content {
  background: var(--navy) !important;
  border-radius: 50% !important;
}

/* ── 툴팁 ────────────────────────────────────────────────────── */
.tooltip .tooltip-inner,
.shiny-notification {
  background: var(--navy) !important;
  font-family: var(--font-body) !important;
  font-size: var(--fs-sm) !important;
  border-radius: var(--radius-sm) !important;
}

/* ── 필터 배너 ───────────────────────────────────────────────── */
.filter-info-banner,
.filter-banner {
  background: rgba(15,35,64,.06) !important;
  border: 1px solid rgba(15,35,64,.12) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--navy) !important;
  font-family: var(--font-body) !important;
}

/* ── 아이콘 컬러 재정의 ──────────────────────────────────────── */
.fa, .fas, .far, .fab {
  color: inherit;
}

.text-acc, .text-primary { color: var(--navy) !important; }
.text-success            { color: var(--green) !important; }
.text-warning            { color: var(--amber) !important; }
.bg-acc, .bg-primary     { background: var(--navy) !important; }

/* ── 애니메이션 키프레임 ─────────────────────────────────────── */
@keyframes up   { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:none} }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes lx   { from{transform:scaleX(0)} to{transform:scaleX(1)} }

/* ── 섹션 레이블 (network-study-shiny 스타일) ──────────────────── */
.ns-lbl {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: .55rem;
}
.ns-lbl::before {
  content: '';
  width: 22px; height: 2px;
  background: var(--navy);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ── 홈 화면 KPI 그리드 ──────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.kpi-card {
  padding: .9rem 1rem;
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--navy);
  border-radius: 0 2px 2px 0;
}

.kpi-card.cnc::before { background: var(--green); }
.kpi-card.upc::before { background: var(--amber); }
.kpi-card.ucc::before { background: #C0392B; }

/* ── 구분선 ─────────────────────────────────────────────────── */
hr, .divider {
  border-color: var(--rule) !important;
}

/* ── KTAS 색상 (기존 유지, 채도 약간 낮춤) ──────────────────── */
.ktas-1, [data-ktas="1"] { color: #C0392B !important; }
.ktas-2, [data-ktas="2"] { color: #B87316 !important; }
.ktas-3, [data-ktas="3"] { color: #B8971A !important; }
.ktas-4, [data-ktas="4"] { color: var(--green) !important; }
.ktas-5, [data-ktas="5"] { color: var(--navy3) !important; }

/* ── 선택된 행 하이라이트 ────────────────────────────────────── */
.selected, tr.selected {
  background: rgba(15,35,64,.06) !important;
}

/* ── 모바일 온보딩/단계 마법사 ───────────────────────────────── */
.wizard-step-active,
.step-active,
.onboarding-dot.active {
  background: var(--navy) !important;
}

.wizard-step,
.step-indicator {
  border-color: var(--navy) !important;
  color: var(--navy) !important;
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
}

/* ── 그래프 카드 제목 선 데코레이터 ─────────────────────────── */
.chart-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--navy);
}

.chart-card-header::before {
  content: '';
  width: 18px; height: 2px;
  background: var(--navy);
  border-radius: 1px;
  flex-shrink: 0;
}

/* ── 실시간 관제 화면 오버레이 텍스트 ───────────────────────── */
.dispatch-overlay,
.live-status {
  font-family: var(--font-display) !important;
  font-weight: 700 !important;
}

/* ── 보고서 생성 버튼 영역 ───────────────────────────────────── */
.settings-section,
.report-section {
  background: var(--bg2) !important;
  border: 1px solid var(--rule) !important;
  border-radius: var(--radius-md) !important;
  padding: 1.2rem !important;
}

/* ================================================================
   I-NET 대화방 (m-screen-chat) 레이아웃 수정 — 모바일 전용
   chat-wrap이 flex:1로 높이를 받지 못하는 문제 해결
================================================================ */
#m-screen-chat.active {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
#m-screen-chat .m-chat-wrap {
  flex: 1;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
/* hotline/meddir 모드일 때 AI 채팅 입력창 완전 숨김 (display:flex !important 우선순위 극복) */
#m-screen-chat.meddir-active .m-chat-wrap,
#m-screen-chat.hotline-active .m-chat-wrap {
  display: none !important;
  flex: 0 0 0 !important;
}
/* 의료지도 채팅 오버레이 배경 (영상 위에 잘 보이도록) */
#md-chat-overlay {
  background: rgba(6,13,26,.7);
  backdrop-filter: blur(4px);
}
#m-screen-chat .m-chat-msgs {
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}
#m-screen-chat .m-chat-inputbar {
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: flex-end !important;
}
/* 핫라인 모드: 메시지 패널이 flex:1 차지 */
#chat-hotline-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#chat-hotline-panel #inet-msgs {
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  touch-action: pan-y !important;
  -webkit-overflow-scrolling: touch !important;
}

/* ================================================================
   PC DESKTOP — network-study-shiny 레이아웃 완전 재구성
   모바일(≤768px)은 imap2_deploy 원본 그대로 유지
================================================================ */
@media (min-width: 769px) {

  /* ═══════════════════════════════════════════════
     0. bslib page_fillable 래퍼 패딩/갭 완전 제거
        page_fillable()이 body에 bslib-gap-spacing 클래스를 추가하여
        padding: 1rem (16px) 을 적용 → 컨텐츠가 박스처럼 보이는 원인
  ═══════════════════════════════════════════════ */
  body.bslib-page-fill,
  body.bslib-gap-spacing,
  .bslib-gap-spacing {
    padding: 0 !important;
    gap: 0 !important;
    margin: 0 !important;
  }
  /* bslib-page-fill overflow 차단 */
  body.bslib-page-fill {
    height: 100vh !important;
    overflow: hidden !important;
  }
  body > .html-fill-item {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  /* ═══════════════════════════════════════════════
     1. 배경 & 기본 폰트
  ═══════════════════════════════════════════════ */
  html {
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
  }
  body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    overflow: hidden !important;
    background: #F6F4F1 !important;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
  }

  /* ═══════════════════════════════════════════════
     2. imap2_deploy 기존 사이드바/헤더 제거
        → 사이드바는 오버레이 드로어로 전환
  ═══════════════════════════════════════════════ */
  .sidebar-container {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    height: 100vh !important; width: 230px !important;
    z-index: 200 !important;
    transform: translateX(-100%) !important;
    transition: transform .28s cubic-bezier(.4,0,.2,1) !important;
    box-shadow: 6px 0 32px rgba(15,35,64,.28) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--bg) !important;
  }
  .sidebar-container.ns-open { transform: translateX(0) !important; }
  .sidebar-container .sidebar-content { overflow-y: auto !important; }
  .app-header { display: none !important; }

  /* ═══════════════════════════════════════════════
     3-4-5. 레이아웃 — position:absolute/fixed 방식
        flex 체인에 의존하지 않고 각 레이어를 inset:0으로 채움
        bslib html-fill-container 래퍼 영향 완전 차단
  ═══════════════════════════════════════════════ */

  /* ── 메인 컨테이너: 뷰포트 고정 ── */
  .app-container {
    position: fixed !important;
    top: 56px !important;          /* 헤더 52px + 진행바 2px + 2px 여유 */
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: calc(100vh - 56px) !important;   /* 명시적 높이 — top+bottom 모호성 제거 */
    overflow: hidden !important;
    z-index: 1 !important;
    background: transparent !important;
  }

  /* ── main-area: app-container 전체 채우기 ── */
  .main-area {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  /* ── dashboard-content: main-area 채우기 (flex 자식) ── */
  .dashboard-content {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    position: relative !important;
    background: transparent !important;
  }

  /* ── tabbable: dashboard-content flex 자식 (bslib html-fill-item 래퍼 대응) ── */
  .dashboard-content > .tabbable,
  .dashboard-content > .html-fill-item > .tabbable,
  .dashboard-content > .html-fill-container > .tabbable {
    flex: 1 !important;
    min-height: 0 !important;
    position: relative !important;
    overflow: hidden !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* ── #main_tabs(ul) 숨김 ── */
  #main_tabs {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* ── tab-content: tabbable 절대 채우기 ── */
  .dashboard-content > .tabbable > .tab-content,
  .dashboard-content > .html-fill-item > .tabbable > .tab-content,
  .dashboard-content > .html-fill-container > .tabbable > .tab-content {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    display: flex !important;
    flex-direction: column !important;
  }

  /* ── 비활성 탭 숨김 ── */
  .tabbable .tab-pane:not(.active) {
    display: none !important;
  }

  /* ── 활성 탭: tab-content 절대 채우기, 콘텐츠 길면 세로 스크롤 ── */
  .tabbable .tab-pane.active {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;       /* 트랙패드 두 손가락 스크롤 보장 */
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-y: contain !important;
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  /* 탭 내부에 자체 스크롤 컨테이너가 있을 때 더블 스크롤 방지 */
  .tabbable .tab-pane.active > .ns-tab-panel,
  .tabbable .tab-pane.active > .ns-panel-layout {
    min-height: 100%;
  }

  /* ── 모든 탭 직접 자식 div: 절대 채우기 + 콘텐츠 길면 세로 스크롤 ── */
  .tabbable .tab-pane.active > div,
  .tabbable .tab-pane.active > .ns-tab-panel,
  .tabbable .tab-pane.active > .ns-panel-layout,
  .tabbable .tab-pane.active > .ns-geo-layout,
  .tabbable .tab-pane.active > .ns-home-layout {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;       /* 트랙패드 wheel 통과 + 내부 콘텐츠 길면 스크롤 */
  }

  /* bslib html-fill-item 래퍼 대응 */
  .tab-pane.active > .html-fill-item,
  .tab-pane.active > .html-fill-container {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    height: auto !important;
    width: auto !important;
  }
  /* ns-ctrl-panel: 관제는 자체 3컬럼 레이아웃이라 내부 패널이 스크롤 담당 */
  .tab-pane.active .ns-ctrl-panel {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    overflow: hidden !important;
  }

  /* ── ns-tab-panel: 헤더+바디 flex 컬럼 레이아웃 ── */
  .tabbable .tab-pane.active > .ns-tab-panel {
    display: flex !important;
    flex-direction: column !important;
  }
  /* ── ns-tab-hdr: HTML .lbl + .sh + .sub-lead 스타일 적용 ── */
  .ns-tab-hdr {
    flex-shrink: 0 !important;
    padding: 16px 36px 14px !important;
    border-bottom: 1px solid rgba(18,16,14,.08) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    background: linear-gradient(90deg,
      rgba(255,255,255,0) 60%,
      color-mix(in srgb, var(--tab-accent, #0F2340) 8%, transparent) 100%
    ) !important;
    position: relative !important;
  }
  .ns-tab-hdr::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important; right: 0 !important; bottom: 0 !important;
    height: 2px !important;
    background: linear-gradient(90deg, var(--tab-accent, #0F2340) 0%, transparent 60%) !important;
    opacity: .35 !important;
  }
  /* HTML .lbl: 작은 대문자 태그 + 좌측 라인 */
  .ns-tab-hlbl {
    font-family: 'Syne', sans-serif !important;
    font-size: .6rem !important; font-weight: 700 !important;
    letter-spacing: .22em !important; text-transform: uppercase !important;
    color: var(--tab-accent, #0F2340) !important;
    display: inline-flex !important; align-items: center !important; gap: 9px !important;
    margin-bottom: .55rem !important;
  }
  .ns-tab-hlbl::before {
    content: '' !important; width: 22px !important; height: 2px !important;
    background: var(--tab-accent, #0F2340) !important;
    border-radius: 1px !important; flex-shrink: 0 !important;
  }
  /* HTML h2.sh: 큰 제목 — clamp(1.7rem,3vw,2.5rem) 기준, 대시보드 공간 고려해 약간 스케일 */
  .ns-tab-htitle {
    font-family: 'Syne', sans-serif !important;
    font-size: clamp(1.4rem, 2.2vw, 2rem) !important; font-weight: 700 !important;
    line-height: 1.1 !important;
    color: var(--ink) !important; margin: 0 !important;
  }
  /* HTML p.sub-lead: 설명 텍스트 */
  .ns-tab-hdesc {
    font-size: .93rem !important; color: var(--ink3) !important;
    line-height: 1.82 !important; margin: .4rem 0 0 !important;
    font-weight: 400 !important;
  }
  /* 카드 컨테이너 (기존 ns-tab-fill 대체) */
  .ns-tab-body {
    flex: 1 !important; min-height: 0 !important;
    display: flex !important; gap: 14px !important;
    padding: 12px 16px !important; overflow: hidden !important;
    align-items: stretch !important;
  }
  /* panel-layout / nedis-layout가 ns-tab-panel 안에 있을 때 flex:1로 채우기 */
  .ns-tab-panel > .ns-panel-layout,
  .ns-tab-panel > .ns-nedis-layout {
    flex: 1 !important; min-height: 0 !important; height: auto !important;
  }

  /* ── 탭 헤더 슬라이드업 진입 애니메이션 (HTML .lbl / .sh / .sub-lead 방식) ── */
  @keyframes ns-tab-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
  .ns-tab-panel-entering .ns-tab-hlbl {
    animation: ns-tab-in .5s 0s both !important;
  }
  .ns-tab-panel-entering .ns-tab-htitle {
    animation: ns-tab-in .52s .1s both !important;
  }
  .ns-tab-panel-entering .ns-tab-hdesc {
    animation: ns-tab-in .52s .22s both !important;
  }

  /* ── 메뉴별 테마 색상 ── */
  .theme-ai     { --tab-accent: #7C3AED; }
  .theme-comp   { --tab-accent: #B87316; }
  .theme-flow   { --tab-accent: #0891B2; }
  .theme-stp    { --tab-accent: #165C35; }
  .theme-db     { --tab-accent: #0F2340; }
  .theme-res    { --tab-accent: #C0392B; }
  .theme-nedis  { --tab-accent: #0284C7; }
  .theme-inet   { --tab-accent: #8B5CF6; }

  /* ── 관제 탭 버튼 강조 ── */
  .ns-tab.ns-tab-ctrl {
    color: #ef4444 !important;
    font-weight: 700 !important;
    letter-spacing: .02em !important;
  }
  .ns-tab.ns-tab-ctrl.active {
    border-bottom-color: #ef4444 !important;
  }

  /* 관제 지도 병원명 permanent 레이블 */
  .ctrl-hosp-label {
    background: rgba(255,255,255,0.92) !important;
    border: none !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.18) !important;
    border-radius: 5px !important;
    padding: 2px 7px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #0F2340 !important;
    white-space: nowrap !important;
  }
  .ctrl-hosp-label::before { display: none !important; }

  /* ══════════════════════════════════════════
     실시간 관제 탭 레이아웃
  ══════════════════════════════════════════ */
  .ns-ctrl-panel {
    background: #f0f2f6 !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  /* ── KPI 스트립 ── */
  .ns-ctrl-kpi-strip {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 5px 12px !important;
    background: #fff !important;
    border-bottom: 1px solid rgba(15,35,64,.08) !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 4px rgba(15,35,64,.06) !important;
  }
  .ns-ctrl-kpi-box {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #f8f9fb !important;
    border: 1px solid rgba(15,35,64,.08) !important;
    border-radius: 7px !important;
    padding: 4px 10px !important;
    min-width: 98px !important;
  }
  .ns-ctrl-kpi-stack { flex: 1 1 auto !important; min-width: 0 !important; }
  .ns-ctrl-kpi-spark {
    margin-top: 3px !important;
    height: 14px !important;
    opacity: .85 !important;
    pointer-events: none !important;
  }
  .ns-ctrl-kpi-spark svg { display: block !important; width: 100% !important; height: 14px !important; }
  .ns-ctrl-kpi-box.ns-ctrl-kpi-red {
    background: rgba(192,57,43,.06) !important;
    border-color: rgba(192,57,43,.2) !important;
  }
  .ns-ctrl-kpi-dot {
    width: 8px !important; height: 8px !important;
    border-radius: 50% !important; flex-shrink: 0 !important;
  }
  .ns-ctrl-dot-green { background: #165C35 !important; }
  .ns-ctrl-dot-blue  { background: #2A5380 !important; }
  .ns-ctrl-dot-navy  { background: #0F2340 !important; }
  .ns-ctrl-dot-red   { background: #C0392B !important; }

  /* 날짜 선택기 */
  .ns-ctrl-date-wrap {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .ns-ctrl-date-lbl {
    font-family: var(--font-body) !important;
    font-size: 9px;
    color: rgba(15,35,64,.5);
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .ns-ctrl-date-wrap .form-group { margin-bottom: 0 !important; }
  .ns-ctrl-date-wrap .shiny-input-container { width: auto !important; }
  .ns-ctrl-date-wrap .input-group {
    border-radius: 4px;
    border: 1px solid rgba(15,35,64,.2) !important;
    background: #fff;
    height: 26px !important;
    width: 138px !important;
    flex-shrink: 0 !important;
  }
  .ns-ctrl-date-wrap input[type="text"] {
    height: 24px !important;
    font-size: 11px !important;
    font-family: 'Outfit', sans-serif !important;
    color: #0F2340 !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 6px !important;
    background: transparent !important;
    width: calc(100% - 28px) !important;
  }
  .ns-ctrl-date-wrap .input-group-addon {
    width: 28px !important;
    height: 24px !important;
    padding: 0 6px !important;
    background: rgba(15,35,64,.06) !important;
    border: none !important;
    border-left: 1px solid rgba(15,35,64,.15) !important;
    font-size: 10px !important;
    flex-shrink: 0 !important;
  }
  .ns-ctrl-kpi-val {
    font-family: 'Outfit', sans-serif !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #0F2340 !important;
    line-height: 1 !important;
  }
  .ns-ctrl-kpi-red .ns-ctrl-kpi-val { color: #C0392B !important; }
  .ns-ctrl-kpi-lbl {
    font-family: var(--font-body) !important;
    font-size: 9px !important;
    color: rgba(15,35,64,.45) !important;
    letter-spacing: .03em !important;
    margin-top: 2px !important;
  }

  /* ── AI 관제 브리핑 ────────────────────────────── */
  /* ── 관제탭 액션 버튼 공통 (AI 브리핑 / 정리) ─ */
  .ns-ctrl-brief-btn,
  .ns-ctrl-cleanup-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 5px 11px !important;
    border-radius: 14px !important;
    font-family: var(--font-body) !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    letter-spacing: .02em !important;
    cursor: pointer !important;
    transition: transform .12s ease, box-shadow .15s ease, filter .12s ease !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    height: 26px !important;
    box-sizing: border-box !important;
  }
  .ns-ctrl-brief-btn svg,
  .ns-ctrl-cleanup-btn svg {
    flex-shrink: 0 !important;
  }

  /* ── AI 브리핑: 파랑→인디고 그라데이션 ─ */
  .ns-ctrl-brief-btn {
    background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
    border: 1px solid #4f46e5 !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(79,70,229,.28) !important;
  }
  .ns-ctrl-brief-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(79,70,229,.4) !important;
    filter: brightness(1.08) !important;
  }
  .ns-ctrl-brief-btn.busy { opacity: .6 !important; cursor: wait !important; pointer-events: none !important; }
  .ns-ctrl-brief-btn.busy svg { animation: briefSpin 1s linear infinite; }
  @keyframes briefSpin { to { transform: rotate(360deg); } }

  /* ── 정리: 진한 빨강 (위험/리셋 성격) ─ */
  .ns-ctrl-cleanup-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    border: 1px solid #991b1b !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(185,28,28,.28) !important;
  }
  .ns-ctrl-cleanup-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(185,28,28,.45) !important;
    filter: brightness(1.08) !important;
  }
  .ns-ctrl-cleanup-btn:active {
    transform: translateY(0) !important;
    filter: brightness(.95) !important;
  }

  /* ── 전화번호 편집 버튼: 그린 (관리/유틸 성격) ─ */
  .ns-ctrl-phones-btn,
  .ns-ctrl-brief-btn.ns-ctrl-phones-btn,
  button.ns-ctrl-phones-btn {
    display: inline-flex !important; align-items: center !important; gap: 5px !important;
    padding: 5px 11px !important;
    border-radius: 14px !important;
    font-family: var(--font-body) !important;
    font-size: 10.5px !important; font-weight: 700 !important;
    line-height: 1 !important; letter-spacing: .02em !important;
    cursor: pointer !important; transition: all .15s ease !important;
    flex-shrink: 0 !important; white-space: nowrap !important;
    height: 26px !important; box-sizing: border-box !important;
    background: linear-gradient(135deg, #059669, #047857) !important;
    border: 1px solid #065f46 !important;
    color: #fff !important;
    box-shadow: 0 1px 3px rgba(5,150,105,.28) !important;
  }
  .ns-ctrl-phones-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(5,150,105,.4) !important;
    filter: brightness(1.08) !important;
  }
  .ns-ctrl-phones-btn:active { transform: translateY(0) !important; filter: brightness(.95) !important; }

  /* ── 전화번호 편집 모달 ─ */
  .phone-editor-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.55); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
  }
  .phone-editor-card {
    background: #fff; border-radius: 14px; max-width: 580px; width: 90%;
    max-height: 80vh; overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
  }
  .phone-editor-head {
    padding: 16px 20px; background: linear-gradient(135deg, #059669, #047857);
    color: #fff; font-weight: 700; font-size: 15px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .phone-editor-head .close {
    background: rgba(255,255,255,.2); border: none; color: #fff;
    width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .phone-editor-body {
    overflow-y: auto; padding: 6px 0;
  }
  .phone-row {
    display: flex; align-items: center; padding: 9px 18px;
    border-bottom: 1px solid #f3f4f6;
  }
  .phone-row:last-child { border-bottom: 0; }
  .phone-row .name {
    flex: 1; font-size: 13px; color: #0F2340; font-weight: 600;
  }
  .phone-row input {
    width: 160px; padding: 6px 10px; border: 1px solid #cbd5e1;
    border-radius: 7px; font-size: 12.5px; font-family: 'JetBrains Mono', monospace;
    color: #0F2340;
  }
  .phone-row input:focus { outline: none; border-color: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,.15); }
  .phone-row button {
    margin-left: 8px; padding: 6px 12px; background: #059669;
    color: #fff; border: none; border-radius: 6px; font-size: 11px;
    font-weight: 700; cursor: pointer;
  }
  .phone-row button:hover { background: #047857; }
  .phone-row button.saved { background: #10b981; }
  .phone-row button:disabled { opacity: .5; cursor: not-allowed; }
  .phone-editor-foot {
    padding: 12px 18px; background: #f9fafb; font-size: 11px;
    color: #6b7280; border-top: 1px solid #e5e7eb;
    display: flex; align-items: center; gap: 6px;
  }

  .ns-ctrl-brief-panel {
    margin: 6px 12px 0;
    background: linear-gradient(180deg, rgba(59,130,246,.06), rgba(99,102,241,.02));
    border: 1px solid rgba(99,102,241,.2);
    border-radius: 10px;
    padding: 10px 14px;
    animation: briefSlideIn .25s ease-out;
  }
  @keyframes briefSlideIn {
    0% { opacity: 0; transform: translateY(-6px); }
    100% { opacity: 1; transform: translateY(0); }
  }
  .ns-ctrl-brief-head {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700;
    color: #3b4a8c;
    margin-bottom: 6px;
  }
  .ns-ctrl-brief-time {
    font-size: 9.5px; font-weight: 500;
    color: rgba(15,35,64,.48);
    margin-left: 2px;
  }
  .ns-ctrl-brief-close {
    margin-left: auto;
    background: none; border: none;
    padding: 3px; border-radius: 4px;
    color: rgba(15,35,64,.5);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .ns-ctrl-brief-close:hover { background: rgba(15,35,64,.08); color: #0F2340; }
  .ns-ctrl-brief-body {
    font-size: 12px; line-height: 1.65;
    color: #1E3A5F;
    font-family: var(--font-body) !important;
    white-space: pre-wrap;
  }

  /* ── 환자 발생지(출발지) 마커 펄스 ── */
  .dispatch-origin-pulse {
    position: relative;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
  }
  .dispatch-origin-pulse::before {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 22px; height: 22px;
    margin-left: -11px; margin-top: -11px;
    border-radius: 50%;
    background: var(--pin-col, #dc2626);
    opacity: .45;
    animation: originPulse 1.6s ease-out infinite;
    pointer-events: none;
  }
  @keyframes originPulse {
    0%   { transform: scale(.55); opacity: .7; }
    100% { transform: scale(2.4); opacity: 0; }
  }
  .dispatch-origin-pulse svg { position: relative; z-index: 2; }
  .leaflet-tooltip.dispatch-origin-tooltip {
    background: rgba(15,35,64,.92);
    color: #fff;
    border: 1px solid rgba(255,255,255,.15);
    font-size: 10.5px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 5px;
  }
  .leaflet-tooltip.dispatch-origin-tooltip::before { border-top-color: rgba(15,35,64,.92); }

  /* ── 구급차 마커 펄스 애니메이션 ── */
  .amb-wrap {
    width: 44px; height: 36px;
    position: relative;
    display: flex; align-items: center; justify-content: center;
  }
  .amb-wrap::before {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 28px; height: 28px;
    margin-left: -14px; margin-top: -14px;
    border-radius: 50%;
    border: 2px solid var(--amb-col, #C0392B);
    opacity: 0;
    animation: ambPulse 2.2s ease-out infinite;
    pointer-events: none;
  }
  .amb-pulse-fast::before { animation-duration: 1.2s; border-width: 2.5px; }
  .amb-pulse-slow::before { animation-duration: 2.4s; opacity: .9; }
  @keyframes ambPulse {
    0%   { transform: scale(.55); opacity: .85; }
    70%  { transform: scale(1.9);  opacity: 0;   }
    100% { transform: scale(1.9);  opacity: 0;   }
  }
  .amb-body {
    position: relative;
    z-index: 2;
    transition: transform .15s linear;
    display: flex; align-items: center; justify-content: center;
  }

  /* ── 본문 3-컬럼 ── */
  .ns-ctrl-body {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  /* ── 표류 구급차 패널 (광주 매뉴얼 Ⅶ-2) ── */
  .ns-drift-panel {
    flex-shrink: 0 !important;
  }
  /* active 케이스가 0건이면 패널 자체를 숨김 */
  .ns-drift-panel.ns-drift-empty {
    display: none !important;
  }
  .ctrl-drift-card {
    flex: 0 0 auto;
    min-width: 220px;
    max-width: 280px;
    background: #fff;
    border: 1px solid rgba(220,38,38,.35);
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .ctrl-drift-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(220,38,38,.18);
  }
  .ctrl-drift-card.ktas-1 { border-left-color: #1e3a8a; }  /* 소생 - 진청 */
  .ctrl-drift-card.ktas-2 { border-left-color: #dc2626; }  /* 응급 - 진적 */
  .ctrl-drift-card.ktas-3 { border-left-color: #ea580c; }  /* 긴급 - 주황 */
  .ctrl-drift-card.ktas-4 { border-left-color: #ca8a04; }  /* 준응급 - 노랑 */
  .ctrl-drift-card.ktas-5 { border-left-color: #16a34a; }  /* 비응급 - 초록 */
  .ctrl-drift-row {
    display: flex; gap: 6px; align-items: center;
    font-size: 11px; color: #1e293b;
  }
  .ctrl-drift-row .lbl { color: #64748b; min-width: 38px; }
  .ctrl-drift-row .val { font-weight: 600; }
  .ctrl-drift-ktas-pill {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 7px; border-radius: 10px;
    font-size: 10.5px; font-weight: 700; letter-spacing: -.2px;
  }
  .ctrl-drift-ktas-pill.k1 { background: rgba(30,58,138,.12); color: #1e3a8a; }
  .ctrl-drift-ktas-pill.k2 { background: rgba(220,38,38,.12); color: #dc2626; }
  .ctrl-drift-ktas-pill.k3 { background: rgba(234,88,12,.12); color: #ea580c; }
  .ctrl-drift-ktas-pill.k4 { background: rgba(202,138,4,.12); color: #ca8a04; }
  .ctrl-drift-ktas-pill.k5 { background: rgba(22,163,74,.12); color: #16a34a; }
  .ctrl-drift-accept-btn {
    margin-top: 4px;
    padding: 6px 10px;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease;
  }
  .ctrl-drift-accept-btn:hover {
    background: #b91c1c;
  }
  .ctrl-drift-force-cancel-btn {
    margin-top: 4px;
    padding: 6px 10px;
    background: rgba(100,116,139,.1);
    color: #64748b;
    border: 1px solid rgba(100,116,139,.3);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
  }
  .ctrl-drift-force-cancel-btn:hover {
    background: rgba(220,38,38,.1);
    color: #dc2626;
    border-color: rgba(220,38,38,.35);
  }
  .ctrl-drift-elapsed {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
  }
  .ctrl-drift-elapsed.warn { color: #ea580c; font-weight: 600; }
  .ctrl-drift-empty-msg {
    width: 100%;
    text-align: center;
  }

  /* ── 하단: 응급의료기관 현황 패널 ── */
  .ns-ctrl-erhosp-panel {
    flex-shrink: 0 !important;
    height: 210px !important;
    background: #fff !important;
    border-top: 1.5px solid rgba(15,35,64,.1) !important;
    padding: 8px 14px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    overflow: hidden !important;
  }
  .ns-ctrl-erhosp-title-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-shrink: 0 !important;
  }
  .ns-ctrl-erhosp-legend {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    font-size: 9px !important;
    color: rgba(15,35,64,.45) !important;
    font-family: var(--font-body) !important;
    font-weight: 600 !important;
    letter-spacing: .03em !important;
  }
  .erhosp-leg-dot {
    display: inline-block !important;
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    margin-right: 3px !important;
    vertical-align: middle !important;
  }
  .erhosp-leg-red    { background: #C0392B !important; }
  .erhosp-leg-orange { background: #D97706 !important; }
  .erhosp-leg-navy   { background: #1E3A5F !important; }

  /* 병원 카드 수평 스크롤 래퍼 */
  .ctrl-erhosp-scroll {
    display: flex !important;
    flex-direction: row !important;
    gap: 10px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    flex: 1 !important;
    min-height: 0 !important;
    padding-bottom: 4px !important;
    scroll-snap-type: x mandatory !important;
  }
  .ctrl-erhosp-scroll::-webkit-scrollbar {
    height: 4px !important;
  }
  .ctrl-erhosp-scroll::-webkit-scrollbar-track {
    background: rgba(15,35,64,.04) !important;
    border-radius: 2px !important;
  }
  .ctrl-erhosp-scroll::-webkit-scrollbar-thumb {
    background: rgba(15,35,64,.18) !important;
    border-radius: 2px !important;
  }

  /* 개별 병원 카드 */
  .ctrl-erhosp-card {
    flex-shrink: 0 !important;
    width: 210px !important;
    background: #f8f9fc !important;
    border: 1px solid rgba(15,35,64,.08) !important;
    border-radius: 9px !important;
    padding: 7px 11px 7px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    scroll-snap-align: start !important;
    transition: box-shadow .15s ease !important;
    overflow: hidden !important;
  }
  .ctrl-erhosp-card:hover {
    box-shadow: 0 3px 12px rgba(15,35,64,.12) !important;
    background: #fff !important;
  }

  /* 카드 헤더 */
  .ctrl-erhosp-hdr {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-left: 7px !important;
  }
  .ctrl-erhosp-name {
    font-family: 'Syne', sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #0F2340 !important;
    letter-spacing: -.01em !important;
  }
  .ctrl-erhosp-badge {
    font-size: 8px !important;
    font-weight: 700 !important;
    font-family: 'Syne', sans-serif !important;
    letter-spacing: .06em !important;
    border-radius: 4px !important;
    padding: 2px 6px !important;
  }

  /* 수치 행 */
  .ctrl-erhosp-stats {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    background: rgba(15,35,64,.04) !important;
    border-radius: 6px !important;
    padding: 5px 8px !important;
  }
  .ctrl-erhosp-stat {
    text-align: center !important;
    flex-shrink: 0 !important;
  }
  .ctrl-erhosp-stat-val {
    font-family: 'Outfit', sans-serif !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }
  .ctrl-erhosp-stat-lbl {
    font-size: 8px !important;
    color: rgba(15,35,64,.4) !important;
    margin-top: 1px !important;
    white-space: nowrap !important;
  }
  .ctrl-erhosp-stat-divider {
    width: 1px !important;
    height: 28px !important;
    background: rgba(15,35,64,.1) !important;
    flex-shrink: 0 !important;
  }
  .ctrl-erhosp-meta {
    flex: 1 !important;
    min-width: 0 !important;
  }

  /* 전문 질환 칩 영역 */
  .ctrl-erhosp-specs {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    min-height: 0 !important;
  }
  .erhosp-spec-chip {
    display: inline-block !important;
    background: rgba(30,58,95,.06) !important;
    border: 1px solid rgba(30,58,95,.12) !important;
    color: #1E3A5F !important;
    border-radius: 4px !important;
    padding: 1px 6px !important;
    font-size: 8.5px !important;
    margin: 2px 2px 0 0 !important;
    font-weight: 600 !important;
    font-family: 'Outfit', sans-serif !important;
    letter-spacing: .01em !important;
    white-space: nowrap !important;
  }

  /* 수용능력 미니 바 */
  .erhosp-cap-wrap {
    flex-shrink: 0 !important;
  }
  .erhosp-cap-bar-bg {
    height: 5px !important;
    background: rgba(15,35,64,.08) !important;
    border-radius: 3px !important;
    overflow: hidden !important;
    margin-bottom: 2px !important;
  }
  .erhosp-cap-bar-fill {
    height: 100% !important;
    border-radius: 3px !important;
    transition: width .4s ease !important;
  }

  /* IMAP 이송 중 표시 */
  .erhosp-imap-row {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    margin-top: 1px !important;
  }
  .erhosp-imap-dot {
    display: inline-block !important;
    width: 5px !important;
    height: 5px !important;
    border-radius: 50% !important;
    background: #2A5380 !important;
    flex-shrink: 0 !important;
  }

  /* ── 좌측 통계 패널 ── */
  .ns-ctrl-left {
    width: 190px !important;
    flex-shrink: 0 !important;
    min-height: 0 !important;
    background: #fff !important;
    border-right: 1px solid rgba(15,35,64,.08) !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 8px 10px 6px !important;
    overflow: hidden !important;
    gap: 0 !important;
  }
  .ns-ctrl-sec-hdr {
    font-family: 'Syne', sans-serif !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
    color: rgba(15,35,64,.4) !important;
    margin-bottom: 6px !important;
    flex-shrink: 0 !important;
  }

  /* 오늘 통계 4-박스 */
  .ctrl-stat-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 5px !important;
    margin-bottom: 2px !important;
    flex-shrink: 0 !important;
  }
  .ctrl-stat-box {
    border-radius: 7px !important;
    padding: 7px 8px !important;
    text-align: center !important;
  }
  .ctrl-stat-green { background: rgba(22,92,53,.08) !important; border: 1px solid rgba(22,92,53,.18) !important; }
  .ctrl-stat-navy  { background: rgba(15,35,64,.06) !important; border: 1px solid rgba(15,35,64,.12) !important; }
  .ctrl-stat-blue  { background: rgba(42,83,128,.08) !important; border: 1px solid rgba(42,83,128,.18) !important; }
  .ctrl-stat-red   { background: rgba(192,57,43,.07) !important; border: 1px solid rgba(192,57,43,.18) !important; }
  .ctrl-stat-val {
    font-family: 'Outfit', sans-serif !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #0F2340 !important;
    line-height: 1 !important;
  }
  .ctrl-stat-red .ctrl-stat-val { color: #C0392B !important; }
  .ctrl-stat-lbl {
    font-family: var(--font-body) !important;
    font-size: 8.5px !important;
    color: rgba(15,35,64,.5) !important;
    margin-top: 2px !important;
    letter-spacing: .02em !important;
  }

  /* KTAS 분포 바 */
  .ctrl-ktas-row {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin-bottom: 4px !important;
  }
  .ctrl-ktas-row-lbl {
    font-family: var(--font-body) !important;
    font-size: 8.5px !important;
    color: rgba(15,35,64,.55) !important;
    width: 68px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .ctrl-ktas-row-bar {
    flex: 1 !important;
    height: 8px !important;
    background: rgba(15,35,64,.07) !important;
    border-radius: 3px !important;
    overflow: hidden !important;
  }
  .ctrl-ktas-row-n {
    font-family: 'Outfit', sans-serif !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    color: #0F2340 !important;
    width: 20px !important;
    text-align: right !important;
    flex-shrink: 0 !important;
  }

  /* 병원별 이송 목록 */
  .ctrl-hosp-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 4px 6px !important;
    border-radius: 5px !important;
    margin-bottom: 3px !important;
    background: rgba(15,35,64,.03) !important;
  }
  .ctrl-hosp-name {
    font-family: var(--font-body) !important;
    font-size: 10px !important;
    color: #0F2340 !important;
    flex: 1 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .ctrl-hosp-bars {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
  }
  .ctrl-hosp-active-dot {
    width: 7px !important; height: 7px !important;
    border-radius: 50% !important;
  }
  .ctrl-hosp-total {
    font-family: 'Outfit', sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #2A5380 !important;
  }

  /* ── 중앙 지도 ── */
  .ns-ctrl-map-wrap {
    flex: 1 !important;
    min-width: 0 !important;
    position: relative !important;
  }
  .ns-ctrl-map-wrap .leaflet-container {
    background: #e8edf2 !important;
  }

  /* ── KPI 스트립 아래 실시간 인포바 ── */
  .ctrl-map-infobar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 3px 12px !important;
    background: #f0f3f8 !important;
    border-bottom: 1px solid rgba(15,35,64,.1) !important;
    flex-shrink: 0 !important;
    gap: 6px !important;
  }
  .ctrl-infobar-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
  }
  .ctrl-infobar-chip {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 4px 10px 4px 7px !important;
    border-radius: 6px !important;
    border-left: 2.5px solid transparent !important;
    cursor: default !important;
    white-space: nowrap !important;
  }
  .ctrl-infobar-icon {
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }
  .ctrl-infobar-chip-body {
    display: flex !important;
    align-items: baseline !important;
    gap: 4px !important;
  }
  .ctrl-infobar-val {
    font-size: 12px !important;
    font-weight: 800 !important;
    font-family: 'Outfit', sans-serif !important;
    letter-spacing: -.02em !important;
    line-height: 1 !important;
  }
  .ctrl-infobar-lbl {
    font-size: 9px !important;
    color: rgba(15,35,64,.45) !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 500 !important;
    letter-spacing: .02em !important;
  }
  .ctrl-infobar-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
  }
  .ctrl-infobar-time-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    color: rgba(15,35,64,.5) !important;
  }
  .ctrl-infobar-time {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #1E3A5F !important;
    font-family: 'Outfit', monospace !important;
    letter-spacing: .06em !important;
  }
  .ctrl-infobar-hint {
    font-size: 8.5px !important;
    color: rgba(15,35,64,.3) !important;
    font-family: 'Outfit', sans-serif !important;
  }

  /* ── 우측 현황 패널 ── */
  .ns-ctrl-right {
    width: 205px !important;
    flex-shrink: 0 !important;
    min-height: 0 !important;
    background: #fff !important;
    border-left: 1px solid rgba(15,35,64,.08) !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 8px 10px 6px !important;
    overflow: hidden !important;
  }

  /* 이송 카드 */
  .ctrl-card {
    display: flex !important;
    border-radius: 7px !important;
    background: #f8f9fb !important;
    border: 1px solid rgba(15,35,64,.07) !important;
    margin-bottom: 5px !important;
    overflow: hidden !important;
  }
  .ctrl-card-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 3px !important;
  }
  .ctrl-badge {
    font-family: 'Outfit', sans-serif !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    color: #fff !important;
  }
  .ctrl-elapsed {
    font-size: 9px !important;
    color: rgba(15,35,64,.4) !important;
  }
  .ctrl-route {
    font-size: 10px !important;
    color: #0F2340 !important;
    line-height: 1.4 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* 최근 완료 */
  .ctrl-recent-row {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 4px 6px !important;
    border-radius: 5px !important;
    background: rgba(15,35,64,.03) !important;
    margin-bottom: 3px !important;
  }
  .ctrl-recent-time {
    font-size: 9px !important;
    color: rgba(15,35,64,.4) !important;
    width: 32px !important;
    flex-shrink: 0 !important;
  }
  .ctrl-recent-route {
    flex: 1 !important;
    font-size: 9.5px !important;
    color: #0F2340 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }
  .ctrl-recent-elapsed {
    font-size: 9px !important;
    color: rgba(15,35,64,.4) !important;
    flex-shrink: 0 !important;
  }

  /* 공통 빈 상태 */
  .ctrl-empty {
    padding: 16px 8px !important;
    text-align: center !important;
    color: rgba(15,35,64,.3) !important;
    font-size: 10.5px !important;
  }
  .ctrl-empty-sm {
    padding: 8px !important;
    font-size: 9.5px !important;
  }

  /* ── 세로 flex 탭 (NEDIS·응급의료자원) ── */
  .ns-nedis-layout, .ns-resource-layout {
    display: flex !important;
    flex-direction: column !important;
    padding: 12px 16px !important;
    gap: 10px !important;
    box-sizing: border-box !important;
  }

  /* NEDIS 내부 3-컬럼 그리드 — 좌측 KPI+추천 카드 고정폭 */
  .ns-nedis-grid {
    flex: 1 !important;
    min-height: 0 !important;
    display: grid !important;
    grid-template-columns: 260px 1fr 1fr !important;
    grid-template-rows: 1fr !important;
    gap: 12px !important;
    align-items: stretch !important;
  }

  /* ── 혼잡도 탭: insights 패널 (컴팩트 단일 컬럼) ──────────────────── */
  .nedis-insights-wrap {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255,255,255,.15) transparent !important;
    padding: 0 !important;
    margin-top: 4px !important;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
  }
  .nedis-insights-wrap::-webkit-scrollbar { width: 3px !important; }
  .nedis-insights-wrap::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.18) !important; border-radius: 99px !important;
  }

  /* ── 혼잡도 탭: 중앙·우측 ns-pcard 내 차트 컨테이너 ─────────────────── */
  .ns-nedis-grid > div.ns-pcard:not(.ns-pcard-featured) {
    overflow: hidden !important;
  }
  .ns-nedis-grid > div.ns-pcard:not(.ns-pcard-featured) .plotly,
  .ns-nedis-grid > div.ns-pcard:not(.ns-pcard-featured) .js-plotly-plot {
    height: 100% !important; width: 100% !important;
  }
  /* Sankey 다크 텍스트 오버라이드 — echarts4r 내 node label */
  .ns-nedis-grid .echarts-for-react text,
  .ns-nedis-grid .ec-chart text {
    fill: #7A746E !important;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 10px !important;
  }

  /* ── 응급실 현황 요약 — 하단 전체폭 인사이트 바 ───────────────── */
  .ns-nedis-insights-bar {
    flex-shrink: 0 !important;
    padding: 13px 15px !important;
  }
  /* 섹션 레이블 위 수평 구분선 */
  .ns-nedis-insights-bar > .ns-panel-lbl {
    margin-bottom: 10px !important;
  }
  /* 6-카드 균등 그리드 */
  .ns-insights-row {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 8px !important;
  }
  /* 개별 지표 카드 */
  .ns-istat {
    position: relative !important;
    padding: 11px 13px 13px !important;
    background: var(--bg) !important;      /* #F6F4F1 — 따뜻한 오프화이트 */
    border-radius: 9px !important;
    border: 1px solid var(--rule) !important;
    border-left: 3px solid !important;     /* accent color set inline */
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    overflow: hidden !important;
  }
  /* 카드 우상단 미묘한 accent 번짐 */
  .ns-istat::after {
    content: '' !important;
    position: absolute !important;
    top: -18px !important; right: -18px !important;
    width: 64px !important; height: 64px !important;
    border-radius: 50% !important;
    background: currentColor !important;
    opacity: .04 !important;
    pointer-events: none !important;
  }
  /* 태그 (LABEL) — ns-panel-lbl 계열 */
  .ns-istat-tag {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 0.56rem !important;
    font-weight: 700 !important;
    letter-spacing: .2em !important;
    text-transform: uppercase !important;
    margin-bottom: 6px !important;
    /* color set inline (accent) */
  }
  /* 큰 수치 */
  .ns-istat-val {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 1.28rem !important;
    font-weight: 800 !important;
    line-height: 1.05 !important;
    color: var(--ink) !important;          /* #12100E */
    margin-bottom: 5px !important;
    word-break: keep-all !important;
    letter-spacing: -.01em !important;
  }
  /* 구분선 */
  .ns-istat-rule {
    width: 20px !important;
    height: 1.5px !important;
    margin-bottom: 5px !important;
    border-radius: 1px !important;
    opacity: .4 !important;
    /* background set inline (accent) */
  }
  /* 설명 텍스트 */
  .ns-istat-desc {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 10.5px !important;
    line-height: 1.45 !important;
    color: var(--ink3) !important;         /* #7A746E */
  }

  /* 응급의료자원 내부 2-행 그리드 (KPI + 차트 영역) */
  .ns-resource-inner {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    gap: 12px !important;
    align-items: stretch !important;
  }

  /* 사례관리 패널 절대 채우기 */
  #case-mgmt-panel {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .tab-pane, .tab-content {
    background: transparent !important;
    border: none !important;
  }

  /* ── html-fill-item 래퍼(bslib) 가 tabbable을 감쌀 경우 대응 ── */
  .dashboard-content > .html-fill-item,
  .dashboard-content > .html-fill-container {
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* ── KPI/배너 (flex-shrink:0으로 공간 차지) ── */
  #kpi_cards { display: none !important; }
  #anomaly_alert_banner {
    flex-shrink: 0 !important;
    padding: 0 12px !important;
    margin: 4px 0 !important;
  }

  /* ═══════════════════════════════════════════════
     6. KPI 카드 — 세로 스택 스타일
  ═══════════════════════════════════════════════ */
  .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .kpi-card {
    padding: .85rem 1rem !important;
    background: rgba(255,255,255,.92) !important;
    border: 1px solid rgba(15,35,64,.08) !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 6px rgba(18,16,14,.06) !important;
    position: relative !important;
    overflow: hidden !important;
    backdrop-filter: blur(6px) !important;
    transition: box-shadow .2s, transform .2s !important;
  }
  .kpi-card:hover {
    box-shadow: 0 3px 16px rgba(18,16,14,.10) !important;
    transform: translateY(-1px) !important;
  }
  /* 좌측 색상 강조선 */
  .kpi-card::before {
    content: '' !important;
    position: absolute !important; left: 0 !important; top: 0 !important; bottom: 0 !important;
    width: 3px !important;
    background: #0F2340 !important;
    border-radius: 0 2px 2px 0 !important;
  }
  .kpi-card.success::before { background: #165C35 !important; }
  .kpi-card.warning::before { background: #B87316 !important; }
  .kpi-card.danger::before  { background: #C0392B !important; }
  /* KPI 내부 텍스트 */
  .kpi-title {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 10px !important; font-weight: 700 !important;
    letter-spacing: .1em !important; text-transform: uppercase !important;
    color: #7A746E !important; margin-bottom: 4px !important;
  }
  .kpi-value {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 1.4rem !important; font-weight: 800 !important;
    color: #0F2340 !important; line-height: 1 !important;
  }
  .kpi-icon {
    color: rgba(15,35,64,.2) !important;
    font-size: 18px !important;
  }

  /* ═══════════════════════════════════════════════
     7. NS PC 헤더 표시
  ═══════════════════════════════════════════════ */
  #ns-pc-nav {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 100 !important;
    flex-shrink: 0 !important;
  }

  /* ── NS 헤더 바 (원래 결과물: 크림 배경 + 네이비 텍스트) ── */
  .ns-header {
    display: flex; align-items: center; gap: 0;
    background: #F6F4F1;
    padding: 0 20px; height: 52px;
    border-bottom: 1px solid rgba(15,35,64,.10);
    box-shadow: 0 1px 6px rgba(15,35,64,.06);
  }
  .ns-logo-area {
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0; margin-right: 28px;
  }
  .ns-logo-icon {
    width: 28px; height: 28px;
    background: #0F2340;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Syne', sans-serif !important;
    font-size: 12px; font-weight: 800; color: #fff;
    letter-spacing: .04em; flex-shrink: 0;
  }
  .ns-title {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 12px; font-weight: 800; color: #0F2340;
    letter-spacing: .02em; line-height: 1;
    white-space: nowrap;
  }
  .ns-subtitle {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 9px; font-weight: 400;
    color: rgba(15,35,64,.42); letter-spacing: .01em;
    margin-top: 2px; white-space: nowrap;
  }
  .ns-tab-bar {
    display: flex; align-items: stretch; gap: 0;
    flex: 1; overflow-x: auto;
    scrollbar-width: none; -ms-overflow-style: none; height: 52px;
  }
  .ns-tab-bar::-webkit-scrollbar { display: none; }
  .ns-tab {
    background: transparent; border: none;
    padding: 0 16px; height: 52px;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: .73rem; font-weight: 500;
    color: var(--ink3);
    cursor: pointer; transition: color .15s, font-weight .15s;
    white-space: nowrap; position: relative;
    flex-shrink: 0; outline: none;
    letter-spacing: .01em;
  }
  .ns-tab:hover { color: rgba(15,35,64,.78); }
  .ns-tab.active {
    color: var(--navy);
    font-weight: 600;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
  }
  .ns-tab.active::after {
    content: '';
    position: absolute; bottom: 0; left: 12px; right: 12px;
    height: 2.5px; background: #0F2340;
    border-radius: 2px 2px 0 0;
  }
  .ns-header-right {
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0; margin-left: 8px;
  }
  .ns-live {
    display: flex; align-items: center; gap: 5px;
    font-family: 'Syne', sans-serif !important;
    font-size: 9px; font-weight: 700;
    color: #165C35; letter-spacing: .14em;
  }
  .ns-date {
    font-family: 'Outfit', monospace !important;
    font-size: 10px; font-weight: 500;
    color: rgba(15,35,64,.38); letter-spacing: .02em;
  }
  .ns-filter-btn {
    background: rgba(15,35,64,.06);
    border: 1px solid rgba(15,35,64,.14);
    border-radius: 7px; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    color: rgba(15,35,64,.55); cursor: pointer;
    transition: all .18s; outline: none;
  }
  .ns-filter-btn:hover { background: rgba(15,35,64,.12); color: #0F2340; }
  .ns-progress-bar { height: 2px; background: rgba(15,35,64,.08); overflow: hidden; }
  .ns-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0F2340 0%, #B87316 60%, #165C35 100%);
    transition: width .4s cubic-bezier(.4,0,.2,1);
    border-radius: 0 2px 2px 0;
  }

  /* ═══════════════════════════════════════════════
     8. 사이드바 오버레이 배경
  ═══════════════════════════════════════════════ */
  #ns-sidebar-overlay {
    display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 190;
    background: rgba(15,35,64,.22);
  }
  /* 오버레이를 사이드바 너비(230px) 오른쪽에서만 표시 → 사이드바 내부 클릭 가능 */
  #ns-sidebar-overlay.visible { display: block; left: 230px; }

  /* ═══════════════════════════════════════════════
     9. 카드 — network-study-shiny 감성
  ═══════════════════════════════════════════════ */
  .chart-card,
  .card:not(.modal-content) {
    background: rgba(255,255,255,.90) !important;
    border: 1px solid rgba(18,16,14,.07) !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 8px rgba(18,16,14,.06), 0 4px 20px rgba(18,16,14,.05) !important;
    backdrop-filter: blur(6px) !important;
    transition: box-shadow .25s, transform .25s !important;
  }
  .chart-card:hover { box-shadow: 0 3px 18px rgba(18,16,14,.10) !important; }

  /* ── 차트 카드 헤더 — ns-lbl 스타일 ── */
  .chart-header {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 14px 8px !important;
    border-bottom: 1px solid rgba(15,35,64,.06) !important;
    margin-bottom: 0 !important;
  }
  .chart-header::before {
    content: '' !important;
    width: 20px !important; height: 2px !important;
    background: #0F2340 !important;
    border-radius: 1px !important;
    flex-shrink: 0 !important;
  }
  .chart-header h6,
  .chart-title {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 11px !important; font-weight: 700 !important;
    letter-spacing: .12em !important; text-transform: uppercase !important;
    color: #0F2340 !important; margin: 0 !important;
  }
  /* 차트 헤더 우측 버튼 */
  .chart-header .btn-expand,
  .chart-header > button {
    margin-left: auto !important;
    background: transparent !important;
    border: 1px solid rgba(15,35,64,.12) !important;
    border-radius: 6px !important;
    color: #7A746E !important;
    font-size: 10px !important;
    padding: 3px 8px !important;
    cursor: pointer !important;
  }

  /* ═══════════════════════════════════════════════
     10. 탭 패널 공통 패딩 & 레이아웃
     ※ .tabbable .tab-pane.active { padding:0 }가 이미 section 3에서 적용됨
  ═══════════════════════════════════════════════ */
  /* row 간격 */
  .tab-pane .row.g-2,
  .tab-pane .row.g-3 {
    margin: 0 !important;
  }
  /* 패널 내 filter-info-banner */
  .filter-info-banner {
    background: rgba(15,35,64,.04) !important;
    border: 1px solid rgba(15,35,64,.10) !important;
    color: #0F2340 !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 12px !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    margin-bottom: 8px !important;
  }

  /* ═══════════════════════════════════════════════
     11. 지도 탭 — 전체 높이 맵 (우측 배치)
  ═══════════════════════════════════════════════ */
  .tabbable .tab-pane.active:has(.map-container),
  .tabbable .tab-pane:has(.map-container) {
    padding: 0 !important;
  }
  .map-container {
    height: 100% !important;
    min-height: calc(100vh - 56px) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
  }
  /* 지도 오버레이 헤더 ns-style */
  .map-overlay-header { top: 16px !important; right: 120px !important; }
  .map-title-main {
    font-family: 'Syne', sans-serif !important; font-weight: 800 !important;
    font-size: 24px !important; letter-spacing: .04em !important;
  }
  .map-title-sub {
    font-family: 'Outfit', sans-serif !important; font-size: 11px !important;
  }
  /* 지도 컨트롤 패널 ns-style */
  .map-controls {
    background: rgba(255,255,255,.95) !important;
    border: 1px solid rgba(18,16,14,.08) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(18,16,14,.08) !important;
  }
  .map-control-label {
    font-family: 'Syne', sans-serif !important;
    font-size: 9px !important; letter-spacing: .1em !important;
    text-transform: uppercase !important; color: #3A3430 !important;
  }
  /* 범례 ns-style */
  .map-legend {
    background: rgba(255,255,255,.95) !important;
    border: 1px solid rgba(18,16,14,.08) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(18,16,14,.08) !important;
  }
  .legend-title {
    font-family: 'Syne', sans-serif !important;
    font-size: 9px !important; letter-spacing: .1em !important;
    text-transform: uppercase !important; color: #0F2340 !important;
  }
  .legend-label { font-family: 'Outfit', sans-serif !important; }
  .legend-count {
    font-family: 'Outfit', monospace !important;
    background: rgba(15,35,64,.08) !important;
    color: #0F2340 !important;
  }
  /* 미니 차트 카드 */
  .mini-chart-card {
    background: rgba(255,255,255,.94) !important;
    border: 1px solid rgba(18,16,14,.07) !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(18,16,14,.08) !important;
  }
  .mini-chart-title {
    font-family: 'Syne', sans-serif !important;
    font-size: 9px !important; letter-spacing: .1em !important;
    text-transform: uppercase !important; color: #0F2340 !important;
  }

  /* ═══════════════════════════════════════════════
     12. 타이포그래피 전역 오버라이드
  ═══════════════════════════════════════════════ */
  h1, h2, h3, h4, h5, h6,
  .chart-title, .card-title, .section-title,
  .kpi-label, .sidebar-title, .header-text h1 {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
  }
  /* 레이블/탭 링크도 Outfit */
  .nav-underline .nav-link,
  .control-label, label,
  .filter-label, .sidebar-subtitle {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
  }

  /* ═══════════════════════════════════════════════
     13. 기타 컴포넌트 ns-style
  ═══════════════════════════════════════════════ */
  /* 테이블 */
  table.dataTable thead th {
    font-family: 'Syne', sans-serif !important;
    font-size: 10px !important; letter-spacing: .1em !important;
    text-transform: uppercase !important;
    background: rgba(15,35,64,.04) !important;
    color: #0F2340 !important;
    border-bottom: 1px solid rgba(15,35,64,.10) !important;
  }
  table.dataTable tbody tr { font-family: 'Outfit', sans-serif !important; font-size: 12px !important; }
  table.dataTable tbody tr:hover { background: rgba(15,35,64,.04) !important; }

  /* 버튼 */
  .btn.action-button,
  .btn-action {
    font-family: 'Outfit', sans-serif !important;
    border-radius: 8px !important;
  }
  /* 선택 박스 */
  .selectize-input, .form-control, .form-select {
    font-family: 'Outfit', sans-serif !important;
    font-size: 12px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(15,35,64,.12) !important;
  }
  .selectize-input.focus, .form-control:focus {
    border-color: #0F2340 !important;
    box-shadow: 0 0 0 3px rgba(15,35,64,.07) !important;
  }

  /* ═══════════════════════════════════════════════
     14. 3-column 에디토리얼 패널 레이아웃
         (원래 결과물 디자인 시스템)
  ═══════════════════════════════════════════════ */
  .ns-panel-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    grid-template-rows: 1fr !important;
    gap: 12px !important;
    height: 100% !important;
    padding: 12px 14px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  /* 에디토리얼 카드 */
  .ns-pcard {
    background: rgba(255,255,255,.96) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid rgba(18,16,14,.07) !important;
    box-shadow: 0 1px 8px rgba(18,16,14,.06), 0 4px 20px rgba(18,16,14,.05) !important;
    overflow: visible !important;
    min-height: 0 !important;
    position: relative !important;
  }
  .ns-pcard.ns-pcard-featured {
    background: linear-gradient(145deg, #0F2340 0%, #1A3A5C 55%, #2A5380 100%) !important;
    border-color: transparent !important;
    overflow: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(255,255,255,.15) transparent !important;
  }

  /* ── Featured 카드 배경 애니메이션 (도트 그리드 + orb) ─────────── */
  @keyframes ns-drift {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(36px, 36px); }
  }
  @keyframes ns-orb1 {
    0%,100% { transform: translate(0, 0) scale(1);   opacity: .55; }
    40%     { transform: translate(18px, -22px) scale(1.15); opacity: .8; }
    70%     { transform: translate(-12px, 14px) scale(0.9); opacity: .5; }
  }
  @keyframes ns-orb2 {
    0%,100% { transform: translate(0, 0) scale(1);   opacity: .35; }
    50%     { transform: translate(-20px, 18px) scale(1.2); opacity: .6; }
  }

  .ns-pcard.ns-pcard-featured::before {
    content: '' !important;
    position: absolute !important; inset: -20% !important;
    width: 140% !important; height: 140% !important;
    background-image: radial-gradient(circle, rgba(255,255,255,.055) 1px, transparent 1px) !important;
    background-size: 32px 32px !important;
    animation: ns-drift 22s linear infinite !important;
    pointer-events: none !important; z-index: 0 !important;
    border-radius: 0 !important;
  }
  .ns-pcard.ns-pcard-featured::after {
    content: '' !important;
    position: absolute !important;
    width: 180px !important; height: 180px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle, rgba(144,187,240,.18) 0%, transparent 68%) !important;
    top: -30px !important; left: -20px !important;
    animation: ns-orb1 14s ease-in-out infinite !important;
    pointer-events: none !important; z-index: 0 !important;
  }
  /* 두 번째 orb — nth-of-type로 구분하면 복잡하므로 JS로 추가 */

  /* featured 내부 콘텐츠가 애니메이션 위에 표시되도록 */
  .ns-pcard.ns-pcard-featured > * {
    position: relative !important; z-index: 1 !important;
  }
  .ns-pcard-featured::-webkit-scrollbar { width: 3px !important; }
  .ns-pcard-featured::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18) !important; border-radius: 99px !important; }

  /* 3-차트 우측 카드 (NEDIS): 패딩 최소화, gap 제거, 스크롤 허용 */
  .ns-pcard.ns-pcard-charts3 {
    padding: 6px 8px !important;
    gap: 0 !important;
    overflow-y: auto !important;      /* overflow:hidden 오버라이드 → 잘림 방지 */
  }
  /* 3-차트 슬롯: 각 슬롯 고정 200px — height:100% 의존 제거 */
  .ns-pcard.ns-pcard-charts3 {
    overflow-y: auto !important;
    gap: 4px !important;
  }
  .ns-pcard-charts3 .ns-charts3-slot {
    flex: none !important;
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
    overflow: hidden !important;
    position: relative !important;
  }
  .ns-pcard-charts3 .ns-charts3-slot .shiny-bound-output,
  .ns-pcard-charts3 .ns-charts3-slot .shiny-bound-output > div,
  .ns-pcard-charts3 .ns-charts3-slot .shiny-bound-output > div > div {
    height: 200px !important;
    width: 100% !important;
  }

  /* 동일 카드 내 차트 간 레이블 상단 여백 축소 */
  .ns-pcard > [style*="margin-top:10px"] { margin-top: 4px !important; }
  .ns-pcard > [style*="margin-top:8px"]  { margin-top: 4px !important; }

  /* 섹션 레이블 (원래 결과물 스타일) */
  .ns-panel-lbl {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: .58rem !important; font-weight: 700 !important;
    letter-spacing: .22em !important; text-transform: uppercase !important;
    color: var(--navy) !important;          /* grey → navy (HTML .lbl 스타일 통일) */
    margin-bottom: 14px !important;
    display: flex !important; align-items: center !important; gap: 10px !important;
  }
  .ns-panel-lbl::before {
    content: '' !important;
    width: 22px !important; height: 2px !important;
    background: var(--navy) !important; flex-shrink: 0 !important;
    border-radius: 1px !important;
  }
  .ns-pcard-featured .ns-panel-lbl { color: rgba(255,255,255,.45) !important; }
  .ns-pcard-featured .ns-panel-lbl::before { background: rgba(255,255,255,.45) !important; }

  /* HTML .pill 스타일 태그 — 분류 라벨에 사용 */
  .ns-pill {
    display: inline-flex !important; align-items: center !important; gap: 5px !important;
    border-radius: 6px !important; padding: 3px 10px !important;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: .6rem !important; font-weight: 700 !important;
    letter-spacing: .1em !important; text-transform: uppercase !important;
    margin-bottom: .5rem !important;
  }
  .ns-pill.navy { background: rgba(15,35,64,.08) !important; color: var(--navy) !important; }
  .ns-pill.green { background: rgba(22,92,53,.08) !important; color: var(--green) !important; }
  .ns-pill.amber { background: rgba(184,115,22,.08) !important; color: var(--amber) !important; }
  .ns-pill.red   { background: rgba(192,57,43,.08)  !important; color: #C0392B !important; }
  .ns-pcard-featured .ns-panel-lbl { color: rgba(255,255,255,.45) !important; }

  /* 제목 — <br> 없이 한 줄로 */
  .ns-panel-heading {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 18px !important; font-weight: 800 !important;
    line-height: 1.2 !important; margin-bottom: 6px !important;
    color: #0F2340 !important;
    white-space: nowrap !important; overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .ns-pcard-featured .ns-panel-heading { color: #fff !important; }

  /* 서브 설명 */
  .ns-panel-sub {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 12.5px !important; line-height: 1.65 !important;
    color: #3A3430 !important;
  }
  .ns-pcard-featured .ns-panel-sub { color: rgba(255,255,255,.75) !important; }

  /* 강조 텍스트 */
  .ns-accent { color: #B87316 !important; }
  .ns-amber  { color: #B87316 !important; }
  .ns-pcard-featured .ns-accent { color: #F5C25A !important; }
  .ns-pcard-featured .ns-amber  { color: #F5C25A !important; }
  .ns-green { color: #165C35 !important; }
  .ns-pcard-featured .ns-green { color: #5ECFAB !important; }

  /* 불릿 리스트 */
  .ns-bullets {
    list-style: none !important; padding: 0 !important;
    margin: 8px 0 0 !important;
  }
  .ns-bullets li {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 11.5px !important;
    color: rgba(255,255,255,.78) !important;
    padding: 5px 0 5px 16px !important;
    border-bottom: 1px solid rgba(255,255,255,.08) !important;
    position: relative !important; line-height: 1.55 !important;
  }
  .ns-bullets li:last-child { border-bottom: none !important; }
  /* HTML .c-list 스타일: 위치에 따라 colored icon — 첫 줄 ✓(green), 둘째 →(amber), 셋째 ✕(red), 나머지 · */
  .ns-bullets li::before {
    content: '—' !important; position: absolute !important; left: 0 !important;
    color: rgba(255,255,255,.3) !important; font-weight: 700 !important; font-size: 10px !important;
    line-height: 1 !important; top: 7px !important;
  }
  .ns-bullets li:nth-child(1)::before { content: '✓' !important; color: #7BE0A8 !important; font-size: 11px !important; top: 6px !important; }
  .ns-bullets li:nth-child(2)::before { content: '→' !important; color: #F5C25A !important; font-size: 11px !important; top: 6px !important; }
  .ns-bullets li:nth-child(3)::before { content: '×' !important; color: #FF8A80 !important; font-size: 12px !important; top: 4px !important; }
  .ns-bullets li:nth-child(4)::before { content: '·' !important;  color: rgba(255,255,255,.4) !important; font-size: 16px !important; top: 4px !important; }

  /* ── 테마 별 비-featured 카드 상단 액센트 선 ── */
  .theme-ai   .ns-tab-body > .ns-pcard:not(.ns-pcard-featured) {
    border-top: 3px solid rgba(124,58,237,.35) !important;
  }
  .theme-comp .ns-tab-body > .ns-pcard:not(.ns-pcard-featured) {
    border-top: 3px solid rgba(184,115,22,.35) !important;
  }
  .theme-flow .ns-tab-body > .ns-pcard:not(.ns-pcard-featured) {
    border-top: 3px solid rgba(8,145,178,.35) !important;
  }
  .theme-stp  .ns-tab-body > .ns-pcard:not(.ns-pcard-featured) {
    border-top: 3px solid rgba(22,92,53,.35) !important;
  }
  .theme-db   .ns-tab-body > .ns-pcard:not(.ns-pcard-featured) {
    border-top: 3px solid rgba(15,35,64,.35) !important;
  }
  .theme-res  .ns-tab-body > .ns-pcard:not(.ns-pcard-featured) {
    border-top: 3px solid rgba(192,57,43,.35) !important;
  }

  /* 차트 섹션 레이블 — 업그레이드 */
  .ns-chart-lbl {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 9px !important; font-weight: 700 !important;
    letter-spacing: .18em !important; text-transform: uppercase !important;
    color: #0F2340 !important;
    margin-bottom: 6px !important;
    display: flex !important; align-items: center !important; gap: 8px !important;
    flex-shrink: 0 !important;
    padding-bottom: 5px !important;
    border-bottom: 1px solid rgba(15,35,64,.08) !important;
  }
  .ns-chart-lbl::before {
    content: '' !important;
    width: 3px !important; height: 14px !important;
    border-radius: 2px !important;
    background: var(--tab-accent, #0F2340) !important; flex-shrink: 0 !important;
  }
  .ns-chart-lbl.ns-amber { color: #B87316 !important; }
  .ns-chart-lbl.ns-amber::before { background: #B87316 !important; }
  .ns-chart-lbl.ns-green { color: #165C35 !important; }
  .ns-chart-lbl.ns-green::before { background: #165C35 !important; }
  /* 차트 래퍼에 미묘한 배경 격자 패턴 — ns-pcard 직계 flex:1 divs */
  .ns-pcard > div[style*="flex:1;min-height:0"],
  .ns-pcard > div[style*="flex: 1; min-height: 0"],
  .ns-chart-area {
    background-image:
      linear-gradient(rgba(15,35,64,.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(15,35,64,.025) 1px, transparent 1px) !important;
    background-size: 40px 40px !important;
    border-radius: 6px !important;
    outline: 1px solid rgba(15,35,64,.05) !important;
  }
  /* 단, 게이지 게임 차트 (flex:0 0 45%) 등 flex:0 divs엔 미적용 */
  .ns-pcard > div[style*="flex:0"],
  .ns-pcard > div[style*="flex: 0"] {
    background-image: none !important;
    outline: none !important;
  }
  /* chart metric badge — 차트 레이블 우측 숫자 뱃지 */
  .ns-chart-badge {
    margin-left: auto !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    background: rgba(15,35,64,.07) !important;
    color: #0F2340 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    text-transform: none !important;
  }

  /* 비교 테이블 (원래 결과물 스타일) */
  .ns-table-wrap {
    overflow: auto !important;
    flex: 1 !important;
  }
  .ns-compare-table {
    width: 100% !important; border-collapse: collapse !important;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important; font-size: 11.5px !important;
  }
  .ns-compare-table thead tr {
    border-bottom: 1.5px solid rgba(15,35,64,.15) !important;
  }
  .ns-compare-table th {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 9px !important; letter-spacing: .14em !important;
    text-transform: uppercase !important; color: #7A746E !important;
    font-weight: 700 !important; padding: 6px 8px !important;
    text-align: left !important; white-space: nowrap !important;
  }
  .ns-compare-table td {
    padding: 7px 8px !important; color: #3A3430 !important;
    border-bottom: 1px solid rgba(18,16,14,.05) !important;
    vertical-align: top !important; line-height: 1.4 !important;
  }
  .ns-compare-table tr:last-child td { border-bottom: none !important; }
  .ns-compare-table td:first-child {
    color: #0F2340 !important; font-weight: 600 !important;
    white-space: nowrap !important;
  }

  /* kpi-grid (2-column grid 해제 후 ns-panel-layout 안에서는 단순 스택) */
  .ns-pcard .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .ns-pcard .kpi-card {
    padding: .65rem .8rem !important;
  }
  .ns-pcard .kpi-value { font-size: 1.15rem !important; }

  /* 패널 구분선 */
  .ns-divider {
    border: none !important;
    border-top: 1px solid rgba(18,16,14,.08) !important;
    margin: 12px 0 !important;
  }
  .ns-pcard-featured .ns-divider {
    border-top-color: rgba(255,255,255,.12) !important;
  }

  /* spacer */
  .ns-spacer { flex: 1 !important; }

  /* echarts / leaflet 컨테이너 — ns-pcard 안에서 height:100% 올바르게 동작 */
  .ns-pcard > .echarts4r-container,
  .ns-pcard > div[class*="echarts4r"],
  .ns-pcard > .shiny-bound-output {
    flex: 1 !important;
    min-height: 0 !important;
    width: 100% !important;
  }
  /* 단일 차트 중앙 카드 — 차트가 카드를 가득 채우도록 */
  .ns-pcard > .ns-chart-lbl:first-child ~ div,
  .ns-pcard > .ns-chart-lbl:first-child + div {
    flex: 1 !important;
    min-height: 0 !important;
  }
  /* shiny output wrapper div 투명화 */
  .ns-pcard .shiny-bound-output { background: transparent !important; }
  /* echarts canvas 100% 동작 */
  .ns-pcard .echarts4r { width: 100% !important; height: 100% !important; }
  /* echarts 내부 canvas — height percentage 강제 */
  .ns-pcard .shiny-bound-output > div { height: 100% !important; }

  /* ★ 핵심: flex:N 차트 래퍼 → 상대 위치, echarts를 절대 채우기 */
  /* min-height:0 스타일도 포함 (R에서 flex wrapper에 주로 사용) */
  .ns-pcard > div[style*="flex:1"],
  .ns-pcard > div[style*="flex: 1"],
  .ns-pcard > div[style*="min-height:0"] {
    position: relative !important;
    flex: 1 !important;
    min-height: 0 !important;
  }
  .ns-pcard > div[style*="flex:1"] > .shiny-bound-output,
  .ns-pcard > div[style*="flex: 1"] > .shiny-bound-output,
  .ns-pcard > div[style*="min-height:0"] > .shiny-bound-output {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    height: auto !important;
    width: auto !important;
  }
  .ns-pcard > div[style*="flex:1"] > .shiny-bound-output > div,
  .ns-pcard > div[style*="flex: 1"] > .shiny-bound-output > div,
  .ns-pcard > div[style*="min-height:0"] > .shiny-bound-output > div {
    height: 100% !important;
    width: 100% !important;
  }

  /* ── NEDIS 2열 그리드 내 중첩 차트 absolute-fill ── */
  div[style*="position:relative"] > .shiny-bound-output {
    position: absolute !important;
    top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    height: auto !important; width: auto !important;
  }
  div[style*="position:relative"] > .shiny-bound-output > div {
    height: 100% !important; width: 100% !important;
  }
  /* 2열 그리드 내 flex column 셀 — min-height:0 강제 */
  div[style*="grid-template-columns"] > div[style*="flex-direction:column"] {
    min-height: 0 !important;
    overflow: hidden !important;
  }

  /* 복수 차트 카드 (right column): 각 chart 영역 균등 분배 */
  .ns-pcard > .ns-chart-lbl { flex-shrink: 0 !important; }
  .ns-pcard .shiny-bound-output + .ns-chart-lbl { margin-top: 6px !important; }

  /* echarts 툴팁이 카드 밖으로 나올 수 있도록 차트 래퍼도 overflow:visible */
  .ns-pcard > div[style*="flex:1"],
  .ns-pcard > div[style*="flex: 1"],
  .ns-pcard > div[style*="flex:1.8"],
  .ns-pcard > div[style*="flex:1.6"],
  .ns-pcard > div[style*="flex:1.4"],
  .ns-pcard > div[style*="flex:1.2"],
  .ns-pcard > div[style*="min-height:0"] {
    overflow: visible !important;
  }
  /* DT 테이블 스크롤 wrapper — overflow:visible 규칙 예외 처리 */
  .ns-dt-scroll {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;   /* 세로: 페이지네이션 접근용 */
    overflow-x: hidden !important; /* 가로: DT 내부 scrollX가 담당 */
  }
  /* DT 내부 가로 스크롤 보장 */
  .ns-dt-scroll .dataTables_scrollBody {
    overflow-x: auto !important;
  }
  .ns-dt-scroll .dataTables_scroll {
    overflow: visible !important;  /* 가로 스크롤바가 보이도록 */
  }

  /* 상세보기 버튼 (DT 테이블 내 각 행) */
  .btn-detail-view {
    background: rgba(15,35,64,.1) !important;
    color: #0F2340 !important;
    border: 1px solid rgba(15,35,64,.25) !important;
    border-radius: 5px !important;
    padding: 2px 8px !important;
    font-size: 11px !important;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;
    transition: background .15s, color .15s !important;
  }
  .btn-detail-view:hover {
    background: #0F2340 !important;
    color: #fff !important;
  }

  /* ECharts 툴팁: 차트를 완전히 가리지 않도록 폭·높이 제한 */
  .echartsTooltip, div[style*="z-index: 9999999"] {
    max-width: 240px !important;
    font-size: 11px !important;
  }

  /* shiny output 재계산 중 opacity 유지 (echarts legend 클릭 시 흐림 방지) */
  .ns-pcard .shiny-bound-output.recalculating { opacity: 1 !important; }
  /* echarts 컨테이너가 overflow:visible 이어야 툴팁 클리핑 없음 */
  .ns-pcard .echarts4r, .ns-pcard [id$="_chart"], .ns-pcard [id$="_gauge"],
  .ns-pcard [id$="_risk"], .ns-pcard [id$="_heatmap"] {
    overflow: visible !important;
  }

  /* ═══════════════════════════════════════════════
     지리적 시각화 — 에디토리얼 인트로 레이아웃
     (좌: 소개 텍스트 폭넓게, 우: 지도 + 미니차트)
  ═══════════════════════════════════════════════ */
  .ns-geo-layout {
    display: grid !important;
    grid-template-columns: 340px 1fr !important;
    gap: 0 !important;
    height: 100% !important;
    min-height: calc(100vh - 56px) !important;
    overflow: hidden !important;
  }

  /* 좌측 소개 영역 */
  .ns-geo-intro {
    display: flex !important;
    flex-direction: column !important;
    padding: 64px 28px 20px !important;
    background: #F6F4F1 !important;
    border-right: 1px solid rgba(15,35,64,.08) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    min-height: 0 !important;
  }
  /* 소개 영역의 lbl은 진한 색상 */
  .ns-geo-intro .ns-panel-lbl {
    color: rgba(15,35,64,.4) !important;
    margin-bottom: 8px !important;
  }
  .ns-geo-intro .ns-panel-lbl::before {
    background: rgba(15,35,64,.35) !important;
  }
  .ns-geo-heading {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 36px !important; font-weight: 800 !important;
    line-height: 1.15 !important; margin: 16px 0 18px !important;
    color: #0F2340 !important; letter-spacing: -.01em !important;
  }
  .ns-geo-sub {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 13.5px !important; line-height: 1.7 !important;
    color: rgba(15,35,64,.58) !important;
  }

  /* 총 건수 (대형) */
  .ns-geo-total {
    margin-bottom: 16px !important;
  }
  .ns-geo-total-val {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 52px !important; font-weight: 800 !important;
    color: #0F2340 !important; line-height: 1 !important;
    letter-spacing: -.02em !important;
  }
  .ns-geo-total-lbl {
    font-family: 'Outfit', sans-serif !important;
    font-size: 10px !important; font-weight: 600 !important;
    letter-spacing: .16em !important; text-transform: uppercase !important;
    color: rgba(15,35,64,.38) !important; margin-top: 4px !important;
  }

  /* 핵심 지표 (CNC/UPC/UCC/수용곤란율) */
  .ns-geo-stats {
    display: flex !important; gap: 16px !important;
    margin-top: 0 !important; flex-wrap: wrap !important;
  }
  .ns-geo-stat {
    display: flex !important; flex-direction: column !important;
    gap: 2px !important;
  }
  .ns-geo-stat-val {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 22px !important; font-weight: 800 !important;
    color: #0F2340 !important; line-height: 1 !important;
  }
  .ns-geo-stat-lbl {
    font-family: 'Outfit', sans-serif !important;
    font-size: 9px !important; font-weight: 700 !important;
    letter-spacing: .14em !important; text-transform: uppercase !important;
    color: rgba(15,35,64,.4) !important;
  }
  /* 최다 발생 지역 행 */
  .ns-geo-region-row {
    display: flex !important; align-items: baseline !important; gap: 10px !important;
  }
  .ns-geo-region-lbl {
    font-family: 'Outfit', sans-serif !important;
    font-size: 9px !important; font-weight: 700 !important;
    letter-spacing: .14em !important; text-transform: uppercase !important;
    color: rgba(15,35,64,.38) !important; flex-shrink: 0 !important;
  }
  .ns-geo-region-val {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: 16px !important; font-weight: 700 !important;
    color: #0F2340 !important;
  }

  /* 컨트롤 패널 (좌측 하단) */
  .ns-geo-controls {
    display: flex !important; flex-direction: column !important;
    gap: 6px !important; margin-top: auto !important;
    padding-top: 12px !important;
  }
  .ns-geo-ctrl-row {
    display: flex !important; align-items: center !important;
    gap: 10px !important;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
  }
  .ns-geo-ctrl-lbl {
    font-size: 10px !important; font-weight: 600 !important;
    letter-spacing: .1em !important; text-transform: uppercase !important;
    color: rgba(15,35,64,.45) !important; width: 36px !important;
    flex-shrink: 0 !important;
  }
  /* Shiny radioButtons inline 컴팩트 */
  .ns-geo-controls .shiny-input-container { margin: 0 !important; }
  .ns-geo-controls .radio-inline, .ns-geo-controls .shiny-input-container label:first-child {
    font-size: 11px !important; color: rgba(15,35,64,.65) !important;
    font-family: 'Outfit', sans-serif !important;
  }
  .ns-geo-controls .radio-inline { margin-right: 8px !important; }

  /* 우측 지도 영역 — grid로 미니차트 잘림 완전 방지 */
  .ns-geo-map-area {
    display: grid !important;
    grid-template-rows: 1fr 190px !important;
    gap: 10px !important;
    padding: 18px !important;
    min-height: 0 !important;
    background: #EFEDE9 !important;
    overflow: hidden !important;
  }
  .ns-geo-map-card {
    min-height: 0 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    position: relative !important;
    box-shadow: 0 2px 20px rgba(15,35,64,.12), 0 8px 40px rgba(15,35,64,.08) !important;
  }
  .ns-geo-map-inner {
    width: 100% !important; height: 100% !important;
  }
  /* leaflet 컨테이너가 부모를 100% 채우도록 */
  .ns-geo-map-inner > .shiny-bound-output,
  .ns-geo-map-inner > [id="map"] {
    height: 100% !important; width: 100% !important;
  }
  /* 지도 범례 (오버레이) */
  .ns-geo-legend {
    position: absolute !important;
    bottom: 14px !important; right: 14px !important;
    background: rgba(255,255,255,.92) !important;
    backdrop-filter: blur(6px) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    display: flex !important; flex-direction: column !important; gap: 5px !important;
    box-shadow: 0 1px 8px rgba(15,35,64,.12) !important;
    z-index: 500 !important;
  }
  .ns-geo-legend-item {
    display: flex !important; align-items: center !important; gap: 7px !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 10.5px !important; font-weight: 600 !important;
    color: #0F2340 !important; letter-spacing: .04em !important;
  }
  .ns-geo-dot {
    width: 8px !important; height: 8px !important;
    border-radius: 50% !important; flex-shrink: 0 !important;
  }

  /* 데이터베이스: DT table spanning 2 cols — overflow:hidden 유지 (scroll 필요) */
  .ns-panel-layout > .ns-pcard[style*="grid-column:2/4"] {
    grid-column: 2 / 4 !important;
    overflow: hidden !important;
  }

  /* DB·I-NET: 좌측 dark card 240px 고정 좁히기 */
  .ns-panel-narrow {
    grid-template-columns: 240px 1fr 1fr !important;
  }

  /* resource_stats KPI strip — 높이 자동(콘텐츠 기준), 절대 flex-stretch 방지 */
  #resource_stats { flex-shrink: 0 !important; height: auto !important; }
  #resource_stats > div { height: auto !important; }
  #resource_stats .resource-stats-grid { height: auto !important; }
  #resource_stats .resource-stat-card { height: auto !important; }

  /* inet_map height fix */
  .ns-pcard .leaflet-container { height: 100% !important; }

  /* 사례관리 iframe */
  #case-mgmt-panel > * { flex-shrink: 0 !important; }
  #case-mgmt-panel > iframe {
    flex: 1 !important; min-height: 0 !important; flex-shrink: 1 !important;
  }

  /* ═══════════════════════════════════════════════
     16. 홈 커버/인트로 레이아웃
  ═══════════════════════════════════════════════ */

  @keyframes ns-home-lx   { from{transform:scaleX(0)} to{transform:scaleX(1)} }
  @keyframes ns-home-up   { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:none} }
  @keyframes ns-home-in   { from{opacity:0} to{opacity:1} }
  @keyframes ns-home-spinR{ from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
  @keyframes ns-home-glow { 0%,100%{opacity:.55} 50%{opacity:1} }

  /* 배경 오브 캔버스: 홈 콘텐츠 아래로 */
  #ns-bg-orbs { z-index: 0 !important; }

  /* 홈 intro: 오브가 텍스트/카드를 가리지 않도록 */
  .ns-home-intro > *:not(.ns-home-title-orbs) {
    position: relative !important;
    z-index: 1 !important;
  }
  /* title-orbs 영역을 intro 컬럼 안으로 제한 */
  .ns-home-intro { overflow: hidden !important; }
  .ns-home-title-orbs { overflow: hidden !important; z-index: 0 !important; }

  /* 홈 우측 캔버스 영역: 오브 위로 내용이 오도록 */
  .ns-home-canvas-area > *:not(.ns-home-orbs) {
    position: relative !important;
    z-index: 1 !important;
  }

  .ns-home-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr !important;
    width: 100% !important;
    height: 100% !important;
    min-height: calc(100vh - 56px) !important;
    overflow: hidden !important;
    position: relative !important;
    z-index: 1 !important;
    isolation: isolate !important;
  }

  /* ── 좌측: 에디토리얼 텍스트 (레퍼런스 HTML cover-l 1:1 매핑) ── */
  .ns-home-intro {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 3rem 3rem 3rem 4rem !important;
    background: #F6F4F1 !important;
    border-right: 1px solid rgba(18,16,14,.08) !important;
    overflow: visible !important;
    min-height: 0 !important;
    position: relative !important;
    z-index: 1 !important;
  }
  .ns-home-intro::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important; top: 15% !important; bottom: 15% !important;
    width: 3px !important;
    background: linear-gradient(180deg, transparent, #0F2340, transparent) !important;
    pointer-events: none !important;
  }

  /* 태그 라인 */
  .ns-cv-tag {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 2rem !important;
    animation: ns-home-up .5s .05s both !important;
  }
  .ns-cv-tag-bar {
    width: 28px !important; height: 2px !important;
    background: #0F2340 !important; border-radius: 1px !important;
    transform-origin: left !important;
    animation: ns-home-lx .4s .05s both !important;
  }
  .ns-cv-tag-txt {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: .62rem !important; font-weight: 700 !important;
    letter-spacing: .20em !important; text-transform: uppercase !important;
    color: #0F2340 !important;
  }

  /* 메인 제목 */
  .ns-home-title {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: clamp(1.8rem, 3.2vw, 2.8rem) !important;
    font-weight: 800 !important;
    line-height: 1.12 !important;
    color: #12100E !important;
    letter-spacing: -.01em !important;
    margin: 0 0 1rem !important;
    animation: ns-home-up .5s .14s both !important;
  }
  .ns-home-title .ns-hi { color: #0F2340 !important; display: block !important; }

  /* 타이틀 아래 인라인 orb 컨테이너 — 텍스트 바로 아래를 자연스럽게 통과 */
  .ns-home-title-orbs {
    position: relative !important;
    height: 52px !important;
    overflow: visible !important;  /* 범위 넘어도 보이게 */
    pointer-events: none !important;
    flex-shrink: 0 !important;
    margin: -2px 0 4px !important;
    z-index: 0 !important;
  }
  .ns-home-title-orbs .ns-orb {
    position: absolute !important;
    /* 위아래로 넓게 떠다니도록 — 타이틀과 겹치게 */
    animation: ns-orb-float var(--dur, 10s) ease-in-out infinite !important;
  }

  /* 설명 텍스트 (cv-desc) */
  .ns-home-subtitle {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: .93rem !important;
    line-height: 1.88 !important;
    color: rgba(18,16,14,.48) !important;
    font-weight: 400 !important;
    max-width: 480px !important;
    margin-bottom: 2.4rem !important;
    animation: ns-home-up .5s .22s both !important;
  }

  /* 메타 섹션 (cv-meta) */
  .ns-cv-meta {
    border-top: 1px solid rgba(18,16,14,.08) !important;
    padding-top: 1.8rem !important;
    display: flex !important; flex-direction: column !important;
    gap: .7rem !important;
    animation: ns-home-up .5s .30s both !important;
  }
  .ns-cv-row { display: flex !important; gap: 1.2rem !important; align-items: baseline !important; }
  .ns-cv-k {
    font-family: 'Outfit', sans-serif !important;
    font-size: .6rem !important; font-weight: 600 !important;
    letter-spacing: .12em !important; text-transform: uppercase !important;
    color: rgba(18,16,14,.32) !important; min-width: 68px !important;
    flex-shrink: 0 !important;
  }
  .ns-cv-v {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: .86rem !important; color: rgba(18,16,14,.58) !important; font-weight: 400 !important;
  }

  .ns-home-version {
    font-family: 'Outfit', monospace !important;
    font-size: 9px !important; font-weight: 600 !important;
    letter-spacing: .14em !important; text-transform: uppercase !important;
    color: rgba(15,35,64,.45) !important; margin-top: 1rem !important;
  }

  /* 데이터 시각화 소통 tagline */
  .ns-home-viz-tagline {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: .78rem !important;
    font-weight: 500 !important;
    color: rgba(15,35,64,.42) !important;
    letter-spacing: .06em !important;
    margin: .35rem 0 0 !important;
    padding: .3rem .6rem !important;
    border-left: 2px solid rgba(15,35,64,.18) !important;
    line-height: 1.5 !important;
  }

  /* 제작자 크레딧 */
  .ns-home-credit {
    font-family: 'Outfit', monospace !important;
    font-size: 7.5px !important;
    font-weight: 500 !important;
    letter-spacing: .22em !important;
    text-transform: uppercase !important;
    color: rgba(15,35,64,.2) !important;
    margin-top: 3px !important;
  }

  /* ── 우측: 라이트 캔버스 영역 ── */
  .ns-home-canvas-area {
    background: #EDEAE5 !important;
    position: relative !important;
    z-index: 2 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1.4rem 1.6rem 1.4rem !important;
    gap: 0 !important;
  }
  /* 도트 그리드 배경 */
  .ns-home-canvas-area::before {
    content: '' !important;
    position: absolute !important; inset: 0 !important;
    pointer-events: none !important;
    background-image: radial-gradient(circle, rgba(15,35,64,.10) 1px, transparent 1px) !important;
    background-size: 28px 28px !important;
    z-index: 0 !important;
  }

  /* 큰 배경 텍스트 */
  .ns-cr-bgtext {
    position: absolute !important; top: 50% !important; left: 50% !important;
    transform: translate(-50%,-50%) !important;
    font-family: 'Syne', sans-serif !important;
    font-weight: 800 !important; font-size: clamp(3rem, 5.5vw, 5rem) !important;
    letter-spacing: .06em !important; text-transform: uppercase !important;
    text-align: center !important; color: rgba(15,35,64,.07) !important;
    line-height: 1.1 !important; white-space: nowrap !important;
    pointer-events: none !important; user-select: none !important;
    animation: ns-home-in 1.4s .6s both !important; z-index: 0 !important;
  }

  /* 칩 행 */
  .ns-cr-row {
    display: flex !important; gap: .7rem !important;
    width: 100% !important; position: relative !important; z-index: 2 !important;
  }
  .ns-cr-row.top { margin-bottom: .7rem !important; }
  .ns-cr-row.bot { margin-top: .7rem !important; }

  .ns-cr-chip {
    background: #FFFFFF !important;
    border: 1px solid rgba(18,16,14,.08) !important;
    border-radius: 8px !important;
    padding: .55rem .85rem !important; flex: 1 !important; min-width: 0 !important;
    display: flex !important; flex-direction: column !important; gap: .18rem !important;
    box-shadow: 0 1px 3px rgba(18,16,14,.05) !important;
    position: relative !important; overflow: hidden !important;
    transition: box-shadow .22s, transform .22s !important;
  }
  .ns-cr-chip:hover {
    box-shadow: 0 1px 8px rgba(18,16,14,.06), 0 4px 20px rgba(18,16,14,.05) !important;
    transform: translateY(-2px) !important;
  }
  .ns-cr-chip::before {
    content: '' !important; position: absolute !important;
    left: 0 !important; top: 0 !important; bottom: 0 !important; width: 2px !important;
    border-radius: 0 1px 1px 0 !important;
  }
  .ns-cr-chip.cnc::before { background: #165C35 !important; }
  .ns-cr-chip.upc::before { background: #B87316 !important; }
  .ns-cr-chip.ucc::before { background: #C0392B !important; }
  .ns-cr-chip.imap::before { background: #0F2340 !important; }

  .ns-cr-chip-en {
    font-family: 'Syne', sans-serif !important;
    font-size: 10px !important; font-weight: 700 !important;
    letter-spacing: .03em !important; color: #0F2340 !important; line-height: 1.25 !important;
  }
  .ns-cr-chip-ko {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 9px !important; font-weight: 500 !important;
    color: rgba(18,16,14,.38) !important; letter-spacing: .02em !important;
  }

  /* 캔버스 래퍼 + 링 — 레퍼런스 HTML .cv-wrap 동일 구조 */
  .ns-cv-wrap {
    position: relative !important;
    display: flex !important; align-items: center !important;
    justify-content: center !important; width: 100% !important;
    z-index: 1 !important;
    margin: .6rem 0 !important;
    flex-shrink: 0 !important;
  }
  .ns-cv-ring {
    position: absolute !important; border-radius: 50% !important;
    border: 1px solid rgba(15,35,64,.09) !important; pointer-events: none !important;
    width: min(62%, 280px) !important; aspect-ratio: 1 !important;
    animation: ns-home-spinR 28s linear infinite !important;
  }
  .ns-cv-ring2 {
    width: min(50%, 224px) !important;
    border-style: dashed !important; border-color: rgba(15,35,64,.06) !important;
    animation: ns-home-spinR 18s linear infinite reverse !important;
  }
  .ns-cv-ring3 {
    width: min(76%, 336px) !important;
    border-color: rgba(15,35,64,.05) !important;
    animation: ns-home-spinR 42s linear infinite !important;
  }

  /* 흰 배경 네트워크 박스 */
  .ns-net-box {
    position: relative !important;
    flex: 0 0 200px !important;
    height: 200px !important;
    min-height: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 24px rgba(15,35,64,.12), 0 1px 6px rgba(15,35,64,.08) !important;
    z-index: 1 !important;
    margin-bottom: .8rem !important;
  }

  /* 네트워크 애니메이션 캔버스 — 레퍼런스 HTML #cv-c와 동일 구조 */
  #imap-intro-canvas {
    display: block !important;
    position: relative !important;
    z-index: 1 !important;
    flex-shrink: 0 !important;
    width: min(96%, 440px) !important;
    aspect-ratio: 4 / 3 !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    border: 1px solid rgba(15,35,64,0.10) !important;
    box-shadow: 0 0 0 4px rgba(15,35,64,0.04), 0 8px 32px rgba(15,35,64,0.12), 0 24px 56px rgba(15,35,64,0.08) !important;
    pointer-events: none !important;
  }

  /* 통계 행 */
  .ns-cr-stats {
    display: flex !important; gap: .6rem !important;
    width: 100% !important; margin-top: .8rem !important;
    position: relative !important; z-index: 2 !important;
  }
  .ns-cr-stat {
    flex: 1 !important;
    background: #FFFFFF !important;
    border: 1px solid rgba(18,16,14,.08) !important;
    border-radius: 8px !important;
    padding: .5rem .6rem !important;
    display: flex !important; flex-direction: column !important;
    align-items: center !important; gap: .1rem !important;
    box-shadow: 0 1px 3px rgba(18,16,14,.05) !important;
  }
  .ns-cr-stat-n {
    font-family: 'Syne', sans-serif !important;
    font-size: 18px !important; font-weight: 800 !important;
    color: #0F2340 !important; line-height: 1 !important;
  }
  .ns-cr-stat-l {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 9px !important; font-weight: 500 !important;
    color: rgba(18,16,14,.38) !important;
    letter-spacing: .03em !important; text-align: center !important;
  }

  /* 범례 (우측 하단 오버레이 제거, 이제 칩/통계로 대체) */
  .ns-home-canvas-legend { display: none !important; }
  .ns-home-cl-item { display: none !important; }
  .ns-home-cl-dot  { display: none !important; }

  /* ═══════════════════════════════════════════════════════════
     I-MAP 분析 방법론 다이어그램 (홈 우측 하단)
     ═══════════════════════════════════════════════════════════ */
  .ns-imd-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-top: 10px !important;
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
  }

  /* ── 프로세스 파이프라인 ── */
  .ns-imd-pipeline {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: rgba(255,255,255,.72) !important;
    border: 1px solid rgba(18,16,14,.07) !important;
    border-radius: 10px !important;
    padding: 7px 10px !important;
    backdrop-filter: blur(4px) !important;
  }
  .ns-imd-node {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 3px !important;
    flex: 1 !important;
    padding: 4px 3px !important;
    border-radius: 7px !important;
    transition: background .18s !important;
  }
  .ns-imd-icon {
    width: 26px !important; height: 26px !important;
    border-radius: 7px !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
  }
  .ns-imd-node-lbl {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 8px !important; font-weight: 600 !important;
    letter-spacing: .04em !important; text-align: center !important;
    white-space: nowrap !important;
  }
  .ns-imd-input  .ns-imd-icon { background: rgba(15,35,64,.08) !important; color: #0F2340 !important; }
  .ns-imd-input  .ns-imd-node-lbl { color: #0F2340 !important; }
  .ns-imd-engine .ns-imd-icon { background: rgba(42,83,128,.1) !important; color: #2A5380 !important; }
  .ns-imd-engine .ns-imd-node-lbl { color: #2A5380 !important; }
  .ns-imd-region .ns-imd-icon { background: rgba(22,92,53,.1) !important; color: #165C35 !important; }
  .ns-imd-region .ns-imd-node-lbl { color: #165C35 !important; }
  .ns-imd-action .ns-imd-icon { background: rgba(184,115,22,.1) !important; color: #B87316 !important; }
  .ns-imd-action .ns-imd-node-lbl { color: #B87316 !important; }
  .ns-imd-arrow {
    color: rgba(18,16,14,.22) !important;
    font-size: 13px !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
  }

  /* ── 3단계 분류 카드 ── */
  .ns-imd-classes {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 6px !important;
  }
  .ns-imd-cls {
    border-radius: 10px !important;
    padding: 8px 9px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    border-left: 3px solid transparent !important;
    background: rgba(255,255,255,.82) !important;
    border: 1px solid rgba(18,16,14,.06) !important;
    backdrop-filter: blur(4px) !important;
  }
  .ns-imd-cls-rank {
    font-family: 'Outfit', sans-serif !important;
    font-size: 7px !important; font-weight: 700 !important;
    letter-spacing: .1em !important; text-transform: uppercase !important;
    opacity: .65 !important;
  }
  .ns-imd-cls-badge {
    font-family: 'Syne', sans-serif !important;
    font-size: 15px !important; font-weight: 800 !important;
    line-height: 1 !important;
  }
  .ns-imd-cls-name {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 6.5px !important; font-weight: 500 !important;
    opacity: .55 !important; line-height: 1.3 !important;
  }
  .ns-imd-cls-list {
    margin: 2px 0 0 !important; padding: 0 0 0 11px !important;
    list-style: disc !important;
  }
  .ns-imd-cls-list li {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: 7.5px !important; font-weight: 400 !important;
    line-height: 1.5 !important;
    color: rgba(18,16,14,.62) !important;
  }
  /* CNC: 초록 */
  .ns-imd-cnc { border-left: 3px solid #165C35 !important; }
  .ns-imd-cnc .ns-imd-cls-rank  { color: #165C35 !important; }
  .ns-imd-cnc .ns-imd-cls-badge { color: #165C35 !important; }
  .ns-imd-cnc .ns-imd-cls-list  { list-style-color: #165C35 !important; }
  /* UPC: 앰버 */
  .ns-imd-upc { border-left: 3px solid #B87316 !important; }
  .ns-imd-upc .ns-imd-cls-rank  { color: #B87316 !important; }
  .ns-imd-upc .ns-imd-cls-badge { color: #B87316 !important; }
  /* UCC: 레드 */
  .ns-imd-ucc { border-left: 3px solid #C0392B !important; }
  .ns-imd-ucc .ns-imd-cls-rank  { color: #C0392B !important; }
  .ns-imd-ucc .ns-imd-cls-badge { color: #C0392B !important; }

  /* ── 홈 우측 플로팅 오브 ── */
  @keyframes ns-orb-float {
    0%   { transform: translateY(0px)   scale(1);    }
    50%  { transform: translateY(-40px) scale(1.07); }
    100% { transform: translateY(0px)   scale(1);    }
  }
  .ns-home-orbs {
    position: absolute !important; inset: 0 !important;
    overflow: hidden !important; z-index: 0 !important;
    pointer-events: none !important;
  }
  .ns-orb {
    position: absolute !important; border-radius: 50% !important;
    opacity: 1;   /* radial-gradient로 소프트 엣지 — 항상 표시 */
    animation: ns-orb-float ease-in-out infinite !important;
  }

  /* ── 지리적 시각화 why-grid 스타일 ── */
  .ns-geo-why-head { margin-bottom: .9rem !important; }
  .ns-geo-sh {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: clamp(1.2rem, 2vw, 1.8rem) !important;
    font-weight: 800 !important; line-height: 1.15 !important;
    color: #12100E !important; margin: .4rem 0 .5rem !important;
  }
  .ns-geo-hi { color: #0F2340 !important; }
  .ns-geo-sublead {
    font-size: .82rem !important; color: rgba(18,16,14,.45) !important;
    line-height: 1.65 !important;
  }

  .ns-geo-domino {
    background: #fff !important;
    border: 1px solid rgba(18,16,14,.08) !important;
    border-radius: 10px !important; padding: .8rem 1rem !important;
    margin-bottom: .8rem !important;
    box-shadow: 0 1px 8px rgba(18,16,14,.06) !important;
  }
  .ns-geo-domino-lbl {
    font-family: 'Syne', sans-serif !important;
    font-size: .6rem !important; font-weight: 700 !important;
    letter-spacing: .18em !important; text-transform: uppercase !important;
    color: #0F2340 !important; margin-bottom: .7rem !important;
    display: flex !important; align-items: center !important; gap: 8px !important;
  }
  .ns-geo-domino-lbl::before {
    content: '' !important; width: 14px !important; height: 2px !important;
    background: #0F2340 !important; border-radius: 1px !important;
  }
  .ns-geo-domino-body {
    font-size: .84rem !important; color: rgba(18,16,14,.6) !important;
    line-height: 1.7 !important; margin-bottom: .8rem !important;
  }
  .ns-geo-chain {
    display: flex !important; align-items: center !important;
    gap: 0 !important; flex-wrap: wrap !important;
  }
  .ns-geo-cnode {
    font-family: 'Outfit', sans-serif !important;
    font-size: .85rem !important; font-weight: 700 !important;
    padding: 6px 16px !important; border-radius: 100px !important;
    color: #fff !important; white-space: nowrap !important;
  }
  .ns-geo-cnc { background: #165C35 !important; }
  .ns-geo-upc { background: #B87316 !important; }
  .ns-geo-ucc { background: #C0392B !important; }
  .ns-geo-carr {
    width: 22px !important; display: flex !important;
    align-items: center !important; justify-content: center !important;
    flex-shrink: 0 !important;
  }

  .ns-geo-limcol {
    display: flex !important; flex-direction: column !important;
    gap: .5rem !important; margin-bottom: .8rem !important;
  }
  .ns-geo-lim {
    background: #fff !important;
    border: 1px solid rgba(18,16,14,.08) !important;
    border-radius: 9px !important; padding: .65rem .85rem !important;
    display: flex !important; align-items: flex-start !important;
    gap: .7rem !important;
    box-shadow: 0 1px 3px rgba(18,16,14,.05) !important;
  }
  .ns-geo-lim-ico {
    flex-shrink: 0 !important; width: 32px !important; height: 32px !important;
    border-radius: 7px !important;
    display: grid !important; place-items: center !important;
  }
  .ns-geo-lim-t {
    font-family: 'Syne', 'Noto Sans KR', sans-serif !important;
    font-size: .82rem !important; font-weight: 700 !important;
    margin-bottom: .2rem !important;
    display: flex !important; align-items: baseline !important;
    gap: .3rem !important; flex-wrap: wrap !important;
  }
  .ns-geo-lim-cnt {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 800 !important;
  }
  .ns-geo-lim-d {
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
    font-size: .72rem !important; color: rgba(18,16,14,.45) !important;
    line-height: 1.5 !important;
  }

  /* ── Leaflet 저작권 표시 제거 ── */
  .leaflet-control-attribution { display: none !important; }

  /* ── 지도 하단 미니차트 행 ── */
  .ns-geo-mini-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 10px !important;
    height: 100% !important;
    margin-top: 0 !important;
  }
  .ns-geo-mini-card {
    background: rgba(255,255,255,.92) !important;
    border-radius: 10px !important;
    padding: 8px 12px !important;
    display: flex !important; flex-direction: column !important;
    box-shadow: 0 1px 6px rgba(15,35,64,.09) !important;
    overflow: hidden !important;
    min-height: 0 !important;
  }
  /* 미니차트 echarts output이 카드 남은 공간을 채우도록 */
  .ns-geo-mini-card > .shiny-bound-output,
  .ns-geo-mini-card > .html-widget-output {
    flex: 1 !important; min-height: 0 !important; width: 100% !important;
  }
  /* I-MAP 분류 정보 카드 (하단 첫 번째 미니카드) */
  .ns-geo-info-card {
    overflow-y: auto !important;
    justify-content: flex-start !important;   /* 제목은 상단 유지 */
  }
  /* info 카드 내 도미노(체인 내용)는 남은 공간 채우며 세로 균등 배분 */
  .ns-geo-info-card .ns-geo-domino {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-evenly !important;
  }
  .ns-geo-info-card .ns-geo-domino {
    background: transparent !important;
    border: none !important; border-radius: 0 !important;
    padding: 0 !important; margin-top: 2px !important;
    box-shadow: none !important;
  }
  .ns-geo-info-card .ns-geo-chain { gap: 4px !important; }
  .ns-geo-mini-lbl {
    font-family: 'Syne', sans-serif !important;
    font-size: 8px !important; font-weight: 700 !important;
    letter-spacing: .18em !important; text-transform: uppercase !important;
    color: rgba(15,35,64,.4) !important; margin-bottom: 4px !important;
    flex-shrink: 0 !important;
  }

  /* 전역 배경 캔버스 — ns_desktop.js가 #ns-bg-orbs에 그림 */

  /* ── 지도 컨트롤 패널 재디자인 ── */
  .ns-geo-controls {
    display: flex !important; flex-direction: column !important;
    gap: 0 !important; margin-top: 6px !important;
    background: #fff !important;
    border: 1px solid rgba(18,16,14,.08) !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 3px rgba(18,16,14,.05) !important;
  }
  .ns-geo-ctrl-row {
    display: flex !important; align-items: center !important;
    gap: 10px !important; padding: .6rem .9rem !important;
    border-bottom: 1px solid rgba(18,16,14,.05) !important;
    font-family: 'Outfit', 'Noto Sans KR', sans-serif !important;
  }
  .ns-geo-ctrl-row:last-child { border-bottom: none !important; }
  .ns-geo-ctrl-lbl {
    font-size: 9px !important; font-weight: 700 !important;
    letter-spacing: .12em !important; text-transform: uppercase !important;
    color: rgba(15,35,64,.4) !important; min-width: 30px !important;
    flex-shrink: 0 !important;
  }
  /* Shiny 컨트롤 compact 스타일 */
  .ns-geo-controls .shiny-input-container { margin: 0 !important; padding: 0 !important; }
  .ns-geo-controls .radio-inline,
  .ns-geo-controls .checkbox-inline,
  .ns-geo-controls label {
    font-size: 11px !important; color: rgba(15,35,64,.7) !important;
    font-family: 'Outfit', sans-serif !important;
    margin: 0 !important; padding: 0 2px !important;
    cursor: pointer !important;
  }
  /* radio-inline → 버튼 그룹 스타일
     ※ Shiny 구조: label.radio-inline > input + span  (.radio-inline 자체가 label) */
  .ns-geo-controls .radio-inline { margin-right: 0 !important; padding: 0 !important; }
  .ns-geo-controls .shiny-input-container.shiny-input-radiogroup .radio-inline {
    display: inline-flex !important; align-items: center !important;
    padding: 3px 9px !important; border-radius: 5px !important;
    margin: 1px !important; cursor: pointer !important;
    font-size: 10px !important; font-weight: 600 !important;
    color: rgba(15,35,64,.65) !important;
    border: 1px solid rgba(15,35,64,.12) !important;
    transition: background .15s, color .15s, border-color .15s !important;
    user-select: none !important;
  }
  .ns-geo-controls .shiny-input-container.shiny-input-radiogroup .radio-inline input[type="radio"] {
    display: none !important;
  }
  /* 선택된 라디오 버튼: :has() 사용 (모던 브라우저 지원) */
  .ns-geo-controls .shiny-input-container.shiny-input-radiogroup .radio-inline:has(input:checked) {
    background: #0F2340 !important; color: #fff !important;
    border-color: #0F2340 !important;
  }
  /* fallback: span 직접 타겟 (구형 브라우저용) */
  .ns-geo-controls .shiny-input-container.shiny-input-radiogroup .radio-inline input[type="radio"]:checked ~ span {
    color: inherit !important;
  }
  .ns-geo-controls input[type="checkbox"] { accent-color: #0F2340 !important; }

  /* 자동 전환 토글 버튼 */
  .ns-map-auto-btn {
    display: inline-flex !important; align-items: center !important;
    gap: 5px !important; padding: 4px 10px !important;
    border-radius: 6px !important; cursor: pointer !important;
    font-size: 9.5px !important; font-weight: 700 !important;
    letter-spacing: .06em !important;
    background: rgba(15,35,64,.07) !important;
    color: rgba(15,35,64,.6) !important;
    border: 1px solid rgba(15,35,64,.14) !important;
    transition: background .18s, color .18s !important;
    font-family: 'Outfit', sans-serif !important;
    width: 100% !important;
  }
  .ns-map-auto-btn.active {
    background: #0F2340 !important;
    color: #fff !important;
    border-color: #0F2340 !important;
  }

  /* 5초 자동 전환 진행 바 */
  .ns-map-progress-wrap {
    width: 100% !important;
    height: 3px !important;
    background: rgba(15,35,64,.10) !important;
    border-radius: 99px !important;
    overflow: hidden !important;
  }
  .ns-map-progress-fill {
    height: 100% !important;
    width: 0% !important;
    background: linear-gradient(90deg, #165C35, #B87316, #C0392B) !important;
    border-radius: 99px !important;
    transition: width 80ms linear !important;
  }

  /* ns-pcard 내 echarts 크기 확실히 채우기 */
  .ns-pcard .shiny-plot-output,
  .ns-pcard .echarts4r-container,
  .ns-pcard [id$="_chart"],
  .ns-pcard [id$="_gauge"],
  .ns-pcard [id$="_risk"],
  .ns-pcard [id$="_heatmap"],
  .ns-pcard [id$="_line"],
  .ns-pcard [id$="_bar"],
  .ns-pcard [id$="_trend"],
  .ns-pcard [id$="_pie"] {
    min-height: 0 !important;
  }

  /* 혼잡도 탭 plotly 차트 height 채우기 */
  .ns-nedis-grid .ns-pcard .shiny-plot-output {
    flex: 1 !important;
    min-height: 0 !important;
    width: 100% !important;
  }
  .ns-nedis-grid .ns-pcard .shiny-plot-output > .plotly.html-widget,
  .ns-nedis-grid .ns-pcard .shiny-plot-output > .js-plotly-plot {
    height: 100% !important;
    width: 100% !important;
  }
  /* 차트 레이블 — ns-pcard(라이트) 내에서 컬러 유지 */
  .ns-nedis-grid .ns-pcard:not(.ns-pcard-featured) .ns-chart-lbl {
    color: #0F2340 !important;
    font-size: 8.5px !important;
  }
  .ns-nedis-grid .ns-pcard:not(.ns-pcard-featured) .ns-chart-lbl.ns-amber {
    color: #B87316 !important;
  }
  .ns-nedis-grid .ns-pcard:not(.ns-pcard-featured) .ns-chart-lbl::before {
    background: #0F2340 !important;
  }
  .ns-nedis-grid .ns-pcard:not(.ns-pcard-featured) .ns-chart-lbl.ns-amber::before {
    background: #B87316 !important;
  }

  /* ── 관제 지도 레이어 컨트롤 화이트 스타일 ── */
  .leaflet-control-layers {
    background: rgba(255,255,255,.97) !important;
    border: 1px solid rgba(15,35,64,.08) !important;
    border-radius: 9px !important;
    box-shadow: 0 2px 12px rgba(15,35,64,.14) !important;
    color: #1E3A5F !important;
    font-family: "Noto Sans KR", sans-serif !important;
    min-width: 130px !important;
  }
  .leaflet-control-layers-expanded {
    padding: 8px 12px !important;
  }
  .leaflet-control-layers-list {
    color: #1E3A5F !important;
    font-size: 10px !important;
  }
  .leaflet-control-layers-separator {
    border-top: 1px solid rgba(15,35,64,.08) !important;
    margin: 5px 0 !important;
  }
  .leaflet-control-layers label {
    color: #1E3A5F !important;
    font-size: 10px !important;
    font-family: "Noto Sans KR", sans-serif !important;
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    margin: 3px 0 !important;
  }
  .leaflet-control-layers input[type="radio"],
  .leaflet-control-layers input[type="checkbox"] {
    accent-color: #2A5380 !important;
    margin: 0 !important;
  }
  .leaflet-control-layers-base::before {
    content: "BASE LAYER";
    display: block;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .15em;
    color: rgba(15,35,64,.38);
    margin-bottom: 5px;
  }
  .leaflet-control-layers-overlays::before {
    content: "OVERLAY";
    display: block;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .15em;
    color: rgba(15,35,64,.38);
    margin-top: 4px;
    margin-bottom: 5px;
  }
}

/* ═══════════════════════════════════════════════
   15. 모바일에서 ns-panel-layout 단일 컬럼 스택
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* 모바일: .app-container 전체 숨김 (mobile app이 대체) → tabsetPanel nav 불필요 */

  .ns-panel-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    height: auto !important;
  }
  .ns-pcard.ns-pcard-featured {
    display: none !important;
  }
  .ns-pcard {
    height: auto !important;
    min-height: 260px !important;
  }
  /* 모바일 지리 시각화: 지도만 풀스크린으로 */
  .ns-geo-layout {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
  }
  .ns-geo-intro { display: none !important; }
  .ns-geo-map-area {
    padding: 0 !important;
    background: transparent !important;
    gap: 8px !important;
  }
  .ns-geo-map-card {
    height: 320px !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  .ns-geo-legend { display: none !important; }
  .ns-geo-mini-row {
    padding: 8px !important;
    grid-template-columns: 1fr 1fr !important;
  }
  /* 모바일에서 분류 정보 카드 숨김 */
  .ns-geo-info-card { display: none !important; }
}


/* ════════════════════════════════════════════════════════════════
   PC 모드 — KTAS 1·2 위급 알람 시스템 (Phase A)
   ════════════════════════════════════════════════════════════════ */
.ctrl-alarm-stack {
  position: fixed;
  top: 64px;
  right: 16px;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 360px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  pointer-events: none;
}
.ctrl-crit-alarm {
  pointer-events: auto;
  background: linear-gradient(135deg, #7f1d1d, #b91c1c);
  border: 2px solid #fca5a5;
  border-radius: 12px;
  padding: 12px 14px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(220,38,38,.35), 0 0 0 4px rgba(239,68,68,.15);
  animation: ctrlAlarmIn .35s cubic-bezier(.2,1.2,.4,1), ctrlAlarmPulse 1.2s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}
.ctrl-crit-alarm.ktas2 {
  background: linear-gradient(135deg, #9a3412, #ea580c);
  border-color: #fdba74;
  box-shadow: 0 8px 32px rgba(234,88,12,.35), 0 0 0 4px rgba(249,115,22,.15);
}
.ctrl-crit-alarm.ktas2 { animation-name: ctrlAlarmIn, ctrlAlarmPulseAmber; }
@keyframes ctrlAlarmIn {
  from { transform: translateX(40px); opacity: 0 }
  to   { transform: translateX(0);    opacity: 1 }
}
@keyframes ctrlAlarmPulse {
  0%,100% { box-shadow: 0 8px 32px rgba(220,38,38,.35), 0 0 0 4px rgba(239,68,68,.15) }
  50%     { box-shadow: 0 12px 44px rgba(220,38,38,.6),  0 0 0 8px rgba(239,68,68,.3) }
}
@keyframes ctrlAlarmPulseAmber {
  0%,100% { box-shadow: 0 8px 32px rgba(234,88,12,.35), 0 0 0 4px rgba(249,115,22,.15) }
  50%     { box-shadow: 0 12px 44px rgba(234,88,12,.6),  0 0 0 8px rgba(249,115,22,.3) }
}
.ctrl-crit-alarm-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 800; letter-spacing: .3px;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,.4);
}
.ctrl-crit-alarm-head svg { flex-shrink: 0; animation: ctrlAlarmIcon 1.1s ease-in-out infinite }
@keyframes ctrlAlarmIcon {
  0%,100% { transform: scale(1) }
  50%     { transform: scale(1.18) }
}
.ctrl-crit-alarm-body {
  font-size: 12px; line-height: 1.55; color: rgba(255,255,255,.96);
  display: flex; flex-direction: column; gap: 2px;
}
.ctrl-crit-alarm-meta {
  font-size: 10.5px; color: rgba(255,255,255,.78);
  margin-top: 4px;
}
.ctrl-crit-alarm-actions {
  display: flex; gap: 6px; margin-top: 9px;
}
.ctrl-crit-alarm-btn {
  flex: 1;
  padding: 6px 10px; font-size: 11px; font-weight: 700;
  border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.4);
  background: rgba(255,255,255,.18);
  color: #fff;
  transition: background .15s;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.ctrl-crit-alarm-btn:hover { background: rgba(255,255,255,.32) }
.ctrl-crit-alarm-btn.primary {
  background: rgba(255,255,255,.95); color: #7f1d1d;
}
.ctrl-crit-alarm-btn.primary:hover { background: #fff }

/* 사이드 표시: 미확인 위급 카운트 — ctrl 탭 옆에 빨간 배지 */
.ns-tab-ctrl.has-critical::after {
  content: attr(data-crit-count);
  position: absolute;
  top: 4px; right: 4px;
  background: #dc2626;
  color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 2px 6px;
  border-radius: 99px;
  min-width: 18px; text-align: center;
  box-shadow: 0 0 0 2px rgba(220,38,38,.3);
  animation: ctrlAlarmPulse 1.2s ease-in-out infinite;
}

/* ════════════════════════════════════════════════════════════════
   PC 모드 — Phase B: 단일 환자 타임라인 슬라이드 패널
   ════════════════════════════════════════════════════════════════ */
.ctrl-timeline-panel {
  position: fixed;
  top: 64px; right: 16px;
  width: 380px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(15,35,64,.12);
  box-shadow: 0 16px 56px rgba(15,35,64,.18), 0 4px 16px rgba(15,35,64,.08);
  z-index: 99997;
  transform: translateX(420px);
  opacity: 0;
  transition: transform .32s cubic-bezier(.2,1.2,.4,1), opacity .25s;
  pointer-events: none;
  padding: 0;
}
.ctrl-timeline-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.ctrl-tl-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 3px solid #dc2626;
  background: rgba(15,35,64,.02);
  border-radius: 14px 14px 0 0;
}
.tl-ktas-badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  color: #fff;
  font-size: 11px; font-weight: 800;
  letter-spacing: .3px;
}
.tl-close-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(15,35,64,.05);
  border: none;
  color: #64748b;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.tl-close-btn:hover { background: rgba(15,35,64,.12); color: #0f2340 }
.ctrl-tl-route {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(15,35,64,.07);
  font-size: 13px;
  color: #0f2340;
}
.ctrl-tl-stages {
  padding: 12px 14px 4px 14px;
}
.tl-stage {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding-bottom: 14px;
  min-height: 36px;
}
.tl-stage-ico {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 2px solid;
  z-index: 2;
  position: relative;
}
.tl-stage-ico svg { width: 13px; height: 13px }
.tl-stage-conn {
  position: absolute;
  left: 13px; top: 28px; bottom: -2px;
  width: 2px;
}
.tl-stage-text {
  flex: 1; padding-top: 4px;
}
.tl-stage-label {
  font-size: 12px; font-weight: 700;
  color: #0f2340;
  margin-bottom: 1px;
}
.tl-stage:not(.done) .tl-stage-label { color: #64748b }
.tl-stage-ts {
  font-size: 10.5px;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .2px;
}
.ctrl-tl-memo {
  margin: 8px 14px 4px;
  padding: 10px 12px;
  background: rgba(245,158,11,.08);
  border-left: 3px solid #f59e0b;
  border-radius: 6px;
}
.ctrl-tl-actions {
  display: flex; gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(15,35,64,.07);
  margin-top: 4px;
}
.ctrl-tl-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(15,35,64,.12);
  background: #fff;
  color: #0f2340;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background .15s, border-color .15s;
}
.ctrl-tl-btn svg { width: 12px; height: 12px }
.ctrl-tl-btn:hover { background: rgba(15,35,64,.04) }
.ctrl-tl-btn.primary {
  background: #0f2340; color: #fff; border-color: #0f2340;
}
.ctrl-tl-btn.primary:hover { background: #1e3a5f }

/* 카드 hover — 클릭 가능 표시 */
.ctrl-card { transition: background .15s, transform .12s }
.ctrl-card:hover { background: rgba(15,35,64,.04); transform: translateY(-1px) }

/* PC 모드 — Phase E: 키보드 단축키 안내 오버레이 */
.ctrl-shortcut-overlay {
  position: fixed; inset: 0;
  background: rgba(15,35,64,.55);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  animation: ctrlScFadeIn .2s;
}
@keyframes ctrlScFadeIn { from { opacity: 0 } to { opacity: 1 } }
.ctrl-shortcut-card {
  background: #fff;
  border-radius: 14px;
  padding: 0;
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
  overflow: hidden;
}
.ctrl-sc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(15,35,64,.08);
  font-size: 14px; font-weight: 800; color: #0f2340;
}
.ctrl-sc-head button {
  width: 26px; height: 26px;
  border-radius: 50%; background: rgba(15,35,64,.05); border: none;
  cursor: pointer; color: #64748b;
  display: flex; align-items: center; justify-content: center;
}
.ctrl-sc-head button svg { width: 13px; height: 13px }
.ctrl-sc-list { padding: 8px 18px; display: flex; flex-direction: column }
.ctrl-sc-row {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(15,35,64,.08);
}
.ctrl-sc-row:last-child { border-bottom: none }
.ctrl-sc-row kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 28px;
  padding: 0 8px;
  background: linear-gradient(180deg,#fff,#f1f5f9);
  border: 1px solid rgba(15,35,64,.18);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: #0f2340;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 12px; font-weight: 700;
}
.ctrl-sc-row span { font-size: 13px; color: #0f2340 }
.ctrl-sc-foot {
  padding: 10px 18px;
  background: rgba(15,35,64,.04);
  font-size: 11px; color: #64748b;
  text-align: center;
}

/* ════════════════════════════════════════════════════════════════
   PC 모드 — AI 브리핑 뉴스 티커 (하단 고정 가로 스크롤)
   ════════════════════════════════════════════════════════════════ */
.ctrl-news-ticker {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 36px;
  background: linear-gradient(90deg, #0a1930 0%, #0f2340 60%, #1e3a5f 100%);
  border-top: 2px solid #fbbf24;
  display: flex; align-items: stretch;
  z-index: 99995;
  box-shadow: 0 -6px 20px rgba(15,35,64,.35);
  font-family: 'Inter','Noto Sans KR',sans-serif;
  transform: translateY(0);
  transition: transform .3s cubic-bezier(.2,1,.4,1);
}
.ctrl-news-ticker.hidden { transform: translateY(40px); pointer-events: none }
.ctrl-news-label {
  background: linear-gradient(135deg,#f59e0b,#fbbf24);
  color: #0f2340;
  padding: 0 14px;
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px;
  flex-shrink: 0;
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
}
.ctrl-news-label svg { animation: tickerPulse 1.4s ease-in-out infinite }
@keyframes tickerPulse { 0%,100% { transform: scale(1) } 50% { transform: scale(1.18) } }
.ctrl-news-track {
  flex: 1; min-width: 0;
  overflow: hidden;
  position: relative;
  display: flex; align-items: center;
}
.ctrl-news-content {
  display: inline-block;
  white-space: nowrap;
  font-size: 13px;
  color: #e2e8f0;
  letter-spacing: .2px;
  padding-left: 100%;
  animation: tickerScroll 60s linear infinite;
  will-change: transform;
}
@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.ctrl-news-content .nt-sep {
  display: inline-block;
  margin: 0 18px;
  color: #fbbf24;
  font-weight: 700;
}
.ctrl-news-time {
  flex-shrink: 0;
  padding: 0 12px;
  display: flex; align-items: center;
  font-size: 10.5px;
  color: rgba(226,232,240,.6);
  font-family: 'JetBrains Mono', monospace;
  border-left: 1px solid rgba(255,255,255,.08);
}
.ctrl-news-close {
  width: 36px;
  background: transparent;
  border: none;
  color: rgba(226,232,240,.6);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.ctrl-news-close:hover { color: #fff; background: rgba(255,255,255,.08) }

/* 티커가 활성일 때 본문 하단 여백 확보 */
body.ctrl-ticker-on .app-container { padding-bottom: 36px !important }

/* ════════════════════════════════════════════════════════════════
   PC 모드 — 트랙패드 스크롤 보장 (방어적)
   ════════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  html, body {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: auto;
  }
  body { min-height: 100vh }
}

/* PC 모드 — 티커가 wheel 이벤트를 흡수하지 않도록 보강 */
.ctrl-news-ticker { pointer-events: none }
.ctrl-news-label,
.ctrl-news-time,
.ctrl-news-close { pointer-events: auto }

/* 모바일에서는 티커 / 알람스택 / 타임라인 패널 숨김 (PC 전용 도구) */
@media (max-width: 768px) {
  .ctrl-news-ticker,
  .ctrl-alarm-stack,
  .ctrl-timeline-panel,
  .ctrl-shortcut-overlay { display: none !important }
  body.ctrl-ticker-on .app-container { padding-bottom: 0 !important }
}

/* ════════════════════════════════════════════════════════════════
   PC 모드 — 운영 통계 패널 (Phase F)
   ════════════════════════════════════════════════════════════════ */
.ns-ctrl-ops-btn {
  margin-left: 5px;
  padding: 4px 9px;
  background: linear-gradient(135deg, rgba(139,92,246,.18), rgba(99,102,241,.14));
  border: 1px solid rgba(139,92,246,.4);
  border-radius: 7px;
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.ns-ctrl-ops-btn:hover {
  background: linear-gradient(135deg, rgba(139,92,246,.32), rgba(99,102,241,.24));
  color: #ddd6fe;
}

.ctrl-ops-panel {
  position: fixed;
  top: 64px; right: 16px;
  width: 380px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(15,35,64,.12);
  box-shadow: 0 16px 56px rgba(15,35,64,.18), 0 4px 16px rgba(15,35,64,.08);
  z-index: 99996;
  transform: translateX(420px);
  opacity: 0;
  transition: transform .32s cubic-bezier(.2,1.2,.4,1), opacity .25s;
  pointer-events: none;
  padding: 0;
}
.ctrl-ops-panel.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.ops-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 3px solid #8b5cf6;
  background: rgba(139,92,246,.04);
  border-radius: 14px 14px 0 0;
}
.ops-head-title {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 800; color: #0f2340;
  flex: 0 0 auto;
}
.ops-head-sub {
  flex: 1;
  font-size: 10.5px;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
  padding-right: 8px;
}
.ops-close {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(15,35,64,.05);
  border: none; color: #64748b;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ops-close:hover { background: rgba(15,35,64,.12); color: #0f2340 }

.ops-section {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(15,35,64,.07);
}
.ops-sec-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ops-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}
.ops-grid:has(> .ops-cell:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr) }
.ops-cell {
  background: rgba(15,35,64,.03);
  border: 1px solid rgba(15,35,64,.06);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
}
.ops-num {
  font-size: 18px; font-weight: 800;
  color: #0f2340;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.1;
}
.ops-lbl {
  font-size: 9.5px;
  color: #64748b;
  margin-top: 2px;
  letter-spacing: .2px;
}

.ops-quota {
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 8px;
}
.ops-quota-row {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  align-items: center;
  gap: 8px;
}
.ops-quota-lbl {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
}
.ops-bar {
  height: 6px;
  background: rgba(15,35,64,.08);
  border-radius: 99px;
  overflow: hidden;
}
.ops-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
}
.ops-quota-val {
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  text-align: right;
}
.ops-meta {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
  letter-spacing: .1px;
}
.ops-system {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: #64748b;
  background: rgba(15,35,64,.02);
  padding: 10px 16px;
  border-bottom: none;
  border-radius: 0 0 14px 14px;
}
.ops-system span { display: inline-flex; align-items: center; gap: 5px }
.ops-refresh {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px;
  background: rgba(139,92,246,.12);
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 7px;
  color: #7c3aed;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.ops-refresh:hover { background: rgba(139,92,246,.22) }

@media (max-width: 768px) {
  .ctrl-ops-panel { display: none !important }
}

/* PC 모드 — 모바일 전용 fixed 요소가 PC 모드에서 절대 표시 안 되도록 (스크롤 룰은 건드리지 않음) */
@media (min-width: 769px) {
  #imap-mobile-app,
  #m-voice-fab,
  #m-ai-fab,
  #btn-guide-float,
  #m-ai-panel,
  #mob-guide-modal {
    display: none !important;
  }
  /* force-mobile-only 모드에서는 모달을 JS가 직접 제어 — CSS로 강제 숨김 안 함 */
  body:not(.force-mobile-only) #tut-picker-modal,
  body:not(.force-mobile-only) #method-viewer-modal {
    display: none !important;
  }
}

/* =====================================================================
   Phase 0-3b: 방법론 탭 + SVG 아이콘 + 차트 ⓘ 모달
   - 4 phase 업그레이드 공통 인프라
   - 모든 신규 UI 요소는 SVG 아이콘 사용 (이모지 금지)
   ===================================================================== */
.ns-icon {
  display: inline-block;
  vertical-align: -2px;
  flex-shrink: 0;
}

.ns-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: transparent;
  border: 1px solid rgba(15,35,64,.18);
  border-radius: 50%;
  color: rgba(15,35,64,.55);
  cursor: pointer;
  transition: all .15s ease;
  padding: 0;
}
.ns-info-btn:hover {
  color: #0072CE;
  border-color: #0072CE;
  background: rgba(0,114,206,.08);
}

.ns-method-panel {
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
  font-family: 'Inter','Noto Sans KR',sans-serif;
}
.ns-method-hdr {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(15,35,64,.08);
  margin-bottom: 20px;
}
.ns-method-hdr-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(0,114,206,.08);
  display: flex; align-items: center; justify-content: center;
}
.ns-method-hdr-ttl {
  font-size: 20px; font-weight: 700;
  color: #0F2340;
  margin-bottom: 6px;
}
.ns-method-hdr-sub {
  font-size: 13px;
  color: rgba(15,35,64,.65);
  line-height: 1.55;
}

.ns-method-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 18px;
  padding: 14px 18px;
  background: rgba(0,114,206,.04);
  border-radius: 10px;
  margin-bottom: 24px;
}
.ns-method-meta-row {
  display: flex; gap: 6px; align-items: center;
  font-size: 12px;
  color: rgba(15,35,64,.7);
}
.ns-method-meta-row strong { color: #0F2340; font-weight: 600; }

.ns-method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}
.ns-method-card {
  background: #fff;
  border: 1px solid rgba(15,35,64,.08);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.ns-method-card:hover {
  box-shadow: 0 4px 20px rgba(15,35,64,.08);
  transform: translateY(-2px);
}
.ns-method-card-hdr {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(0,114,206,.06), rgba(0,114,206,.02));
  border-bottom: 1px solid rgba(15,35,64,.06);
}
.ns-method-card-ttl {
  font-size: 14px; font-weight: 700;
  color: #0F2340;
}
.ns-method-card-body {
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.6;
}
.ns-method-card-row { margin-bottom: 8px; }
.ns-method-card-lbl {
  color: rgba(15,35,64,.55);
  font-weight: 600;
  margin-right: 4px;
}
.ns-method-card-val { color: rgba(15,35,64,.85); }
.ns-method-card-formula {
  font-family: 'JetBrains Mono','Menlo',monospace;
  font-size: 11.5px;
  background: rgba(15,35,64,.04);
  padding: 2px 6px;
  border-radius: 4px;
  color: #0F2340;
}
.ns-method-card-note {
  display: flex; gap: 6px; align-items: flex-start;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15,35,64,.1);
  font-size: 11.5px;
  color: rgba(220,80,40,.85);
}
.ns-method-card-note .ns-icon { margin-top: 2px; }

.ns-method-modal p { margin: 8px 0; line-height: 1.65; }
.ns-method-modal code {
  font-family: 'JetBrains Mono','Menlo',monospace;
  background: rgba(15,35,64,.05);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12.5px;
  color: #0F2340;
}
.ns-method-empty {
  text-align: center;
  padding: 60px 20px;
  color: rgba(15,35,64,.45);
  font-size: 13px;
}

/* 모바일에서 방법론 그리드 1열 */
@media (max-width: 600px) {
  .ns-method-panel { padding: 16px; }
  .ns-method-hdr { flex-direction: column; gap: 10px; }
  .ns-method-grid { grid-template-columns: 1fr; }
}

/* I-NET 탭 전체화면 (requestFullscreen API) */
#pc-inet-tab-panel:fullscreen,
#pc-inet-tab-panel:-webkit-full-screen {
  background: #0a1628 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
}
#pc-inet-tab-panel:fullscreen .ns-tab-body,
#pc-inet-tab-panel:-webkit-full-screen .ns-tab-body {
  flex: 1 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* I-NET 채팅 카드 전체화면 portal 상태 */
#pc-inet-chat-card.pc-inet-fullscreen {
  flex: 1 !important;
  width: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  /* ns-pcard-featured의 overflow-y:auto !important 명시 override */
  overflow-y: hidden !important;
  border-radius: 12px !important;
}
/* 전체보기: 메시지 영역이 남은 공간 채우도록 명시 */
#pc-inet-chat-card.pc-inet-fullscreen #pc-inet-msgs {
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

/* ── 프로필 직종 선택 카드 ── */
.profile-role-card.selected {
  border-color: rgba(99, 179, 237, .8) !important;
  background: rgba(59, 130, 246, .18) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, .25);
}
.profile-role-card.selected div:first-child {
  color: #93c5fd !important;
}

/* I-NET 채팅 답장 인용구 */
.inet-reply-quote {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 4px 8px;
  margin-bottom: 5px;
  border-left: 2px solid rgba(99,130,191,.6);
  background: rgba(99,130,191,.1);
  border-radius: 4px;
  font-size: 10.5px;
  max-width: 240px;
}
.inet-reply-quote-nick {
  color: #60a5fa;
  font-weight: 700;
}
.inet-reply-quote-text {
  color: #94a3b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 내 말풍선(노란 배경)의 답장 인용구 — 가독성을 위해 어두운 색 사용 */
.self-bubble .inet-reply-quote {
  border-left-color: rgba(0,0,0,.3);
  background: rgba(0,0,0,.08);
}
.self-bubble .inet-reply-quote-nick {
  color: rgba(0,0,0,.75);
}
.self-bubble .inet-reply-quote-text {
  color: rgba(0,0,0,.5);
}

/* 누끼 이모지(big-emoji) 안 답장 인용구
   배경이 투명하므로 반드시 독립된 카드 스타일로 강제 표시
   self-bubble 어두운 색 오버라이드(.self-bubble 규칙)보다 우선순위 높음 */
.inet-bubble.inet-big-emoji .inet-reply-quote {
  background: rgba(10, 20, 48, 0.82) !important;
  border-left-color: rgba(99,130,191,.75) !important;
  border-radius: 6px;
}
.inet-bubble.inet-big-emoji .inet-reply-quote-nick {
  color: #93c5fd !important;
}
.inet-bubble.inet-big-emoji .inet-reply-quote-text {
  color: #94a3b8 !important;
}

/* 공감 버튼 행 (더 이상 기본 표시 안 함 — 롱프레스 컨텍스트 메뉴로 대체) */
.inet-react-row { display: none; }

/* 공감 배지 — 반응 있을 때만 메시지 바디에 표시 */
.inet-react-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(99,130,191,.12);
  border: 1px solid rgba(99,130,191,.28);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 9.5px;
  color: #64748b;
  cursor: pointer;
  margin-top: 3px;
  transition: background .15s, color .15s;
  user-select: none;
}
.inet-react-badge.i-reacted {
  background: rgba(16,185,129,.18);
  border-color: rgba(16,185,129,.45);
  color: #10b981;
}
.inet-react-badge.self-align {
  align-self: flex-end;
}

/* 롱프레스 컨텍스트 메뉴 */
.inet-ctx-menu {
  position: fixed;
  z-index: 9999;
  background: #1e2d47;
  border: 1px solid rgba(99,130,191,.4);
  border-radius: 11px;
  padding: 4px;
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 130px;
  animation: ctxFadeIn .12s ease;
}
@keyframes ctxFadeIn {
  from { opacity:0; transform:scale(.92) translateY(4px); }
  to   { opacity:1; transform:scale(1)   translateY(0); }
}
.inet-ctx-menu button {
  background: none;
  border: none;
  color: #e2e8f0;
  padding: 9px 14px;
  cursor: pointer;
  border-radius: 7px;
  text-align: left;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
}
.inet-ctx-menu button:hover,
.inet-ctx-menu button:active {
  background: rgba(99,130,191,.15);
}
.inet-ctx-menu .ctx-divider {
  height: 1px;
  background: rgba(99,130,191,.15);
  margin: 2px 4px;
}

/* ── I-NET 채팅 전체보기 ── */
#chat-hotline-panel.inet-chat-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  /* 드리프트 배너(99999)·AI 패널(199999)보다 위에 표시 */
  z-index: 200100 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #060d1a !important;
  overflow: hidden !important;
}
/* 전체보기: 헤더(버튼 포함) 항상 상단 고정 */
#chat-hotline-panel.inet-chat-fullscreen > div:first-child {
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 1 !important;
}
/* 전체보기: 메시지 영역이 남은 공간 채우도록 명시 */
#chat-hotline-panel.inet-chat-fullscreen #inet-msgs {
  flex: 1 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}
/* 전체보기: 빠른응답·입력창 하단 고정 */
#chat-hotline-panel.inet-chat-fullscreen #inet-quick-reply,
#chat-hotline-panel.inet-chat-fullscreen > div:last-child {
  flex-shrink: 0 !important;
}
/* 전체보기 시 헤더 버튼 색상 강조 */
#chat-hotline-panel.inet-chat-fullscreen #inet-fs-btn {
  background: rgba(99, 130, 191, .28) !important;
  border-color: rgba(99, 130, 191, .5) !important;
  color: #93c5fd !important;
}
/* 전체보기 패널 내부 도구 섹션:
   — .m-chat-sugs 의 background:var(--bg)=#0a0e1a 가 패널 배경(#060d1a)과 달라 박스가 보이는 현상 수정
   — 나머지 inline 스타일(border, padding 등)은 그대로 유지 → 전체보기 전과 동일한 디자인 */
#chat-hotline-panel.inet-chat-fullscreen > #inet-quick-patient .m-chat-sugs,
#chat-hotline-panel.inet-chat-fullscreen > #chat-quick-field .m-chat-sugs {
  background: transparent !important;
}

/* 스와이프-답장 화살표 — 왼쪽으로 밀면 오른쪽에 표시 (self/other 동일) */
.inet-reply-swipe-arrow {
  position: absolute;
  right: -34px;
  left: auto;
  top: 50%;
  transform: translateY(-50%) scale(0.55);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(59, 130, 246, .18);
  border: 1px solid rgba(59, 130, 246, .32);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60a5fa;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

/* 이모지 전용 메시지 — 말풍선 제거, 이모지만 크게 표시 (카카오톡 스타일) */
.inet-bubble.inet-big-emoji {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  min-width: 0 !important;
  padding: 2px 2px !important;
  font-size: 2.6em;
  line-height: 1.1;
  animation: bigEmojiPop .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes bigEmojiPop {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}

/* 이모티콘 피커 — 인라인 flex 아이템 (position:fixed 제거) */
.inet-emoji-picker {
  flex-shrink: 0;
  background: rgba(15, 25, 50, .98);
  border-top: 1px solid rgba(99,130,191,.22);
  padding: 8px 6px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  animation: ctxFadeIn .13s ease;
}
.inet-emoji-picker button {
  font-size: 20px;
}
.inet-emoji-picker button {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 5px;
  border-radius: 8px;
  line-height: 1;
  transition: background .1s;
}
.inet-emoji-picker button:hover,
.inet-emoji-picker button:active {
  background: rgba(99,130,191,.18);
}

/* 채팅 배경 워터마크 */
.inet-chat-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-20deg);
  pointer-events: none;
  user-select: none;
  z-index: -1;
  text-align: center;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 5px;
  color: rgba(99, 130, 191, 0.07);
  line-height: 2.3;
  white-space: pre;
  width: 200px;
}

/* 빠른 응답 칩 - 토글 헤더 */
.inet-qr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px 4px 12px;
  cursor: pointer;
  user-select: none;
}
.inet-qr-header-label {
  font-size: 9.5px;
  color: rgba(99,130,191,.7);
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: .3px;
}
.inet-qr-chev {
  font-size: 9px;
  color: #64748b;
  transition: transform .2s;
}
/* 빠른 응답 칩 스크롤 컨테이너 */
.inet-qr-chips {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 5px;
  padding: 0 10px 7px;
  scrollbar-width: none;
}
.inet-qr-chips::-webkit-scrollbar { display: none; }
