/*!*****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./src/app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************/
/* ── Pretendard ── */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

/* ── BASE VARIABLES ── */
:root {
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --trans: 0.15s ease;
  --fs-scale: 1;
}

/* ── 폰트 크기 ── */
[data-font="sm"] { --fs-scale: 0.85; }
[data-font="md"] { --fs-scale: 1; }
[data-font="lg"] { --fs-scale: 1.15; }

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg0: #fcfcfc;
  --bg1: #ffffff;
  --bg2: #f4f5f9;
  --bg3: #fafafe;
  --bd: #e8e8e8;
  --bd2: #d4d4d4;
  --t1: #000000e0;
  --t2: #000000cf;
  --t3: #000000b0;
  --ac: #3078FF;
  --ac2: #4CD3FF;
  --ac-soft: rgba(48, 120, 255, 0.09);
  --ok: #10b981;
  --err: #ef4444;
  --warn: #f59e0b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 4px rgba(0,0,0,.03);
  --shadow: 0 2px 8px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.04);
  --cu-global-sidebar-row-background-active: #e4e5ea;
  --cu-background-primary-on-subtle: rgba(0,0,0,0.05);
}

/* ── DARK THEME ── */
[data-theme="dark"] {
  --bg0: #111111;
  --bg1: #111111;
  --bg2: #1e1e1e;
  --bg3: #242424;
  --bd: #2A2A2A;
  --bd2: #333333;
  --t1: #ffffffd6;
  --t2: #ffffffcf;
  --t3: #ffffff69;
  --ac: #3078FF;
  --ac2: #4CD3FF;
  --ac-soft: rgba(48, 120, 255, 0.13);
  --ok: #34d399;
  --err: #f87171;
  --warn: #fbbf24;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.5);
  --shadow: 0 4px 16px rgba(0,0,0,.6);
  --cu-global-sidebar-row-background-active: #252525;
  --cu-background-primary-on-subtle: rgba(255,255,255,0.06);
}

/* ── 다크모드 사이드바 배경 개별 지정 ── */
[data-theme="dark"] .lnb { background: #191919; }
[data-color="slate"][data-theme="dark"] .gnb { background: #191919; }
[data-color="slate"][data-theme="dark"] .gnb-item:hover { background: #ffffff12; }
[data-color="slate"][data-theme="dark"] .gnb-item.a { background: #ffffff12; }
[data-color="slate"][data-theme="light"] .gnb { background: #000000; }
[data-color="slate"][data-theme="light"] .gnb-item.a { background: #ffffff33; }
[data-theme="dark"] .lnb-item,
[data-theme="dark"] .lnb-leaf,
[data-theme="dark"] .lnb-fav-hd { color: #b0b0b0; }
[data-theme="dark"] .lnb-item:hover,
[data-theme="dark"] .lnb-leaf:hover { color: #e8e8e8; }
[data-theme="light"] .lnb { background: #f9f9f9; }
[data-theme="light"] .lnb-item:hover,
[data-theme="light"] .lnb-leaf:hover,
[data-theme="light"] .lnb-item.a,
[data-theme="light"] .lnb-leaf.a { background: #eaeaea; }
[data-theme="light"] .lnb-item,
[data-theme="light"] .lnb-leaf,
[data-theme="light"] .lnb-fav-hd { color: #373737; }
[data-theme="light"] .lnb-item:hover,
[data-theme="light"] .lnb-leaf:hover { color: #111111; }
[data-theme="light"] .lnb-item.a,
[data-theme="light"] .lnb-leaf.a { color: #202020; }

/* ── 다크모드 active / hover 개별 지정 ── */
[data-theme="dark"] .gnb-item:hover { background: #00000033; color: #ffffffab; }
[data-theme="dark"] .gnb-item.a     { background: #00000033; color: #ffffffab; }

[data-theme="dark"] .lnb-item:hover { background: #222222; }

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; display: flex; flex-direction: column; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg0);
  color: var(--t1);
  font-size: calc(13px * var(--fs-scale));
  line-height: 1.5;
}
button, input, select, textarea { font-family: inherit; }

/* ══════════════════════════════════════
   APP  —  전체 래퍼
══════════════════════════════════════ */
.app {
  display: flex;
  flex: 1 1;
  overflow: hidden;
  padding: 6px;
  background: var(--bg0);
}

/* ══════════════════════════════════════
   SIDEBAR WRAP  —  GNB + LNB 묶음 컨테이너
   layout.tsx: .sidebar-wrap
══════════════════════════════════════ */
.sidebar-wrap {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 6px;
}

/* 사이드바 상단 헤더 (기관 선택) */
.sidebar-hd {
  display: flex;
  align-items: center;
  padding: 0;
  flex-shrink: 0;
  height: 35px;
}
.sidebar-hd-collapsed {
  justify-content: center;
  margin-right: 6px;
  background: var(--bg1);
  border-radius: 8px;
}

/* GNB + LNB 가로 배치 */
.sidebar-nav {
  flex: 1 1;
  display: flex;
  overflow: hidden;
  gap: 6px;
}

/* ══════════════════════════════════════
   FACILITY SELECTOR  —  기관 선택
══════════════════════════════════════ */
.facility-bar { display: contents; }
.facility-selector {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border-radius: 8px;
  border: none;
  background: var(--bg1);
  cursor: pointer;
  transition: var(--trans);
  width: 100%;
  height: 100%;
}
[data-theme="dark"] .facility-selector { background: #191919; }
[data-theme="light"] .facility-selector { background: #f9f9f9; border: 1px solid var(--bd); }
[data-theme="light"] .sidebar-hd-collapsed { background: #ededed; }
[data-theme="dark"] .sidebar-hd-collapsed { background: #191919; }
[data-theme="dark"] .facility-selector:hover { background: rgba(255,255,255,.05); }
[data-theme="light"] .facility-selector:hover { background: #e0e0e0; }
.facility-selector-icon { color: var(--ac); flex-shrink: 0; }
.facility-logo { display: flex; align-items: center; flex-shrink: 0; width: 18px; height: 18px; }
.logo-ac  { fill: var(--ac); }
.logo-ac2 { fill: var(--ac2); }
[data-color="slate"] .logo-ac  { fill: #3078FF; }
[data-color="slate"] .logo-ac2 { fill: #4CD3FF; }
.facility-selector-name {
  font-size: calc(13px * var(--fs-scale));
  font-weight: 600;
  color: var(--t1);
  white-space: nowrap;
  flex: 1 1;
  text-align: left;
}
.facility-selector-chevron { color: var(--t3); flex-shrink: 0; }

/* ══════════════════════════════════════
   CONTENT WRAP  —  오른쪽 콘텐츠 패널
   layout.tsx: .content-wrap
══════════════════════════════════════ */
.content-wrap {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* mh + mb 래퍼 */
.content-body {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--bd);
  border-radius: 0 8px 8px 0;
  background: var(--bg1);
  position: relative;
  z-index: 1;
}
[data-theme="dark"] .content-body { background: #111111; }
[data-theme="light"] .content-body { background: #ffffff; }
[data-theme="light"] .mb { background: #ffffff; }

/* ══════════════════════════════════════
   공통 로고 칩
══════════════════════════════════════ */
.logo-i {
  width: 28px; height: 28px; min-width: 28px;
  border-radius: 12px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ══════════════════════════════════════
   1depth 사이드바  (.gnb)  — 64px
══════════════════════════════════════ */
.gnb {
  width: 52px;
  min-width: 52px;
  background: color-mix(in srgb, var(--ac), black 25%);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

/* 로고 영역 */
.gnb-logo {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 13px 0 8px;
  flex-shrink: 0;
}
.gnb-logo-txt { display: none; }

/* 메뉴 스크롤 영역 */
.gnb-nav {
  flex: 1 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 6px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}
.gnb-nav::-webkit-scrollbar { display: none; }

/* 1depth 아이템 — 아이콘 + 미니 라벨 */
.gnb-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #ffffffab;
  transition: var(--trans);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  width: 100%;
}
.gnb-item:hover { background: #00000033; color: #ffffffab; }
.gnb-item.a   { background: #00000033; color: #ffffffab; }
.gnb-icon {
  flex-shrink: 0;
  color: inherit;
  opacity: 1;
  transition: var(--trans);
  display: block;
}
.gnb-item:hover .gnb-icon { opacity: 0.75; }
.gnb-item.a .gnb-icon     { opacity: 1; }
.gnb-label {
  font-size: calc(9px * var(--fs-scale));
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
  line-height: 1;
  letter-spacing: 0.01em;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 하단 영역 */
.gnb-bot {
  width: 100%;
  padding: 8px 6px 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.gnb-user { display: flex; justify-content: center; }
.gnb-user-info { display: none; }
.gnb-user-name { display: none; }
.gnb-user-role { display: none; }

/* ══════════════════════════════════════
   2depth 사이드바  (.lnb)  — 255px
   (sidebar-nav 안에서 GNB 우측에 위치)
══════════════════════════════════════ */
.lnb {
  width: 255px;
  min-width: 255px;
  background: var(--bg1);
  border: 1px solid var(--bd);
  border-right: none;
  border-radius: 8px 0 0 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.2s ease, min-width 0.2s ease;
}

/* 섹션 헤더 */
.lnb-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  min-height: 42px;
  flex-shrink: 0;
  gap: 6px;
}
.lnb-hd-label {
  font-size: calc(16px * var(--fs-scale));
  font-weight: 700;
  color: var(--t1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lnb-hd-count {
  font-size: calc(10px * var(--fs-scale));
  font-weight: 600;
  color: var(--t3);
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 99px;
  padding: 1px 6px;
  flex-shrink: 0;
}
.lnb-hd-toggle { display: none; }

/* GNB — LNB 펼치기 버튼 */
.gnb-lnb-open {
  display: flex; align-items: center; justify-content: center;
  padding: 6px 0 2px;
  flex-shrink: 0;
}
.gnb-lnb-open-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: none; border-radius: var(--radius-xs);
  background: transparent;
  color: var(--t3);
  cursor: pointer;
  transition: var(--trans);
}
.gnb-lnb-open-btn:hover { background: var(--bg2); color: var(--t1); }

/* LNB 접기 버튼 */
.lnb-collapse-btn {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--t3);
  cursor: pointer;
  transition: var(--trans);
  flex-shrink: 0;
  margin-left: auto;
}
.lnb-collapse-btn:hover { background: var(--bg2); color: var(--t1); }

/* LNB 접힌 상태 — 완전히 숨김 */
.lnb.collapsed {
  width: 0;
  min-width: 0;
  border: none;
  padding: 0;
}

/* 2depth 메뉴 리스트 */
.lnb-nav {
  flex: 1 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.lnb-nav::-webkit-scrollbar { width: 3px; }
.lnb-nav::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 3px; }

/* 2depth 아이템 */
.lnb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--t2);
  font-size: calc(14px * var(--fs-scale));
  transition: var(--trans);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  white-space: nowrap;
}
.lnb-item:hover { background: var(--bg2); color: var(--t1); }
.lnb-item.a     { background: var(--cu-global-sidebar-row-background-active, var(--cu-background-primary-on-subtle)); color: var(--t1); font-weight: 500; }
.lnb-icon {
  flex-shrink: 0;
  opacity: 1;
  transition: var(--trans);
  display: block;
}
.lnb-item:hover .lnb-icon { opacity: 1; }
.lnb-item.a .lnb-icon     { opacity: 1; }
.lnb-txt { overflow: hidden; text-overflow: ellipsis; flex: 1 1; }

/* 섹션 chevron */
.lnb-chevron {
  flex-shrink: 0;
  opacity: 0.3;
  transition: transform var(--trans), opacity var(--trans);
}
.lnb-chevron.open { transform: rotate(90deg); opacity: 0.6; }
.lnb-item:hover .lnb-chevron { opacity: 0.55; }
.lnb-item.a .lnb-chevron     { opacity: 0.7; }

/* 리프 메뉴 영역 */
.lnb-section { display: flex; flex-direction: column; }
.lnb-children {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 4px 10px;
  margin: 1px 0 2px 18px;
  border-left: 1px solid var(--bd);
  position: relative;
}
.lnb-section:last-child .lnb-children {
  border-left: none;
}
.lnb-section:last-child .lnb-children::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--bd) 60%, transparent 100%);
}

/* 리프 아이템 */
.lnb-leaf {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--t3);
  font-size: calc(13px * var(--fs-scale));
  transition: var(--trans);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  white-space: nowrap;
}
.lnb-leaf:hover { background: var(--bg2); color: var(--t2); }
.lnb-leaf.a {
  background: var(--cu-global-sidebar-row-background-active, var(--cu-background-primary-on-subtle));
  color: var(--t1);
  font-weight: 500;
}
.lnb-leaf-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--bd2);
  flex-shrink: 0;
  transition: var(--trans);
}
.lnb-leaf:hover .lnb-leaf-dot { background: var(--t3); }
.lnb-leaf.a .lnb-leaf-dot     { background: var(--ac); }
.lnb-leaf-txt { overflow: hidden; text-overflow: ellipsis; flex: 1 1; }

/* ── 즐겨찾기 별 버튼 ── */
.lnb-star {
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--t3);
  padding: 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 3px;
  transition: opacity var(--trans), color var(--trans);
  line-height: 0;
}
.lnb-leaf:hover .lnb-star,
.lnb-item:hover .lnb-star { opacity: 1; }
.lnb-star.on { opacity: 1; color: #f59e0b; }
.lnb-star:hover { color: #f59e0b !important; }

/* ── 즐겨찾기 섹션 ── */
.lnb-fav-hd {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px 4px;
  font-size: calc(10px * var(--fs-scale));
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.lnb-fav-sep {
  height: 1px;
  background: var(--bd);
  margin: 6px 6px 8px;
}

/* ══════════════════════════════════════
   MAIN  (.mn)  — 콘텐츠 영역
   (right-panel 안에 있어 개별 border/shadow 없음)
══════════════════════════════════════ */
.mn {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--bg1);
}

/* 상단 헤더 */
.mh {
  padding: 0 18px;
  background: var(--bg1);
  display: flex;
  align-items: center;
  min-height: 46px;
  gap: 8px;
  flex-shrink: 0;
}
.mh-title {
  font-size: calc(15px * var(--fs-scale));
  font-weight: 600;
  color: #eeeeee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="light"] .mh-title { color: #000000; }
[data-theme="light"] .mh { background: #fcfcfc; }
.mh-grow { flex: 1 1; }
.mh-right { display: flex; align-items: center; gap: 6px; }

/* 헤더 버튼 */
.mh-btn-outline {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 10px; height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--bg2);
  color: var(--t1);
  font-size: calc(12.5px * var(--fs-scale)); font-weight: 500; font-family: inherit;
  cursor: pointer; transition: var(--trans); white-space: nowrap;
}
.mh-btn-outline:hover { background: var(--bd2); color: var(--t1); }

.mh-btn-sub {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 10px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--bd);
  background: var(--bg2);
  color: var(--t2);
  font-size: calc(12.5px * var(--fs-scale)); font-weight: 500; font-family: inherit;
  cursor: pointer; transition: var(--trans); white-space: nowrap;
}
.mh-btn-sub:hover { background: var(--bg3); color: var(--t1); }

.mh-btn-primary {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 12px; height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--ac);
  color: #ffffff;
  font-size: calc(12.5px * var(--fs-scale)); font-weight: 500; font-family: inherit;
  cursor: pointer; transition: var(--trans); white-space: nowrap;
}
.mh-btn-primary:hover { opacity: 0.88; }

/* 검정 테마 — 라이트: 검정 버튼, 다크: 흰색 버튼 */
[data-color="slate"] .tab-item.a { color: #ffffff; }

[data-color="slate"][data-theme="light"] .mh-btn-primary,
[data-color="slate"][data-theme="light"] .btn-p {
  background: #111111;
  color: #ffffff;
}
[data-color="slate"][data-theme="dark"] .mh-btn-primary,
[data-color="slate"][data-theme="dark"] .btn-p {
  background: #ffffff;
  color: #111111;
}

/* 콘텐츠 스크롤 영역 */
.mb {
  flex: 1 1;
  overflow-y: auto;
  padding: 18px;
  background: #090909;
}
.mb::-webkit-scrollbar { width: 5px; }
.mb::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 3px; }

/* ══════════════════════════════════════
   공통 유틸 클래스 (theme-btn, rail-avatar 재사용)
══════════════════════════════════════ */
.rail-avatar,
.gnb-avatar {
  width: 26px; height: 26px;
  border-radius: 25%;
  background: linear-gradient(135deg, #6366f1, #0ea5e9);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(10px * var(--fs-scale)); font-weight: 700; color: #fff;
  cursor: pointer; flex-shrink: 0;
}
.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid var(--bd);
  color: var(--t2);
  cursor: pointer;
  font-size: calc(13px * var(--fs-scale));
  transition: var(--trans);
}
.theme-btn:hover { background: var(--ac-soft); color: var(--t1); }

/* ══════════════════════════════════════
   CARD
══════════════════════════════════════ */
.card {
  background: var(--bg1);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color var(--trans);
}
/* .card:hover 제거 */

/* ══════════════════════════════════════
   KPI
══════════════════════════════════════ */
.kpi {
  background: var(--bg1);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.kpi-l { font-size: calc(11px * var(--fs-scale)); color: var(--t3); font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-v { font-size: calc(22px * var(--fs-scale)); font-weight: 700; letter-spacing: -0.5px; color: var(--t1); }
.kpi-s { font-size: calc(11px * var(--fs-scale)); color: var(--t3); margin-top: 3px; }

/* ══════════════════════════════════════
   BADGE
══════════════════════════════════════ */
.bdg { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-sm); font-size: calc(11px * var(--fs-scale)); font-weight: 600; white-space: nowrap; }
.bdg-ok   { background: rgba(16,185,129,.12); color: #10b981; }
.bdg-err  { background: rgba(239,68,68,.12);  color: #ef4444; }
.bdg-warn { background: rgba(245,158,11,.12); color: #f59e0b; }
.bdg-muted{ background: rgba(148,163,184,.12);color: var(--t3); }
.bdg-ac   { background: var(--ac-soft); color: var(--ac); }
[data-theme="dark"] .bdg-ok   { background: rgba(52,211,153,.15); color: #34d399; }
[data-theme="dark"] .bdg-err  { background: rgba(248,113,113,.15); color: #f87171; }
[data-theme="dark"] .bdg-warn { background: rgba(251,191,36,.15); color: #fbbf24; }
[data-theme="dark"] .bdg-ac   { background: var(--ac-soft); color: var(--ac2); }

/* ══════════════════════════════════════
   TABLE
══════════════════════════════════════ */
.dt { width: 100%; border-collapse: collapse; }
.dt thead { background: var(--bg2); }
.dt th { font-size: calc(11px * var(--fs-scale)); font-weight: 600; color: var(--t3); text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--bd); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em; }
.dt td { font-size: calc(12.5px * var(--fs-scale)); padding: 9px 12px; border-bottom: 1px solid var(--bd); color: var(--t1); }
.dt tbody tr { cursor: pointer; transition: background var(--trans); }
/* .dt tbody tr:hover 제거 */

/* ══════════════════════════════════════
   TABS
══════════════════════════════════════ */
.tabs { display: flex; background: var(--bg0); border-radius: var(--radius); padding: 3px; gap: 2px; margin-bottom: 16px; width: -moz-fit-content; width: fit-content; }
.tab { padding: 6px 16px; font-size: calc(13px * var(--fs-scale)); font-weight: 500; color: var(--t2); cursor: pointer; border-radius: var(--radius-sm); transition: var(--trans); border: none; background: none; }
.tab:hover { color: var(--t1); background: rgba(255,255,255,.5); }
.tab.a { color: var(--t1); background: var(--bg1); box-shadow: 0 1px 3px rgba(0,0,0,.08); font-weight: 600; }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-sm); font-size: calc(13px * var(--fs-scale)); font-weight: 500; cursor: pointer; border: 1px solid var(--bd); background: var(--bg1); color: var(--t1); transition: var(--trans); white-space: nowrap; }
.btn:hover { background: var(--bg2); border-color: var(--bd2); }
.btn-p { background: var(--ac); border-color: var(--ac); color: #fff; }
.btn-p:hover { opacity: 0.88; }
.btn-s { padding: 5px 12px; font-size: calc(12.5px * var(--fs-scale)); }
.btn-xs { padding: 3px 8px; font-size: calc(11.5px * var(--fs-scale)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--t2); }
.btn-ghost:hover { color: var(--t1); background: var(--bg2); }

/* ══════════════════════════════════════
   INPUT
══════════════════════════════════════ */
.inp { background: var(--bg2); border: 1px solid var(--bd); color: var(--t1); border-radius: var(--radius-sm); padding: 8px 12px; font-size: calc(13px * var(--fs-scale)); font-family: inherit; outline: none; width: 100%; transition: border-color var(--trans); }
.inp:focus { border-color: var(--ac); background: var(--bg1); }
.inp::placeholder { color: var(--t3); }

/* ══════════════════════════════════════
   GRID
══════════════════════════════════════ */
.grid { display: grid; grid-gap: 12px; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ══════════════════════════════════════
   UTIL
══════════════════════════════════════ */
.sep { height: 1px; background: var(--bd); margin: 16px 0; }
.fc { display: flex; align-items: center; gap: 8px; }
.section-title { font-size: calc(11px * var(--fs-scale)); font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }

/* ══════════════════════════════════════
   MARKDOWN content (.md-body)
══════════════════════════════════════ */
.md-body h1 { font-size: calc(17px * var(--fs-scale)); font-weight: 700; color: var(--t1); margin: 0 0 12px; }
.md-body h2 { font-size: calc(14px * var(--fs-scale)); font-weight: 700; color: var(--t1); margin: 18px 0 8px; border-bottom: 1px solid var(--bd); padding-bottom: 5px; }
.md-body h3 { font-size: calc(13px * var(--fs-scale)); font-weight: 700; color: var(--ac2); margin: 12px 0 5px; }
.md-body h4 { font-size: calc(12.5px * var(--fs-scale)); font-weight: 600; color: var(--t2); margin: 10px 0 4px; }
.md-body p { color: var(--t2); line-height: 1.8; margin: 5px 0; }
.md-body strong { color: var(--t1); font-weight: 600; }
.md-body em { color: var(--t3); font-style: italic; }
.md-body code { font-size: calc(11.5px * var(--fs-scale)); background: var(--bg2); border: 1px solid var(--bd); border-radius: 4px; padding: 1px 5px; color: var(--ac2); font-family: 'Consolas', monospace; }
[data-theme="light"] .md-body code { color: var(--ac); background: rgba(48,120,255,.07); border-color: rgba(48,120,255,.2); }
[data-color="slate"][data-theme="dark"] .md-body code { color: #ffffff; }
.md-body li { color: var(--t2); margin: 3px 0 3px 16px; line-height: 1.7; }
.md-body blockquote { border-left: 3px solid var(--ac); padding: 8px 12px; background: var(--bg2); border-radius: 0 4px 4px 0; color: var(--t2); margin: 8px 0; }
.md-body table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: calc(12px * var(--fs-scale)); }
.md-body th { background: var(--bg2); color: var(--t3); font-size: calc(11px * var(--fs-scale)); font-weight: 600; text-align: left; padding: 7px 10px; border: 1px solid var(--bd); }
.md-body td { padding: 7px 10px; border: 1px solid var(--bd); color: var(--t2); }
/* .md-body tr:hover 제거 */

/* ══════════════════════════════════════
   TAB BAR  — Chrome 스타일 탭
══════════════════════════════════════ */
.tab-bar {
  display: flex;
  align-items: flex-end;
  height: 42px;
  padding: 0;
  flex-shrink: 0;
  gap: 0;
  position: relative;
  z-index: 2;
  margin-bottom: -1px;
}

/* 탭 목록 (가로 스크롤) */
.tab-list {
  display: flex;
  align-items: flex-end;
  overflow-x: auto;
  overflow-y: visible;
  min-width: 0;
  gap: 0;
  flex-shrink: 1;
}
.tab-list::-webkit-scrollbar { display: none; }

/* 탭 아이템 — 비활성 */
.tab-item {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  min-width: 100px;
  max-width: 180px;
  background: transparent;
  color: var(--t2);
  font-size: calc(12.5px * var(--fs-scale));
  font-weight: 500;
  cursor: pointer;
  height: 42px;
  flex-shrink: 0;
  white-space: nowrap;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  z-index: 1;
  opacity: 0.35;
  transition: opacity var(--trans);
}
.tab-item:hover { opacity: 0.6; }

/* 왼쪽 영역 */
.tab-l { width: 10px; flex-shrink: 0; display: flex; flex-direction: column; }
.tab-l-top { flex: 1 1; }
.tab-l-bot { width: 8px; height: 8px; flex-shrink: 0; border-bottom: 1px solid var(--bd); border-right: 1px solid var(--bd); border-radius: 0 0 8px 0; }

/* 중앙 영역 */
.tab-m {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: -3px;
}

/* 탭 상단 — 라벨 + 닫기 */
.tab-top {
  flex: 1 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 6px 0 10px;
  border-top: 1px solid var(--bd);
  border-left: 1px solid var(--bd);
  border-right: 1px solid var(--bd);
  border-radius: 8px 8px 0 0;
}

/* 탭 하단 — 공백 */
.tab-bot { height: 6px; flex-shrink: 0; }

/* 오른쪽 영역 */
.tab-r { width: 6px; flex-shrink: 0; display: flex; flex-direction: column; }
.tab-r-top { flex: 1 1; }
.tab-r-bot { height: 8px; width: 8px; flex-shrink: 0; border-bottom: 1px solid var(--bd); border-left: 1px solid var(--bd); border-radius: 0 0 0 8px; margin-left: -1px; }

/* 활성 탭 */
.tab-item.a {
  background: var(--bg1);
  opacity: 1;
  z-index: 2;
  color: var(--ac);
}
[data-theme="dark"] .tab-item.a { background: #111111; }
[data-theme="light"] .tab-item.a { background: #fcfcfc; }
[data-theme="light"] .tab-item { color: #000000; }
[data-theme="light"] .tab-item.a { color: var(--ac); }


/* 새 탭 플레이스홀더 */
.new-tab-placeholder {
  flex: 1 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t3);
  font-size: calc(14px * var(--fs-scale));
}

/* + 새 탭 버튼 */
.tab-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: auto 4px;
  border: none;
  background: transparent;
  color: var(--t3);
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background var(--trans), color var(--trans);
}
.tab-add:hover { background: rgba(255,255,255,.08); color: var(--t1); }

.tab-bar-grow { flex: 1 1; }
.tab-avatar { margin: auto 8px; flex-shrink: 0; }
.tab-bar-icon {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin: auto 2px;
  background: var(--cu-background-primary-on-subtle); border: none; border-radius: 6px;
  color: var(--t2); cursor: pointer; flex-shrink: 0;
  transition: background var(--trans), color var(--trans);
}
.tab-bar-icon:hover { background: rgba(255,255,255,.08); color: var(--t1); }
[data-theme="light"] .tab-bar-icon:hover { background: rgba(0,0,0,.08); }
.tab-locale-btn { width: auto; padding: 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .02em; }

/* 탭 컨텍스트 메뉴 */
.tab-ctx-menu {
  position: fixed;
  z-index: 9999;
  background: var(--bg2);
  border: 1px solid var(--bd2);
  border-radius: 8px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.tab-ctx-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 7px 12px;
  background: transparent;
  border: none;
  border-radius: 5px;
  color: var(--t1);
  font-size: calc(12.5px * var(--fs-scale));
  text-align: left;
  cursor: pointer;
  transition: background var(--trans);
}
.tab-ctx-menu button:hover { background: var(--bg3); }

/* 탭 라벨 */
.tab-label { flex: 1 1; overflow: hidden; text-overflow: ellipsis; }

/* 탭 × 버튼 — hover/active 시에만 노출 */
.tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border: none;
  background: transparent;
  color: transparent;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  flex-shrink: 0;
  transition: background var(--trans), color var(--trans);
}
.tab-item:hover .tab-close,
.tab-item.a .tab-close { color: var(--t3); }
.tab-close:hover { background: rgba(255,255,255,.15) !important; color: var(--t1) !important; }

/* GNB hover flyout */
.gnb-flyout {
  position: fixed;
  z-index: 9999;
  background: var(--bg1);
  border: 1px solid var(--bd);
  border-radius: 8px;
  width: 220px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
}
[data-theme="dark"] .gnb-flyout { background: #191919; }
[data-theme="dark"] .gnb-flyout-item,
[data-theme="dark"] .gnb-flyout-leaf { color: #b0b0b0; }
[data-theme="light"] .gnb-flyout-item,
[data-theme="light"] .gnb-flyout-leaf { color: #373737; }
.gnb-flyout-hd {
  padding: 12px 14px 8px;
  font-size: calc(11px * var(--fs-scale));
  font-weight: 700;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  border-bottom: 1px solid var(--bd);
}
.gnb-flyout-nav { padding: 6px; display: flex; flex-direction: column; gap: 1px; }
.gnb-flyout-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: calc(12.5px * var(--fs-scale));
  color: var(--t2);
  cursor: pointer;
  transition: background var(--trans), color var(--trans);
}
.gnb-flyout-item:hover { background: var(--bg2); color: var(--t1); }
.gnb-flyout-item.a { background: var(--ac-soft); color: var(--ac); }
.gnb-flyout-item span:first-of-type { flex: 1 1; }
.gnb-flyout-chevron { color: var(--t3); transition: transform var(--trans); flex-shrink: 0; }
.gnb-flyout-chevron.open { transform: rotate(90deg); }
.gnb-flyout-leaves { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 2px 28px; }
.gnb-flyout-leaf {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: calc(12px * var(--fs-scale));
  color: var(--t3);
  cursor: pointer;
  transition: background var(--trans), color var(--trans);
}
.gnb-flyout-leaf:hover { background: var(--bg2); color: var(--t2); }
.gnb-flyout-leaf.a { color: var(--ac); }
.gnb-flyout-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0; opacity: 0.5;
}

/* ══════════════════════════════════════
   LAYOUT PATTERNS
══════════════════════════════════════ */
/* 콤팩트형 */
[data-layout="compact"] .gnb { width: 44px; min-width: 44px; }
[data-layout="compact"] .gnb-label { display: none; }
[data-layout="compact"] .lnb { width: 200px; min-width: 200px; }
[data-layout="compact"] .lnb.collapsed { width: 0; min-width: 0; border: none; padding: 0; }

/* 넓은형 */
[data-layout="wide"] .lnb { width: 255px; min-width: 255px; }

/* ══════════════════════════════════════
   UNIFIED SIDEBAR  (.usb)  — 통합형 레이아웃
   GNB + LNB 를 하나의 패널로 통합
══════════════════════════════════════ */
.usb {
  display: none;            /* 기본: 숨김 */
  flex-direction: column;
  width: 240px;
  min-width: 240px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  gap: 6px;
}

/* 통합형 활성화 시 GNB / LNB 숨기고 USb 표시 */
[data-layout="unified"] .gnb { display: none; }
[data-layout="unified"] .lnb { display: none; }
[data-layout="unified"] .usb { display: flex; }
[data-layout="unified"] .sidebar-hd { display: none; }

/* 로고 + 네비 + 하단 래퍼 */
.usb-body {
  flex: 1 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--bd);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--bg1);
}
[data-theme="dark"] .usb-body { background: #191919; }

/* 기관 선택 헤더 */
.usb-hd {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 35px;
}

/* 로고 */
.usb-logo {
  display: flex;
  justify-content: center;
  padding: 13px 0 8px;
  flex-shrink: 0;
}

/* 스크롤 영역 */
.usb-nav {
  flex: 1 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 8px 6px;
  display: flex;
  flex-direction: column;
}
.usb-nav::-webkit-scrollbar { width: 3px; }
.usb-nav::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 3px; }

/* ── 1depth ─────────────────────── */
.usb-top-section { display: flex; flex-direction: column; }

.usb-top-row {
  display: flex;
  align-items: center;
  border-radius: 8px;
  margin-bottom: 1px;
  transition: background var(--trans);
}
.usb-top-row:hover { background: rgba(255,255,255,.05); }
.usb-top-row.a     { background: rgba(255,255,255,.07); }

/* 링크 영역 (아이콘 + 라벨) */
.usb-top-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px 7px 10px;
  flex: 1 1;
  min-width: 0;
  text-decoration: none;
  color: var(--t1);
  font-size: calc(13px * var(--fs-scale));
  font-weight: 500;
  cursor: pointer;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.usb-top-icon {
  flex-shrink: 0;
  color: var(--t2);
  opacity: 0.8;
  transition: var(--trans);
}
.usb-top-row.a .usb-top-icon { opacity: 1; }
.usb-top-txt {
  flex: 1 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 펼침 토글 버튼 (chevron) */
.usb-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--t3);
  transition: var(--trans);
  padding: 0;
}
.usb-toggle-btn:hover { color: var(--t1); }

/* 공통 chevron 화살표 */
.usb-chevron {
  flex-shrink: 0;
  opacity: 0.5;
  transition: transform var(--trans), opacity var(--trans);
}
.usb-chevron.open { transform: rotate(90deg); opacity: 0.85; }

/* ── 2depth ─────────────────────── */
.usb-sub-list {
  margin: 0 0 4px 16px;
  padding: 0 0 0 10px;
  border-left: 1px solid var(--bd);
}
/* 마지막 top-section 하단 선 페이드 */
.usb-top-section:last-child .usb-sub-list {
  border-left: none;
  position: relative;
}
.usb-top-section:last-child .usb-sub-list::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, var(--bd) 60%, transparent 100%);
}

.usb-sub-section { display: flex; flex-direction: column; }

.usb-sub-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--t2);
  font-size: calc(13px * var(--fs-scale));
  transition: var(--trans);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  white-space: nowrap;
  text-decoration: none;
  margin-bottom: 1px;
}
.usb-sub-item:hover { background: var(--bg2); color: var(--t1); }
.usb-sub-item.a     { background: var(--cu-global-sidebar-row-background-active); color: var(--t1); font-weight: 500; }
.usb-sub-icon { flex-shrink: 0; opacity: 0.45; transition: var(--trans); }
.usb-sub-item:hover .usb-sub-icon { opacity: 0.65; }
.usb-sub-item.a .usb-sub-icon     { opacity: 0.85; }
.usb-sub-txt { flex: 1 1; overflow: hidden; text-overflow: ellipsis; }

/* ── 3depth ─────────────────────── */
.usb-leaf-list {
  margin: 0 0 3px 12px;
  padding: 0 0 2px 8px;
  border-left: 1px solid var(--bd);
}

.usb-leaf-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--t3);
  font-size: calc(12px * var(--fs-scale));
  transition: var(--trans);
  white-space: nowrap;
  text-decoration: none;
  margin-bottom: 1px;
}
.usb-leaf-item:hover { background: var(--bg2); color: var(--t2); }
.usb-leaf-item.a     { background: var(--cu-global-sidebar-row-background-active); color: var(--t1); font-weight: 500; }
.usb-leaf-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--bd2);
  flex-shrink: 0;
  transition: var(--trans);
}
.usb-leaf-item.a .usb-leaf-dot { background: var(--ac); }
.usb-leaf-txt { flex: 1 1; overflow: hidden; text-overflow: ellipsis; }

/* 하단 아바타 */
.usb-bot {
  padding: 8px 6px 10px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

/* ── 통합형: GNB 포인트 컬러와 동일한 색상 적용 ── */
[data-layout="unified"] .usb-body {
  background: color-mix(in srgb, var(--ac), black 25%);
  border-color: transparent;
}
/* 텍스트 / 아이콘 기본 (#cccccc — GNB item과 동일) */
[data-layout="unified"] .usb-top-main   { color: #cccccc; }
[data-layout="unified"] .usb-top-icon   { color: #ffffffe0; }
[data-layout="unified"] .usb-toggle-btn { color: #cccccc; }
[data-layout="unified"] .usb-toggle-btn:hover { color: #ffffff; }
[data-layout="unified"] .usb-chevron    { opacity: 0.6; }
[data-layout="unified"] .usb-sub-item  { color: #cccccc; }
[data-layout="unified"] .usb-sub-icon  { color: #cccccc; }
[data-layout="unified"][data-theme="light"] .usb-sub-icon { color: #ffffffe0; }
[data-layout="unified"] .usb-leaf-item { color: rgba(255,255,255,0.55); }

/* hover / active (#00000033 bg + white text — GNB와 동일) */
[data-layout="unified"] .usb-top-row:hover { background: #00000033; }
[data-layout="unified"] .usb-top-row.a     { background: #00000033; }
[data-layout="unified"] .usb-top-row:hover .usb-top-main,
[data-layout="unified"] .usb-top-row.a     .usb-top-main { color: #ffffff; }
[data-layout="unified"] .usb-top-row:hover .usb-top-icon,
[data-layout="unified"] .usb-top-row.a     .usb-top-icon { color: #ffffff; }
[data-layout="unified"] .usb-sub-item:hover { background: #00000033; color: #ffffff; }
[data-layout="unified"] .usb-sub-item.a     { background: #00000033; color: #ffffff; }
[data-layout="unified"] .usb-sub-item:hover .usb-sub-icon,
[data-layout="unified"] .usb-sub-item.a     .usb-sub-icon { opacity: 1; color: #ffffff; }
[data-layout="unified"] .usb-leaf-item:hover { background: #00000033; color: #ffffff; }
[data-layout="unified"] .usb-leaf-item.a     { background: #00000033; color: #ffffff; }

/* 인덴트 구분선 · 도트 */
[data-layout="unified"] .usb-sub-list,
[data-layout="unified"] .usb-leaf-list { border-left-color: rgba(255,255,255,0.18); }
[data-layout="unified"] .usb-top-section:last-child .usb-sub-list::before {
  background: linear-gradient(to bottom, rgba(255,255,255,0.18) 60%, transparent 100%);
}
[data-layout="unified"] .usb-leaf-dot { background: rgba(255,255,255,0.3); }
[data-layout="unified"] .usb-leaf-item.a .usb-leaf-dot { background: #ffffff; }

/* 스크롤바 */
[data-layout="unified"] .usb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }

/* ── 통합형 라이트 모드 색상 개별 지정 ── */
[data-layout="unified"][data-theme="light"] .usb-sub-item    { color: #ffffffdb; }
[data-layout="unified"][data-theme="light"] .usb-sub-item.a  { color: #ffffffdb; }
[data-layout="unified"][data-theme="light"] .usb-leaf-item   { color: #ffffff99; }

/* ── 통합형 슬레이트(검정) 예외 ── */
[data-layout="unified"][data-color="slate"][data-theme="dark"]  .usb-body { background: #191919; }
[data-layout="unified"][data-color="slate"][data-theme="light"] .usb-body { background: #000000; }
[data-layout="unified"][data-color="slate"][data-theme="light"] .usb-top-row.a,
[data-layout="unified"][data-color="slate"][data-theme="light"] .usb-sub-item.a,
[data-layout="unified"][data-color="slate"][data-theme="light"] .usb-leaf-item.a { background: #ffffff33; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
/* 모바일 메뉴 버튼 — 기본: 숨김 */
.tab-mobile-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--t2);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: var(--trans);
}
.tab-mobile-menu:hover { background: var(--bg2); color: var(--t1); }

/* LNB 모바일 오버레이 */
.lnb-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.45);
}

@media (max-width: 900px) {
  /* 햄버거 버튼 노출 */
  .tab-mobile-menu { display: flex; }

  /* 기본형·콤팩트형 사이드바 요소 숨김 */
  .gnb { display: none; }
  .sidebar-hd { display: none; }
  .sidebar-wrap { gap: 0; }
  .lnb { display: none !important; }

  /* 모바일에서는 레이아웃 설정 무관하게 통합형 USB 사용 */
  .usb {
    display: flex !important;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 201;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    border-radius: 0;
  }
  .usb.open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0,0,0,.4);
  }

  .mb { padding: 12px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════
   CONTENT STYLE THEMES  (data-content)
══════════════════════════════════════ */
/* 기본형(card): 현재 .card 스타일 유지 */

/* 플랫형(flat): 배경만, 경계·그림자 없음 */
[data-content="flat"] .card {
  border: none;
  box-shadow: none;
}
[data-theme="dark"][data-content="flat"]  .card { background: var(--bg2); }
[data-theme="light"][data-content="flat"] .card { background: var(--bg2); }

/* 라인형(line): 하단 구분선만, radius·shadow 없음 */
[data-content="line"] .card {
  border: none;
  border-bottom: 1px solid var(--bd);
  box-shadow: none;
  background: transparent;
  border-radius: 0;
}

/* ── 카드형 콘텐츠: 탭 바 pill 스타일 ── */
[data-content="card"] .nx-tab-bar {
  background: #24252a;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
[data-theme="light"][data-content="card"] .nx-tab-bar {
  background: #F4F5F7;
}
[data-content="card"] .nx-tab {
  height: auto !important;
  padding: 6px 12px !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 7px;
}
[data-content="card"] .nx-tab.a {
  background: var(--ac) !important;
  color: #ffffff !important;
}
[data-content="card"] .nx-tab.a .nx-tab-cnt {
  color: rgba(255,255,255,0.8) !important;
  opacity: 1 !important;
}

/* ═══════════════════════════════════════════════════════════
   AI Command Palette
═══════════════════════════════════════════════════════════ */

/* ── 오버레이 ── */
.ai-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: ai-fade-in 0.12s ease;
}
@keyframes ai-fade-in { from { opacity: 0 } to { opacity: 1 } }

/* ── 팔레트 컨테이너 ── */
.ai-palette {
  width: 620px; max-width: 100%;
  height: 500px; max-height: calc(100vh - 80px);
  background: var(--bg1);
  border: 1px solid var(--bd);
  border-radius: 14px;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
  overflow: hidden;
  animation: ai-slide-in 0.15s ease;
}
@keyframes ai-slide-in { from { transform: translateY(-12px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ── 헤더 ── */
.ai-palette-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
}
.ai-palette-hd-icon { color: var(--ac); flex-shrink: 0; }
.ai-palette-hd-title { font-size: 13px; font-weight: 600; color: var(--t1); flex: 1 1; }
.ai-palette-hd-session {
  font-size: 11px; color: var(--t3);
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-palette-hd-kbd {
  font-size: 10px; color: var(--t3);
  background: var(--bg2); border: 1px solid var(--bd);
  border-radius: 4px; padding: 1px 5px;
  font-family: monospace;
}
.ai-palette-hd-new, .ai-palette-hd-close {
  width: 24px; height: 24px; border-radius: 6px;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--t3); background: transparent; transition: var(--trans);
}
.ai-palette-hd-new:hover, .ai-palette-hd-close:hover {
  background: var(--bg2); color: var(--t1);
}

/* ── 메시지 영역 ── */
.ai-msgs {
  flex: 1 1; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.ai-msg { display: flex; gap: 8px; align-items: flex-start; }
.ai-msg.user { flex-direction: row-reverse; }
.ai-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ac-soft, rgba(var(--ac-rgb,80,80,200),0.12));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--ac);
}
.ai-bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 13px; line-height: 1.6; color: var(--t1);
  white-space: pre-wrap; word-break: break-word;
}
.ai-msg.assistant .ai-bubble { background: var(--bg2); border-radius: 4px 12px 12px 12px; }
.ai-msg.user      .ai-bubble { background: var(--ac); color: #fff; border-radius: 12px 4px 12px 12px; }

/* ── 타이핑 인디케이터 ── */
.ai-typing { display: flex; align-items: center; gap: 4px; padding: 12px 14px !important; }
.ai-typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--t3);
  animation: ai-dot 1.2s infinite ease-in-out;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-dot {
  0%,80%,100% { transform: scale(0.6); opacity: 0.4; }
  40%          { transform: scale(1);   opacity: 1; }
}

/* ── 입력 영역 ── */
.ai-input-row {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--bd);
  flex-shrink: 0;
}
.ai-input {
  flex: 1 1;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px; color: var(--t1);
  font-family: inherit; resize: none; outline: none;
  max-height: 120px; overflow-y: auto; transition: border-color var(--trans);
}
.ai-input:focus { border-color: var(--ac); }
.ai-input::placeholder { color: var(--t3); }
.ai-input:disabled { opacity: 0.6; }
.ai-send-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--ac); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0; transition: opacity var(--trans);
}
.ai-send-btn:disabled { opacity: 0.4; cursor: default; }
.ai-send-btn:not(:disabled):hover { opacity: 0.85; }

/* ═══════════════════════════════════════════════════════════
   AI History Dropdown (TabBar)
═══════════════════════════════════════════════════════════ */
/* ── 탭바 우측 액션 그룹 ── */
.tab-bar-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: auto 6px auto 0;
  flex-shrink: 0;
}
.tab-bar-actions .tab-bar-icon { margin: 0; }
.tab-bar-actions .tab-avatar   { margin: 0 0 0 4px; }

/* AI 히스토리 래퍼 — position:relative 기준점 + margin:auto로 수직 정렬 */
.ai-hist-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin: auto 2px;
}

.ai-hist-drop {
  position: absolute; top: calc(100% + 4px); right: 0;
  width: 288px;
  background: var(--bg1);
  border: 1px solid var(--bd);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
  z-index: 8000;
  overflow: hidden;
  animation: ai-fade-in 0.1s ease;
}
.ai-hist-hd {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  font-size: 11px; color: var(--t3); font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--bd);
}
.ai-hist-list { max-height: 260px; overflow-y: auto; }
.ai-hist-empty {
  padding: 20px 12px;
  font-size: 12px; color: var(--t3); text-align: center;
}
.ai-hist-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer;
  transition: background var(--trans);
}
.ai-hist-item:hover { background: var(--bg2); }
.ai-hist-item-icon { color: var(--ac); flex-shrink: 0; }
.ai-hist-item-body {
  flex: 1 1; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.ai-hist-item-title {
  font-size: 12px; color: var(--t1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-hist-item-time { font-size: 10px; color: var(--t3); }
.ai-hist-item-del {
  width: 22px; height: 22px; border-radius: 4px;
  border: none; background: transparent; cursor: pointer;
  color: var(--t3); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: var(--trans); flex-shrink: 0;
}
.ai-hist-item:hover .ai-hist-item-del { opacity: 1; }
.ai-hist-item-del:hover { background: var(--bg2); color: #ef4444; }
.ai-hist-new {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; cursor: pointer;
  border-top: 1px solid var(--bd);
  font-size: 12px; color: var(--ac);
  transition: background var(--trans);
}
.ai-hist-new:hover { background: var(--bg2); }
.ai-hist-new-kbd {
  margin-left: auto;
  font-size: 10px; color: var(--t3);
  background: var(--bg2); border: 1px solid var(--bd);
  border-radius: 4px; padding: 1px 5px; font-family: monospace;
}

/* tab-bar-icon.on (AI 버튼 활성) */
.tab-bar-icon.on { color: var(--ac); background: color-mix(in srgb, var(--ac) 12%, transparent); }

/* ═══════════════════════════════════════════════════════════
   AI 리치 응답 — 차트 / 테이블 / 다운로드
═══════════════════════════════════════════════════════════ */

/* ── 차트 ── */
.ai-chart { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.ai-chart-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
}
.ai-chart-lbl { width: 60px; flex-shrink: 0; color: var(--t2); text-align: right; }
.ai-chart-track {
  flex: 1 1; height: 14px; background: var(--bg2); border-radius: 3px; overflow: hidden;
}
.ai-chart-bar {
  height: 100%; background: var(--ac); border-radius: 3px;
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}
.ai-chart-val { width: 52px; flex-shrink: 0; color: var(--t1); font-weight: 500; font-size: 11px; }

/* ── 테이블 ── */
.ai-table-wrap {
  margin-top: 10px; overflow-x: auto;
  border: 1px solid var(--bd); border-radius: 6px;
}
.ai-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.ai-table th {
  background: var(--bg2); color: var(--t3); font-weight: 600;
  padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--bd);
  white-space: nowrap;
}
.ai-table td {
  padding: 5px 10px; color: var(--t2); border-bottom: 1px solid var(--bd);
  white-space: nowrap;
}
.ai-table tr:last-child td { border-bottom: none; }
.ai-table tr:hover td { background: var(--bg2); }

/* ── 다운로드 버튼 ── */
.ai-dl-btn {
  margin-top: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--ac);
  background: color-mix(in srgb, var(--ac) 10%, transparent);
  color: var(--ac); font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background var(--trans);
}
.ai-dl-btn:hover { background: color-mix(in srgb, var(--ac) 20%, transparent); }

