/* ============================================
   MONFFICE - Main Styles
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 전역 가로 스크롤 방지 */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb, #CBD5E1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* Body 배경 - 테마 적용 */
body { background-color: var(--body-bg, #F3F4F6); color: var(--text-primary, #111827); transition: background-color 0.3s, color 0.3s; }

/* Layout */
.app-layout { display: flex; min-height: 100dvh; }
.sidebar {
  width: 260px;
  height: 100dvh;
  height: 100dvh; /* 모바일 브라우저 UI 제외한 실제 뷰포트 높이 */
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  transition: all 0.3s;
  position: fixed;
  top: 0; left: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
.sidebar-header { flex-shrink: 0; }
.sidebar-nav {
  flex: 1 1 0;
  min-height: 0; /* flex 자식에서 overflow 스크롤이 동작하려면 필수 */
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
}
.sidebar-footer { flex-shrink: 0; }
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-label { display: none; }
.sidebar.collapsed .sidebar-logo-text { display: none; }
.main-area {
  flex: 1;
  margin-left: 260px;
  transition: margin 0.3s;
  min-height: 100dvh;
  min-height: 100dvh;
}
.main-area.expanded { margin-left: 64px; }
.header {
  height: 56px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  /* 항상 상단 고정 */
  position: fixed;
  top: 0;
  left: 260px; /* 사이드바 기본 너비 */
  right: 0;
  z-index: 30;
  transition: left 0.3s; /* 사이드바 접힘 애니메이션 동기화 */
  backdrop-filter: var(--header-backdrop, blur(12px));
  -webkit-backdrop-filter: var(--header-backdrop, blur(12px));
}
.content { padding: 24px; padding-top: calc(56px + 24px); flex: 1; }

/* Sidebar Nav */
.nav-item { display: flex; align-items: center; padding: 10px 20px; cursor: pointer; transition: all 0.2s; border-radius: 8px; margin: 2px 8px; color: var(--sidebar-text); text-decoration: none; font-size: 14px; }
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-item i { width: 24px; text-align: center; margin-right: 12px; font-size: 16px; }

/* Cards — glass 효과 포함 */
.card {
  background: var(--glass-bg, var(--card-bg, #fff));
  border-radius: 16px;
  border: 1px solid var(--glass-border, var(--card-border, #E5E7EB));
  padding: 20px;
  transition: all 0.25s;
  box-shadow: var(--glass-shadow, var(--card-shadow));
  backdrop-filter: var(--glass-blur, none);
  -webkit-backdrop-filter: var(--glass-blur, none);
}
.card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 600; color: var(--text-primary, #111827); }

/* Buttons */
.btn { padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; border: none; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--btn-primary); color: white; }
.btn-primary:hover { background: var(--btn-primary-hover); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-surface); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-danger { background: #EF4444; color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-success { background: #10B981; color: white; }
.btn-success:hover { background: #059669; }

/* Badge */
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.badge-primary { background: var(--badge-bg); color: var(--badge-text); }
.badge-success { background: var(--badge-success-bg, #D1FAE5); color: var(--badge-success-text, #065F46); }
.badge-warning { background: var(--badge-warning-bg, #FEF3C7); color: var(--badge-warning-text, #92400E); }
.badge-danger  { background: var(--badge-danger-bg,  #FEE2E2); color: var(--badge-danger-text,  #991B1B); }
.badge-info    { background: var(--badge-info-bg,    #DBEAFE); color: var(--badge-info-text,    #1E40AF); }
.badge-gray    { background: var(--badge-gray-bg,    #F3F4F6); color: var(--badge-gray-text,    #4B5563); }

/* Status badges for approval */
.status-draft       { background: var(--badge-gray-bg,    #F3F4F6); color: var(--badge-gray-text,    #4B5563); }
.status-pending     { background: var(--badge-warning-bg, #FEF3C7); color: var(--badge-warning-text, #92400E); }
.status-in_progress { background: var(--badge-info-bg,    #DBEAFE); color: var(--badge-info-text,    #1E40AF); }
.status-approved    { background: var(--badge-success-bg, #D1FAE5); color: var(--badge-success-text, #065F46); }
.status-rejected    { background: var(--badge-danger-bg,  #FEE2E2); color: var(--badge-danger-text,  #991B1B); }
.status-canceled    { background: var(--badge-gray-bg,    #F3F4F6); color: var(--badge-gray-text,    #6B7280); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 600; color: var(--table-header-text, #6B7280); background: var(--table-header-bg, #F9FAFB); border-bottom: 1px solid var(--table-border, #E5E7EB); white-space: nowrap; }
td { padding: 10px 12px; font-size: 14px; border-bottom: 1px solid var(--table-row-border, #F3F4F6); color: var(--text-primary, #111827); }
tr:hover td { background: var(--table-row-hover, var(--primary-surface)); }
tr.clickable { cursor: pointer; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary, #374151); margin-bottom: 4px; }
.form-input { width: 100%; padding: 8px 12px; border: 1px solid var(--input-border, #D1D5DB); border-radius: 8px; font-size: 14px; transition: border-color 0.2s, background 0.2s; outline: none; background: var(--input-bg, #fff); color: var(--input-text, #111827); }
.form-input:focus { border-color: var(--input-focus-border, var(--primary)); box-shadow: 0 0 0 3px var(--input-focus-shadow, rgba(232,116,0,0.1)); }
/* 검색창·로그인 아이콘 패딩 수정: Tailwind pl-*/pr-*/py-* 가 form-input padding 단축 속성에
   덮어쓰이는 CSS 우선순위 문제 수정 — compound selector(2클래스)로 specificity 상승 */
.form-input.pl-8  { padding-left: 2rem; }
.form-input.pl-9  { padding-left: 2.25rem; }
.form-input.pl-10 { padding-left: 2.5rem; }
.form-input.pr-10 { padding-right: 2.5rem; }
.form-input.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.form-input.py-2  { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px 12px; padding-right: 32px; }
textarea.form-input { min-height: 100px; resize: vertical; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: var(--modal-overlay, rgba(0,0,0,0.5)); display: flex; align-items: center; justify-content: center; z-index: 4000; opacity: 0; transition: opacity 0.2s; pointer-events: none; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-overlay.active { opacity: 1; pointer-events: auto; }
body.modal-input-active {
  overscroll-behavior: contain;
}
.modal-overlay,
.modal,
.sticker-picker-popup {
  overscroll-behavior: contain;
}
.modal {
  background: var(--glass-bg, var(--modal-bg, #fff));
  border: 1px solid var(--glass-border, var(--modal-border, #E5E7EB));
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--glass-shadow, 0 25px 50px rgba(0,0,0,0.25));
  backdrop-filter: var(--glass-blur, blur(12px));
  -webkit-backdrop-filter: var(--glass-blur, blur(12px));
}
.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-primary, #111827); }

/* Org Tree */
.org-tree { padding-left: 20px; }
.org-node { margin: 4px 0; }
.org-node-header { display: flex; align-items: center; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: all 0.2s; color: var(--text-primary, #111827); }
.org-node-header:hover { background: var(--primary-surface); }
.org-member { display: flex; align-items: center; padding: 4px 12px 4px 36px; font-size: 13px; color: var(--text-secondary, #374151); }
.org-member-avatar { width: 28px; height: 28px; border-radius: 6px; background: var(--primary-surface); display: flex; align-items: center; justify-content: center; margin-right: 8px; font-size: 12px; color: var(--primary); font-weight: 600; flex-shrink: 0; overflow: hidden; }
.org-member-avatar.org-member-avatar-img { object-fit: cover; }

/* Toast Notification */
/* z-index:10001 — 모달 오버레이(9999)·패널(10000) 위에 항상 표시 */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 10px; color: white; font-size: 14px; font-weight: 500; z-index: 10001; transform: translateY(100px); opacity: 0; transition: all 0.3s; pointer-events: none; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: #10B981; }
.toast-error { background: #EF4444; }
.toast-info { background: var(--primary); }

.mobile-file-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.44);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.mobile-file-picker-overlay.show { opacity: 1; }
.mobile-file-picker-sheet {
  width: min(460px, 100%);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15,23,42,.26);
  padding: 10px 14px 16px;
  transform: translateY(16px);
  transition: transform 0.18s ease;
}
.mobile-file-picker-overlay.show .mobile-file-picker-sheet { transform: translateY(0); }
.mobile-file-picker-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--card-border);
  margin: 0 auto 12px;
}
.mobile-file-picker-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 14px;
}
.mobile-file-picker-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.mobile-file-picker-action {
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text-main);
  border-radius: 10px;
  min-height: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.mobile-file-picker-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-surface);
  color: var(--primary);
  font-size: 18px;
}

.ms-schedule-modal {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ms-schedule-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.ms-schedule-textarea {
  min-height: 120px;
  resize: vertical;
}
.ms-schedule-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}
.ms-scheduled-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ms-scheduled-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--input-bg);
}
.ms-scheduled-main {
  flex: 1;
  min-width: 0;
}
.ms-scheduled-time {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.ms-scheduled-content {
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.ms-scheduled-error {
  margin-top: 8px;
  font-size: 12px;
  color: #dc2626;
}
.ms-scheduled-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 12px;
  color: var(--text-muted);
}
.ms-share-target {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ms-share-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--input-bg);
  padding: 10px;
}
.ms-share-preview-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ms-share-preview-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
  word-break: break-word;
}
.ms-share-preview-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ms-share-preview-files span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--primary-surface);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.ms-share-room-list {
  display: grid;
  gap: 6px;
  max-height: min(360px, 42vh);
  overflow: auto;
}
.ms-share-room {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}
.ms-share-room.selected {
  border-color: var(--primary);
  background: var(--primary-surface);
}
.ms-share-room-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}
.ms-share-room-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.ms-share-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}
.ms-external-share-ready {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text-main);
}
.ms-external-share-ready p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.ms-external-share-ready div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ms-external-share-ready span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--primary-surface);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

/* 메신저 메시지 내 URL 링크 스타일 */
.msg-link { color: var(--primary); text-decoration: underline; word-break: break-all; }
.msg-link:hover { opacity: 0.8; }
/* 내 메시지 버블(배경=primary)에서 링크는 흰색으로 표시 */
.message-group.own .message-bubble .msg-link { color: rgba(255,255,255,0.9); text-decoration: underline; }
.message-group.own .message-bubble .msg-link:hover { opacity: 0.75; }

.ms-link-preview {
  width: min(260px, 64vw);
  max-width: 100%;
  margin-top: 6px;
  white-space: normal;
}
.ms-link-preview-card {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}
.ms-link-preview-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.15);
}
.ms-link-preview-media {
  width: 100%;
  aspect-ratio: 2.35 / 1;
  max-height: 112px;
  background: #eef2f7;
  overflow: hidden;
}
.ms-link-preview-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ms-link-preview-body {
  display: grid;
  gap: 3px;
  padding: 8px 9px 9px;
  min-width: 0;
}
.ms-link-preview-title {
  color: #0f172a;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ms-link-preview-desc {
  color: #475569;
  font-size: 11.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ms-link-preview-domain {
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-link-preview-skeleton {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px;
  min-height: 58px;
  padding: 7px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 10px;
  background: rgba(255,255,255,0.86);
}
.ms-link-preview-skeleton-media,
.ms-link-preview-skeleton-lines i {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, #e5e7eb 0%, #f8fafc 52%, #e5e7eb 100%);
  background-size: 220% 100%;
  animation: msLinkPreviewPulse 1.2s ease-in-out infinite;
}
.ms-link-preview-skeleton-lines {
  display: grid;
  align-content: center;
  gap: 8px;
}
.ms-link-preview-skeleton-lines i {
  height: 10px;
}
.ms-link-preview-skeleton-lines i:nth-child(2) { width: 82%; }
.ms-link-preview-skeleton-lines i:nth-child(3) { width: 56%; }
@keyframes msLinkPreviewPulse {
  0% { background-position: 0% 50%; }
  100% { background-position: -220% 50%; }
}

.mf-bubble .ms-link-preview {
  width: min(240px, 62vw);
}

@media (max-width: 640px) {
  .ms-link-preview {
    width: min(220px, 60vw);
  }
  .ms-link-preview-media {
    max-height: 92px;
  }
  .ms-link-preview-title {
    font-size: 12.5px;
  }
}

/* Loading */
.spinner { width: 32px; height: 32px; border: 3px solid #E5E7EB; border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   Mobile Responsive — 스마트폰 최적화
   ============================================ */

/* 🔴 [v3.45.8] iPad 햄버거/사이드바 분기점 — Tailwind lg(1024px) 기준
   기존 768px 기준은 iPad 영역(768~1024px)에서 햄버거가 사라져 사이드바를 열 수단이 없었음.
   이 블록은 iPad·작은 태블릿용 사이드바 슬라이드 동작만 정의하며,
   모달 하단시트·폼·버튼 크기 등 진짜 모바일(≤768px) 전용 스타일은 아래 블록에 그대로 유지함. */
@media (max-width: 1023px) {
  /* 사이드바: 화면 밖에 숨김 + mobile-open 시 슬라이드 인 */
  .sidebar {
    transform: translateX(-100%);
    width: 82vw;
    max-width: 300px;
    height: 100dvh;
    height: 100dvh;
    z-index: 50;
  }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.18); }
  body.sidebar-open { overflow: hidden; touch-action: none; }
  /* 메인 영역이 사이드바 자리(margin-left)를 차지하지 않도록 */
  .main-area {
    margin-left: 0 !important;
  }
  /* 헤더가 화면 좌측 끝에 붙도록 (데스크톱에서는 JS가 left:64px/260px 동기화) */
  .header { left: 0 !important; }
  /* 헤더가 사이드바보다 아래 layer로 — 슬라이드 인 시 사이드바가 헤더를 덮음 */
  .header { z-index: 40; }

  body.messenger-privacy-locked.sidebar-open .sidebar {
    z-index: 9700;
  }

  body.messenger-privacy-locked.sidebar-open #sidebarOverlay {
    z-index: 9650 !important;
  }
}

/* 🔴 [v3.45.10] iOS Safari/iPad input 자동 줌 방지
   iOS Safari는 input/textarea의 font-size가 16px 미만이면 focus 시 자동으로 페이지를 확대함.
   기존엔 @media (max-width: 768px) 블록 안에서만 .form-input을 16px로 강제했는데,
   사이드바 분기를 1023px로 통일한 v3.45.8 이후 iPad(769~1023px) 영역도 동일 처리해야 일관성 보장.
   .form-input 외에 직접 input[type=...]/textarea/select로 작성된 입력창도 모두 포함. */
@media (max-width: 1023px) {
  .form-input,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  input[type="datetime-local"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* 터치 타겟 최소 44px 보장 */
@media (max-width: 768px) {
  /* 모바일: body 스크롤 완전 차단 — SPA에서 body 자체가 스크롤되지 않도록 */
  html, body {
    height: 100dvh;
    overflow: hidden;
  }

  /* 레이아웃 */
  .sidebar {
    transform: translateX(-100%);
    width: 82vw;
    max-width: 300px;
    height: 100dvh;
    height: 100dvh;
  }
  .sidebar.mobile-open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,0.18); }
  /* 사이드바 열렸을 때 body 스크롤 차단 */
  body.sidebar-open { overflow: hidden; touch-action: none; }
  .main-area {
    margin-left: 0 !important;
    height: 100dvh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .content { padding: 12px; padding-top: calc(52px + 12px); }
  .header { padding: 0 12px; height: 52px; left: 0 !important; }

  /* 헤더 타이틀 표시 (sm:block 오버라이드) */
  .header h2 { display: block !important; font-size: 15px; }

  /* 카드 */
  .card { padding: 14px; border-radius: 10px; }
  .card-header { margin-bottom: 12px; }
  .card-title { font-size: 14px; }

  /* 모달 — 하단 시트 스타일 */
  .modal-overlay { align-items: flex-end; }
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0;
    max-height: var(--vvh, 92dvh);
    padding: 20px 16px 32px;
    /* iOS 홈 인디케이터 여백 */
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }
  .modal-lg { max-width: 100% !important; }
  .modal-title { font-size: 16px; }

  /* 버튼 — 터치 영역 확보 */
  .btn { min-height: 40px; padding: 8px 14px; font-size: 13px; }
  .btn-sm { min-height: 34px; padding: 6px 10px; font-size: 12px; }
  .btn-lg { min-height: 48px; padding: 12px 20px; font-size: 15px; }
  .btn-xs { min-height: 28px; padding: 4px 8px; font-size: 11px; }

  /* 폼 */
  .form-input { font-size: 16px !important; /* iOS 줌 방지 */ min-height: 42px; }
  .form-label { font-size: 13px; }
  .form-group { margin-bottom: 14px; }
  textarea.form-input { min-height: 90px; }

  /* 테이블 — 가로 스크롤 */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; }
  table { min-width: 500px; }
  th, td { padding: 8px 10px; font-size: 12px; white-space: nowrap; }

  /* 네비 아이템 터치 타겟 */
  .nav-item { padding: 13px 20px; font-size: 15px; }
  .nav-item i { font-size: 18px; }

  /* 배지 */
  .badge { font-size: 10px; padding: 2px 6px; }

  /* 토스트 — 하단 중앙 */
  .toast {
    bottom: max(16px, env(safe-area-inset-bottom));
    right: 16px;
    left: 16px;
    text-align: center;
    border-radius: 12px;
    font-size: 13px;
  }

  /* 조직도 */
  .org-tree { padding-left: 8px; }
  .org-member { padding-left: 20px; }

  /* 관리자 카드 */
  .admin-card { padding: 12px; gap: 10px; }
  .admin-card > i { font-size: 18px; }
  .admin-card p.font-medium { font-size: 13px; }

  /* 결재 흐름 */
  .approval-flow { gap: 2px; }
  .approval-step { min-width: 60px; }
  .approval-step-circle { width: 32px; height: 32px; font-size: 12px; }

  /* 그리드 유틸 */
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 초소형 화면 (Galaxy Fold 등 360px 이하) */
@media (max-width: 380px) {
  .content { padding: 8px; }
  .card { padding: 12px; }
  .btn { font-size: 12px; padding: 7px 10px; }
  .nav-item { padding: 12px 14px; }
}

/* PWA safe areas */
@supports (padding-top: env(safe-area-inset-top)) {
  .header { padding-top: env(safe-area-inset-top); height: auto; min-height: 56px; }
  .sidebar { padding-top: env(safe-area-inset-top); }
  /* 헤더 높이 변동에 맞춰 content padding-top 조정 */
  .content { padding-top: calc(56px + env(safe-area-inset-top) + 24px); }
}
@media (max-width: 768px) {
  @supports (padding-top: env(safe-area-inset-top)) {
    .header { min-height: 52px; }
    .content { padding-top: calc(52px + env(safe-area-inset-top) + 12px); }
  }
}
/* 모바일: 사이드바 z-index가 헤더보다 위 (오버레이 방식) */
@media (max-width: 768px) {
  .sidebar { z-index: 50; }
  .header { z-index: 40; }
}

/* Approval flow visualization */
.approval-flow { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 12px 0; }
.approval-step { display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.approval-step-circle { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; border: 2px solid var(--card-border, #E5E7EB); background: var(--card-bg, #fff); }
.approval-step-circle.done { background: #10B981; color: white; border-color: #10B981; }
.approval-step-circle.current { background: var(--primary); color: white; border-color: var(--primary); animation: pulse 2s infinite; }
.approval-step-circle.rejected { background: #EF4444; color: white; border-color: #EF4444; }
.approval-step-arrow { color: #D1D5DB; font-size: 18px; }
.approval-step-label { font-size: 11px; color: #6B7280; margin-top: 4px; text-align: center; }
.approval-step-name { font-size: 12px; font-weight: 600; margin-top: 2px; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,116,0,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(232,116,0,0); }
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Kanban drag feedback */
[draggable=true]:active { opacity: 0.5; cursor: grabbing; }
.cursor-grab { cursor: grab; }

/* Calendar cell hover */
.calendar-cell:hover { background: rgba(232,116,0,0.05); }

/* ============================================
   Rich Content Display (TinyMCE 출력 HTML)
   ============================================ */
.rich-content {
  word-break: break-word;
  overflow-wrap: break-word;
}
.rich-content table {
  border-collapse: collapse;
  width: 100% !important;
  margin: 8px 0;
  table-layout: auto;
  max-width: 100%;
}
/* TinyMCE가 생성하는 픽셀 단위 고정 너비를 비율 기반으로 재정의 */
.rich-content table td,
.rich-content table th {
  border: 1px solid #d1d5db;
  padding: 6px 10px;
  width: auto !important;
  word-break: break-word;
  overflow-wrap: break-word;
  text-align: left;
  vertical-align: top;
}
.rich-content table th {
  background: #f3f4f6;
  font-weight: 600;
}
.rich-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0;
}
.rich-content blockquote {
  border-left: 3px solid #ccc;
  margin: 10px 0;
  padding: 8px 16px;
  color: #666;
  background: #f9fafb;
}
.rich-content pre {
  background: #f4f4f5;
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}
.rich-content h1 { font-size: 1.5em; font-weight: 700; margin: 16px 0 8px; }
.rich-content h2 { font-size: 1.25em; font-weight: 600; margin: 14px 0 6px; }
.rich-content h3 { font-size: 1.1em; font-weight: 600; margin: 12px 0 4px; }
.rich-content ul, .rich-content ol { padding-left: 24px; margin: 8px 0; }
.rich-content li { margin-bottom: 4px; }
.rich-content a { color: var(--primary); text-decoration: underline; }
.rich-content hr { border: none; border-top: 1px solid #e5e7eb; margin: 16px 0; }
.rich-content p { margin-bottom: 8px; }
.rich-content p:last-child { margin-bottom: 0; }

/* rich-content 다크테마 지원 */
[data-theme="dark"] .rich-content { color: var(--text-primary); }
[data-theme="dark"] .rich-content table td,
[data-theme="dark"] .rich-content table th { border-color: var(--card-border); color: var(--text-primary); }
[data-theme="dark"] .rich-content table th { background: var(--table-header-bg); }
[data-theme="dark"] .rich-content blockquote { border-left-color: var(--card-border); color: var(--text-muted); background: var(--body-bg); }
[data-theme="dark"] .rich-content pre { background: var(--body-bg); color: var(--text-primary); }
[data-theme="dark"] .rich-content hr { border-top-color: var(--card-border); }

/* TinyMCE 에디터 통합 스타일 */
.tox-tinymce {
  border-radius: 10px !important;
  border-color: var(--tinymce-border, #d1d5db) !important;
  overflow: hidden;
}
.tox-tinymce:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--input-focus-shadow, rgba(232,116,0,0.1)) !important;
}
.tox .tox-toolbar__primary {
  background: var(--tinymce-toolbar-bg, #f9fafb) !important;
  border-bottom: 1px solid var(--tinymce-border, #e5e7eb) !important;
}
.tox .tox-toolbar-overlord {
  background: var(--tinymce-toolbar-bg, #f9fafb) !important;
}
.tox .tox-statusbar {
  border-top: 1px solid var(--tinymce-border, #e5e7eb) !important;
  background: var(--tinymce-toolbar-bg, #f9fafb) !important;
  color: var(--text-muted, #6B7280) !important;
}
/* 편집 본문은 모든 테마에서 흰 문서 표면으로 고정 */
.tox .tox-edit-area,
.tox .tox-edit-area__iframe {
  background-color: #ffffff !important;
  color-scheme: light;
}
/* 모달 안의 TinyMCE z-index 보정 */
.modal .tox-tinymce { z-index: 1; }
/* tox-tinymce-aux는 드롭다운·색상피커 팝업의 호스트 컨테이너.
   dialog-wrap(10200)보다 높아야 팝업이 모달 위에 표시됨 */
.tox.tox-tinymce-aux,
.tox.tox-silver-sink,
.tox.tox-silver-popup-sink {
  z-index: 12050 !important;
}
.tox .tox-dialog-wrap,
.tox-dialog-wrap {
  z-index: 12000 !important;
}
.tox .tox-menu,
.tox-menu,
.tox-collection,
.tox-pop,
.tox-pop__dialog,
.tox-swatches {
  z-index: 12100 !important;
}
/* TinyMCE 색상 선택기: 셀/표 속성 모달의 테두리색·배경색 팝업이
   dialog 뒤로 깔리지 않도록 dialog 내부 popup host와 color picker를 한 단계 더 올린다. */
.tox .tox-dialog__popups,
.tox-dialog__popups {
  position: relative !important;
  z-index: 12200 !important;
  overflow: visible !important;
}
.tox .tox-dialog__popups .tox-pop,
.tox .tox-dialog__popups .tox-pop__dialog,
.tox .tox-dialog__popups .tox-menu,
.tox .tox-dialog__popups .tox-collection,
.tox .tox-dialog__popups .tox-swatches,
.tox-dialog__popups .tox-pop,
.tox-dialog__popups .tox-pop__dialog,
.tox-dialog__popups .tox-menu,
.tox-dialog__popups .tox-collection,
.tox-dialog__popups .tox-swatches,
.tox-dialog__popups .tox-swatches-menu,
.tox.tox-tinymce-aux .tox-pop,
.tox.tox-tinymce-aux .tox-pop__dialog,
.tox.tox-tinymce-aux .tox-swatches,
.tox.tox-tinymce-aux .tox-swatches-menu,
.tox.tox-tinymce-aux .tox-color-input {
  position: relative !important;
  z-index: 12250 !important;
}
.tox-dialog-wrap:has(.tox-color-picker-container),
.tox .tox-dialog-wrap:has(.tox-color-picker-container) {
  z-index: 12300 !important;
}

/* TinyMCE 표 속성 모달 — 드롭다운이 모달 영역에서 잘려 비활성화되는 문제 수정
   custom listbox (tox-listboxfield)는 position:absolute로 렌더되므로
   부모 컨테이너의 overflow:hidden/auto가 있으면 clipping됨 → visible로 해제 */
.tox .tox-dialog__body-content {
  overflow: visible !important;
}
.tox .tox-dialog__body {
  overflow: visible !important;
}
/* 상세 탭 내부 컨테이너도 visible 처리 (탭 패널 내 색상 피커 클리핑 방지) */
.tox .tox-dialog__body-tab-set,
.tox .tox-tabpanel,
.tox .tox-tabpanel--active {
  overflow: visible !important;
}
.tox .tox-form__group {
  overflow: visible !important;
}
.tox .tox-form__grid,
.tox .tox-form__controls-h-stack,
.tox .tox-form {
  overflow: visible !important;
}
/* aux 레이어의 tox-menu가 dialog 위에 렌더되도록 z-index 상향 */
.tox.tox-tinymce-aux .tox-menu {
  z-index: 12100 !important;
}

/* Admin management card */
.admin-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border, #E5E7EB);
  background: var(--card-bg, white);
  color: var(--text-primary, #111827);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}
.admin-card:hover {
  border-color: var(--primary);
  background: var(--primary-surface);
  transform: translateY(-1px);
  box-shadow: var(--card-shadow-hover);
}
.admin-card > i {
  font-size: 20px;
  color: var(--primary);
  width: 24px;
  text-align: center;
}

/* Extra-small button */
.btn-xs { padding: 2px 6px; font-size: 11px; border-radius: 4px; }
.btn-xs i { font-size: 10px; }

/* ============================================
   Community Writer — 전체화면 글쓰기 (트위터/X 스타일)
   ============================================ */

/* 모바일: position fixed로 완전한 전체화면 점유 */
.community-writer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  background: var(--modal-bg, #fff);
}
body.community-writer-open {
  overflow: hidden;
  touch-action: none;
}
.community-writer-sheet {
  background: var(--modal-bg, #fff);
  width: 100%;
  max-width: 100%;
  border-radius: 0;   /* 전체화면이므로 둥근 모서리 제거 */
  display: flex;
  flex-direction: column;
  height: 100%;       /* overlay를 꽉 채움 */
  /* iOS 키보드 올라올 때 뷰포트가 줄어드는 것을 CSS로 추적 */
  overflow: hidden;
}
.community-writer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 12px;
  padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--card-border, #f0f0f0);
  flex-shrink: 0;
  background: var(--modal-bg, #fff);
}
.community-writer-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: #374151;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.community-writer-close:hover { background: #e5e7eb; }
.community-writer-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}
.community-writer-body {
  flex: 1 1 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  /* 에디터가 키보드에 밀리지 않도록 최소높이 지정하지 않음 */
}
.community-writer-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  border-top: 1px solid var(--card-border, #f0f0f0);
  flex-shrink: 0;
  background: var(--modal-bg, #fff);
  /* iOS 홈 인디케이터 여백 */
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}

/* 데스크탑: 가운데 팝업 */
@media (min-width: 769px) {
  .community-writer-overlay {
    background: rgba(0,0,0,0.45);
    align-items: center;
  }
  .community-writer-sheet {
    max-width: 680px;
    height: auto;
    max-height: 82vh;
    border-radius: 16px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.22);
  }
  .community-writer-body { min-height: 280px; }
  .community-writer-header { padding-top: 14px; }
}

/* 글쓰기 유도 버튼 */
.community-write-trigger {
  cursor: text;
}

/* ============================================
   Community Feed — 이미지 썸네일 그리드
   ============================================ */
.community-img-grid {
  display: grid;
  gap: 3px;
  border-radius: 12px;
  overflow: hidden;
}
/* 1장: 전체 너비 */
.community-img-grid-1 {
  grid-template-columns: 1fr;
}
/* 2장: 나란히 */
.community-img-grid-2 {
  grid-template-columns: 1fr 1fr;
}
/* 3장: 왼쪽 1장 + 오른쪽 2장 세로 */
.community-img-grid-3 {
  grid-template-columns: 1fr 1fr;
}
.community-img-grid-3 .community-img-thumb:first-child {
  grid-row: span 2;
}
/* 4장: 2×2 */
.community-img-grid-4 {
  grid-template-columns: 1fr 1fr;
}

.community-img-thumb {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: var(--body-bg, #f5f5f5);
  aspect-ratio: 1 / 1;
}
.community-img-grid-1 .community-img-thumb {
  aspect-ratio: 16 / 9;  /* 1장은 와이드 비율 */
  max-height: 360px;
}
.community-img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}
.community-img-thumb:hover img {
  transform: scale(1.04);
}
.community-img-more {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.48);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ============================================
   Community Channel Tabs — 채널 탭 내비게이션
   ============================================ */
.comm-channel-tabs-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge */
  border-bottom: 2px solid var(--card-border, #f0f0f0);
  background: var(--card-bg, #fff);
  border-radius: 12px 12px 0 0;
}
.comm-channel-tabs-wrap::-webkit-scrollbar { display: none; }

.comm-channel-tabs {
  display: flex;
  gap: 0;
  min-width: max-content;
  padding: 0 4px;
}

.comm-channel-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.comm-channel-tab:hover { color: var(--primary); }
.comm-channel-tab--active {
  color: var(--primary);
  font-weight: 600;
  border-bottom-color: var(--primary);
}
.comm-channel-tab i { font-size: 12px; }

/* ==========================================
   링크 허브 페이지 (포털 스타일)
   ========================================== */

/* ── 전체 래퍼 ────────────────────────────── */
.link-hub-page {
  margin: -24px;                 /* .content 패딩 상쇄 */
  margin-top: calc(-24px);
  background: #FAF7F3;           /* 크림/베이지 배경 */
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  font-family: inherit;
}

/* ── 페이지 헤더 ──────────────────────────── */
.link-hub-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--card-bg, #fff);
  border-bottom: 1px solid var(--card-border, #E9E4DD);
  flex-shrink: 0;
}
.link-hub-page-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.link-hub-logo-circle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}
.link-hub-logo-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.link-hub-brand-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main, #111827);
  letter-spacing: -0.3px;
  line-height: 1.2;
}
.link-hub-brand-sub {
  font-size: 12px;
  color: var(--text-secondary, #6B7280);
  margin-top: 1px;
}
.link-hub-page-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.link-hub-header-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--card-border, #E5E7EB);
  background: var(--body-bg, #F9FAFB);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary, #6B7280);
  font-size: 15px;
  transition: all 0.15s;
}
.link-hub-header-btn:hover {
  background: var(--primary-surface, #FFF7F0);
  border-color: var(--primary);
  color: var(--primary);
}
.link-hub-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  cursor: pointer;
}

/* ── 전폭 검색바 섹션 ─────────────────────── */
.link-hub-search-section {
  padding: 20px 32px 0;
  flex-shrink: 0;
}
.link-hub-search-bar-wrap {
  position: relative;
  max-width: 100%;
}
.link-hub-search-bar-wrap .lh-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary, #9CA3AF);
  font-size: 16px;
  pointer-events: none;
}
.link-hub-search-bar {
  width: 100%;
  padding: 14px 48px 14px 50px;
  border: 1.5px solid var(--card-border, #E5E7EB);
  border-radius: 14px;
  background: var(--card-bg, #fff);
  color: var(--text-main, #111827);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.link-hub-search-bar:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--input-focus-shadow, rgba(232,116,0,0.12)), 0 2px 8px rgba(0,0,0,0.04);
}
.link-hub-search-count {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-secondary, #9CA3AF);
  pointer-events: none;
  background: var(--primary-surface, #FFF7F0);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
  display: none;
}
.link-hub-search-count.visible { display: block; }

/* ── 콘텐츠 영역 ──────────────────────────── */
.link-hub-content {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
}

/* ── 즐겨찾기 섹션 헤더 ─────────────────── */
.link-hub-fav-section {
  margin-bottom: 28px;
}
.link-hub-fav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary) 0%, #FF8C00 100%);
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  user-select: none;
}
.link-hub-fav-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.link-hub-fav-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}
.link-hub-fav-badge {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.25);
  color: #fff;
  padding: 1px 8px;
  border-radius: 10px;
}
.link-hub-fav-arrow {
  color: #fff;
  font-size: 13px;
  transition: transform 0.2s;
}
.link-hub-fav-arrow.collapsed { transform: rotate(-90deg); }
.link-hub-fav-body {
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--card-border, #E9E4DD);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 16px;
}

/* ── 카테고리 아코디언 섹션 ──────────────── */
.link-hub-section {
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.link-hub-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--card-border, #E9E4DD);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
  border-radius: 12px;
}
.link-hub-section.open > .link-hub-section-header {
  border-radius: 12px 12px 0 0;
  border-bottom-color: var(--card-border, #E9E4DD);
}
.link-hub-section-header:hover {
  background: var(--primary-surface, #FFF7F0);
}
.link-hub-section-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.link-hub-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main, #111827);
}
.link-hub-section-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-surface, #FFF7F0);
  border: 1px solid rgba(232,116,0,0.2);
  border-radius: 10px;
  padding: 1px 8px;
  line-height: 18px;
}
.link-hub-section-arrow {
  font-size: 13px;
  color: var(--text-secondary, #9CA3AF);
  transition: transform 0.25s;
}
.link-hub-section.open .link-hub-section-arrow { transform: rotate(180deg); }
.link-hub-section-body {
  display: none;
  padding: 16px;
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--card-border, #E9E4DD);
  border-top: none;
  border-radius: 0 0 12px 12px;
}
.link-hub-section.open > .link-hub-section-body { display: block; }

/* ── 반응형 카드 그리드 ───────────────────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
@media (max-width: 1280px) { .links-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 900px)  { .links-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px)  { .links-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 400px)  { .links-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── 링크 카드 (로고 포트폴리오 스타일: 정사각형, 테두리 없음) ─── */
.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--card-bg, #fff);
  border: none;
  border-radius: 16px;
  padding: 5% 4% 6%;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(.4,0,.2,1);
  position: relative;
  text-decoration: none;
  aspect-ratio: 1 / 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  overflow: hidden;
}
.link-card:hover {
  box-shadow: 0 8px 24px rgba(232,116,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
  transform: translateY(-3px);
  background: var(--primary-surface, #FFF3E6);
}

/* 카드 배지 영역 (우상단) */
.link-card-badges {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.link-badge-fav {
  font-size: 10px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  letter-spacing: 0.02em;
}
.link-badge-current {
  font-size: 10px;
  font-weight: 700;
  background: #10B981;
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  letter-spacing: 0.02em;
}

/* 아이콘 원형 배경 — 카드 너비의 62% (px 상한 없이 순수 비례) */
.link-card-icon-circle {
  width: 62%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--primary-surface, #FFF3E6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: clamp(22px, 2.8vw, 40px);
  flex-shrink: 0;
  overflow: hidden;
  margin-bottom: 4%;
  transition: transform 0.2s, background 0.2s;
}
.link-card:hover .link-card-icon-circle {
  transform: scale(1.06);
  background: var(--primary);
  color: #fff;
}
.link-card-icon-circle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12%;
  border-radius: 50%;
}

/* 하위 호환 (구형 .link-card-icon-wrap / .link-card-icon) */
.link-card-icon-wrap, .link-card-icon {
  width: 62%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--primary-surface, #FFF3E6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: clamp(22px, 2.8vw, 40px);
  flex-shrink: 0;
  overflow: hidden;
  margin-bottom: 4%;
}
.link-card-icon-wrap img.link-card-logo {
  width: 100%; height: 100%;
  object-fit: contain; padding: 12%; border-radius: 50%;
}

.link-card-body { width: 92%; }

.link-card-title {
  font-size: clamp(10px, 0.9vw, 13px);
  font-weight: 700;
  color: var(--text-main, #111827);
  line-height: 1.3;
  margin-bottom: 0;
  word-break: keep-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.link-card-url { display: none; }  /* URL은 포털 스타일에서 숨김 */

/* 설명 툴팁 — 호버 시 카드 하단 오버레이로 표시 */
.link-card-desc {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(30,20,10,0.78);
  color: #fff;
  font-size: 11px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: 0 0 16px 16px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
  text-align: left;
  z-index: 5;
  overflow: hidden;
  max-height: 60px;
  word-break: keep-all;
}
@media (hover: hover) {
  .link-card:hover .link-card-desc {
    opacity: 1;
    transform: translateY(0);
  }
}
/* 터치 환경: 툴팁 완전 숨김 */
@media (hover: none) {
  .link-card-desc { display: none; }
}

/* 편집/삭제 버튼 — PC: hover 시만, 모바일: ⋮ 버튼으로 대체 */
.link-card-actions {
  display: none;
  position: absolute;
  bottom: 8px;
  right: 8px;
  gap: 3px;
  z-index: 2;
}
/* PC(hover 지원): hover 시 표시 */
@media (hover: hover) {
  .link-card:hover .link-card-actions { display: flex; }
}

/* ⋮ 메뉴 버튼 — 모바일(touch) 전용 */
.link-card-menu-btn {
  position: absolute;
  bottom: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--card-border, #E5E7EB);
  background: var(--card-bg, #fff);
  color: var(--text-secondary, #9CA3AF);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3;
  padding: 0;
  transition: all 0.15s;
}
.link-card-menu-btn:hover {
  background: var(--primary-surface, #FFF7F0);
  border-color: var(--primary);
  color: var(--primary);
}
/* touch 환경: ⋮ 항상 표시 */
@media (hover: none) {
  .link-card-menu-btn { display: flex; }
  .link-card-actions { display: none !important; }
}
/* 마우스 환경: ⋮ 완전 숨김 */
@media (hover: hover) {
  .link-card-menu-btn { display: none !important; }
}

/* 카드 컨텍스트 메뉴 (body에 동적 삽입) */
.lnk-ctx-menu {
  position: fixed;
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--card-border, #E5E7EB);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.14);
  z-index: 99999;
  min-width: 120px;
  overflow: hidden;
}
.lnk-ctx-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-main, #111827);
  text-align: left;
  transition: background 0.12s;
  white-space: nowrap;
}
.lnk-ctx-menu button:hover { background: var(--primary-surface, #FFF7F0); }
.lnk-ctx-menu button.lnk-ctx-danger { color: #EF4444; }
.lnk-ctx-menu button.lnk-ctx-danger:hover { background: #FEF2F2; }

/* 즐겨찾기 토글 버튼 (내부) */
.link-fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #CBD5E1);
  font-size: 13px;
  padding: 2px 3px;
  border-radius: 4px;
  transition: all 0.15s;
  flex-shrink: 0;
  line-height: 1;
  position: absolute;
  top: 10px;
  left: 10px;
  opacity: 0;
}
.link-card:hover .link-fav-btn, .link-fav-btn.active { opacity: 1; }
/* touch 환경: 즐겨찾기 버튼도 항상 표시 */
@media (hover: none) {
  .link-fav-btn { opacity: 1; }
}
.link-fav-btn.active { color: #F59E0B; }
.link-fav-btn:hover { color: #F59E0B; background: var(--primary-surface, #FFF7F0); }

/* ── 빈 상태 ──────────────────────────────── */
.link-hub-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary, #9CA3AF);
}
.link-hub-empty i { font-size: 40px; opacity: 0.3; margin-bottom: 12px; }
.link-hub-empty p { font-size: 14px; }

/* ── 푸터 ─────────────────────────────────── */
.link-hub-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-top: 1px solid var(--card-border, #E9E4DD);
  background: var(--card-bg, #fff);
  font-size: 12px;
  color: var(--text-secondary, #9CA3AF);
}
.link-hub-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.link-hub-footer-logo {
  font-weight: 800;
  font-size: 13px;
  color: var(--primary);
}
.link-hub-footer-right a,
.link-hub-footer-right button {
  font-size: 12px;
  color: var(--text-secondary, #9CA3AF);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
  transition: color 0.15s;
}
.link-hub-footer-right a:hover,
.link-hub-footer-right button:hover { color: var(--primary); }

/* ── 모바일 반응형 ────────────────────────── */
@media (max-width: 768px) {
  .link-hub-page { margin: -24px; margin-top: -24px; }
  .link-hub-page-header { padding: 14px 16px; }
  .link-hub-search-section { padding: 14px 16px 0; }
  .link-hub-content { padding: 16px; }
  .link-hub-footer { padding: 12px 16px; }
  .link-hub-brand-sub { font-size: 10px; }
}

/* ── 아이콘 픽커 (모달 내) — 공통 유지 ──── */
.link-icon-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--card-border, #E5E7EB);
  padding-bottom: 6px;
}
.link-icon-tab-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  background: none;
  color: var(--text-secondary, #6B7280);
  transition: all 0.15s;
}
.link-icon-tab-btn.active {
  background: var(--primary-surface, #FFF7F0);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.link-icon-search {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--card-border, #E5E7EB);
  border-radius: 7px;
  background: var(--input-bg, #fff);
  color: var(--text-main, #111827);
  font-size: 13px;
  margin-bottom: 8px;
  outline: none;
  transition: border-color 0.15s;
}
.link-icon-search:focus { border-color: var(--primary); }
.link-icon-upload-area {
  border: 2px dashed var(--card-border, #D1D5DB);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 8px;
  background: var(--body-bg, #F9FAFB);
  position: relative;
}
.link-icon-upload-area:hover { border-color: var(--primary); background: var(--primary-surface, #FFF7F0); }
.link-icon-upload-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.link-icon-upload-label {
  font-size: 12px;
  color: var(--text-secondary, #6B7280);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.link-icon-upload-label i { font-size: 22px; color: var(--primary); opacity: 0.7; }
.link-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 2px;
}
.link-icon-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary, #6B7280);
  background: var(--body-bg, #F9FAFB);
  transition: all 0.12s;
}
.link-icon-item:hover { background: var(--primary-surface, #FFF7F0); color: var(--primary); }
.link-icon-item.selected { border-color: var(--primary); background: var(--primary-surface, #FFF7F0); color: var(--primary); }
.link-icon-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--body-bg, #F9FAFB);
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid var(--card-border, #E5E7EB);
}
.link-icon-preview-box {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--primary-surface, #FFF7F0);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: var(--primary); overflow: hidden; flex-shrink: 0;
}
.link-icon-preview-box img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.link-icon-preview-label { font-size: 12px; color: var(--text-secondary, #6B7280); }
.link-icon-preview-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main, #111827);
  word-break: break-all;
}

/* ==========================================
   통합 검색 모달
   ========================================== */
.global-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(40px, 10vh, 100px);
}
.global-search-box {
  background: var(--glass-bg, rgba(255,255,255,0.9));
  backdrop-filter: var(--glass-blur, blur(12px));
  -webkit-backdrop-filter: var(--glass-blur, blur(12px));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.5));
  width: 100%;
  max-width: 620px;
  border-radius: 20px;
  box-shadow: var(--glass-shadow, 0 20px 60px rgba(0,0,0,0.25));
  overflow: hidden;
  margin: 0 16px;
}
.global-search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border, #F3F4F6);
}
.global-search-input-wrap i.search-icon {
  font-size: 18px;
  color: #9CA3AF;
  flex-shrink: 0;
}
.global-search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--text-primary, #111827);
  background: transparent;
}
.global-search-input-wrap input::placeholder { color: #9CA3AF; }
.global-search-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #F3F4F6;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B7280;
  font-size: 14px;
  flex-shrink: 0;
}
.global-search-close:hover { background: #E5E7EB; }
.global-search-scope {
  display: flex;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid #F3F4F6;
  overflow-x: auto;
  scrollbar-width: none;
}
.global-search-scope::-webkit-scrollbar { display: none; }
.gs-scope-btn {
  flex-shrink: 0;
  border: 1px solid var(--card-border, #E5E7EB);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  background: var(--card-bg, #fff);
  color: var(--text-muted, #6B7280);
  transition: all 0.15s;
}
.gs-scope-btn:hover, .gs-scope-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.global-search-results {
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px 0;
}
.gs-empty {
  padding: 32px 20px;
  text-align: center;
  color: #9CA3AF;
  font-size: 14px;
}
.gs-result-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid #F9FAFB;
}
.gs-result-item:hover { background: #F9FAFB; }
.gs-result-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  background: var(--primary-surface, #FFF7F0);
  color: var(--primary);
}
.gs-result-body { flex: 1; min-width: 0; }
.gs-result-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-result-meta {
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 2px;
}
.gs-result-snippet {
  font-size: 12px;
  color: #6B7280;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gs-type-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #F3F4F6;
  color: #6B7280;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}
.global-search-footer {
  padding: 8px 16px;
  border-top: 1px solid #F3F4F6;
  font-size: 11px;
  color: #9CA3AF;
  display: flex;
  gap: 12px;
}

@media (max-width: 768px) {
  .links-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .link-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 10px;
    gap: 8px;
  }
  .link-card-url { display: none; }
  .link-card-actions {
    display: flex !important;
    position: static;
    justify-content: center;
    gap: 6px;
    width: 100%;
  }
  .global-search-box {
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 100%;
    margin: 0;
  }
  .global-search-overlay {
    align-items: flex-end;
    padding-top: 0;
  }
  .global-search-results { max-height: 55vh; }
}

/* ==========================================
   메일 페이지 레이아웃 (v2.0 — 3패널)
   ========================================== */
.mail-layout {
  display: flex;
  height: calc(100dvh - 56px - 48px);
  min-height: 400px;
  gap: 0;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  border: 1px solid var(--card-border, #E5E7EB);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

/* 패널1: 폴더트리 */
.mail-folder-panel {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid #F3F4F6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card-bg, #fff);
}
.mail-folder-panel-header {
  padding: 14px 12px;
  border-bottom: 1px solid #F3F4F6;
}
.mail-folder-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8px;
}
.mail-folder-section {
  padding: 4px 0;
  border-bottom: 1px solid #F9FAFB;
}
.mail-folder-section:last-child { border-bottom: none; }
.mail-folder-section-title {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mail-folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 14px;
  border-radius: 0;
  font-size: 13px;
  color: var(--text-secondary, #374151);
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.1s;
  text-align: left;
  position: relative;
}
.mail-folder-item:hover { background: var(--table-row-hover, #F9FAFB); }
.mail-folder-item.active {
  background: var(--primary-surface, #FFF7F0);
  color: var(--primary);
  font-weight: 600;
  border-right: 2px solid var(--primary);
}
.mail-folder-item .fa-fw { width: 16px; text-align: center; }
.mail-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}
.mail-badge-danger { background: #EF4444; }
.mail-badge-gray { background: #9CA3AF; }

/* 저장공간 */
.mail-quick-search-section { padding: 8px 14px 12px; }
.mail-storage-bar { padding-top: 4px; }
.mail-storage-track {
  height: 4px;
  background: #E5E7EB;
  border-radius: 2px;
  overflow: hidden;
}
.mail-storage-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s;
}

/* 패널2: 메일 목록 */
.mail-list-panel {
  width: 320px;
  flex-shrink: 0;
  border-right: 1px solid #F3F4F6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card-bg, #fff);
}
.mail-list-panel-header {
  padding: 10px 12px 0;
  border-bottom: 1px solid #F3F4F6;
  flex-shrink: 0;
}
.mail-icon-btn {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: 6px;
  color: #9CA3AF; cursor: pointer; font-size: 12px;
  transition: background 0.1s, color 0.1s;
}
.mail-icon-btn:hover { background: #F3F4F6; color: #374151; }
.mail-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  flex-wrap: wrap;
}
.mail-toolbar-btn {
  padding: 3px 7px;
  border: 1px solid #E5E7EB;
  border-radius: 5px;
  font-size: 11px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
}
.mail-toolbar-btn:hover { background: #F9FAFB; }
.mail-list-scroll {
  flex: 1;
  overflow-y: auto;
}
.mail-pagination {
  flex-shrink: 0;
  border-top: 1px solid #F3F4F6;
}
.mail-page-btn {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #E5E7EB; border-radius: 4px;
  font-size: 11px; background: #fff; color: #374151; cursor: pointer;
  transition: all 0.1s;
}
.mail-page-btn:hover:not([disabled]) { background: var(--primary-surface); color: var(--primary); border-color: var(--primary); }
.mail-page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }
.mail-page-btn[disabled] { opacity: 0.35; cursor: not-allowed; }

/* 날짜 그룹 헤더 */
.mail-date-group-label {
  padding: 6px 12px 3px;
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  background: #FAFAFA;
  border-bottom: 1px solid #F3F4F6;
  position: sticky;
  top: 0;
  z-index: 1;
}

/* 메일 목록 아이템 v2 */
.mail-list-item2 {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 9px 10px;
  border-bottom: 1px solid #F9FAFB;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.mail-list-item2:hover { background: #F9FAFB; }
.mail-list-item2.selected { background: var(--primary-surface, #FFF7F0); border-right: 2px solid var(--primary); }
.mail-list-item2.checked { background: #EFF6FF; }
.mail-list-item2.unread { background: #fff; }
.mail-list-item2.unread .mail-item2-sender { font-weight: 700; color: #111827; }
.mail-list-item2.unread .mail-item2-subject { font-weight: 600; }
.mail-item2-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 1px;
}
.mail-item2-body { flex: 1; min-width: 0; }
.mail-item2-row1 { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 2px; }
.mail-item2-sender { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.mail-item2-row2 { display: flex; align-items: center; gap: 4px; }
.mail-item2-subject { font-size: 13px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.mail-item2-preview { font-size: 11px; color: #9CA3AF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mail-item2-date { font-size: 11px; flex-shrink: 0; }

/* 플래그 버튼 */
.mail-flag-btn {
  width: 18px; height: 18px;
  border: none; background: none; cursor: pointer;
  color: #D1D5DB; padding: 0; display: inline-flex;
  align-items: center; justify-content: center;
  transition: color 0.1s;
}
.mail-flag-btn:hover { color: #F59E0B; }
.mail-flag-btn.flagged { color: #EF4444; }
.mail-read-icon { width: 14px; display: flex; justify-content: center; }
.mail-check { cursor: pointer; }

/* compact view */
.mail-list-scroll.compact-view .mail-list-item2 { padding: 5px 10px; }
.mail-list-scroll.compact-view .mail-item2-preview { display: none; }

/* 패널3: 메일 읽기 */
.mail-content-pane {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mail-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #9CA3AF;
  gap: 8px;
  padding: 32px;
}
.mail-detail { padding: 20px 24px; flex: 1; }
.mail-detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid #F3F4F6;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.mail-detail-header { margin-bottom: 0; }
.mail-detail-subject {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
  flex: 1;
}
.mail-detail-meta {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--table-header-bg, #F9FAFB);
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
}
.mail-meta-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.mail-meta-avatar {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
}
.mail-attachments {
  margin-top: 12px;
  padding: 10px 12px;
  background: #F9FAFB;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
}
.mail-attach-item {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  font-size: 12px;
}
.mail-detail-body {
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.8;
  color: #374151;
  border-top: 1px solid #F3F4F6;
  padding-top: 20px;
}

/* 패널 리사이즈 핸들 */
.mail-resize-handle {
  flex-shrink: 0;
  width: 5px;
  background: transparent;
  cursor: col-resize;
  position: relative;
  transition: background 0.15s;
  z-index: 2;
}
.mail-resize-handle:hover,
.mail-resize-handle:active {
  background: var(--primary, #6366F1);
  opacity: 0.4;
}
.mail-resize-handle::after {
  content: '';
  position: absolute;
  top: 0; left: 2px;
  width: 1px;
  height: 100%;
  background: var(--card-border, #E5E7EB);
}

/* Gmail 메시지 뷰 */
.mail-view-inner { height: 100%; display: flex; flex-direction: column; }
.mail-view-header { padding: 20px 24px 14px; border-bottom: 1px solid var(--card-border, #E5E7EB); flex-shrink: 0; }
.mail-view-subject { font-size: 18px; font-weight: 600; color: var(--text-main, #111); margin-bottom: 8px; }
.mail-view-meta { font-size: 13px; color: var(--text-secondary, #6B7280); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.mail-view-body { flex: 1; overflow-y: auto; padding: 0; }

/* 모바일 메일 레이아웃 — display 토글 방식 */
@media (max-width: 1024px) {
  .mail-resize-handle { display: none; }
  .mail-folder-panel { width: 180px !important; }
  .mail-list-panel { width: 280px !important; }
}
/* 모바일 뒤로가기 버튼 — 데스크톱에서 숨김 */
.mail-mobile-back { display: none; }
@media (max-width: 768px) {
  /* 레이아웃: 블록으로 전환, 높이 자동 */
  .mail-layout {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    overflow: visible !important;
  }
  /* 리사이즈 핸들 숨김 */
  .mail-resize-handle { display: none !important; }
  /* 기본: 모든 패널 숨김 */
  .mail-folder-panel,
  .mail-list-panel,
  .mail-content-pane {
    display: none !important;
    width: 100% !important;
    max-height: none !important;
    border: none !important;
    min-height: calc(100dvh - 56px - 48px);
  }
  /* 기본 상태: 폴더 패널만 표시 */
  .mail-folder-panel {
    display: flex !important;
    flex-direction: column;
  }
  /* 목록 뷰: 목록 패널만 표시 */
  .mail-layout.mail-show-list .mail-folder-panel { display: none !important; }
  .mail-layout.mail-show-list .mail-list-panel   { display: flex !important; flex-direction: column; }
  /* 상세 뷰: 상세 패널만 표시 */
  .mail-layout.mail-show-detail .mail-folder-panel { display: none !important; }
  .mail-layout.mail-show-detail .mail-list-panel   { display: none !important; }
  .mail-layout.mail-show-detail .mail-content-pane { display: block !important; }
  /* 모바일 뒤로가기 버튼 표시 */
  .mail-mobile-back {
    display: flex !important;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    border-bottom: 1px solid var(--card-border);
    background: var(--card-bg);
    cursor: pointer;
    border-left: none; border-right: none; border-top: none;
    width: 100%;
    text-align: left;
    flex-shrink: 0;
  }
  /* 폴더 패널 스타일 */
  .mail-folder-scroll { padding: 8px 6px; }
  .mail-folder-section { border-bottom: none; padding: 4px 0; }
  .mail-folder-section-title { display: block; font-size: 11px; }
  .mail-folder-item { padding: 10px 14px; border-radius: 8px; font-size: 14px; width: 100%; }
  .mail-folder-item.active { border-right: none; }
  /* 목록 패널 */
  .mail-list-panel-header { padding: 10px 12px; }
  .mail-list-scroll { flex: 1; overflow-y: auto; }
  /* 상세 패널 */
  .mail-detail { padding: 12px; }
  .mail-detail-subject { font-size: 16px; }
  .mail-detail-toolbar { flex-wrap: wrap; gap: 6px; }
}

/* 레거시 호환 (기존 클래스명 유지) */
.mail-sidebar {
  width: 280px; flex-shrink: 0; border-right: 1px solid #F3F4F6;
  display: flex; flex-direction: column; overflow: hidden;
}
.mail-sidebar-header { padding: 16px; border-bottom: 1px solid #F3F4F6; }
.mail-folder-nav { padding: 8px; border-bottom: 1px solid #F3F4F6; }
.mail-list-wrap { flex: 1; overflow-y: auto; }
.mail-list-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid #F9FAFB;
  cursor: pointer; transition: background 0.1s; position: relative;
}
.mail-list-item:hover { background: #F9FAFB; }
.mail-list-item.selected { background: var(--primary-surface, #FFF7F0); }
.mail-list-item.unread .mail-item-sender,
.mail-list-item.unread .mail-item-subject { font-weight: 700; }
.mail-list-item.unread::before {
  content: ''; position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--primary);
}
.mail-item-avatar {
  width: 34px; height: 34px; border-radius: 6px; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.mail-item-body { flex: 1; min-width: 0; }
.mail-item-row { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.mail-item-sender { font-size: 13px; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.mail-item-date { font-size: 11px; color: #9CA3AF; flex-shrink: 0; }
.mail-item-subject { font-size: 13px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mail-item-preview { font-size: 12px; color: #9CA3AF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.mail-item-star { width: 24px; height: 24px; border: none; background: none; cursor: pointer; color: #D1D5DB; padding: 2px; flex-shrink: 0; }
.mail-item-star.starred { color: #F59E0B; }

/* ==========================================
   게시판 사이드바 & 우측 패널 (v3.10.21)
   ========================================== */
.board-sidebar-group {
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid #F9FAFB;
}
.board-sidebar-group:last-child { border-bottom: none; }
.board-sidebar-group-title {
  padding: 6px 12px 3px;
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.board-sidebar-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-secondary, #374151);
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.1s;
  text-align: left;
  border-radius: 6px;
  position: relative;
}
.board-sidebar-item:hover { background: var(--table-row-hover, #F9FAFB); }
.board-sidebar-item.active {
  background: var(--primary-surface, #FFF7F0);
  color: var(--primary);
  font-weight: 600;
}
.board-sidebar-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  border-radius: 9px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
}

/* 게시판 NEW 배지 */
.board-new-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px; height: 14px;
  border-radius: 3px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  margin-left: 3px;
  flex-shrink: 0;
}

/* 게시판 우측 최신글 패널 */
.board-right-panel {
  overflow-y: auto;
  max-height: calc(100dvh - 200px);
}
.board-right-section { border-bottom: 1px solid #F3F4F6; }
.board-right-section:last-child { border-bottom: none; }
.board-right-section-title {
  padding: 7px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.board-right-section-title:hover { color: var(--primary); }
.board-right-post-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  padding: 4px 12px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.board-right-post-item:hover { background: #F9FAFB; }
.board-right-post-title {
  font-size: 12px;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.board-right-post-date {
  font-size: 11px;
  color: #9CA3AF;
  flex-shrink: 0;
}
.board-right-notice {
  display: inline-block;
  padding: 0 4px;
  background: #FEF2F2;
  color: #EF4444;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 3px;
}
.board-right-tab-btn {
  padding: 2px 7px;
  font-size: 11px;
  border: 1px solid #E5E7EB;
  border-radius: 4px;
  background: #fff;
  color: #6B7280;
  cursor: pointer;
  transition: all 0.1s;
}
.board-right-tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ==========================================
   커뮤니티 3-컬럼 레이아웃 (v3.10.21)
   ========================================== */
.community-layout {
  display: grid;
  grid-template-columns: 200px 1fr 220px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) {
  .community-layout { grid-template-columns: 180px 1fr; }
  .community-right-panel { display: none; }
}
@media (max-width: 768px) {
  .community-layout { grid-template-columns: 1fr; }
  .community-sidebar { display: none; }
}
.community-sidebar {
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #E5E7EB);
  border-radius: 10px;
  overflow: hidden;
  position: sticky;
  top: 16px;
}
.community-sidebar-header { padding: 12px; border-bottom: 1px solid #F3F4F6; }
.community-sidebar-scroll { overflow-y: auto; max-height: calc(100dvh - 180px); padding: 8px 0; }
.community-sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px 6px;
}
.community-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-secondary, #374151);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
  border-radius: 0;
}
.community-sidebar-item:hover { background: var(--table-row-hover, #F9FAFB); }
.community-sidebar-item.active {
  background: var(--primary-surface, #EEF2FF);
  color: var(--primary, #4F46E5);
  font-weight: 600;
}
.community-sidebar-badge {
  margin-left: auto;
  background: var(--primary, #4F46E5);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
}
.community-main { min-width: 0; }
.community-top-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 2px solid #F3F4F6;
  padding-bottom: 0;
}
.comm-top-tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.comm-top-tab:hover { color: var(--primary, #4F46E5); }
.comm-top-tab.active { color: var(--primary, #4F46E5); border-bottom-color: var(--primary, #4F46E5); font-weight: 600; }
.community-right-panel {
  position: sticky;
  top: 16px;
}
.community-right-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #E5E7EB);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.community-rank-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}
.community-rank-item:hover { background: #F9FAFB; }
.community-rank-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary, #4F46E5);
  width: 20px;
  flex-shrink: 0;
}

/* ==========================================
   보고 레이아웃 (Daouoffice 스타일, v3.10.21)
   ========================================== */
.report-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .report-layout { grid-template-columns: 1fr; }
  .report-sidebar { display: none; }
}
.report-sidebar {
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #E5E7EB);
  border-radius: 10px;
  overflow: hidden;
  position: sticky;
  top: 16px;
}
.report-sidebar-scroll { overflow-y: auto; max-height: calc(100dvh - 180px); padding: 8px 0; }
.report-sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px 6px;
}
.report-sidebar-dept { margin-bottom: 2px; }
.report-sidebar-dept-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background 0.1s;
}
.report-sidebar-dept-name:hover { background: #F9FAFB; }
.report-sidebar-dept-sub { padding-left: 20px; font-weight: 500; }
.report-sidebar-dept-body { }
.report-sidebar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 12px 5px 20px;
  font-size: 12px;
  color: #6B7280;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.report-sidebar-item:hover { background: #F9FAFB; color: #374151; }
.report-sidebar-item.active { color: var(--primary, #4F46E5); font-weight: 600; background: var(--primary-surface, #EEF2FF); }
.report-sidebar-badge {
  margin-left: auto;
  background: var(--primary, #4F46E5);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 6px;
}
.report-main { min-width: 0; }
.report-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #E5E7EB);
  border-radius: 10px;
  margin-bottom: 12px;
}
.report-section {
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #E5E7EB);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}
.report-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #F3F4F6;
}
.report-no-draft {
  padding: 16px 14px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 10px;
  margin-bottom: 12px;
}

/* ==========================================
   사이드바 메뉴 편집기 (드래그&드롭)
   ========================================== */
.menu-editor-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 0;
}
.menu-editor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--card-border, #E5E7EB);
  border-radius: 8px;
  cursor: grab;
  transition: all 0.15s;
  user-select: none;
}
.menu-editor-item:hover {
  border-color: var(--primary);
  background: var(--primary-surface, #FFF7F0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.menu-editor-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
  border-color: var(--primary);
  background: var(--primary-surface, #FFF7F0);
}
.menu-editor-drag-handle {
  color: #D1D5DB;
  font-size: 14px;
  cursor: grab;
  flex-shrink: 0;
}
.menu-editor-icon {
  width: 20px;
  text-align: center;
  color: var(--primary);
  font-size: 14px;
  flex-shrink: 0;
}
.menu-editor-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #111827;
}
.menu-editor-page {
  font-size: 11px;
  color: #9CA3AF;
  font-family: monospace;
}

/* ==========================================
   문서보관함 - 업로드 & HTML 뷰어
   ========================================== */

/* iframe 래퍼 — 테마 연동 + 모바일 반응형 */
.archive-iframe-wrap {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  /* 가로 스크롤: iframe 내부에서 처리하므로 래퍼는 숨김 */
  overflow-x: hidden;
}
.archive-iframe-wrap iframe {
  width: 100%;
  border: none;
  display: block;
  background: var(--card-bg);
  max-width: 100%;
  /* 높이는 JS에서 동적으로 설정 */
  min-height: 200px;
}

/* 모든 테마에서 래퍼 테두리 색상 테마 변수 사용 */
[data-theme] .archive-iframe-wrap {
  background: var(--card-bg);
  border-color: var(--card-border);
}
[data-theme] .archive-iframe-wrap iframe {
  background: var(--card-bg);
}

/* fallback: .archive-html-content (iframe 미지원 시) — 테마 변수 기반 */
.archive-html-content {
  font-size: 13px;
  line-height: 1.7;
  background: var(--card-bg);
  color: var(--input-text);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  word-break: break-word;
  overflow-wrap: break-word;
}
.archive-html-content * {
  max-width: 100%;
  box-sizing: border-box;
}
/* 중첩 테이블이 깨지지 않도록 display:table 유지 */
.archive-html-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
  /* display:block 제거 — 중첩 테이블 구조 유지 */
}
.archive-html-content table td,
.archive-html-content table th {
  border: 1px solid var(--input-border);
  padding: 4px 7px;
  color: var(--input-text);
  background: var(--card-bg);
  white-space: normal;
  word-break: break-word;
}
.archive-html-content table th {
  background: var(--table-header-bg);
  font-weight: 600;
  color: var(--input-text);
}
.archive-html-content img {
  max-width: 100%;
  height: auto;
}
.archive-html-content h1, .archive-html-content h2, .archive-html-content h3 {
  font-weight: 700;
  margin: 12px 0 6px;
  color: var(--input-text);
}
/* 드래그 드롭 활성 상태 */
#archDropZone.drag-active {
  border-color: var(--primary);
  background: var(--primary-surface);
}

/* ==========================================
   모바일 추가 반응형 강화 (2026-02)
   ========================================== */

/* 모달 안 grid-cols-2 → 모바일 1열 */
@media (max-width: 480px) {
  .modal .grid.grid-cols-2,
  .modal [class*="grid-cols-2"] {
    grid-template-columns: 1fr !important;
  }
  /* 결재 기안자 정보 박스 */
  .modal .grid.grid-cols-2.gap-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* ==========================================
   조직도 멤버 모바일 최적화
   ========================================== */
@media (max-width: 768px) {
  .org-member {
    flex-wrap: wrap;
    gap: 2px;
  }
  .org-member > span:last-child {
    display: none; /* 이메일 숨기기 */
  }
  .org-tree { padding-left: 4px; }
  .org-node { margin-left: 0 !important; }

  /* 드라이브 그리드 모바일 2열 유지 */
  .grid.grid-cols-2.sm\:grid-cols-3.lg\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* 결재 흐름선 wrap */
  .approval-flow {
    gap: 2px;
    padding: 8px 0;
  }

  /* max-w-4xl 모바일에서 전체폭 */
  .max-w-4xl { max-width: 100% !important; }

  /* 폼 내 버튼 행 wrap */
  .flex.justify-end.gap-2 { flex-wrap: wrap; }

  /* 보고서/설문 리스트 카드 */
  .grid.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   가로 스크롤 완전 방지 추가 규칙
   ========================================== */
.content > * { max-width: 100%; }
img, video, iframe { max-width: 100%; }

/* 헤더 타이틀 오버플로 방지 */
#pageTitle {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100vw - 200px);
}

@media (max-width: 768px) {
  #pageTitle { max-width: calc(100vw - 130px); font-size: 14px; }
  .header { flex-wrap: nowrap !important; }
  .header > div:first-child,
  .header > div:last-child {
    min-width: 0;
    flex-wrap: nowrap !important;
  }
  .header > div:last-child { gap: 4px !important; }
  .header button {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px !important;
  }
  .header button.hidden,
  .header button[onclick="App.toggleCollapse()"] {
    display: none !important;
  }
  .header button[onclick="openGlobalSearch()"],
  .header button[onclick="Components.toggleLangMenu()"],
  .header button[onclick="Store.logout()"] {
    width: 40px;
  }
  .header button[onclick="openGlobalSearch()"] span,
  .header button[onclick="Components.toggleLangMenu()"] span:not(:first-child) {
    display: none !important;
  }
  .btn-sm {
    min-height: 40px;
    padding: 8px 12px;
  }
  .btn-xs {
    min-height: 40px;
    padding: 8px 10px;
  }
  /* 전체 결재 작성 폼 패딩 조정 */
  .max-w-4xl.mx-auto { padding: 0; }
  /* 카드 내부 min-width 제거 */
  .card .table-wrap table { min-width: 0; }
  /* 검색바 너비 제한 */
  #driveSearchInput, #orgSearch { width: 100% !important; }
}

/* ==========================================
   PWA 하단 네비 여백 (iOS 홈 인디케이터)
   ========================================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .content {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  @media (max-width: 768px) {
    .content {
      padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
  }
}

/* ==========================================
   글래스모피즘 전역 강화 (2026-02)
   ========================================== */

/* 헤더 글래스 강화 */
.header {
  background: var(--glass-bg, var(--header-bg)) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--glass-border, var(--header-border)) !important;
}

/* 검색박스 배경 글래스 */
.global-search-box {
  background: var(--glass-bg, rgba(255,255,255,0.9)) !important;
  border: 1px solid var(--glass-border, rgba(255,255,255,0.5)) !important;
}
.global-search-input-wrap {
  background: transparent;
}
.global-search-input-wrap input {
  background: transparent !important;
  color: var(--text-primary, #111827) !important;
}

/* 사이드바 활성 아이템 글래스 효과 */
.nav-item.active {
  background: var(--sidebar-active);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

/* ==========================================
   모바일 오버플로우 완전 차단 (2026-02 강화판)
   ========================================== */

/* 모든 레이아웃 요소가 화면을 넘어가지 않도록 */
.content, .main-area {
  overflow-x: hidden;
  min-width: 0;
}

/* 플렉스/그리드 자식이 넘치지 않도록 */
.content > div,
.content > section,
.content > article {
  min-width: 0;
  max-width: 100%;
}

/* 칸반보드 가로스크롤 컨테이너는 명시적으로 허용 */
.overflow-x-auto {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

/* 테이블 wrapper는 스크롤 허용 */
.table-wrap {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  /* 모든 grid가 모바일에서 최대 2열로 제한 */
  .grid-cols-3:not(.force-cols-3),
  .grid-cols-4:not(.force-cols-4),
  .grid-cols-5:not(.force-cols-5),
  .grid-cols-6:not(.force-cols-6) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* 모달 내부 컨텐츠 wrap */
  .modal > * { min-width: 0; }

  /* 텍스트가 넘치는 경우 ellipsis 처리 */
  .truncate-mobile {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 카드 내 flex가 넘치지 않도록 */
  .card { overflow: hidden; }
  /* changelog 타임라인 카드는 overflow hidden 제외 — 항목이 잘리지 않도록 */
  .card:has(.version-timeline) { overflow: visible; }

  /* 승인 흐름 가로 스크롤 허용 */
  .approval-flow {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
  }

  /* 태블릿/모바일에서 폼 그리드 단일 열 */
  .grid.grid-cols-2 { grid-template-columns: 1fr !important; }
  .grid.grid-cols-3 { grid-template-columns: 1fr !important; }
  
  /* 단, 통계 카드 2열 유지 */
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 480px) {
  /* 초소형 화면에서 grid 1열로 */
  .grid-cols-2:not(.keep-2col),
  [class*="grid-cols-"] { grid-template-columns: 1fr !important; }

  /* 단, 대시보드 stats 2열 유지 */
  .grid.grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  /* 버튼 행 wrap */
  .flex.gap-2, .flex.gap-3 { flex-wrap: wrap; }
}

/* ==========================================
   테마 적용 누락 컴포넌트 보완 (2026-02)
   ========================================== */

/* 결재 흐름 원형 글래스 */
.approval-step-circle {
  background: var(--card-bg, #fff) !important;
  border-color: var(--card-border, #E5E7EB) !important;
  color: var(--text-primary, #111827) !important;
}

/* 채널 탭 배경 테마 */
.comm-channel-tabs-wrap {
  background: var(--card-bg, #fff) !important;
  border-bottom-color: var(--card-border, #f0f0f0) !important;
}
.comm-channel-tab { color: var(--text-muted, #6B7280) !important; }

/* 검색 결과 아이템 배경 */
.gs-result-item { background: transparent; }
.gs-result-item:hover { background: var(--table-row-hover, #F9FAFB) !important; }
.gs-result-title { color: var(--text-primary, #111827) !important; }

/* 메일 상세 메타 배경 */
.mail-detail-meta { background: var(--table-header-bg, #F9FAFB) !important; }

/* 메뉴 에디터 라벨 */
.menu-editor-label { color: var(--text-primary, #111827) !important; }

/* 드라이브 그리드/리스트 행 */
.drive-item-row:hover { background: var(--table-row-hover, #F9FAFB) !important; }

/* 조직도 노드 헤더 */
.org-node-header { color: var(--text-primary, #111827) !important; }
.org-member { color: var(--text-secondary, #374151) !important; }

/* ==========================================
   Community writer 테마
   ========================================== */
.community-writer-overlay,
.community-writer-sheet,
.community-writer-header,
.community-writer-footer {
  background: var(--card-bg, #fff) !important;
}
.community-writer-close {
  background: var(--primary-surface, #f3f4f6) !important;
  color: var(--text-secondary, #374151) !important;
}
.community-writer-title { color: var(--text-primary, #111827) !important; }

/* ==========================================
   임시저장 (DraftManager) 관련 스타일
   ========================================== */
/* 자동저장 상태 표시줄 */
.draft-status-bar {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.draft-status-bar .draft-save-btn {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--input-border);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.draft-status-bar .draft-save-btn:hover {
  background: var(--primary-surface);
  border-color: var(--primary);
  color: var(--primary);
}
/* 복원 배너 애니메이션 */
#draftRestoreBanner {
  animation: draftBannerIn 0.25s ease;
}
@keyframes draftBannerIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════════
   임시저장 목록 모달
════════════════════════════════════════════════ */
.draft-list-modal {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  width: min(480px, 92vw);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  overflow: hidden;
  animation: draftModalIn 0.2s ease;
}
@keyframes draftModalIn {
  from { opacity:0; transform:scale(0.95) translateY(8px); }
  to   { opacity:1; transform:scale(1)    translateY(0);   }
}
.draft-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}
.draft-list-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
}
.draft-list-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--primary-surface, #f3f4f6);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.draft-list-close:hover {
  background: var(--primary);
  color: #fff;
}
.draft-list-body {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}
.draft-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.draft-list-empty i {
  font-size: 32px;
  opacity: 0.4;
}
.draft-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.12s;
}
.draft-list-item:last-child { border-bottom: none; }
.draft-list-item:hover { background: var(--primary-surface, #fff8f0); }
.draft-list-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.draft-list-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.draft-list-item-time {
  font-size: 11px;
  color: var(--text-muted);
}
.draft-list-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.draft-list-load-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: var(--primary-surface);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.draft-list-load-btn:hover {
  background: var(--primary);
  color: #fff;
}
.draft-list-del-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.draft-list-del-btn:hover {
  background: var(--badge-danger-bg, #fee2e2);
  color: var(--badge-danger-text, #991b1b);
  border-color: var(--badge-danger-text, #991b1b);
}
/* 임시저장 버튼 (저장 건수 뱃지 포함) */
.btn-draft {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-draft .draft-count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* ==========================================
   다크 테마 Tailwind 클래스 오버라이드
   bg-gray-50, bg-gray-100, bg-white 등 하드코딩된 배경색을
   다크 테마에서 테마 변수로 교체
   ========================================== */
[data-theme="dark"] .bg-gray-50,
[data-theme="dark"] .bg-gray-100,
[data-theme="dark"] .hover\:bg-gray-50:not(:hover),
[data-theme="dark"] .border-gray-100 {
  background-color: var(--body-bg, #0f172a) !important;
  border-color: var(--card-border, #334155) !important;
}
[data-theme="dark"] .bg-white {
  background-color: var(--card-bg, #1e293b) !important;
}
[data-theme="dark"] .text-gray-400,
[data-theme="dark"] .text-gray-500 {
  color: var(--text-muted, #94a3b8) !important;
}
[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-800 {
  color: var(--text-secondary, #cbd5e1) !important;
}
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-black {
  color: var(--text-primary, #f1f5f9) !important;
}
[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-300 {
  border-color: var(--card-border, #334155) !important;
}
/* 카드 내부 구분선 */
[data-theme="dark"] .border-b,
[data-theme="dark"] .border-t {
  border-color: var(--card-border, #334155);
}
/* 다크 테마에서 amber 계열 (과거문서 배지) 가독성 */
[data-theme="dark"] .text-amber-600 { color: #fbbf24 !important; }
[data-theme="dark"] .bg-amber-50 { background-color: rgba(251,191,36,0.15) !important; }

/* ==========================================
   Moncher Warm Preview — 파일럿 UI 적용 패스
   기존 테마와 동작을 보존하기 위해 pilot theme에서만 작동한다.
   ========================================== */
html[data-theme="moncher-warm-preview"] body {
  background-color: var(--surface-canvas);
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .content {
  background: linear-gradient(180deg, var(--surface-canvas) 0%, #F3F6FA 100%);
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .header {
  background: var(--topbar-bg);
  border-bottom-color: var(--topbar-border);
  box-shadow: 0 1px 0 rgba(15,23,42,0.04), 0 10px 26px rgba(15,23,42,0.06);
}

[data-theme="moncher-warm-preview"] .sidebar {
  background: linear-gradient(180deg, #111827 0%, #0B1220 100%);
  color: var(--nav-text);
  box-shadow: 8px 0 28px rgba(15,23,42,0.16);
}

[data-theme="moncher-warm-preview"] .sidebar .border-white\/10 {
  border-color: rgba(255,255,255,0.08) !important;
}

[data-theme="moncher-warm-preview"] .nav-item {
  color: var(--nav-text);
  border: 1px solid transparent;
}

[data-theme="moncher-warm-preview"] .nav-item:hover {
  background: var(--nav-hover);
  color: #FFFFFF;
  border-color: rgba(255,255,255,0.08);
}

[data-theme="moncher-warm-preview"] .nav-item.active {
  background: linear-gradient(135deg, var(--nav-active-bg), #F59A38);
  color: var(--nav-active-text);
  box-shadow: 0 8px 18px rgba(217,108,0,0.26);
}

[data-theme="moncher-warm-preview"] .bg-white {
  background-color: var(--surface-card) !important;
}

[data-theme="moncher-warm-preview"] .bg-gray-50,
[data-theme="moncher-warm-preview"] .bg-gray-100 {
  background-color: var(--surface-panel) !important;
}

[data-theme="moncher-warm-preview"] .hover\:bg-gray-50:hover,
[data-theme="moncher-warm-preview"] .hover\:bg-gray-100:hover,
[data-theme="moncher-warm-preview"] .hover\:bg-gray-200:hover {
  background-color: var(--surface-hover) !important;
}

[data-theme="moncher-warm-preview"] .text-gray-400,
[data-theme="moncher-warm-preview"] .text-gray-500 {
  color: var(--text-disabled) !important;
}

[data-theme="moncher-warm-preview"] .text-gray-600,
[data-theme="moncher-warm-preview"] .text-gray-700,
[data-theme="moncher-warm-preview"] .text-gray-800 {
  color: var(--text-sub) !important;
}

[data-theme="moncher-warm-preview"] .text-gray-900,
[data-theme="moncher-warm-preview"] .text-black {
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] .hover\:text-gray-600:hover,
[data-theme="moncher-warm-preview"] .hover\:text-gray-700:hover {
  color: var(--primary) !important;
}

[data-theme="moncher-warm-preview"] .border-gray-100,
[data-theme="moncher-warm-preview"] .border-gray-200,
[data-theme="moncher-warm-preview"] .border-gray-300,
[data-theme="moncher-warm-preview"] .border-b,
[data-theme="moncher-warm-preview"] .border-t,
[data-theme="moncher-warm-preview"] .border {
  border-color: var(--border) !important;
}

[data-theme="moncher-warm-preview"] .shadow,
[data-theme="moncher-warm-preview"] .shadow-md {
  box-shadow: var(--shadow-sm) !important;
}

[data-theme="moncher-warm-preview"] .shadow-lg,
[data-theme="moncher-warm-preview"] .shadow-xl,
[data-theme="moncher-warm-preview"] .shadow-2xl {
  box-shadow: var(--shadow-popover) !important;
}

[data-theme="moncher-warm-preview"] .card,
[data-theme="moncher-warm-preview"] .approval-layout,
[data-theme="moncher-warm-preview"] .approval-home-section,
[data-theme="moncher-warm-preview"] .approval-dash-card,
[data-theme="moncher-warm-preview"] .community-sidebar,
[data-theme="moncher-warm-preview"] .community-right-card,
[data-theme="moncher-warm-preview"] .local-draft-card,
[data-theme="moncher-warm-preview"] .version-item {
  background: var(--surface-card);
  border-color: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

[data-theme="moncher-warm-preview"] .card-title,
[data-theme="moncher-warm-preview"] .modal-title,
[data-theme="moncher-warm-preview"] .room-list-title h2,
[data-theme="moncher-warm-preview"] .chat-header-name,
[data-theme="moncher-warm-preview"] .approval-dash-value {
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .card:hover,
[data-theme="moncher-warm-preview"] .approval-dash-card:hover,
[data-theme="moncher-warm-preview"] .local-draft-card:hover,
[data-theme="moncher-warm-preview"] .version-item:hover {
  border-color: rgba(var(--primary-rgb),0.35);
  box-shadow: var(--shadow-md);
}

[data-theme="moncher-warm-preview"] .btn {
  border-radius: var(--radius-md);
  font-weight: 650;
  transition: background-color var(--motion-base) var(--ease-standard),
              border-color var(--motion-base) var(--ease-standard),
              color var(--motion-base) var(--ease-standard),
              box-shadow var(--motion-base) var(--ease-standard),
              transform var(--motion-fast) var(--ease-standard);
}

[data-theme="moncher-warm-preview"] .btn-primary,
[data-theme="moncher-warm-preview"] .chat-send-btn,
[data-theme="moncher-warm-preview"] .ms-thread-send-btn {
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  box-shadow: 0 8px 18px rgba(var(--primary-rgb),0.18);
}

[data-theme="moncher-warm-preview"] .btn-primary:hover,
[data-theme="moncher-warm-preview"] .chat-send-btn:hover:not(:disabled),
[data-theme="moncher-warm-preview"] .ms-thread-send-btn:hover {
  background: var(--button-primary-hover);
  box-shadow: 0 10px 22px rgba(var(--primary-rgb),0.22);
}

[data-theme="moncher-warm-preview"] .btn-outline,
[data-theme="moncher-warm-preview"] .btn:not(.btn-primary):not(.btn-danger):not(.btn-success) {
  background: var(--button-secondary-bg);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .btn-outline:hover,
[data-theme="moncher-warm-preview"] .btn:not(.btn-primary):not(.btn-danger):not(.btn-success):hover {
  background: var(--button-secondary-hover);
  border-color: rgba(var(--primary-rgb),0.45);
  color: var(--primary);
}

[data-theme="moncher-warm-preview"] .btn-danger {
  background: var(--button-danger-bg);
  color: #FFFFFF;
}

[data-theme="moncher-warm-preview"] .btn-danger:hover {
  background: var(--button-danger-hover);
}

[data-theme="moncher-warm-preview"] .form-label,
[data-theme="moncher-warm-preview"] label {
  color: var(--text-sub);
}

[data-theme="moncher-warm-preview"] .form-input,
[data-theme="moncher-warm-preview"] input[type="text"],
[data-theme="moncher-warm-preview"] input[type="email"],
[data-theme="moncher-warm-preview"] input[type="password"],
[data-theme="moncher-warm-preview"] input[type="search"],
[data-theme="moncher-warm-preview"] input[type="tel"],
[data-theme="moncher-warm-preview"] input[type="url"],
[data-theme="moncher-warm-preview"] input[type="number"],
[data-theme="moncher-warm-preview"] input[type="date"],
[data-theme="moncher-warm-preview"] input[type="time"],
[data-theme="moncher-warm-preview"] input[type="datetime-local"],
[data-theme="moncher-warm-preview"] textarea,
[data-theme="moncher-warm-preview"] select {
  background-color: var(--input-bg);
  border-color: var(--input-border);
  color: var(--input-text);
  border-radius: var(--radius-md);
}

[data-theme="moncher-warm-preview"] .form-input:focus,
[data-theme="moncher-warm-preview"] input:focus,
[data-theme="moncher-warm-preview"] textarea:focus,
[data-theme="moncher-warm-preview"] select:focus {
  border-color: var(--input-focus-border);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

[data-theme="moncher-warm-preview"] th,
[data-theme="moncher-warm-preview"] .approval-home-table th {
  background: var(--table-header-bg);
  color: var(--table-header-text);
  border-bottom-color: var(--table-border);
}

[data-theme="moncher-warm-preview"] td,
[data-theme="moncher-warm-preview"] .approval-home-table td {
  color: var(--text-main);
  border-bottom-color: var(--border-subtle);
}

[data-theme="moncher-warm-preview"] tr:hover td,
[data-theme="moncher-warm-preview"] .approval-home-table tr:hover td {
  background: var(--surface-hover);
}

[data-theme="moncher-warm-preview"] .modal-overlay {
  background: var(--overlay);
}

[data-theme="moncher-warm-preview"] .modal,
[data-theme="moncher-warm-preview"] .community-writer-sheet,
[data-theme="moncher-warm-preview"] #aiPanel,
[data-theme="moncher-warm-preview"] #manualPanel {
  background: var(--modal-surface) !important;
  border-color: var(--modal-border) !important;
  box-shadow: var(--modal-shadow);
}

[data-theme="moncher-warm-preview"] .modal-header,
[data-theme="moncher-warm-preview"] .community-writer-header,
[data-theme="moncher-warm-preview"] .community-writer-footer,
[data-theme="moncher-warm-preview"] #aiPanel .ai-header,
[data-theme="moncher-warm-preview"] #aiPanel .ai-footer {
  border-color: var(--border);
  background: var(--surface-card);
}

[data-theme="moncher-warm-preview"] .community-writer-close,
[data-theme="moncher-warm-preview"] .chat-back-btn,
[data-theme="moncher-warm-preview"] .chat-header-actions button,
[data-theme="moncher-warm-preview"] .room-list-actions button,
[data-theme="moncher-warm-preview"] .chat-input-actions button,
[data-theme="moncher-warm-preview"] .ms-thread-close {
  background: transparent;
  color: var(--text-sub);
}

[data-theme="moncher-warm-preview"] .community-writer-close:hover,
[data-theme="moncher-warm-preview"] .chat-back-btn:hover,
[data-theme="moncher-warm-preview"] .chat-header-actions button:hover,
[data-theme="moncher-warm-preview"] .room-list-actions button:hover,
[data-theme="moncher-warm-preview"] .chat-input-actions button:hover,
[data-theme="moncher-warm-preview"] .ms-thread-close:hover {
  background: var(--topbar-icon-hover);
  color: var(--primary);
}

[data-theme="moncher-warm-preview"] #langMenu,
[data-theme="moncher-warm-preview"] #notifDropdown,
[data-theme="moncher-warm-preview"] .ms-reaction-picker {
  background: var(--dropdown-bg) !important;
  border-color: var(--dropdown-border) !important;
  box-shadow: var(--dropdown-shadow) !important;
}

[data-theme="moncher-warm-preview"] .badge,
[data-theme="moncher-warm-preview"] .status-draft,
[data-theme="moncher-warm-preview"] .status-pending,
[data-theme="moncher-warm-preview"] .status-in_progress,
[data-theme="moncher-warm-preview"] .status-approved,
[data-theme="moncher-warm-preview"] .status-rejected,
[data-theme="moncher-warm-preview"] .status-canceled {
  border-radius: var(--radius-full);
}

[data-theme="moncher-warm-preview"] .messenger-container,
[data-theme="moncher-warm-preview"] .chat-view-panel,
[data-theme="moncher-warm-preview"] .chat-messages,
[data-theme="moncher-warm-preview"] .chat-empty-state {
  background: var(--chat-bg);
}

[data-theme="moncher-warm-preview"] .room-list-panel,
[data-theme="moncher-warm-preview"] .room-list-header,
[data-theme="moncher-warm-preview"] .chat-header,
[data-theme="moncher-warm-preview"] .chat-input-wrap,
[data-theme="moncher-warm-preview"] .ms-thread-panel,
[data-theme="moncher-warm-preview"] .ms-thread-header,
[data-theme="moncher-warm-preview"] .ms-thread-input-wrap {
  background: var(--chat-panel-bg);
  border-color: var(--border);
}

[data-theme="moncher-warm-preview"] .room-search-wrap input,
[data-theme="moncher-warm-preview"] .chat-input-container,
[data-theme="moncher-warm-preview"] .ms-thread-input {
  background: #F8FAFC;
  border-color: var(--border-strong);
}

[data-theme="moncher-warm-preview"] .room-item:hover,
[data-theme="moncher-warm-preview"] .ms-room-item:hover,
[data-theme="moncher-warm-preview"] .ms-section-header:hover {
  background: var(--surface-hover);
}

[data-theme="moncher-warm-preview"] .room-item.active,
[data-theme="moncher-warm-preview"] .ms-room-item.active {
  background: var(--surface-selected);
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .message-bubble,
[data-theme="moncher-warm-preview"] .typing-indicator {
  background: var(--chat-bubble-in);
  color: var(--text-main);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

[data-theme="moncher-warm-preview"] .message-group.own .message-bubble {
  background: var(--chat-bubble-out);
  border-color: transparent;
  color: var(--chat-bubble-out-text);
  box-shadow: 0 8px 18px rgba(var(--primary-rgb),0.18);
}

[data-theme="moncher-warm-preview"] .message-bubble.message-bubble-image,
[data-theme="moncher-warm-preview"] .message-group.own .message-bubble.message-bubble-image {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

[data-theme="moncher-warm-preview"] .chat-date-divider span {
  background: rgba(15,23,42,0.07);
  color: var(--text-sub);
}

[data-theme="moncher-warm-preview"] .reply-quote {
  background: var(--reply-quote-bg) !important;
  border-left-color: var(--reply-quote-border) !important;
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] .message-group.own .reply-quote {
  background: rgba(255,255,255,0.18) !important;
  color: #FFFFFF !important;
  border-left-color: rgba(255,255,255,0.62) !important;
}

[data-theme="moncher-warm-preview"] .community-layout,
[data-theme="moncher-warm-preview"] .approval-main,
[data-theme="moncher-warm-preview"] .approval-home-layout,
[data-theme="moncher-warm-preview"] .approval-list-layout {
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .community-sidebar-header,
[data-theme="moncher-warm-preview"] .community-top-tabs,
[data-theme="moncher-warm-preview"] .comm-channel-tabs-wrap,
[data-theme="moncher-warm-preview"] .approval-sidebar,
[data-theme="moncher-warm-preview"] .approval-sidebar-header,
[data-theme="moncher-warm-preview"] .approval-sidebar-section,
[data-theme="moncher-warm-preview"] .approval-home-section-header {
  border-color: var(--border);
  background: var(--surface-card);
}

[data-theme="moncher-warm-preview"] .community-sidebar-item:hover,
[data-theme="moncher-warm-preview"] .community-rank-item:hover,
[data-theme="moncher-warm-preview"] .approval-sidebar-item:hover {
  background: var(--surface-hover);
}

[data-theme="moncher-warm-preview"] .community-sidebar-item.active,
[data-theme="moncher-warm-preview"] .approval-sidebar-item.active,
[data-theme="moncher-warm-preview"] .comm-channel-tab--active {
  background: var(--surface-selected);
  color: var(--primary);
  border-color: var(--primary);
}

[data-theme="moncher-warm-preview"] .approval-sidebar-section-title,
[data-theme="moncher-warm-preview"] .approval-sidebar-subsection,
[data-theme="moncher-warm-preview"] .community-sidebar-section-title {
  color: var(--text-sub);
}

[data-theme="moncher-warm-preview"] .approval-home-pending-meta,
[data-theme="moncher-warm-preview"] .file-upload-progress {
  background: var(--surface-panel);
  border: 1px solid var(--border);
}

[data-theme="moncher-warm-preview"] .file-msg-wrap,
[data-theme="moncher-warm-preview"] .ms-reaction-badge {
  background: var(--surface-card);
  border-color: var(--border);
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .file-msg-wrap:hover,
[data-theme="moncher-warm-preview"] .ms-reaction-badge:hover,
[data-theme="moncher-warm-preview"] .ms-reaction-badge.mine {
  background: var(--surface-hover);
  border-color: rgba(var(--primary-rgb),0.45);
}

[data-theme="moncher-warm-preview"] #aiPanel .ai-bubble.assistant {
  background: var(--surface-panel);
  color: var(--text-main);
  border: 1px solid var(--border);
}

@media (hover: hover) and (pointer: fine) {
  [data-theme="moncher-warm-preview"] .card:hover,
  [data-theme="moncher-warm-preview"] .approval-dash-card:hover,
  [data-theme="moncher-warm-preview"] .local-draft-card:hover,
  [data-theme="moncher-warm-preview"] .version-item:hover {
    transform: translateY(-1px);
  }

  [data-theme="moncher-warm-preview"] .btn:hover,
  [data-theme="moncher-warm-preview"] .chat-header-actions button:hover,
  [data-theme="moncher-warm-preview"] .room-list-actions button:hover {
    transform: translateY(-1px);
  }
}

/* ==========================================
   Appearance personalization v3.83.36
   사용자 브라우저 저장 기반의 개인 화면 설정. 기능 이벤트/라우터/데이터 흐름은 건드리지 않는다.
   ========================================== */
html[data-theme] {
  --appearance-ui-font-size: 14px;
}

html[data-theme] body {
  font-size: var(--appearance-ui-font-size);
}

.settings-page-shell {
  display: grid;
  grid-template-columns: minmax(196px, 240px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.settings-section-nav {
  position: sticky;
  top: 76px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--theme-card-bg);
  box-shadow: var(--shadow-sm);
}

.settings-tab-list {
  display: grid;
  gap: 6px;
}

.settings-tab-button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-sub);
  text-align: left;
  transition: background var(--motion-fast) var(--ease-standard), border-color var(--motion-fast) var(--ease-standard), color var(--motion-fast) var(--ease-standard), transform var(--motion-fast) var(--ease-standard);
}

.settings-tab-button i {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--surface-hover);
  color: var(--primary);
}

.settings-tab-button strong,
.settings-tab-button small {
  display: block;
  min-width: 0;
}

.settings-tab-button strong {
  color: var(--text-main);
  font-size: 14px;
}

.settings-tab-button small {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-tab-button:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--primary-rgb),0.18);
  transform: translateY(-1px);
}

.settings-tab-button.active {
  background: var(--surface-selected);
  border-color: rgba(var(--primary-rgb),0.36);
  color: var(--primary);
  box-shadow: 0 8px 22px rgba(var(--primary-rgb),0.12);
}

.settings-tab-button.active i {
  background: var(--primary);
  color: var(--button-primary-text, var(--text-inverse));
}

.settings-section-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.settings-section {
  display: none;
}

.settings-section.settings-section-active {
  display: block;
}

.settings-mobile-label,
.settings-mobile-select {
  display: none;
}

html[data-sidebar-glass="on"] .sidebar {
  background:
    linear-gradient(180deg, rgba(var(--primary-rgb),0.18), rgba(2,6,23,0.18)),
    var(--theme-sidebar-bg) !important;
  border-right: 1px solid rgba(255,255,255,0.13);
  backdrop-filter: saturate(1.18) blur(20px);
  -webkit-backdrop-filter: saturate(1.18) blur(20px);
}

html[data-ui-density="compact"] .card,
html[data-ui-density="compact"] .dash-widget,
html[data-ui-density="compact"] .approval-home-section,
html[data-ui-density="compact"] .community-right-card,
html[data-ui-density="compact"] .version-item,
html[data-ui-density="compact"] .admin-card {
  border-radius: var(--radius-md) !important;
}

html[data-ui-density="compact"] .btn {
  min-height: 34px;
  padding-top: 7px;
  padding-bottom: 7px;
}

html[data-ui-density="compact"] .form-input,
html[data-ui-density="compact"] select,
html[data-ui-density="compact"] textarea {
  min-height: 36px;
}

html[data-motion="reduced"],
html[data-motion="reduced"] * {
  scroll-behavior: auto !important;
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  transition-duration: 1ms !important;
  animation-duration: 1ms !important;
}

/* ==========================================
   Messenger multi-window desktop layer v3.83.38
   ========================================== */
.ms-room-float-btn,
.ms-room-popout-btn {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0;
  transition: background .16s ease, color .16s ease, opacity .16s ease;
}

.ms-room-item:hover .ms-room-float-btn,
.ms-room-item:focus-within .ms-room-float-btn,
.ms-room-item:hover .ms-room-popout-btn,
.ms-room-item:focus-within .ms-room-popout-btn {
  opacity: 1;
}

.ms-room-float-btn:hover,
.ms-room-popout-btn:hover {
  background: var(--primary-surface, rgba(var(--primary-rgb), .12));
  color: var(--primary);
}

.messenger-floating-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9300;
}

.messenger-floating-window {
  position: fixed;
  min-width: 320px;
  min-height: 390px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 84px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  border: 1px solid rgba(var(--primary-rgb), .22);
  border-radius: 14px;
  background: var(--card-bg);
  background: color-mix(in srgb, var(--card-bg) 94%, transparent);
  color: var(--text-primary);
  box-shadow: 0 22px 58px rgba(15, 23, 42, .24);
  backdrop-filter: saturate(1.1) blur(18px);
  -webkit-backdrop-filter: saturate(1.1) blur(18px);
}

.messenger-floating-window.active {
  border-color: rgba(var(--primary-rgb), .56);
  box-shadow: 0 26px 70px rgba(15, 23, 42, .32), 0 0 0 1px rgba(var(--primary-rgb), .12);
}

.mf-window-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border-bottom: 1px solid var(--card-border);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .13), rgba(var(--primary-rgb), .04));
  cursor: move;
  user-select: none;
}

.mf-window-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
}

.mf-window-title > span:not(.mf-room-avatar):not(.mf-unread-badge) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mf-room-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-contrast, #fff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
}

.mf-room-avatar-group {
  background: var(--primary-surface, rgba(var(--primary-rgb), .15));
  color: var(--primary);
}

.mf-window-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mf-window-actions button,
.mf-icon-btn,
.mf-send-btn {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mf-window-actions button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
}

.mf-window-actions button:hover,
.mf-icon-btn:hover {
  background: var(--primary-surface, rgba(var(--primary-rgb), .12));
  color: var(--primary);
}

.mf-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px 12px;
  background: var(--body-bg);
  background: color-mix(in srgb, var(--body-bg) 80%, var(--card-bg));
}

.mf-messages::-webkit-scrollbar,
.messenger-window-dock::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.mf-messages::-webkit-scrollbar-thumb,
.messenger-window-dock::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), .26);
  border-radius: 999px;
}

.mf-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.mf-empty i {
  font-size: 24px;
  color: var(--primary);
}

.mf-empty.error i {
  color: var(--error);
}

.mf-date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 12px;
}

.mf-date-divider span {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--card-bg);
  background: color-mix(in srgb, var(--card-bg) 82%, var(--primary-surface));
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 11px;
}

.mf-message {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin: 5px 0;
}

.mf-message.own {
  flex-direction: row-reverse;
}

.mf-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-contrast, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 800;
}

.mf-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mf-avatar.invisible {
  visibility: hidden;
}

.mf-message-main {
  min-width: 0;
  max-width: min(88%, 760px);
}

.mf-message.own .mf-message-main {
  align-items: flex-end;
}

.mf-sender {
  margin: 0 4px 3px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

.mf-bubble-wrap {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  position: relative;
}

.mf-message.own .mf-bubble-wrap {
  flex-direction: row-reverse;
}

.mf-bubble {
  max-width: 100%;
  padding: 8px 11px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.mf-message.own .mf-bubble {
  border-color: rgba(var(--primary-rgb), .18);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
  background: var(--primary);
  color: var(--primary-contrast, #fff);
}

.mf-time {
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
  margin-bottom: 2px;
}

.mf-reply {
  display: grid;
  gap: 2px;
  margin-bottom: 7px;
  padding: 6px 8px;
  border-left: 3px solid rgba(var(--primary-rgb), .7);
  border-radius: 8px;
  background: var(--body-bg);
  background: color-mix(in srgb, var(--body-bg) 76%, var(--card-bg));
  cursor: pointer;
}

.mf-message.own .mf-reply {
  background: rgba(255, 255, 255, .16);
  border-left-color: rgba(255, 255, 255, .72);
}

.mf-reply strong {
  font-size: 11px;
  color: inherit;
}

.mf-reply span {
  font-size: 12px;
  opacity: .82;
  max-height: 34px;
  overflow: hidden;
}

.mf-image,
.mf-file {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
  max-width: 100%;
}

.mf-image img {
  width: min(220px, 100%);
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.mf-file {
  min-width: 190px;
}

.mf-file i {
  color: var(--primary);
  font-size: 22px;
  flex-shrink: 0;
}

.mf-file span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.mf-file small {
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
}

.mf-message.own .mf-file i,
.mf-message.own .mf-file small {
  color: rgba(255, 255, 255, .82);
}

.mf-uploading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mf-uploading strong {
  font-size: 11px;
}

.mf-system-message {
  margin: 10px auto;
  color: var(--text-muted);
  font-size: 11px;
  text-align: center;
}

.mf-hover-menu {
  display: flex;
  flex-direction: row;
  gap: 2px;
  align-items: center;
  position: absolute;
  bottom: calc(100% - 2px);
  margin-bottom: 0;
  padding: 3px 5px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--card-bg);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  transform: translateY(2px);
  white-space: nowrap;
  max-width: min(340px, calc(100vw - 64px));
  overflow-x: auto;
  z-index: 20;
}

.mf-message.own .mf-hover-menu {
  right: 0;
}

.mf-message:not(.own) .mf-hover-menu {
  left: 0;
}

.mf-message:hover .mf-hover-menu,
.mf-message:focus-within .mf-hover-menu,
.mf-message.is-hovered .mf-hover-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.mf-reactions-wrap {
  margin-top: 3px;
  justify-content: flex-start;
}

.mf-message.own .mf-reactions-wrap {
  justify-content: flex-end;
}

.mf-reply-preview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 7px 8px;
  border-left: 3px solid var(--primary);
  border-radius: 9px;
  background: var(--primary-surface);
  color: var(--text-primary);
}

.mf-reply-preview > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mf-reply-preview strong {
  font-size: 11px;
  color: var(--primary);
}

.mf-reply-preview span {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mf-reply-preview button {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mf-input-wrap {
  padding: 10px;
  border-top: 1px solid var(--card-border);
  background: var(--card-bg);
}

.mf-input-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 6px 7px;
  border: 1px solid var(--input-border);
  border-radius: 14px;
  background: var(--input-bg, var(--body-bg));
}

.mf-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  flex-shrink: 0;
}

.mf-input {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  max-height: 96px;
  padding: 7px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--input-text, var(--text-primary));
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.mf-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-contrast, #fff);
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(var(--primary-rgb), .24);
}

.mf-send-btn:hover {
  filter: brightness(1.04);
}

.mf-unread-badge,
.mf-dock-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--error, #ef4444);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
}

.messenger-window-dock {
  position: fixed;
  right: 18px;
  bottom: 16px;
  max-width: calc(100vw - 36px);
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--card-bg);
  background: color-mix(in srgb, var(--card-bg) 92%, transparent);
  box-shadow: 0 14px 38px rgba(15, 23, 42, .22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9400;
}

.messenger-window-dock.visible {
  display: flex;
}

.mf-dock-item {
  min-width: 118px;
  max-width: 190px;
  height: 36px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--body-bg);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.mf-dock-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 12px;
}

.mf-dock-item.active {
  border-color: rgba(var(--primary-rgb), .42);
  background: var(--primary-surface, rgba(var(--primary-rgb), .12));
  color: var(--primary);
}

.mf-dock-item.minimized {
  border-style: dashed;
}

.mf-highlight {
  animation: mfPulse 1.4s ease;
}

@keyframes mfPulse {
  0%, 100% { outline: 0 solid transparent; }
  35% { outline: 3px solid rgba(var(--primary-rgb), .32); }
}

@media (max-width: 768px) {
  .messenger-floating-layer,
  .messenger-window-dock,
  .ms-room-float-btn,
  .ms-room-popout-btn {
    display: none !important;
  }
}

body.messenger-popout-mode {
  overflow: hidden;
}

body.messenger-popout-mode .app-layout,
body.messenger-popout-mode .main-area,
body.messenger-popout-mode .content {
  height: 100dvh;
  min-height: 100dvh;
}

body.messenger-popout-mode #sidebar,
body.messenger-popout-mode #appHeader,
body.messenger-popout-mode #sidebarOverlay,
body.messenger-popout-mode .messenger-floating-layer,
body.messenger-popout-mode .messenger-window-dock {
  display: none !important;
}

body.messenger-popout-mode .main-area,
body.messenger-popout-mode .main-area.expanded {
  margin-left: 0 !important;
  padding-top: 0 !important;
}

body.messenger-popout-mode .content {
  padding: 0 !important;
  overflow: hidden;
}

body.messenger-popout-mode .messenger-container,
.messenger-popout-container {
  height: 100dvh;
  min-height: 100dvh;
  border-radius: 0;
  border: 0;
}

body.messenger-popout-mode .chat-view-panel {
  min-height: 100dvh;
}

body.messenger-popout-mode .room-list-panel.hidden-mobile {
  display: none !important;
}

.approval-title-with-popout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.approval-title-with-popout > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.approval-popout-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--card-border, #e5e7eb);
  border-radius: 7px;
  background: var(--card-bg, #fff);
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  font-size: 11px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.approval-popout-btn:hover {
  background: var(--primary-surface, #fff7ed);
  color: var(--primary, #e87400);
  border-color: color-mix(in srgb, var(--primary, #e87400) 38%, var(--card-border, #e5e7eb));
}

body.approval-popout-mode {
  overflow: hidden;
}

body.approval-popout-mode .app-layout,
body.approval-popout-mode .main-area,
body.approval-popout-mode .content {
  height: 100dvh;
  min-height: 100dvh;
}

body.approval-popout-mode #sidebar,
body.approval-popout-mode #appHeader,
body.approval-popout-mode #sidebarOverlay,
body.approval-popout-mode .approval-sidebar {
  display: none !important;
}

body.approval-popout-mode .main-area,
body.approval-popout-mode .main-area.expanded {
  margin-left: 0 !important;
  padding-top: 0 !important;
}

body.approval-popout-mode .content {
  padding: 16px !important;
  overflow: auto;
}

body.approval-popout-mode .approval-layout,
body.approval-popout-mode .approval-main,
body.approval-popout-mode .approval-detail-popout-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

body.board-popout-mode,
body.mail-popout-mode {
  overflow: hidden;
}

body.board-popout-mode .app-layout,
body.board-popout-mode .main-area,
body.board-popout-mode .content,
body.mail-popout-mode .app-layout,
body.mail-popout-mode .main-area,
body.mail-popout-mode .content {
  height: 100dvh;
  min-height: 100dvh;
}

body.board-popout-mode #sidebar,
body.board-popout-mode #appHeader,
body.board-popout-mode #sidebarOverlay,
body.mail-popout-mode #sidebar,
body.mail-popout-mode #appHeader,
body.mail-popout-mode #sidebarOverlay {
  display: none !important;
}

body.board-popout-mode .main-area,
body.board-popout-mode .main-area.expanded,
body.mail-popout-mode .main-area,
body.mail-popout-mode .main-area.expanded {
  margin-left: 0 !important;
  padding-top: 0 !important;
}

body.board-popout-mode .content {
  padding: 16px !important;
  overflow: auto;
}

body.board-popout-mode .board-detail-popout-shell {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
}

body.mail-popout-mode .content {
  padding: 0 !important;
  overflow: hidden;
}

body.mail-popout-mode .mail-layout {
  height: 100dvh;
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.mail-popout-mode .mail-folder-panel,
body.mail-popout-mode .mail-list-panel,
body.mail-popout-mode .mail-resize-handle {
  display: none !important;
}

body.mail-popout-mode .mail-content-pane {
  display: block !important;
  flex: 1 1 100%;
  width: 100% !important;
  max-width: none !important;
  height: 100%;
  overflow: auto;
}

/* ==========================================
   Dark surface + appearance coverage v3.83.37
   다크/Liquid Glass에서 남는 흰 표면과 개인화 미적용 반복 요소를 최종 보정한다.
   ========================================== */
html {
  --density-control-min-height: 38px;
  --density-control-y: 9px;
  --density-control-x: 13px;
  --density-panel-pad: 16px;
  --density-section-pad: 16px;
  --density-list-y: 9px;
  --density-list-x: 12px;
  --density-table-y: 9px;
  --density-table-x: 12px;
  --density-message-y: 9px;
  --density-message-x: 12px;
}

html[data-ui-density="compact"] {
  --density-control-min-height: 34px;
  --density-control-y: 7px;
  --density-control-x: 10px;
  --density-panel-pad: 12px;
  --density-section-pad: 12px;
  --density-list-y: 7px;
  --density-list-x: 10px;
  --density-table-y: 7px;
  --density-table-x: 10px;
  --density-message-y: 7px;
  --density-message-x: 10px;
}

html[data-ui-density="comfortable"] {
  --density-control-min-height: 38px;
  --density-control-y: 9px;
  --density-control-x: 13px;
  --density-panel-pad: 16px;
  --density-section-pad: 16px;
  --density-list-y: 9px;
  --density-list-x: 12px;
  --density-table-y: 9px;
  --density-table-x: 12px;
  --density-message-y: 9px;
  --density-message-x: 12px;
}

body,
.main-area,
.content,
#pageContent,
.modal,
.card,
.dash-widget,
.approval-layout,
.approval-home-layout,
.approval-list-layout,
.mail-layout,
.messenger-container,
.community-page,
.settings-page {
  font-size: var(--appearance-ui-font-size, 14px);
}

.btn,
.form-input,
input,
select,
textarea,
.room-item,
.ms-room-item,
.message-bubble,
.mail-list-item2,
.mail-folder-item,
.mail-detail-body,
.approval-home-table,
.approval-home-pending-meta {
  font-size: var(--appearance-ui-font-size, 14px) !important;
}

.text-xs,
.mail-item2-preview,
.mail-item2-date,
.mail-folder-section-title,
.approval-home-table th {
  font-size: max(11px, calc(var(--appearance-ui-font-size, 14px) - 3px)) !important;
}

.text-sm,
.btn-sm,
.btn-xs,
.mail-toolbar-btn,
.mail-page-btn,
.mail-icon-btn,
.mail-attach-item,
.chat-header-status {
  font-size: max(12px, calc(var(--appearance-ui-font-size, 14px) - 2px)) !important;
}

.mail-detail-subject,
.mail-view-subject,
.chat-header-name,
.room-list-title h2,
.approval-home-header h2 {
  font-size: calc(var(--appearance-ui-font-size, 14px) + 4px) !important;
}

.btn,
.form-input,
input:not([type="radio"]):not([type="checkbox"]),
select,
textarea {
  min-height: var(--density-control-min-height);
}

.btn:not(.btn-xs):not(.btn-sm) {
  padding: var(--density-control-y) var(--density-control-x);
}

.mail-list-item2,
.mail-list-item,
.room-item,
.ms-room-item,
.community-sidebar-item,
.approval-sidebar-item,
.manual-section-header,
.manual-item-header,
.gs-result-item {
  padding-top: var(--density-list-y) !important;
  padding-bottom: var(--density-list-y) !important;
}

.message-bubble {
  padding: var(--density-message-y) var(--density-message-x) !important;
}

.approval-home-table th,
.approval-home-table td,
table th,
table td {
  padding-top: var(--density-table-y) !important;
  padding-bottom: var(--density-table-y) !important;
}

.approval-home-section-header,
.mail-list-panel-header,
.mail-folder-panel-header,
.chat-header,
.room-list-header,
.modal-header,
.community-writer-header {
  padding: var(--density-section-pad) !important;
}

.mail-detail,
.approval-home-pending-card,
.approval-home-no-pending,
.chat-messages,
.room-list,
.ms-thread-panel,
.community-right-card,
.admin-card,
.version-item {
  padding: var(--density-panel-pad) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) {
  color-scheme: dark;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) body,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .main-area,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .content,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) #pageContent {
  background: var(--theme-page-bg, var(--body-bg)) !important;
  color: var(--text-main, var(--text-primary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .bg-white,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .bg-gray-50,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .bg-gray-100,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .hover\:bg-gray-50:hover,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .hover\:bg-gray-100:hover {
  background: var(--theme-card-bg, var(--surface-card, var(--card-bg))) !important;
  color: var(--text-main, var(--text-primary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .text-gray-900,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .text-gray-800,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .text-gray-700 {
  color: var(--text-main, var(--text-primary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .text-gray-600,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .text-gray-500,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .text-gray-400 {
  color: var(--text-muted) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-layout,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-folder-panel,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-list-panel,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-content-pane,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-detail,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-view-inner,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .approval-home-section,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .approval-home-table-wrap {
  background: var(--theme-card-bg, var(--surface-card, var(--card-bg))) !important;
  border-color: var(--border, var(--card-border)) !important;
  color: var(--text-main, var(--text-primary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-list-panel-header,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-folder-panel-header,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-pagination,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-date-group-label,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-detail-meta,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-attachments,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .approval-home-section-header,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .approval-home-pending-meta,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .approval-home-table th,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) table thead,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) table th {
  background: var(--theme-panel-head-bg, var(--surface-panel, var(--table-header-bg))) !important;
  border-color: var(--border, var(--table-border)) !important;
  color: var(--table-header-text, var(--text-sub)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-list-item2,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-list-item2.unread,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-list-item,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .approval-home-table td,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) table td {
  background: transparent !important;
  border-color: var(--border-subtle, var(--table-row-border)) !important;
  color: var(--text-sub, var(--text-secondary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-list-item2:hover,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-list-item:hover,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-folder-item:hover,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-toolbar-btn:hover,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-icon-btn:hover,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-attach-item:hover {
  background: var(--surface-hover, var(--table-row-hover)) !important;
  color: var(--text-main, var(--text-primary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-list-item2.selected,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-list-item.selected,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-list-item2.checked,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-folder-item.active {
  background: var(--surface-selected, var(--primary-surface)) !important;
  border-color: var(--border-strong, var(--primary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-item2-sender,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-item2-subject,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-detail-subject,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-view-subject,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .approval-home-table td strong {
  color: var(--text-main, var(--text-primary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-item2-preview,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-item2-date,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-detail-meta,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-view-meta,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .approval-home-pending-meta {
  color: var(--text-muted) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-toolbar-btn,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-page-btn,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-icon-btn,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-attach-item {
  background: var(--theme-control-bg, var(--button-secondary-bg, var(--surface-panel))) !important;
  border-color: var(--border, var(--card-border)) !important;
  color: var(--text-sub, var(--text-secondary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-detail-body,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-view-body {
  background: var(--body-bg) !important;
  border-color: var(--border-subtle, var(--table-row-border)) !important;
  color: var(--text-main, var(--text-primary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-detail-body iframe,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .mail-view-body iframe {
  background: var(--body-bg) !important;
  border-radius: var(--radius-md, 8px);
  color-scheme: dark;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox-tinymce,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-editor-header,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-toolbar,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-toolbar__primary,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-toolbar-overlord,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-menubar,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-statusbar {
  background: var(--editor-toolbar-bg, var(--tinymce-toolbar-bg)) !important;
  border-color: var(--editor-border, var(--tinymce-border)) !important;
  color: var(--text-sub, var(--text-secondary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-edit-area,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-edit-area__iframe {
  background: #ffffff !important;
  color-scheme: light;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-tbtn,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-mbtn,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-listboxfield .tox-listbox--select {
  color: var(--text-sub, var(--text-secondary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-tbtn svg,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-mbtn svg {
  fill: var(--text-sub, var(--text-secondary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-tbtn:hover,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-mbtn:hover,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-tbtn--enabled {
  background: var(--surface-hover, var(--primary-surface)) !important;
  color: var(--text-main, var(--text-primary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-menu,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-dialog,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-collection__item,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-pop,
:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-pop__dialog {
  background: var(--theme-popover-bg, var(--dropdown-bg)) !important;
  border-color: var(--border, var(--dropdown-border)) !important;
  color: var(--text-main, var(--text-primary)) !important;
}

:is(html[data-theme="dark"], html[data-theme="liquid-glass"]) .tox .tox-collection__item:hover {
  background: var(--dropdown-hover, var(--surface-hover)) !important;
}

/* ==========================================
   User accent final coverage v3.83.36
   강조색을 선택하면 주요 선택/버튼/포커스/업로드/탭 표면까지 같은 색상 체계를 따른다.
   ========================================== */
html[data-user-accent="on"] .btn-primary,
html[data-user-accent="on"] button.btn-primary {
  background: var(--button-primary-bg) !important;
  border-color: var(--button-primary-bg) !important;
  color: var(--button-primary-text) !important;
}

html[data-user-accent="on"] .btn-primary:hover,
html[data-user-accent="on"] button.btn-primary:hover {
  background: var(--button-primary-hover) !important;
  border-color: var(--button-primary-hover) !important;
}

html[data-user-accent="on"] .nav-item.active,
html[data-user-accent="on"] .sidebar .nav-item.active {
  background: var(--nav-active-bg) !important;
  color: var(--nav-active-text) !important;
}

html[data-user-accent="on"] .nav-item.active i,
html[data-user-accent="on"] .sidebar .nav-item.active i {
  color: var(--nav-active-text) !important;
}

html[data-user-accent="on"] .board-sidebar-badge,
html[data-user-accent="on"] .community-sidebar-badge,
html[data-user-accent="on"] .report-sidebar-badge {
  background: var(--badge-bg) !important;
  color: var(--badge-text) !important;
}

html[data-user-accent="on"] .form-input:focus,
html[data-user-accent="on"] input:focus,
html[data-user-accent="on"] select:focus,
html[data-user-accent="on"] textarea:focus {
  border-color: var(--input-focus-border) !important;
  box-shadow: 0 0 0 3px var(--focus-ring) !important;
}

html[data-user-accent="on"] .settings-tab-button.active,
html[data-user-accent="on"] .room-item.active,
html[data-user-accent="on"] .ms-room-item.active,
html[data-user-accent="on"] .community-sidebar-item.active,
html[data-user-accent="on"] .approval-sidebar-item.active,
html[data-user-accent="on"] .comm-channel-tab--active {
  background: var(--surface-selected) !important;
  border-color: rgba(var(--primary-rgb),0.36) !important;
  color: var(--primary) !important;
}

html[data-user-accent="on"] .settings-tab-button.active i {
  background: var(--primary) !important;
  color: var(--button-primary-text) !important;
}

html[data-user-accent="on"] .dropzone,
html[data-user-accent="on"] .file-dropzone,
html[data-user-accent="on"] .upload-zone,
html[data-user-accent="on"] .attachment-dropzone {
  background: var(--dropzone-bg) !important;
  border-color: var(--dropzone-border) !important;
}

html[data-user-accent="on"] .dropzone:hover,
html[data-user-accent="on"] .file-dropzone:hover,
html[data-user-accent="on"] .upload-zone:hover,
html[data-user-accent="on"] .attachment-dropzone:hover {
  background: var(--dropzone-hover) !important;
}

html[data-user-accent="on"] .reply-preview,
html[data-user-accent="on"] .message-reply-preview,
html[data-user-accent="on"] .reply-quote {
  background: var(--reply-quote-bg) !important;
  border-left-color: var(--reply-quote-border) !important;
}

html[data-user-accent="on"] .message-bubble.out,
html[data-user-accent="on"] .message-bubble.sent,
html[data-user-accent="on"] .chat-message.me .message-bubble {
  background: var(--chat-bubble-out) !important;
  color: var(--chat-bubble-out-text) !important;
}

.appearance-panel {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--theme-card-bg);
}

.appearance-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.appearance-row:last-child {
  border-bottom: 0;
}

.appearance-title {
  font-weight: 700;
  color: var(--text-main);
}

.appearance-desc {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}

.appearance-control {
  justify-self: end;
  width: min(100%, 240px);
}

.appearance-color-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.appearance-color-wrap input[type="color"] {
  width: 44px;
  height: 36px;
  padding: 2px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--theme-control-bg);
}

.appearance-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}

.appearance-swatch {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.86);
  box-shadow: 0 0 0 1px var(--border), 0 6px 16px rgba(15,23,42,0.16);
}

.appearance-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  cursor: pointer;
  color: var(--text-sub);
  font-weight: 600;
}

.appearance-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

@media (max-width: 640px) {
  .settings-page-shell {
    display: block;
  }

  .settings-section-nav {
    position: static;
    margin-bottom: 12px;
    padding: 10px;
  }

  .settings-tab-list {
    display: none;
  }

  .settings-mobile-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
  }

  .settings-mobile-select {
    display: block;
    width: 100%;
  }

  .appearance-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .appearance-control,
  .appearance-color-wrap,
  .appearance-presets {
    justify-self: stretch;
    justify-content: flex-start;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-theme="moncher-warm-preview"] *,
  [data-theme="moncher-warm-preview"] *::before,
  [data-theme="moncher-warm-preview"] *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================
   Moncher Warm Preview — 파일럿 커버리지 확장
   기능 동작을 바꾸지 않고 남은 주요 화면의 표면/상태색만 정리한다.
   ========================================== */
[data-theme="moncher-warm-preview"] .bg-blue-50,
[data-theme="moncher-warm-preview"] .bg-blue-100,
[data-theme="moncher-warm-preview"] .bg-sky-50,
[data-theme="moncher-warm-preview"] .bg-sky-100,
[data-theme="moncher-warm-preview"] .bg-cyan-50,
[data-theme="moncher-warm-preview"] .bg-cyan-100,
[data-theme="moncher-warm-preview"] .bg-indigo-50,
[data-theme="moncher-warm-preview"] .bg-indigo-100,
[data-theme="moncher-warm-preview"] .hover\:bg-blue-50:hover,
[data-theme="moncher-warm-preview"] .hover\:bg-sky-50:hover,
[data-theme="moncher-warm-preview"] .hover\:bg-indigo-50:hover {
  background-color: var(--semantic-info-bg) !important;
}

[data-theme="moncher-warm-preview"] .bg-green-50,
[data-theme="moncher-warm-preview"] .bg-green-100,
[data-theme="moncher-warm-preview"] .bg-emerald-50,
[data-theme="moncher-warm-preview"] .bg-emerald-100,
[data-theme="moncher-warm-preview"] .bg-teal-50,
[data-theme="moncher-warm-preview"] .bg-teal-100,
[data-theme="moncher-warm-preview"] .hover\:bg-green-50:hover,
[data-theme="moncher-warm-preview"] .hover\:bg-emerald-50:hover {
  background-color: var(--semantic-success-bg) !important;
}

[data-theme="moncher-warm-preview"] .bg-yellow-50,
[data-theme="moncher-warm-preview"] .bg-yellow-100,
[data-theme="moncher-warm-preview"] .bg-amber-50,
[data-theme="moncher-warm-preview"] .bg-amber-100,
[data-theme="moncher-warm-preview"] .bg-orange-50,
[data-theme="moncher-warm-preview"] .bg-orange-100,
[data-theme="moncher-warm-preview"] .hover\:bg-yellow-50:hover,
[data-theme="moncher-warm-preview"] .hover\:bg-amber-50:hover,
[data-theme="moncher-warm-preview"] .hover\:bg-orange-50:hover {
  background-color: var(--semantic-warning-bg) !important;
}

[data-theme="moncher-warm-preview"] .bg-red-50,
[data-theme="moncher-warm-preview"] .bg-red-100,
[data-theme="moncher-warm-preview"] .bg-rose-50,
[data-theme="moncher-warm-preview"] .bg-rose-100,
[data-theme="moncher-warm-preview"] .bg-pink-50,
[data-theme="moncher-warm-preview"] .bg-pink-100,
[data-theme="moncher-warm-preview"] .hover\:bg-red-50:hover,
[data-theme="moncher-warm-preview"] .hover\:bg-rose-50:hover {
  background-color: var(--semantic-danger-bg) !important;
}

[data-theme="moncher-warm-preview"] .bg-purple-50,
[data-theme="moncher-warm-preview"] .bg-purple-100,
[data-theme="moncher-warm-preview"] .bg-violet-50,
[data-theme="moncher-warm-preview"] .bg-violet-100 {
  background-color: #F5F3FF !important;
}

[data-theme="moncher-warm-preview"] .text-blue-500,
[data-theme="moncher-warm-preview"] .text-blue-600,
[data-theme="moncher-warm-preview"] .text-blue-700,
[data-theme="moncher-warm-preview"] .text-sky-500,
[data-theme="moncher-warm-preview"] .text-sky-600,
[data-theme="moncher-warm-preview"] .text-cyan-500,
[data-theme="moncher-warm-preview"] .text-cyan-600,
[data-theme="moncher-warm-preview"] .text-indigo-500,
[data-theme="moncher-warm-preview"] .text-indigo-600,
[data-theme="moncher-warm-preview"] .hover\:text-blue-600:hover {
  color: var(--semantic-info-text) !important;
}

[data-theme="moncher-warm-preview"] .text-green-500,
[data-theme="moncher-warm-preview"] .text-green-600,
[data-theme="moncher-warm-preview"] .text-green-700,
[data-theme="moncher-warm-preview"] .text-emerald-500,
[data-theme="moncher-warm-preview"] .text-emerald-600,
[data-theme="moncher-warm-preview"] .text-teal-500,
[data-theme="moncher-warm-preview"] .text-teal-600 {
  color: var(--semantic-success-text) !important;
}

[data-theme="moncher-warm-preview"] .text-yellow-500,
[data-theme="moncher-warm-preview"] .text-yellow-600,
[data-theme="moncher-warm-preview"] .text-amber-500,
[data-theme="moncher-warm-preview"] .text-amber-600,
[data-theme="moncher-warm-preview"] .text-orange-500,
[data-theme="moncher-warm-preview"] .text-orange-600 {
  color: var(--semantic-warning-text) !important;
}

[data-theme="moncher-warm-preview"] .text-red-500,
[data-theme="moncher-warm-preview"] .text-red-600,
[data-theme="moncher-warm-preview"] .text-red-700,
[data-theme="moncher-warm-preview"] .text-rose-500,
[data-theme="moncher-warm-preview"] .text-rose-600,
[data-theme="moncher-warm-preview"] .text-pink-500,
[data-theme="moncher-warm-preview"] .text-pink-600,
[data-theme="moncher-warm-preview"] .hover\:text-red-600:hover {
  color: var(--semantic-danger-text) !important;
}

[data-theme="moncher-warm-preview"] .text-purple-500,
[data-theme="moncher-warm-preview"] .text-purple-600,
[data-theme="moncher-warm-preview"] .text-violet-500,
[data-theme="moncher-warm-preview"] .text-violet-600 {
  color: #6D28D9 !important;
}

[data-theme="moncher-warm-preview"] .border-blue-100,
[data-theme="moncher-warm-preview"] .border-blue-200,
[data-theme="moncher-warm-preview"] .border-blue-300,
[data-theme="moncher-warm-preview"] .border-sky-100,
[data-theme="moncher-warm-preview"] .border-sky-200,
[data-theme="moncher-warm-preview"] .border-indigo-100,
[data-theme="moncher-warm-preview"] .border-indigo-200 {
  border-color: var(--semantic-info-border) !important;
}

[data-theme="moncher-warm-preview"] .border-green-100,
[data-theme="moncher-warm-preview"] .border-green-200,
[data-theme="moncher-warm-preview"] .border-emerald-100,
[data-theme="moncher-warm-preview"] .border-emerald-200,
[data-theme="moncher-warm-preview"] .border-teal-100,
[data-theme="moncher-warm-preview"] .border-teal-200 {
  border-color: var(--semantic-success-border) !important;
}

[data-theme="moncher-warm-preview"] .border-yellow-100,
[data-theme="moncher-warm-preview"] .border-yellow-200,
[data-theme="moncher-warm-preview"] .border-amber-100,
[data-theme="moncher-warm-preview"] .border-amber-200,
[data-theme="moncher-warm-preview"] .border-orange-100,
[data-theme="moncher-warm-preview"] .border-orange-200 {
  border-color: var(--semantic-warning-border) !important;
}

[data-theme="moncher-warm-preview"] .border-red-100,
[data-theme="moncher-warm-preview"] .border-red-200,
[data-theme="moncher-warm-preview"] .border-rose-100,
[data-theme="moncher-warm-preview"] .border-rose-200,
[data-theme="moncher-warm-preview"] .border-pink-100,
[data-theme="moncher-warm-preview"] .border-pink-200 {
  border-color: var(--semantic-danger-border) !important;
}

[data-theme="moncher-warm-preview"] .badge-success,
[data-theme="moncher-warm-preview"] .status-approved {
  background: var(--semantic-success-bg);
  color: var(--semantic-success-text);
  border: 1px solid var(--semantic-success-border);
}

[data-theme="moncher-warm-preview"] .badge-warning,
[data-theme="moncher-warm-preview"] .status-pending {
  background: var(--semantic-warning-bg);
  color: var(--semantic-warning-text);
  border: 1px solid var(--semantic-warning-border);
}

[data-theme="moncher-warm-preview"] .badge-danger,
[data-theme="moncher-warm-preview"] .status-rejected {
  background: var(--semantic-danger-bg);
  color: var(--semantic-danger-text);
  border: 1px solid var(--semantic-danger-border);
}

[data-theme="moncher-warm-preview"] .badge-info,
[data-theme="moncher-warm-preview"] .status-in_progress {
  background: var(--semantic-info-bg);
  color: var(--semantic-info-text);
  border: 1px solid var(--semantic-info-border);
}

[data-theme="moncher-warm-preview"] .badge-gray,
[data-theme="moncher-warm-preview"] .status-draft,
[data-theme="moncher-warm-preview"] .status-canceled {
  background: var(--semantic-neutral-bg);
  color: var(--semantic-neutral-text);
  border: 1px solid var(--semantic-neutral-border);
}

[data-theme="moncher-warm-preview"] .toast {
  box-shadow: var(--shadow-popover);
}

[data-theme="moncher-warm-preview"] .toast-success { background: #047857; }
[data-theme="moncher-warm-preview"] .toast-error { background: #B91C1C; }
[data-theme="moncher-warm-preview"] .toast-info { background: var(--primary); }

[data-theme="moncher-warm-preview"] .dash-widget,
[data-theme="moncher-warm-preview"] .report-sidebar,
[data-theme="moncher-warm-preview"] .report-main-header,
[data-theme="moncher-warm-preview"] .report-section,
[data-theme="moncher-warm-preview"] .mail-layout,
[data-theme="moncher-warm-preview"] .mail-sidebar,
[data-theme="moncher-warm-preview"] .link-hub-fav-body,
[data-theme="moncher-warm-preview"] .link-hub-section,
[data-theme="moncher-warm-preview"] .board-right-panel,
[data-theme="moncher-warm-preview"] .archive-iframe-wrap,
[data-theme="moncher-warm-preview"] .archive-html-content {
  background: var(--surface-card);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

[data-theme="moncher-warm-preview"] .dash-widget {
  border-radius: var(--radius-lg);
}

[data-theme="moncher-warm-preview"] .dash-widget .border-b,
[data-theme="moncher-warm-preview"] .dash-widget .border-t,
[data-theme="moncher-warm-preview"] .report-main-header,
[data-theme="moncher-warm-preview"] .report-section-header,
[data-theme="moncher-warm-preview"] .mail-folder-panel,
[data-theme="moncher-warm-preview"] .mail-list-panel,
[data-theme="moncher-warm-preview"] .mail-folder-panel-header,
[data-theme="moncher-warm-preview"] .mail-list-panel-header,
[data-theme="moncher-warm-preview"] .mail-pagination,
[data-theme="moncher-warm-preview"] .mail-sidebar-header,
[data-theme="moncher-warm-preview"] .mail-folder-nav,
[data-theme="moncher-warm-preview"] .mail-list-item,
[data-theme="moncher-warm-preview"] .mail-list-item2,
[data-theme="moncher-warm-preview"] .mail-detail-toolbar,
[data-theme="moncher-warm-preview"] .mail-detail-body,
[data-theme="moncher-warm-preview"] .board-sidebar-group,
[data-theme="moncher-warm-preview"] .board-right-section,
[data-theme="moncher-warm-preview"] .version-timeline::before {
  border-color: var(--border) !important;
}

[data-theme="moncher-warm-preview"] .mail-folder-panel,
[data-theme="moncher-warm-preview"] .mail-list-panel,
[data-theme="moncher-warm-preview"] .mail-content-pane,
[data-theme="moncher-warm-preview"] .mail-sidebar,
[data-theme="moncher-warm-preview"] .board-right-panel {
  background: var(--surface-card);
}

[data-theme="moncher-warm-preview"] .mail-folder-section,
[data-theme="moncher-warm-preview"] .mail-date-group-label,
[data-theme="moncher-warm-preview"] .mail-detail-meta,
[data-theme="moncher-warm-preview"] .mail-attachments,
[data-theme="moncher-warm-preview"] .mail-empty-state,
[data-theme="moncher-warm-preview"] .report-sidebar-section-title,
[data-theme="moncher-warm-preview"] .board-sidebar-group-title {
  background: var(--surface-panel);
  color: var(--text-sub);
}

[data-theme="moncher-warm-preview"] .mail-folder-section-title,
[data-theme="moncher-warm-preview"] .mail-item2-preview,
[data-theme="moncher-warm-preview"] .mail-item2-date,
[data-theme="moncher-warm-preview"] .mail-item-date,
[data-theme="moncher-warm-preview"] .mail-item-preview,
[data-theme="moncher-warm-preview"] .board-right-post-date,
[data-theme="moncher-warm-preview"] .report-sidebar-section-title {
  color: var(--text-disabled) !important;
}

[data-theme="moncher-warm-preview"] .mail-item2-sender,
[data-theme="moncher-warm-preview"] .mail-item-sender,
[data-theme="moncher-warm-preview"] .mail-detail-subject,
[data-theme="moncher-warm-preview"] .mail-view-subject,
[data-theme="moncher-warm-preview"] .board-right-section-title,
[data-theme="moncher-warm-preview"] .board-right-post-title {
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] .mail-item2-subject,
[data-theme="moncher-warm-preview"] .mail-item-subject,
[data-theme="moncher-warm-preview"] .mail-detail-body,
[data-theme="moncher-warm-preview"] .mail-detail-meta,
[data-theme="moncher-warm-preview"] .mail-view-meta,
[data-theme="moncher-warm-preview"] .report-sidebar-item,
[data-theme="moncher-warm-preview"] .report-sidebar-dept-name {
  color: var(--text-sub) !important;
}

[data-theme="moncher-warm-preview"] .mail-folder-item:hover,
[data-theme="moncher-warm-preview"] .mail-list-item:hover,
[data-theme="moncher-warm-preview"] .mail-list-item2:hover,
[data-theme="moncher-warm-preview"] .mail-toolbar-btn:hover,
[data-theme="moncher-warm-preview"] .mail-icon-btn:hover,
[data-theme="moncher-warm-preview"] .board-sidebar-item:hover,
[data-theme="moncher-warm-preview"] .board-right-post-item:hover,
[data-theme="moncher-warm-preview"] .board-right-tab-btn:hover,
[data-theme="moncher-warm-preview"] .report-sidebar-item:hover,
[data-theme="moncher-warm-preview"] .report-sidebar-dept-name:hover,
[data-theme="moncher-warm-preview"] .org-node-header:hover,
[data-theme="moncher-warm-preview"] .org-member:hover,
[data-theme="moncher-warm-preview"] .org-user-item:hover,
[data-theme="moncher-warm-preview"] .drive-item-row:hover,
[data-theme="moncher-warm-preview"] .draft-list-item:hover {
  background: var(--surface-hover) !important;
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] .mail-folder-item.active,
[data-theme="moncher-warm-preview"] .mail-list-item.selected,
[data-theme="moncher-warm-preview"] .mail-list-item2.selected,
[data-theme="moncher-warm-preview"] .board-sidebar-item.active,
[data-theme="moncher-warm-preview"] .board-right-tab-btn.active,
[data-theme="moncher-warm-preview"] .report-sidebar-item.active,
[data-theme="moncher-warm-preview"] .hr-tab.active {
  background: var(--surface-selected) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

[data-theme="moncher-warm-preview"] .mail-list-item2.checked {
  background: var(--semantic-info-bg) !important;
}

[data-theme="moncher-warm-preview"] .mail-badge,
[data-theme="moncher-warm-preview"] .board-sidebar-badge,
[data-theme="moncher-warm-preview"] .community-sidebar-badge,
[data-theme="moncher-warm-preview"] .report-sidebar-badge {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(var(--primary-rgb),0.18);
}

[data-theme="moncher-warm-preview"] .mail-badge-danger,
[data-theme="moncher-warm-preview"] .board-right-notice {
  background: var(--semantic-danger-bg);
  color: var(--semantic-danger-text);
  border: 1px solid var(--semantic-danger-border);
}

[data-theme="moncher-warm-preview"] .mail-badge-gray {
  background: var(--semantic-neutral-bg);
  color: var(--semantic-neutral-text);
  border: 1px solid var(--semantic-neutral-border);
}

[data-theme="moncher-warm-preview"] .mail-icon-btn,
[data-theme="moncher-warm-preview"] .mail-toolbar-btn,
[data-theme="moncher-warm-preview"] .mail-page-btn,
[data-theme="moncher-warm-preview"] .board-right-tab-btn,
[data-theme="moncher-warm-preview"] .link-hub-header-btn,
[data-theme="moncher-warm-preview"] .link-card-menu-btn,
[data-theme="moncher-warm-preview"] .link-icon-tab-btn,
[data-theme="moncher-warm-preview"] .draft-list-load-btn,
[data-theme="moncher-warm-preview"] .draft-list-del-btn {
  background: var(--button-secondary-bg);
  border-color: var(--border);
  color: var(--text-sub);
}

[data-theme="moncher-warm-preview"] .mail-page-btn:hover:not([disabled]),
[data-theme="moncher-warm-preview"] .link-hub-header-btn:hover,
[data-theme="moncher-warm-preview"] .link-card-menu-btn:hover,
[data-theme="moncher-warm-preview"] .link-icon-tab-btn:hover,
[data-theme="moncher-warm-preview"] .link-icon-tab-btn.active,
[data-theme="moncher-warm-preview"] .draft-list-load-btn:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--primary-rgb),0.45);
  color: var(--primary);
}

[data-theme="moncher-warm-preview"] .mail-page-btn.active,
[data-theme="moncher-warm-preview"] .board-right-tab-btn.active {
  background: var(--primary) !important;
  color: #FFFFFF !important;
}

[data-theme="moncher-warm-preview"] .mail-attach-item,
[data-theme="moncher-warm-preview"] .mail-attachments {
  background: var(--surface-panel);
  border-color: var(--border);
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .mail-storage-track {
  background: var(--border);
}

[data-theme="moncher-warm-preview"] .mail-flag-btn:hover,
[data-theme="moncher-warm-preview"] .mail-flag-btn.flagged,
[data-theme="moncher-warm-preview"] .mail-item-star.starred,
[data-theme="moncher-warm-preview"] .link-fav-btn.active,
[data-theme="moncher-warm-preview"] .link-fav-btn:hover {
  color: var(--semantic-warning-text);
}

[data-theme="moncher-warm-preview"] .link-hub-page {
  background: var(--surface-canvas);
}

[data-theme="moncher-warm-preview"] .link-hub-page-header,
[data-theme="moncher-warm-preview"] .link-hub-footer {
  background: var(--topbar-bg);
  border-color: var(--topbar-border);
}

[data-theme="moncher-warm-preview"] .link-hub-search-bar,
[data-theme="moncher-warm-preview"] .link-hub-fav-body,
[data-theme="moncher-warm-preview"] .link-hub-section-header,
[data-theme="moncher-warm-preview"] .link-hub-section-body,
[data-theme="moncher-warm-preview"] .lnk-ctx-menu {
  background: var(--surface-card);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

[data-theme="moncher-warm-preview"] .link-hub-fav-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

[data-theme="moncher-warm-preview"] .link-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

[data-theme="moncher-warm-preview"] .link-card:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--primary-rgb),0.35);
  box-shadow: var(--shadow-md);
}

[data-theme="moncher-warm-preview"] .link-card-icon-circle,
[data-theme="moncher-warm-preview"] .link-card-icon-wrap,
[data-theme="moncher-warm-preview"] .link-card-icon {
  background: var(--surface-selected);
  color: var(--primary);
}

[data-theme="moncher-warm-preview"] .link-card:hover .link-card-icon-circle {
  background: var(--primary);
  color: #FFFFFF;
}

[data-theme="moncher-warm-preview"] .link-card-desc {
  background: rgba(15,23,42,0.86);
}

[data-theme="moncher-warm-preview"] .link-badge-current {
  background: var(--semantic-success-bg);
  color: var(--semantic-success-text);
  border: 1px solid var(--semantic-success-border);
}

[data-theme="moncher-warm-preview"] .lnk-ctx-menu button:hover {
  background: var(--surface-hover);
}

[data-theme="moncher-warm-preview"] .lnk-ctx-menu button.lnk-ctx-danger {
  color: var(--semantic-danger-text);
}

[data-theme="moncher-warm-preview"] .lnk-ctx-menu button.lnk-ctx-danger:hover {
  background: var(--semantic-danger-bg);
}

[data-theme="moncher-warm-preview"] .work-mgr-wrap {
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .work-kanban-col,
[data-theme="moncher-warm-preview"] .work-group,
[data-theme="moncher-warm-preview"] .work-card,
[data-theme="moncher-warm-preview"] .gantt-bar,
[data-theme="moncher-warm-preview"] .linked-budget-doc-card,
[data-theme="moncher-warm-preview"] .member-row {
  border-color: var(--border) !important;
}

[data-theme="moncher-warm-preview"] .work-kanban-col {
  background: var(--surface-panel) !important;
}

[data-theme="moncher-warm-preview"] .work-card,
[data-theme="moncher-warm-preview"] .linked-budget-doc-card,
[data-theme="moncher-warm-preview"] .member-row {
  background: var(--surface-card) !important;
  color: var(--text-main) !important;
  box-shadow: var(--shadow-xs);
}

[data-theme="moncher-warm-preview"] .work-card:hover,
[data-theme="moncher-warm-preview"] .linked-budget-doc-card:hover,
[data-theme="moncher-warm-preview"] .member-row:hover {
  background: var(--surface-hover) !important;
  border-color: rgba(var(--primary-rgb),0.35) !important;
  box-shadow: var(--shadow-sm);
}

[data-theme="moncher-warm-preview"] .calendar-cell:hover {
  background: var(--surface-hover) !important;
}

[data-theme="moncher-warm-preview"] .org-node-header,
[data-theme="moncher-warm-preview"] .org-member,
[data-theme="moncher-warm-preview"] .org-user-item,
[data-theme="moncher-warm-preview"] .hr-row {
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] .org-member-avatar,
[data-theme="moncher-warm-preview"] .mail-meta-avatar,
[data-theme="moncher-warm-preview"] .mail-item-avatar,
[data-theme="moncher-warm-preview"] .link-hub-avatar {
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #FFFFFF;
}

[data-theme="moncher-warm-preview"] .drive-item-row,
[data-theme="moncher-warm-preview"] .draft-list-item,
[data-theme="moncher-warm-preview"] .draft-status-bar,
[data-theme="moncher-warm-preview"] .file-upload-progress,
[data-theme="moncher-warm-preview"] #archDropZone,
[data-theme="moncher-warm-preview"] .link-icon-upload-area {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] #archDropZone.drag-active,
[data-theme="moncher-warm-preview"] .link-icon-upload-area:hover,
[data-theme="moncher-warm-preview"] .file-upload-progress:hover {
  background: var(--dropzone-hover) !important;
  border-color: var(--dropzone-border) !important;
}

[data-theme="moncher-warm-preview"] .archive-html-content table th {
  background: var(--table-header-bg) !important;
  color: var(--table-header-text) !important;
}

[data-theme="moncher-warm-preview"] .archive-html-content table td {
  color: var(--text-main) !important;
  border-color: var(--border) !important;
}

[data-theme="moncher-warm-preview"] #manualPanel,
[data-theme="moncher-warm-preview"] #notifDropdown,
[data-theme="moncher-warm-preview"] #langMenu {
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] #manualPanel button:hover,
[data-theme="moncher-warm-preview"] #notifDropdown button:hover,
[data-theme="moncher-warm-preview"] #langMenu button:hover {
  background: var(--surface-hover) !important;
}

@media (hover: hover) and (pointer: fine) {
  [data-theme="moncher-warm-preview"] .link-card:hover,
  [data-theme="moncher-warm-preview"] .dash-widget:hover,
  [data-theme="moncher-warm-preview"] .work-card:hover {
    transform: translateY(-1px);
  }
}

/* ==========================================
   Moncher Warm Preview — 파일럿 커버리지 확장 2
   HR/급여/캘린더/예약/설문/주소록 및 rich content 표면 보강.
   ========================================== */
[data-theme="moncher-warm-preview"] .rich-content {
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .rich-content table td,
[data-theme="moncher-warm-preview"] .rich-content table th {
  border-color: var(--border) !important;
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .rich-content table th {
  background: var(--table-header-bg) !important;
  color: var(--table-header-text) !important;
}

[data-theme="moncher-warm-preview"] .rich-content blockquote,
[data-theme="moncher-warm-preview"] .rich-content pre {
  background: var(--surface-panel);
  border-color: var(--border-strong);
  color: var(--text-sub);
}

[data-theme="moncher-warm-preview"] .rich-content hr {
  border-top-color: var(--border);
}

/* 작성 완료 문서 본문은 에디터와 동일하게 테마와 무관한 흰 문서 표면으로 고정 */
.rich-content,
html[data-theme] .rich-content {
  background: #ffffff !important;
  color: #111827 !important;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  color-scheme: light;
}

.rich-content table td,
.rich-content table th,
html[data-theme] .rich-content table td,
html[data-theme] .rich-content table th {
  border-color: #d1d5db !important;
  color: #111827 !important;
}

.rich-content table th,
html[data-theme] .rich-content table th {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

.rich-content blockquote,
html[data-theme] .rich-content blockquote {
  background: #f9fafb !important;
  border-left-color: #d1d5db !important;
  color: #4b5563 !important;
}

.rich-content pre,
html[data-theme] .rich-content pre {
  background: #f4f4f5 !important;
  color: #111827 !important;
}

.rich-content hr,
html[data-theme] .rich-content hr {
  border-top-color: #e5e7eb !important;
}

/* 모바일 문서 열람 안정화: 게시판/커뮤니티/메일/전자결재/보고 본문 공통 */
.board-detail-shell,
.approval-detail-shell,
.mail-detail,
.mail-view-inner,
.doc-preview-shell,
.doc-preview-paper,
.mobile-readable-doc {
  min-width: 0;
  max-width: 100%;
}

.mobile-readable-doc,
.rich-content {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y pinch-zoom;
}

.rich-content :where(div, section, article, figure, p, blockquote, pre, ul, ol) {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.rich-content :where(a, code, pre) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.rich-content :where(img, video, canvas, svg, iframe, embed, object) {
  max-width: 100% !important;
  height: auto !important;
  box-sizing: border-box;
}

.rich-content :where(div, section, article, figure, p, blockquote, pre, ul, ol, img, video, canvas, svg, iframe, embed, object)[style*="width"] {
  max-width: 100% !important;
}

.rich-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  margin: 10px 0;
  border-radius: 8px;
  box-shadow: inset -14px 0 12px -18px rgba(15, 23, 42, 0.55);
}

.rich-table-scroll > table,
html[data-theme] .rich-table-scroll > table {
  width: max-content !important;
  min-width: 100%;
  max-width: none !important;
  margin: 0 !important;
}

.rich-table-scroll > table th,
.rich-table-scroll > table td {
  min-width: 72px;
  white-space: normal;
}

.rich-content table th,
.rich-content table td,
html[data-theme] .rich-content table th,
html[data-theme] .rich-content table td {
  white-space: normal !important;
}

.mail-detail-body,
.mail-view-body {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y pinch-zoom;
}

.mail-detail-body iframe,
.mail-view-body iframe,
html[data-theme] .mail-detail-body iframe,
html[data-theme] .mail-view-body iframe {
  background: #ffffff !important;
  color-scheme: light !important;
  border-radius: 10px;
}

@media (max-width: 768px) {
  .content:has(.board-detail-shell),
  .content:has(.approval-detail-shell) {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .modal:has(.rich-content),
  .modal:has(.mail-detail),
  .modal:has(.doc-preview-paper) {
    width: calc(100% - 12px) !important;
    max-width: calc(100% - 12px) !important;
    margin-inline: 6px;
  }

  .board-detail-shell,
  .approval-detail-shell {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .board-detail-shell > .card,
  .approval-detail-shell > .card {
    overflow: hidden;
    padding: 8px !important;
    border-radius: 8px;
  }

  .board-post-actions,
  .board-post-header,
  .approval-doc-actions,
  .approval-detail-shell .card > .mb-4 {
    margin-bottom: 8px !important;
  }

  .board-post-actions,
  .approval-doc-actions {
    width: 100%;
    gap: 6px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .board-post-actions > .flex,
  .approval-doc-actions > .flex {
    flex: 0 0 auto;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    justify-content: flex-start !important;
  }

  .board-post-actions .btn,
  .approval-doc-actions .btn {
    flex: 0 0 auto;
    min-height: 34px;
    height: 34px;
    padding: 0 10px !important;
    font-size: 12px !important;
    line-height: 1 !important;
    border-radius: 9px !important;
  }

  #boardPostTitle {
    font-size: 15px !important;
    line-height: 1.32 !important;
  }

  .board-post-meta {
    gap: 4px 10px !important;
    flex-wrap: wrap;
    font-size: 11px !important;
  }

  .rich-content,
  html[data-theme] .rich-content {
    padding: 3px !important;
    border: 0 !important;
    border-radius: 4px;
    font-size: 11.5px !important;
    line-height: 1.52 !important;
  }

  .rich-content h1 { font-size: 1.18em; }
  .rich-content h2 { font-size: 1.1em; }
  .rich-content h3 { font-size: 1.02em; }
  .rich-content :where(p, div, section, article, span, font, a, li, strong, b, em, u, small, label) {
    font-size: inherit !important;
    line-height: inherit !important;
  }
  .rich-content ul,
  .rich-content ol { padding-left: 18px; }
  .rich-content p,
  .rich-content li {
    margin-bottom: 7px;
  }
  .rich-content img,
  .rich-content video,
  .rich-content canvas {
    display: block;
    margin: 8px auto;
  }

  .rich-table-scroll {
    margin-left: -2px;
    margin-right: -2px;
    padding: 0 2px 5px;
    border-radius: 4px;
    scrollbar-width: thin;
    box-shadow:
      inset -14px 0 12px -18px rgba(15, 23, 42, 0.55),
      inset 14px 0 12px -18px rgba(15, 23, 42, 0.35);
  }

  .rich-table-scroll > table th,
  .rich-table-scroll > table td {
    padding: 4px 6px !important;
    min-width: 56px;
    font-size: 10.5px !important;
    line-height: 1.38 !important;
    border-color: #e5e7eb !important;
  }

  .rich-table-scroll > table th:empty,
  .rich-table-scroll > table td:empty {
    min-width: 28px;
    padding-left: 3px !important;
    padding-right: 3px !important;
  }

  .approval-detail-shell .grid {
    gap: 8px !important;
    padding: 10px !important;
    font-size: 12px !important;
  }

  .approval-detail-shell .grid span,
  .approval-detail-shell .grid p {
    font-size: inherit !important;
    line-height: 1.42 !important;
  }

  .approval-detail-shell .overflow-x-auto table {
    font-size: 10.5px !important;
    line-height: 1.35 !important;
  }

  .approval-detail-shell .overflow-x-auto table th,
  .approval-detail-shell .overflow-x-auto table td {
    padding: 5px 6px !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
  }

  .mail-detail-body {
    padding-top: 12px;
    margin-top: 12px;
  }

  .mail-view-header {
    padding: 14px 12px 10px;
  }

  .mail-view-subject {
    font-size: 16px;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .mail-view-body iframe,
  .mail-detail-body iframe {
    width: 100% !important;
    min-width: 0 !important;
    border-radius: 8px;
  }

  .doc-preview-shell {
    padding: 6px !important;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .doc-preview-paper {
    width: 100%;
    max-width: 100%;
    padding: 10px !important;
    border-radius: 8px !important;
  }
}


[data-theme="moncher-warm-preview"] .tox-tinymce,
[data-theme="moncher-warm-preview"] .tox .tox-toolbar__primary,
[data-theme="moncher-warm-preview"] .tox .tox-toolbar-overlord,
[data-theme="moncher-warm-preview"] .tox .tox-statusbar {
  border-color: var(--editor-border) !important;
  background: var(--editor-toolbar-bg) !important;
  color: var(--text-sub) !important;
}

[data-theme="moncher-warm-preview"] .cal-main,
[data-theme="moncher-warm-preview"] .cal-sidebar > .card,
[data-theme="moncher-warm-preview"] .cal-legend-card {
  background: var(--surface-card);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

[data-theme="moncher-warm-preview"] .cal-header,
[data-theme="moncher-warm-preview"] .cal-weekdays,
[data-theme="moncher-warm-preview"] .cal-grid,
[data-theme="moncher-warm-preview"] .cal-cell,
[data-theme="moncher-warm-preview"] .cal-today-item {
  border-color: var(--border) !important;
}

[data-theme="moncher-warm-preview"] .cal-weekdays,
[data-theme="moncher-warm-preview"] .cal-cell-out {
  background: var(--surface-panel) !important;
}

[data-theme="moncher-warm-preview"] .cal-cell {
  background: var(--surface-card);
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .cal-cell:hover,
[data-theme="moncher-warm-preview"] .cal-cell-today {
  background: var(--surface-hover) !important;
}

[data-theme="moncher-warm-preview"] .cal-weekday,
[data-theme="moncher-warm-preview"] .cal-event-more,
[data-theme="moncher-warm-preview"] .cal-dot-more,
[data-theme="moncher-warm-preview"] .cal-today-time,
[data-theme="moncher-warm-preview"] .cal-no-event {
  color: var(--text-disabled) !important;
}

[data-theme="moncher-warm-preview"] .cal-weekday-sun {
  color: var(--semantic-danger-text) !important;
}

[data-theme="moncher-warm-preview"] .cal-weekday-sat {
  color: var(--semantic-info-text) !important;
}

[data-theme="moncher-warm-preview"] .cal-day-num,
[data-theme="moncher-warm-preview"] .cal-title,
[data-theme="moncher-warm-preview"] .cal-section-title,
[data-theme="moncher-warm-preview"] .cal-today-title {
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] .cal-today-badge {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 4px 10px rgba(var(--primary-rgb),0.18);
}

[data-theme="moncher-warm-preview"] .cal-event-bar {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

[data-theme="moncher-warm-preview"] .hr-row:hover {
  background: var(--surface-hover) !important;
  opacity: 1 !important;
}

[data-theme="moncher-warm-preview"] .hr-tab {
  color: var(--text-sub) !important;
}

[data-theme="moncher-warm-preview"] .hr-tab:hover {
  color: var(--primary) !important;
  background: var(--surface-hover);
}

[data-theme="moncher-warm-preview"] [style*="background:var(--body-bg)"],
[data-theme="moncher-warm-preview"] [style*="background: var(--body-bg)"] {
  background: var(--surface-panel) !important;
}

[data-theme="moncher-warm-preview"] [style*="background:var(--card-bg)"],
[data-theme="moncher-warm-preview"] [style*="background: var(--card-bg)"] {
  background: var(--surface-card) !important;
}

[data-theme="moncher-warm-preview"] [style*="border:1px solid var(--card-border)"],
[data-theme="moncher-warm-preview"] [style*="border: 1px solid var(--card-border)"],
[data-theme="moncher-warm-preview"] [style*="border-color:var(--card-border)"],
[data-theme="moncher-warm-preview"] [style*="border-color: var(--card-border)"] {
  border-color: var(--border) !important;
}

[data-theme="moncher-warm-preview"] [style*="color:var(--text-main)"],
[data-theme="moncher-warm-preview"] [style*="color: var(--text-main)"] {
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] [style*="color:var(--text-secondary)"],
[data-theme="moncher-warm-preview"] [style*="color: var(--text-secondary)"],
[data-theme="moncher-warm-preview"] [style*="color:var(--text-muted)"],
[data-theme="moncher-warm-preview"] [style*="color: var(--text-muted)"] {
  color: var(--text-sub) !important;
}

[data-theme="moncher-warm-preview"] [style*="#22c55e1a"],
[data-theme="moncher-warm-preview"] [style*="#10B9811a"],
[data-theme="moncher-warm-preview"] [style*="#10b9811a"] {
  background: var(--semantic-success-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="color:#22c55e"],
[data-theme="moncher-warm-preview"] [style*="color: #22c55e"],
[data-theme="moncher-warm-preview"] [style*="color:#10B981"],
[data-theme="moncher-warm-preview"] [style*="color: #10B981"],
[data-theme="moncher-warm-preview"] [style*="color:#10b981"],
[data-theme="moncher-warm-preview"] [style*="color: #10b981"] {
  color: var(--semantic-success-text) !important;
}

[data-theme="moncher-warm-preview"] [style*="#f59e0b1a"],
[data-theme="moncher-warm-preview"] [style*="#f973161a"] {
  background: var(--semantic-warning-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="color:#f59e0b"],
[data-theme="moncher-warm-preview"] [style*="color: #f59e0b"],
[data-theme="moncher-warm-preview"] [style*="color:#f97316"],
[data-theme="moncher-warm-preview"] [style*="color: #f97316"] {
  color: var(--semantic-warning-text) !important;
}

[data-theme="moncher-warm-preview"] [style*="#ef44441a"],
[data-theme="moncher-warm-preview"] [style*="#7f1d1d1a"] {
  background: var(--semantic-danger-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="color:#ef4444"],
[data-theme="moncher-warm-preview"] [style*="color: #ef4444"],
[data-theme="moncher-warm-preview"] [style*="color:#7f1d1d"],
[data-theme="moncher-warm-preview"] [style*="color: #7f1d1d"] {
  color: var(--semantic-danger-text) !important;
}

[data-theme="moncher-warm-preview"] [style*="#3b82f61a"],
[data-theme="moncher-warm-preview"] [style*="#8b5cf61a"] {
  background: var(--semantic-info-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="color:#3b82f6"],
[data-theme="moncher-warm-preview"] [style*="color: #3b82f6"],
[data-theme="moncher-warm-preview"] [style*="color:#8b5cf6"],
[data-theme="moncher-warm-preview"] [style*="color: #8b5cf6"] {
  color: var(--semantic-info-text) !important;
}

[data-theme="moncher-warm-preview"] [style*="#94a3b81a"] {
  background: var(--semantic-neutral-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="color:#94a3b8"],
[data-theme="moncher-warm-preview"] [style*="color: #94a3b8"] {
  color: var(--semantic-neutral-text) !important;
}

[data-theme="moncher-warm-preview"] .rounded-xl[style*="border:1px solid var(--card-border)"],
[data-theme="moncher-warm-preview"] .rounded-lg[style*="border:1px solid var(--card-border)"],
[data-theme="moncher-warm-preview"] .rounded-xl[style*="background:var(--card-bg)"] {
  box-shadow: var(--shadow-xs);
}

[data-theme="moncher-warm-preview"] .rounded-xl[style*="border:1px solid var(--card-border)"]:hover,
[data-theme="moncher-warm-preview"] .rounded-lg[style*="border:1px solid var(--card-border)"]:hover {
  border-color: rgba(var(--primary-rgb),0.32) !important;
}

[data-theme="moncher-warm-preview"] .contact-detail-card,
[data-theme="moncher-warm-preview"] .survey-card,
[data-theme="moncher-warm-preview"] .reservation-card {
  background: var(--surface-card);
  border-color: var(--border);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

[data-theme="moncher-warm-preview"] .border-gray-50,
[data-theme="moncher-warm-preview"] .border-slate-100,
[data-theme="moncher-warm-preview"] .border-slate-200,
[data-theme="moncher-warm-preview"] .divide-gray-100 > :not([hidden]) ~ :not([hidden]),
[data-theme="moncher-warm-preview"] .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--border) !important;
}

[data-theme="moncher-warm-preview"] .bg-slate-50,
[data-theme="moncher-warm-preview"] .bg-slate-100,
[data-theme="moncher-warm-preview"] .hover\:bg-slate-50:hover,
[data-theme="moncher-warm-preview"] .hover\:bg-slate-100:hover {
  background-color: var(--surface-panel) !important;
}

[data-theme="moncher-warm-preview"] .text-slate-400,
[data-theme="moncher-warm-preview"] .text-slate-500,
[data-theme="moncher-warm-preview"] .text-slate-600,
[data-theme="moncher-warm-preview"] .text-slate-700 {
  color: var(--text-sub) !important;
}

[data-theme="moncher-warm-preview"] .text-slate-800,
[data-theme="moncher-warm-preview"] .text-slate-900 {
  color: var(--text-main) !important;
}

/* ==========================================
   Moncher Warm Preview — QA 보강 패스
   라우터/viewport/이벤트 구조는 유지하고 남은 시각 토큰만 보정한다.
   ========================================== */
[data-theme="moncher-warm-preview"] .header button {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-sub) !important;
  transition: background-color var(--motion-base) var(--ease-standard),
              border-color var(--motion-base) var(--ease-standard),
              color var(--motion-base) var(--ease-standard),
              box-shadow var(--motion-base) var(--ease-standard),
              transform var(--motion-fast) var(--ease-standard);
}

[data-theme="moncher-warm-preview"] .header button[class*="bg-gray-100"],
[data-theme="moncher-warm-preview"] .header button[class*="bg-slate-100"] {
  background: rgba(255,255,255,0.78) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-xs);
}

[data-theme="moncher-warm-preview"] .header button:hover {
  background: var(--topbar-icon-hover) !important;
  border-color: rgba(var(--primary-rgb),0.28) !important;
  color: var(--primary) !important;
}

[data-theme="moncher-warm-preview"] .header button[title*="로그아웃"]:hover {
  background: var(--semantic-danger-bg) !important;
  border-color: var(--semantic-danger-border) !important;
  color: var(--semantic-danger-text) !important;
}

[data-theme="moncher-warm-preview"] .header button:focus-visible,
[data-theme="moncher-warm-preview"] button:focus-visible,
[data-theme="moncher-warm-preview"] a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

[data-theme="moncher-warm-preview"] .dash-widget .fas,
[data-theme="moncher-warm-preview"] .dash-widget i,
[data-theme="moncher-warm-preview"] .card i[style*="color:#D96C00"],
[data-theme="moncher-warm-preview"] .card i[style*="color:#EC4899"],
[data-theme="moncher-warm-preview"] .card i[style*="color:#8B5CF6"],
[data-theme="moncher-warm-preview"] .card i[style*="color:#6366F1"],
[data-theme="moncher-warm-preview"] .card i[style*="color:#3B82F6"] {
  filter: saturate(0.9);
}

[data-theme="moncher-warm-preview"] .dash-widget [style*="font-size:22px"][style*="#3B82F6"],
[data-theme="moncher-warm-preview"] .dash-widget [style*="font-size:22px"][style*="#6366F1"],
[data-theme="moncher-warm-preview"] [style*="color:#3B82F6"],
[data-theme="moncher-warm-preview"] [style*="color: #3B82F6"],
[data-theme="moncher-warm-preview"] [style*="color:#6366F1"],
[data-theme="moncher-warm-preview"] [style*="color: #6366F1"],
[data-theme="moncher-warm-preview"] [style*="color:#8B5CF6"],
[data-theme="moncher-warm-preview"] [style*="color: #8B5CF6"] {
  color: var(--semantic-info-text) !important;
}

[data-theme="moncher-warm-preview"] .dash-widget [style*="font-size:22px"][style*="#10B981"],
[data-theme="moncher-warm-preview"] [style*="color:#10B981"],
[data-theme="moncher-warm-preview"] [style*="color: #10B981"],
[data-theme="moncher-warm-preview"] [style*="color:#22C55E"],
[data-theme="moncher-warm-preview"] [style*="color: #22C55E"],
[data-theme="moncher-warm-preview"] [style*="color:#22c55e"],
[data-theme="moncher-warm-preview"] [style*="color: #22c55e"] {
  color: var(--semantic-success-text) !important;
}

[data-theme="moncher-warm-preview"] .dash-widget [style*="font-size:22px"][style*="#F59E0B"],
[data-theme="moncher-warm-preview"] [style*="color:#F59E0B"],
[data-theme="moncher-warm-preview"] [style*="color: #F59E0B"],
[data-theme="moncher-warm-preview"] [style*="color:#F97316"],
[data-theme="moncher-warm-preview"] [style*="color: #F97316"],
[data-theme="moncher-warm-preview"] [style*="color:#f97316"],
[data-theme="moncher-warm-preview"] [style*="color: #f97316"],
[data-theme="moncher-warm-preview"] [style*="color:#D96C00"],
[data-theme="moncher-warm-preview"] [style*="color: #D96C00"] {
  color: var(--semantic-warning-text) !important;
}

[data-theme="moncher-warm-preview"] [style*="color:#EF4444"],
[data-theme="moncher-warm-preview"] [style*="color: #EF4444"],
[data-theme="moncher-warm-preview"] [style*="color:#DC2626"],
[data-theme="moncher-warm-preview"] [style*="color: #DC2626"],
[data-theme="moncher-warm-preview"] [style*="color:#EC4899"],
[data-theme="moncher-warm-preview"] [style*="color: #EC4899"],
[data-theme="moncher-warm-preview"] [style*="color:#ef4444"],
[data-theme="moncher-warm-preview"] [style*="color: #ef4444"] {
  color: var(--semantic-danger-text) !important;
}

[data-theme="moncher-warm-preview"] [style*="#10B98120"],
[data-theme="moncher-warm-preview"] [style*="#10B98115"],
[data-theme="moncher-warm-preview"] [style*="#10B9811a"],
[data-theme="moncher-warm-preview"] [style*="#22C55E1a"],
[data-theme="moncher-warm-preview"] [style*="#22c55e1a"] {
  background: var(--semantic-success-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="#F59E0B20"],
[data-theme="moncher-warm-preview"] [style*="#F59E0B15"],
[data-theme="moncher-warm-preview"] [style*="#F59E0B1a"],
[data-theme="moncher-warm-preview"] [style*="#f59e0b1a"],
[data-theme="moncher-warm-preview"] [style*="#F973161a"] {
  background: var(--semantic-warning-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="#3B82F620"],
[data-theme="moncher-warm-preview"] [style*="#3B82F615"],
[data-theme="moncher-warm-preview"] [style*="#3B82F61a"],
[data-theme="moncher-warm-preview"] [style*="#6366F115"],
[data-theme="moncher-warm-preview"] [style*="#6366F11a"],
[data-theme="moncher-warm-preview"] [style*="#8B5CF615"],
[data-theme="moncher-warm-preview"] [style*="#8B5CF61a"] {
  background: var(--semantic-info-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="#EF444420"],
[data-theme="moncher-warm-preview"] [style*="#EF444415"],
[data-theme="moncher-warm-preview"] [style*="#EF44441a"],
[data-theme="moncher-warm-preview"] [style*="#EC489915"],
[data-theme="moncher-warm-preview"] [style*="#EC48991a"] {
  background: var(--semantic-danger-bg) !important;
}

[data-theme="moncher-warm-preview"] .cal-legend-dot[style*="#10B981"],
[data-theme="moncher-warm-preview"] .cal-legend-dot[style*="#22c55e"] {
  background: var(--semantic-success-text) !important;
}

[data-theme="moncher-warm-preview"] .cal-legend-dot[style*="#F59E0B"],
[data-theme="moncher-warm-preview"] .cal-legend-dot[style*="#E87400"] {
  background: var(--semantic-warning-text) !important;
}

[data-theme="moncher-warm-preview"] .cal-legend-dot[style*="#3B82F6"],
[data-theme="moncher-warm-preview"] .cal-legend-dot[style*="#6366F1"],
[data-theme="moncher-warm-preview"] .cal-legend-dot[style*="#8B5CF6"] {
  background: var(--semantic-info-text) !important;
}

[data-theme="moncher-warm-preview"] .cal-legend-dot[style*="#EF4444"],
[data-theme="moncher-warm-preview"] .cal-legend-dot[style*="#EC4899"] {
  background: var(--semantic-danger-text) !important;
}

[data-theme="moncher-warm-preview"] [style*="rgba(124,58,237,0.25)"] {
  background: rgba(var(--primary-rgb),0.2) !important;
  color: #FED7AA !important;
}

[data-theme="moncher-warm-preview"] [style*="background:#7c3aed"],
[data-theme="moncher-warm-preview"] [style*="background: #7c3aed"] {
  background: var(--semantic-info-bg) !important;
  color: var(--semantic-info-text) !important;
}

[data-theme="moncher-warm-preview"] [style*="background:var(--primary)"],
[data-theme="moncher-warm-preview"] [style*="background: var(--primary)"] {
  background: var(--button-primary-bg) !important;
  color: var(--button-primary-text) !important;
}

[data-theme="moncher-warm-preview"] button[style*="background:var(--primary)"],
[data-theme="moncher-warm-preview"] button[style*="background: var(--primary)"] {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 18px rgba(var(--primary-rgb),0.18);
}

[data-theme="moncher-warm-preview"] button[style*="background:var(--primary)"]:hover,
[data-theme="moncher-warm-preview"] button[style*="background: var(--primary)"]:hover {
  background: var(--button-primary-hover) !important;
  box-shadow: 0 10px 22px rgba(var(--primary-rgb),0.22);
}

[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"][style*="border-color"],
[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"][style*="border-color"] > div {
  border-radius: var(--radius-md) !important;
}

[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"][style*="border-color"] {
  background: var(--surface-card) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
  transform: none !important;
}

[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"][style*="border-color:#D96C00"],
[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"][style*="border-color: #D96C00"] {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb),0.16), var(--shadow-md) !important;
}

[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#F8FAFC"],
[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#FFF3E6"],
[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#F5FDF8"],
[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#F8F6F3"] {
  background: linear-gradient(135deg, var(--surface-panel), #FFFFFF) !important;
}

[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#111827"],
[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#4A2C1A"],
[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#2E1A0F"],
[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#0F172A"] {
  background: var(--nav-bg) !important;
}

[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#FFFFFF"] {
  background: rgba(255,255,255,0.92) !important;
}

[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#D96C00"],
[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#E87400"],
[data-theme="moncher-warm-preview"] button[class*="rounded-2xl"] [style*="background:#F59A38"] {
  background: var(--primary) !important;
}

[data-theme="moncher-warm-preview"] .grid[class*="grid-cols"] {
  scrollbar-color: var(--border-strong) transparent;
}

@media (max-width: 520px) {
  .header h2 {
    display: none !important;
  }

  [data-theme="moncher-warm-preview"] #dashQuickAdd {
    min-width: 0 !important;
  }

  [data-theme="moncher-warm-preview"] #dashQuickAddBoard {
    max-width: 118px !important;
    min-width: 96px !important;
  }
}

@media (max-width: 768px) {
  [data-theme="moncher-warm-preview"] .comm-top-tab,
  [data-theme="moncher-warm-preview"] #dashEditToggleBtn {
    min-height: 40px !important;
  }
}

[data-theme="moncher-warm-preview"] .community-right-card > .flex.items-center.justify-between.mb-2 {
  align-items: stretch !important;
  flex-direction: column !important;
  gap: 8px !important;
}

[data-theme="moncher-warm-preview"] .community-right-card > .flex.items-center.justify-between.mb-2 h4 {
  white-space: nowrap !important;
}

[data-theme="moncher-warm-preview"] .community-right-card > .flex.items-center.justify-between.mb-2 select {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

@media (max-width: 520px) {
  [data-theme="moncher-warm-preview"] .community-top-tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    gap: 6px !important;
    scrollbar-width: none;
  }

  [data-theme="moncher-warm-preview"] .community-top-tabs::-webkit-scrollbar {
    display: none;
  }

  [data-theme="moncher-warm-preview"] .community-top-tabs > .flex-1 {
    display: none !important;
  }

  [data-theme="moncher-warm-preview"] .community-top-tabs .comm-top-tab,
  [data-theme="moncher-warm-preview"] .community-top-tabs .btn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  [data-theme="moncher-warm-preview"] #commInlineActions > .flex {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px !important;
  }

  [data-theme="moncher-warm-preview"] #commInlineActions > .flex > .flex-1 {
    display: none !important;
  }

  [data-theme="moncher-warm-preview"] #commInlineChannel,
  [data-theme="moncher-warm-preview"] #commInlineVis,
  [data-theme="moncher-warm-preview"] #commInlineActions button {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: center !important;
  }
}

@media (hover: hover) and (pointer: fine) {
  [data-theme="moncher-warm-preview"] button[class*="rounded-2xl"][style*="border-color"]:hover {
    transform: translateY(-1px) !important;
    box-shadow: var(--shadow-md) !important;
  }
}

/* Moncher Warm Preview — components/settings/todo inline color token pass */
[data-theme="moncher-warm-preview"] .global-search-box {
  background: var(--surface-elevated) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-popover) !important;
}

[data-theme="moncher-warm-preview"] .global-search-input-wrap,
[data-theme="moncher-warm-preview"] .global-search-scope,
[data-theme="moncher-warm-preview"] .global-search-footer {
  border-color: var(--border);
  background: var(--surface-card);
}

[data-theme="moncher-warm-preview"] .global-search-close,
[data-theme="moncher-warm-preview"] .gs-type-badge {
  background: var(--surface-panel);
  color: var(--text-sub);
}

[data-theme="moncher-warm-preview"] .global-search-close:hover,
[data-theme="moncher-warm-preview"] .gs-result-item:hover {
  background: var(--surface-hover);
}

[data-theme="moncher-warm-preview"] .global-search-input-wrap i.search-icon,
[data-theme="moncher-warm-preview"] .global-search-input-wrap input::placeholder,
[data-theme="moncher-warm-preview"] .gs-empty,
[data-theme="moncher-warm-preview"] .gs-result-meta,
[data-theme="moncher-warm-preview"] .global-search-footer {
  color: var(--text-disabled);
}

[data-theme="moncher-warm-preview"] .gs-result-item {
  border-color: var(--border-subtle);
}

[data-theme="moncher-warm-preview"] .gs-result-title {
  color: var(--text-main);
}

[data-theme="moncher-warm-preview"] .gs-result-snippet {
  color: var(--text-sub);
}

[data-theme="moncher-warm-preview"] #manualPanel .manual-section-icon {
  background: var(--surface-panel) !important;
  border: 1px solid var(--border);
  color: var(--primary) !important;
}

[data-theme="moncher-warm-preview"] #manualPanel .manual-section-header:hover,
[data-theme="moncher-warm-preview"] #manualPanel .manual-item-header:hover {
  background: var(--surface-hover);
}

[data-theme="moncher-warm-preview"] #manualPanel .manual-search-highlight {
  background: var(--semantic-warning-bg);
  color: var(--semantic-warning-text);
}

[data-theme="moncher-warm-preview"] #notifDropdown .hover\:bg-gray-50:hover {
  background: var(--surface-hover) !important;
}

[data-theme="moncher-warm-preview"] #notifDropdown [style*="background:var(--primary-surface)"] {
  background: var(--surface-selected) !important;
}

[data-theme="moncher-warm-preview"] #notifDropdown .rounded-full[style*="background:var(--primary)"] {
  background: var(--primary) !important;
}

[data-theme="moncher-warm-preview"] .admin-card {
  background: var(--surface-card);
  border-color: var(--border);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

[data-theme="moncher-warm-preview"] .admin-card:hover {
  background: var(--surface-hover);
  border-color: rgba(var(--primary-rgb),0.36);
  box-shadow: var(--shadow-md);
}

[data-theme="moncher-warm-preview"] .admin-card > i {
  color: var(--primary);
}

[data-theme="moncher-warm-preview"] .admin-card[style*="border-color:#8B5CF6"],
[data-theme="moncher-warm-preview"] .admin-card[style*="border-color: #8B5CF6"],
[data-theme="moncher-warm-preview"] .admin-card[style*="border-color:#7c3aed"],
[data-theme="moncher-warm-preview"] .admin-card[style*="border-color: #7c3aed"] {
  border-color: var(--semantic-accent-border) !important;
}

[data-theme="moncher-warm-preview"] .admin-card[style*="border-color:#0ea5e9"],
[data-theme="moncher-warm-preview"] .admin-card[style*="border-color: #0ea5e9"] {
  border-color: var(--semantic-info-border) !important;
}

[data-theme="moncher-warm-preview"] .admin-card[style*="border-color:#f59e0b"],
[data-theme="moncher-warm-preview"] .admin-card[style*="border-color: #f59e0b"] {
  border-color: var(--semantic-warning-border) !important;
}

[data-theme="moncher-warm-preview"] [style*="background:#EFF6FF"],
[data-theme="moncher-warm-preview"] [style*="background: #EFF6FF"],
[data-theme="moncher-warm-preview"] [style*="background:#DBEAFE"],
[data-theme="moncher-warm-preview"] [style*="background: #DBEAFE"] {
  background: var(--semantic-info-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="background:#ECFDF5"],
[data-theme="moncher-warm-preview"] [style*="background: #ECFDF5"],
[data-theme="moncher-warm-preview"] [style*="background:#F0FDF4"],
[data-theme="moncher-warm-preview"] [style*="background: #F0FDF4"],
[data-theme="moncher-warm-preview"] [style*="background:#D1FAE5"],
[data-theme="moncher-warm-preview"] [style*="background: #D1FAE5"] {
  background: var(--semantic-success-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="background:#FFFBEB"],
[data-theme="moncher-warm-preview"] [style*="background: #FFFBEB"],
[data-theme="moncher-warm-preview"] [style*="background:#FEF3C7"],
[data-theme="moncher-warm-preview"] [style*="background: #FEF3C7"] {
  background: var(--semantic-warning-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="background:#FEF2F2"],
[data-theme="moncher-warm-preview"] [style*="background: #FEF2F2"],
[data-theme="moncher-warm-preview"] [style*="background:#FEE2E2"],
[data-theme="moncher-warm-preview"] [style*="background: #FEE2E2"],
[data-theme="moncher-warm-preview"] [style*="background:#FFF5F5"],
[data-theme="moncher-warm-preview"] [style*="background: #FFF5F5"],
[data-theme="moncher-warm-preview"] [style*="background:#EF444410"],
[data-theme="moncher-warm-preview"] [style*="background: #EF444410"] {
  background: var(--semantic-danger-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="background:#F5F3FF"],
[data-theme="moncher-warm-preview"] [style*="background: #F5F3FF"],
[data-theme="moncher-warm-preview"] [style*="background:#FDF4FF"],
[data-theme="moncher-warm-preview"] [style*="background: #FDF4FF"] {
  background: var(--semantic-accent-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="background:#F9FAFB"],
[data-theme="moncher-warm-preview"] [style*="background: #F9FAFB"] {
  background: var(--semantic-neutral-bg) !important;
}

[data-theme="moncher-warm-preview"] [style*="background:#6b7280"],
[data-theme="moncher-warm-preview"] [style*="background: #6b7280"],
[data-theme="moncher-warm-preview"] [style*="background:#6B7280"],
[data-theme="moncher-warm-preview"] [style*="background: #6B7280"] {
  background: var(--semantic-neutral-text) !important;
  color: #FFFFFF !important;
}

[data-theme="moncher-warm-preview"] [style*="color:#6B7280"],
[data-theme="moncher-warm-preview"] [style*="color: #6B7280"],
[data-theme="moncher-warm-preview"] [style*="color:#6b7280"],
[data-theme="moncher-warm-preview"] [style*="color: #6b7280"] {
  color: var(--semantic-neutral-text) !important;
}

[data-theme="moncher-warm-preview"] [style*="color:#7c3aed"],
[data-theme="moncher-warm-preview"] [style*="color: #7c3aed"],
[data-theme="moncher-warm-preview"] [style*="color:#8B5CF6"],
[data-theme="moncher-warm-preview"] [style*="color: #8B5CF6"] {
  color: var(--semantic-accent-text) !important;
}

[data-theme="moncher-warm-preview"] [style*="border:1px solid #3B82F620"],
[data-theme="moncher-warm-preview"] [style*="border:1px solid #BFDBFE"],
[data-theme="moncher-warm-preview"] [style*="border:1px solid #DBEAFE"] {
  border-color: var(--semantic-info-border) !important;
}

[data-theme="moncher-warm-preview"] [style*="border:1px solid #10B98120"],
[data-theme="moncher-warm-preview"] [style*="border:1px solid #D1FAE5"],
[data-theme="moncher-warm-preview"] [style*="border:1px solid #A7F3D0"] {
  border-color: var(--semantic-success-border) !important;
}

[data-theme="moncher-warm-preview"] [style*="border:1px solid #F59E0B20"],
[data-theme="moncher-warm-preview"] [style*="border:1px solid #FEF3C7"],
[data-theme="moncher-warm-preview"] [style*="border:1px solid #FDE68A"] {
  border-color: var(--semantic-warning-border) !important;
}

[data-theme="moncher-warm-preview"] [style*="border:1px solid #EF444420"],
[data-theme="moncher-warm-preview"] [style*="border:1px solid #EF444430"],
[data-theme="moncher-warm-preview"] [style*="border:1px solid #FEE2E2"],
[data-theme="moncher-warm-preview"] [style*="border:1px solid #FECACA"] {
  border-color: var(--semantic-danger-border) !important;
}

[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background:#10B981"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background: #10B981"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background:#22C55E"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background: #22C55E"] {
  background: var(--semantic-success-text) !important;
}

[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background:#EF4444"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background: #EF4444"] {
  background: var(--semantic-danger-text) !important;
}

[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background:#F59E0B"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background: #F59E0B"] {
  background: var(--semantic-warning-text) !important;
}

[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background:#3B82F6"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background: #3B82F6"] {
  background: var(--semantic-info-text) !important;
}

[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="border:1px solid #FEE2E2"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="border:1px solid #FFF5F5"] {
  border-color: var(--semantic-danger-border) !important;
}

[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="border:1px solid #D1FAE5"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="border:1px solid #F0FDF4"] {
  border-color: var(--semantic-success-border) !important;
}

[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background:var(--card-border)"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background: var(--card-border)"],
[data-theme="moncher-warm-preview"] [style*="background:var(--card-border)"],
[data-theme="moncher-warm-preview"] [style*="background: var(--card-border)"] {
  background: var(--surface-panel) !important;
}

/* =============================================
   버전 히스토리 타임라인 스타일
   ============================================= */
.version-timeline {
  position: relative;
  padding-left: 20px;
}
.version-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--card-border, #E5E7EB);
}
.version-item {
  position: relative;
  margin-bottom: 4px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  cursor: pointer;
  transition: box-shadow 0.18s, border-color 0.18s;
}
.version-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.version-item-latest {
  border-color: var(--primary);
  background: var(--primary-surface, rgba(232,116,0,0.06));
}
.version-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  user-select: none;
}
.version-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--card-border, #D1D5DB);
  border: 2px solid var(--card-bg);
  flex-shrink: 0;
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
}
.version-dot-latest {
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-surface, rgba(232,116,0,0.2));
}
.version-item-meta {
  flex: 1;
  min-width: 0;
}
.version-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.version-date {
  font-size: 11px;
  color: var(--text-muted);
}
.version-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.version-chevron {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.version-badge-current {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-surface, rgba(232,116,0,0.1));
  border: 1px solid var(--primary);
  border-radius: 20px;
  padding: 2px 10px;
}
.version-badge-new {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border-radius: 20px;
  padding: 1px 7px;
}

/* ============================================
   파일 업로드 진행률
   ============================================ */
.file-upload-progress {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
}

.file-upload-progress .file-preview {
  text-align: center;
}

.file-upload-progress .file-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.file-upload-progress .file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.file-upload-progress .file-info i {
  color: var(--primary);
  font-size: 16px;
}

.file-upload-progress .file-name {
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-upload-progress .file-size {
  color: var(--text-muted);
  font-size: 12px;
}

.file-upload-progress .progress-bar {
  width: 100%;
  height: 8px;
  background: var(--body-bg);
  border-radius: 4px;
  overflow: hidden;
}

.file-upload-progress .progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
  border-radius: 4px;
}

.file-upload-progress .progress-text {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}
.version-detail {
  padding: 0 14px 12px 14px;
}
.version-change-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.version-change-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.version-change-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 2px;
}
.version-tag-feat   { background: rgba(37,99,235,0.12); color: #2563EB; }
.version-tag-fix    { background: rgba(220,38,38,0.10); color: #DC2626; }
.version-tag-perf   { background: rgba(5,150,105,0.12); color: #059669; }
.version-tag-style  { background: rgba(139,92,246,0.12); color: #7C3AED; }
.version-tag-docs   { background: rgba(107,114,128,0.12); color: #6B7280; }
.version-tag-refactor { background: rgba(245,158,11,0.12); color: #D97706; }
.version-tag-chore  { background: rgba(107,114,128,0.10); color: #9CA3AF; }

/* 다크 테마 조정 */
[data-theme="dark"] .version-tag-feat   { background: rgba(96,165,250,0.18); color: #93C5FD; }
[data-theme="dark"] .version-tag-fix    { background: rgba(252,165,165,0.18); color: #FCA5A5; }
[data-theme="dark"] .version-tag-perf   { background: rgba(52,211,153,0.18); color: #6EE7B7; }
[data-theme="dark"] .version-tag-style  { background: rgba(196,181,253,0.18); color: #C4B5FD; }
[data-theme="dark"] .version-tag-docs   { background: rgba(156,163,175,0.18); color: #9CA3AF; }
[data-theme="dark"] .version-tag-refactor { background: rgba(253,230,138,0.18); color: #FCD34D; }

@media (max-width: 768px) {
  .version-item-header { padding: 10px 12px; gap: 8px; }
  .version-title { font-size: 12px; }
  .version-num { font-size: 12px; }
  .version-detail { padding: 0 12px 10px 12px; }
  .version-change-item { font-size: 12px; }
}



/* ==========================================
   Messenger Layout - 카카오톡 스타일
   ========================================== */

/* ── 전체 컨테이너 ── */
.messenger-container {
  position: relative;
  display: flex;
  height: calc(100dvh - 60px);
  height: calc(100dvh - 60px);
  width: 100%;
  background: var(--body-bg);
  overflow: hidden;
}

.messenger-container.messenger-privacy-locked .room-list-panel,
.messenger-container.messenger-privacy-locked .chat-view-panel,
.messenger-container.messenger-privacy-locked .ms-thread-panel {
  filter: blur(12px);
  pointer-events: none;
  user-select: none;
}

.messenger-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 35%, rgba(var(--primary-rgb), .16), transparent 42%),
    color-mix(in srgb, var(--body-bg) 82%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.messenger-lock-overlay-global {
  position: fixed;
  z-index: 9600;
}

.messenger-lock-card {
  width: min(380px, 100%);
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--card-bg) 94%, transparent);
  color: var(--text-primary);
  box-shadow: var(--shadow-xl, 0 24px 80px rgba(15, 23, 42, .28));
  text-align: center;
}

.messenger-lock-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--primary-contrast, #fff);
  font-size: 22px;
}

.messenger-lock-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
}

.messenger-lock-card p {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.messenger-lock-card form {
  display: grid;
  gap: 10px;
}

.messenger-lock-pin-input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--input-text);
  text-align: center;
  font-size: 20px !important;
  letter-spacing: 6px;
  outline: none;
  -webkit-text-security: disc;
}

.messenger-lock-pin-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .16);
}

.messenger-lock-field .messenger-lock-pin-field-input {
  text-align: left;
  font-size: 16px !important;
  letter-spacing: 4px;
}

.messenger-lock-settings-link {
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.messenger-lock-settings {
  display: grid;
  gap: 12px;
  padding: 4px 0;
}

.modal:has(.messenger-lock-settings) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal:has(.messenger-lock-settings) .modal-body {
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal:has(.messenger-lock-settings) .modal-footer {
  flex-shrink: 0;
  background: var(--glass-bg, var(--modal-bg, var(--card-bg)));
}

.messenger-lock-setting-row,
.messenger-lock-field {
  display: flex;
  gap: 14px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  color: var(--text-primary);
}

.messenger-lock-setting-row {
  align-items: center;
  justify-content: space-between;
  padding: 14px;
}

.messenger-lock-setting-row strong,
.messenger-lock-field > span {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
}

.messenger-lock-setting-row strong i {
  margin-right: 8px;
  color: var(--primary);
}

.messenger-lock-setting-row div > span,
.messenger-lock-field small,
.messenger-lock-hint {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.messenger-lock-setting-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.messenger-lock-field {
  flex-direction: column;
  padding: 12px 14px;
}

.messenger-lock-field input,
.messenger-lock-field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--input-border);
  border-radius: 10px;
  background: var(--input-bg);
  color: var(--input-text);
  padding: 8px 10px;
}

.messenger-lock-hint {
  margin: 2px 4px 0;
}

@media (max-width: 768px) {
  .modal:has(.messenger-lock-settings) {
    max-height: var(--vvh, 92dvh);
  }

  .messenger-lock-setting-row {
    align-items: flex-start;
    gap: 12px;
  }

  .messenger-lock-setting-row input[type="checkbox"] {
    margin-top: 2px;
  }
}

body.messenger-privacy-locked .messenger-floating-window {
  filter: blur(10px);
  pointer-events: none;
  user-select: none;
}

body.messenger-privacy-locked .messenger-window-dock {
  filter: blur(10px);
  pointer-events: none;
}

/* 메신저 활성 시 #pageContent의 하단 padding이 100dvh를 24px 초과해 body가 스크롤 가능해지는 문제 수정
   — overflow:hidden으로 넘침 차단 (padding/height 변경 없이 안전하게 적용) */
#pageContent:has(.messenger-container) {
  overflow: hidden;
}

#pageContent .messenger-container {
  height: calc(100dvh - 80px);
  height: calc(100dvh - 80px);
  width: 100%;
}

/* ── 좌측: 채팅방 목록 패널 ── */
.room-list-panel {
  width: 320px;
  min-width: 280px;
  max-width: 360px;
  flex-shrink: 0;
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  overflow: hidden;
  transition: transform 0.25s ease;
}

/* 헤더 */
.room-list-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
  background: var(--card-bg);
}

.room-list-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.room-list-title h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.room-list-actions {
  display: flex;
  gap: 6px;
}

.room-list-actions button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  transition: all 0.2s;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.room-list-actions button.btn-primary {
  background: var(--primary);
  color: white;
}

.room-list-actions button.btn-outline {
  background: transparent;
  color: var(--text-secondary);
}

.room-list-actions button:hover {
  opacity: 0.8;
  transform: scale(1.06);
}

/* 검색창 */
.room-search-wrap {
  position: relative;
}

.room-search-wrap input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: none;
  border-radius: 20px;
  background: var(--body-bg);
  color: var(--input-text);
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.room-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
}

/* 채팅방 목록 */
#roomList {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

#roomList::-webkit-scrollbar { width: 4px; }
#roomList::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 2px; }

/* ── 채팅방 아이템 ── */
.room-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  min-height: 64px;
}

.room-item:hover {
  background: var(--primary-surface, rgba(0,0,0,0.04));
}

.room-item.active {
  background: var(--primary-surface, rgba(0,0,0,0.06));
}

/* 채팅방 아바타 */
.room-item-avatar {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.room-item-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}

.room-item-online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid var(--card-bg);
}

/* 채팅방 내용 */
.room-item-content {
  flex: 1;
  min-width: 0;
}

.room-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}

.room-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.room-item-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.room-item-preview {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.room-item-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: #E74C3C;
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  margin-left: 4px;
}

/* ── 우측: 채팅뷰 패널 ── */
.chat-view-panel {
  flex: 1;
  display: none;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #F2F3F5;
  position: relative;
}

[data-theme="dark"] .chat-view-panel {
  background: #1a1a1a;
}

/* 데스크톱: 항상 표시 */
@media (min-width: 769px) {
  .chat-view-panel {
    display: flex;
  }
}

.chat-view-panel.active {
  display: flex;
}

/* ── 채팅 헤더 ── */
.chat-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  flex-shrink: 0;
  min-height: 56px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  z-index: 1;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.ms-channel-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  color: var(--text-primary);
  font-weight: 700;
  cursor: pointer;
}

.ms-channel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 16px;
  color: var(--text-muted);
  line-height: 1;
}

.ms-channel-icon:empty {
  display: none;
}

.ms-channel-name {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
  line-height: 1.25;
}

.ms-channel-topic {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}

.chat-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  transition: background 0.15s;
}

.chat-back-btn:hover {
  background: var(--primary-surface, rgba(0,0,0,0.06));
}

/* 채팅 헤더 아바타 */
.chat-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.chat-header-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}

.chat-header-info {
  flex: 1;
  min-width: 0;
}

.chat-header-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-header-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.chat-header-actions button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.15s;
}

.chat-header-actions button:hover {
  background: var(--primary-surface, rgba(0,0,0,0.06));
  color: var(--primary);
}

.ms-mobile-menu-item {
  display: none !important;
}

/* ── 메시지 영역 ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;  /* 스크롤 끝에서 부모로 체인되지 않도록 차단 */
  padding: 12px 16px 8px;
  background: #F2F3F5;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 0;
}

[data-theme="dark"] .chat-messages {
  background: #1a1a1a;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }
[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

/* 날짜 구분선 */
.chat-date-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 10px;
}

.chat-date-divider span {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(0,0,0,0.07);
  padding: 3px 12px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  margin: 0 auto;
}

[data-theme="dark"] .chat-date-divider span {
  background: rgba(255,255,255,0.1);
}

/* 메시지 그룹: 기본 간격 */
.message-group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 4px;   /* 2→4px: 연속 메시지 간격 (카카오톡 기준) */
}

.message-group.own {
  flex-direction: row-reverse;
}

/* 다른 발신자 전환 시 위 여백 */
.message-group.gap-top {
  margin-top: 14px;     /* 10→14px: 그룹 간 여백 (카카오톡 기준) */
}

/* 아바타 */
.message-avatar {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  align-self: flex-end;
  overflow: hidden;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
}

.message-avatar.invisible {
  visibility: hidden;
}

/* 메시지 컨텐츠 영역 */
.message-content {
  max-width: min(86%, 820px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.message-group.own .message-content {
  align-items: flex-end;
}

/* 발신자 이름 */
.message-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
  padding: 0 4px;
}

.message-group.own .message-sender {
  display: none;
}

/* 메시지 버블 + 시간 행 */
.message-row {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  min-width: 0;
  position: relative;
}

.message-group.own .message-row {
  flex-direction: row-reverse;
}

/* 메시지 버블 */
.message-bubble {
  padding: 9px 13px;
  border-radius: 18px;
  background: #FFFFFF;
  color: #1A1A1A;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  display: block;
  width: fit-content;    /* 텍스트 너비에 맞게 수축 — 짧은 메시지 과도한 여백 방지 */
  max-width: 100%;
  white-space: pre-wrap;
  position: relative;
}

/* 상대방 버블: 왼쪽 하단 각짐 */
.message-group:not(.own) .message-bubble {
  border-bottom-left-radius: 4px;
}

/* 내 버블: 오른쪽 하단 각짐 + 주 색상 */
.message-group.own .message-bubble {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

[data-theme="dark"] .message-bubble {
  background: #2E2E2E;
  color: #F0F0F0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

[data-theme="dark"] .message-group.own .message-bubble {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* 이미지 메시지: 배경/패딩 없이 이미지만 표시 */
.message-bubble.message-bubble-image {
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: block;
  font-size: 0;      /* 템플릿 개행 텍스트노드 ghost line-box 제거 */
  line-height: 0;    /* 같은 이유 */
  white-space: normal; /* white-space:pre-wrap 상속 override */
}
.message-group:not(.own) .message-bubble.message-bubble-image {
  border-radius: 0 !important;
}
.message-group.own .message-bubble.message-bubble-image {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
[data-theme="dark"] .message-bubble.message-bubble-image,
[data-theme="dark"] .message-group.own .message-bubble.message-bubble-image {
  background: transparent !important;
  box-shadow: none !important;
}

/* 메시지 시간 */
.message-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-bottom: 3px;
  line-height: 1.2;
}

/* 읽음 수 */
.message-read-count {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
  display: block;
  text-align: right;
}

/* 안 읽음 표시 */
.message-read-unread {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
  display: block;
  text-align: right;
  opacity: 0.7;
}

/* ── 입력창 영역 ── */
.chat-input-wrap {
  padding: 10px 12px;
  border-top: 1px solid var(--card-border);
  background: var(--card-bg);
  flex-shrink: 0;
}

.chat-input-container {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--body-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 24px;
  padding: 6px 8px 6px 14px;
  transition: border-color 0.2s;
}

.chat-input-container:focus-within {
  border-color: var(--primary);
}

.chat-input-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.chat-input-actions button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: color 0.15s;
  flex-shrink: 0;
}

.chat-input-actions button:hover {
  color: var(--primary);
}

#messageInput {
  flex: 1;
  min-height: 22px;
  max-height: 120px;
  padding: 5px 0;
  border: none;
  background: transparent;
  color: var(--input-text);
  font-size: 14px;
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  outline: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overflow-anchor: none;
}

#messageInput::-webkit-scrollbar {
  display: none;
}

#messageInput::placeholder {
  color: var(--text-muted);
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-size: 15px;
}

.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.08);
  opacity: 0.9;
}

.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── 빈 상태 ── */
.chat-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  padding: 32px;
  gap: 14px;
  background: #F2F3F5;
}

[data-theme="dark"] .chat-empty-state {
  background: #1a1a1a;
}

.chat-empty-state i {
  font-size: 60px;
  opacity: 0.18;
}

.chat-empty-state p {
  font-size: 15px;
  opacity: 0.55;
}

/* ── 타이핑 인디케이터 ── */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 9px 13px;
  background: #FFFFFF;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  margin-bottom: 8px;
}

[data-theme="dark"] .typing-indicator {
  background: #2E2E2E;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ── 시스템 메시지 ── */
.system-message {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 5px 14px;
  margin: 10px auto;
  background: rgba(0,0,0,0.06);
  border-radius: 12px;
  width: fit-content;
  max-width: 80%;
}

[data-theme="dark"] .system-message {
  background: rgba(255,255,255,0.08);
}

/* ── 모바일: 한 패널씩 표시 ── */
@media (max-width: 768px) {
  /* 메신저 활성 시 외부 스크롤바 제거 — .main-area의 overflow-y:auto가 이중 스크롤바를 만드는 문제 해결 */
  .main-area:has(.messenger-container) {
    overflow: hidden !important;
  }

  .messenger-container {
    position: relative;
    overflow: hidden;
    min-height: 0;
  }

  .messenger-container.messenger-keyboard-open {
    position: fixed !important;
    top: var(--messenger-top, 0) !important;
    left: var(--messenger-left, 0) !important;
    width: var(--messenger-width, 100vw) !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 10050;
    height: var(--messenger-vvh, var(--vvh, 100dvh)) !important;
    min-height: 0 !important;
    max-height: var(--messenger-vvh, var(--vvh, 100dvh)) !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  .messenger-container.messenger-keyboard-open .chat-view-panel.active {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
  }

  .messenger-container.messenger-keyboard-open .chat-messages {
    min-height: 0;
    flex: 1 1 auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    overflow-anchor: none;
  }

  .messenger-container.messenger-keyboard-open .chat-input-wrap {
    padding: 8px 10px 10px !important;
    contain: layout style;
  }

  .messenger-container.messenger-keyboard-open #messageInput {
    will-change: height;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  .messenger-container.messenger-keyboard-open .messenger-lock-overlay {
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: max(14px, env(safe-area-inset-top)) 20px max(16px, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .messenger-container.messenger-keyboard-open .messenger-lock-card {
    max-height: calc(var(--messenger-vvh, var(--vvh, 100dvh)) - 28px);
    overflow-y: auto;
  }

  html.messenger-keyboard-lock,
  body.messenger-keyboard-lock,
  body.messenger-keyboard-lock .main-area:has(.messenger-container),
  body.messenger-keyboard-lock #pageContent:has(.messenger-container) {
    overflow: hidden !important;
    overscroll-behavior: none !important;
  }

  .room-list-panel {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    position: absolute;
    inset: 0;
    z-index: 1;
    transition: transform 0.25s ease;
  }

  /* 채팅방 선택 시 목록 패널 슬라이드 아웃 */
  .room-list-panel.hidden-mobile {
    transform: translateX(-100%);
  }

  .chat-view-panel {
    width: 100%;
    position: absolute;
    inset: 0;
    z-index: 2;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    display: flex;
    min-height: 0;
  }

  .chat-view-panel.active {
    transform: translateX(0);
  }

  .chat-header.ms-chat-header {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    min-height: calc(52px + env(safe-area-inset-top, 0px));
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px !important;
  }

  .chat-header-left {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    gap: 8px;
  }

  .chat-back-btn {
    display: flex;
    width: 32px;
    height: 32px;
  }

  .ms-channel-title {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .ms-channel-name {
    font-size: 16px;
    display: block;
    min-width: 0;
    max-width: 100%;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    text-overflow: ellipsis;
  }

  .ms-channel-topic {
    display: none;
  }

  .chat-header-actions {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    justify-content: flex-end;
    overflow: visible;
    padding-left: 0;
    scrollbar-width: none;
  }

  .chat-header-actions::-webkit-scrollbar {
    display: none;
  }

  .chat-header-actions #connectionStatus {
    display: none !important;
  }

  .chat-header-actions > .ms-header-btn {
    display: none !important;
  }

  .chat-header-actions > .ms-header-more-wrap {
    display: block;
    flex: 0 0 auto;
  }

  .chat-header-actions > .ms-header-more-wrap > .ms-header-btn {
    display: flex !important;
    width: 36px;
    height: 36px;
  }

  #roomMenuDropdown .ms-mobile-menu-item {
    display: flex !important;
  }

  #roomMenuDropdown div.ms-mobile-menu-item {
    display: block !important;
  }

  .message-content {
    max-width: 88%;
  }
}

/* ── 데스크톱 ── */
@media (min-width: 769px) {
  .room-list-panel {
    width: 300px;
    min-width: 260px;
    max-width: 340px;
    position: relative;
    transform: none !important;
  }

  .chat-view-panel {
    position: relative;
    transform: none !important;
    display: flex;
  }

  .chat-back-btn {
    display: none;
  }

  .message-content {
    max-width: min(82%, 820px);
  }
}

/* ── 큰 화면 ── */
@media (min-width: 1280px) {
  .room-list-panel {
    width: 320px;
  }

  .message-content {
    max-width: min(76%, 860px);
  }
}

/* ── iOS Safe Area ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .chat-input-wrap {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

/* ── 모바일 키보드 대응: visualViewport 높이를 CSS 변수로 주입 ── */
@media (max-width: 768px) {
  body:not(.messenger-popout-mode) .messenger-container {
    /* JS 전역 --vvh는 실제 viewport 높이이므로 앱 헤더 영역을 제외해 본문 내부 높이와 맞춘다. */
    height: calc(var(--vvh, 100dvh) - 80px);
  }

  body.messenger-popout-mode .messenger-container,
  .messenger-popout-container {
    height: var(--vvh, 100dvh);
    min-height: var(--vvh, 100dvh);
  }

  .messenger-container.messenger-keyboard-open {
    height: var(--messenger-vvh, var(--vvh, 100dvh)) !important;
    min-height: 0 !important;
  }
}

/* ==========================================
   Phase 4: 메시지 인터랙션 스타일
   ========================================== */

/* ── 호버 액션 메뉴 ── */
.message-group {
  position: relative;
}

.message-actions {
  position: absolute;
  top: -6px;
  display: flex;
  gap: 2px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 3px 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
  white-space: nowrap;
}

/* 상대방 메시지: 오른쪽에 메뉴 */
.message-group:not(.own) .message-actions {
  left: calc(38px + 8px + 4px);
}

/* 내 메시지: 왼쪽에 메뉴 */
.message-group.own .message-actions {
  right: 4px;
}

/* 호버 시 메뉴 표시 (CSS :hover 제거 — iOS에서 탭 후 지속 표시 버그 방지, JS .is-hovered 사용) */
.message-group.is-hovered .message-actions {
  opacity: 1;
  pointer-events: auto;
}

.message-actions button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}

.message-actions button:hover {
  background: var(--primary-surface, rgba(0,0,0,0.07));
  color: var(--primary);
}

/* ── 이모지 반응 ── */
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

/* ── 답장(Reply) 미리보기 ── */
.reply-preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 12px;
  background: var(--body-bg);
  border-top: 1px solid var(--card-border);
  border-left: 3px solid var(--primary);
  flex-shrink: 0;
}

.reply-preview-bar .reply-info {
  flex: 1;
  min-width: 0;
}

.reply-preview-bar .reply-sender {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2px;
}

.reply-preview-bar .reply-text {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-preview-bar .reply-cancel {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.reply-preview-bar .reply-cancel:hover {
  background: var(--primary-surface);
  color: var(--text-primary);
}

/* reply-quote 구형 블록 제거됨 — 아래 신형 블록 사용 (4660번대) */

/* ── 수정 모드 입력창 강조 ── */
.chat-input-container.edit-mode {
  border-color: #f59e0b;
  background: #fffbeb;
}

[data-theme="dark"] .chat-input-container.edit-mode {
  border-color: #f59e0b;
  background: #2a2400;
}

.edit-mode-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: #fffbeb;
  border-top: 1px solid #f59e0b;
  flex-shrink: 0;
  font-size: 12px;
  color: #92400e;
}

[data-theme="dark"] .edit-mode-bar {
  background: #2a2400;
  color: #fcd34d;
}

.edit-mode-bar i { color: #f59e0b; }

.edit-mode-bar button {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.edit-mode-bar button:hover { opacity: 1; }

/* ── 표(table) 메시지 버블 ── */
.msg-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border-radius: 8px;
}

.msg-table-wrap table {
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.msg-table-wrap th,
.msg-table-wrap td {
  padding: 5px 10px;
  border: 1px solid rgba(0,0,0,0.15);
  text-align: left;
}

.message-group.own .msg-table-wrap th,
.message-group.own .msg-table-wrap td {
  border-color: rgba(255,255,255,0.25);
}

.msg-table-wrap th {
  background: rgba(0,0,0,0.06);
  font-weight: 600;
}

.message-group.own .msg-table-wrap th {
  background: rgba(0,0,0,0.12);
}

/* ── 날짜 구분선 (이미 정의된 것 보완) ── */
.chat-date-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  pointer-events: none;
}

.chat-date-divider::before,
.chat-date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
  opacity: 0.5;
}

.chat-date-divider span {
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  padding: 2px 10px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==========================================
   Phase 4 추가 CSS: 호버 메뉴 / 답글 / 리액션
   ========================================== */

/* ── 메시지 버블 래퍼 ── */
.message-bubble-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* 자식 stretch 방지 → 버블이 텍스트 너비로 수축 */
  min-width: 0;
  flex: 1;
  max-width: 100%;
}
/* 내 메시지는 버블이 오른쪽 정렬되도록 */
.message-group.own .message-bubble-wrap {
  align-items: flex-end;
}

/* ── 호버 메뉴 ── */
/* CSS :hover 트리거 완전 제거 → JS .is-hovered 클래스로만 제어
   이유: bottom:100% 로 버블 위에 떠 있어서 마우스 이동 경로 중
   .message-row 밖을 지나는 순간 CSS hover가 끊겨 메뉴가 도망감 */
.msg-hover-menu {
  display: flex;
  flex-direction: row;
  gap: 2px;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 3px 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  white-space: nowrap;
  position: absolute;
  bottom: 100%;
  margin-bottom: 2px;
  z-index: 200;
}

/* 내 메시지: 호버 메뉴를 오른쪽 정렬 */
.message-group.own .msg-hover-menu {
  right: 0;
}

/* 상대방 메시지: 호버 메뉴를 왼쪽 정렬 */
.message-group:not(.own) .msg-hover-menu {
  left: 0;
}

/* JS가 .is-hovered 클래스를 .message-group에 추가할 때만 표시 */
.message-group.is-hovered .msg-hover-menu {
  opacity: 1;
  pointer-events: auto;
}

.msg-hover-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.msg-hover-btn:hover {
  background: rgba(0,0,0,0.07);
  color: var(--primary);
}
.msg-hover-btn.danger:hover { color: #ef4444; }

/* message-row 레이아웃 */
.message-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
  position: relative;
}
.message-group.own .message-row {
  flex-direction: row-reverse;
}

/* ── 답글 미리보기 (입력창 위) ── */
.reply-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--body-bg);
  border-top: 1px solid var(--card-border);
  border-left: 3px solid var(--primary);
  flex-shrink: 0;
}
.reply-preview-inner {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.reply-preview-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-right: 4px;
  flex-shrink: 0;
}
.reply-preview-content {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reply-cancel-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.12s;
}
.reply-cancel-btn:hover { color: var(--text-primary); }

/* ── 답글 인용 (버블 내) ── */
.reply-quote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  color: var(--text-main);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  max-width: 100%;
  overflow: hidden;
  white-space: normal;
  line-height: 1.35;
}
.reply-quote:hover {
  background: var(--body-bg);
  border-color: var(--primary);
}
.message-group.own .reply-quote {
  background: var(--card-bg);
  border-color: var(--card-border);
  border-left-color: var(--primary);
}
.message-bubble:has(.reply-quote) {
  min-width: min(260px, 100%);
  max-width: min(420px, 100%);
  white-space: normal;
}
.message-bubble.message-bubble-image:has(.reply-quote) {
  max-width: min(420px, 100%);
}
.reply-quote-main {
  flex: 1;
  min-width: 0;
}
.reply-quote-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 3px;
}
.reply-quote-text {
  font-size: 12px;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  word-break: break-word;
}
.reply-quote-thumb {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--body-bg);
  border: 1px solid var(--card-border);
}
.reply-quote-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 14px;
}

/* ── 날짜 구분선 ── */
.date-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 6px;
  pointer-events: none;
}
.date-divider::before,
.date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--card-border);
  opacity: 0.5;
}
.date-divider span {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 10px;
  background: var(--body-bg);
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--card-border);
}

/* ── 인라인 메시지 수정 ── */
.edit-inline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}
.edit-textarea {
  width: 100%;
  min-height: 60px;
  padding: 6px 8px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}
.edit-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.edit-cancel-btn,
.edit-save-btn {
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.12s;
}
.edit-cancel-btn {
  background: var(--body-bg);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}
.edit-cancel-btn:hover { background: var(--card-border); }
.edit-save-btn {
  background: var(--primary);
  color: #fff;
}
.edit-save-btn:hover { opacity: 0.88; }

/* ── 삭제된 메시지 ── */
.message-bubble.deleted-message {
  opacity: 0.55;
  font-style: italic;
  background: var(--body-bg) !important;
  color: var(--text-muted) !important;
  border: 1px dashed var(--card-border) !important;
  width: fit-content;
  max-width: fit-content;
  padding: 6px 12px;
  font-size: 13px;
  box-shadow: none !important;
  white-space: normal;  /* pre-wrap 상속 취소 — template literal 줄바꿈이 높이에 반영되는 문제 방지 */
  line-height: 1.4;
}

/* ── 수정됨 표시 ── */
.edited-mark {
  font-size: 11px;
  opacity: 0.6;
  margin-left: 5px;
}

/* ── 메시지 하이라이트 (답글 클릭 시) ── */
@keyframes msgHighlight {
  0% { background: rgba(var(--primary-rgb,79,70,229),0.18); }
  100% { background: transparent; }
}
.msg-highlight {
  animation: msgHighlight 1.5s ease-out;
  border-radius: 8px;
}

/* ── 이미지 메시지 버블 ── */
.img-msg-wrap {
  max-width: 240px;
  cursor: pointer;
  display: block;    /* inline-block → block: line-height ghost space 제거 */
  line-height: 0;    /* 부모 font-size/line-height 상속으로 생기는 여백 제거 */
}
.img-msg-thumb {
  max-width: 240px;
  max-height: 300px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  transition: opacity 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.img-msg-wrap:hover .img-msg-thumb { opacity: 0.85; }

@media (max-width: 768px) {
  #imgViewerOverlay .img-viewer-counter {
    display: none !important;
  }

  #imgViewerOverlay .img-viewer-actions {
    top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
    right: max(10px, env(safe-area-inset-right, 0px)) !important;
    gap: 6px !important;
  }

  #imgViewerOverlay .img-viewer-download {
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    justify-content: center !important;
    border-radius: 50% !important;
  }

  #imgViewerOverlay .img-viewer-download-label {
    display: none !important;
  }

  #imgViewerOverlay #imgViewerClose {
    width: 40px !important;
    height: 40px !important;
    font-size: 22px !important;
  }

  #imgViewerOverlay #imgViewerZoomBar {
    top: calc(env(safe-area-inset-top, 0px) + 10px) !important;
  }

  #imgViewerOverlay #imgViewerStage {
    top: calc(env(safe-area-inset-top, 0px) + 62px) !important;
    left: 8px !important;
    right: 8px !important;
  }
}

.img-msg-bundle-grid,
.mf-image-bundle-grid {
  --bundle-cols: 3;
  display: grid;
  grid-template-columns: repeat(var(--bundle-cols), minmax(0, 1fr));
  gap: 2px;
  width: min(282px, calc(100vw - 112px));
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,0.08);
  line-height: 0;
}

.mf-image-bundle-grid {
  width: min(238px, 100%);
  border-radius: 10px;
}

.img-msg-bundle-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 0;
  background: var(--hover-bg);
  cursor: pointer;
  overflow: hidden;
}

.img-msg-bundle-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .16s ease, opacity .16s ease;
}

.img-msg-bundle-item:hover img {
  transform: scale(1.025);
  opacity: .88;
}

.img-msg-bundle-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.48);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.img-upload-bundle-preview {
  display: grid;
  grid-template-columns: repeat(2, 52px);
  gap: 3px;
  margin-bottom: 8px;
}

.img-upload-bundle-preview img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

@media (max-width: 640px) {
  .img-msg-bundle-grid {
    width: min(252px, calc(100vw - 96px));
  }
}

/* 비이미지 파일 첨부 버블 */
.file-msg-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  max-width: 260px;
  cursor: pointer;
  padding: 2px 0;
}
.file-msg-wrap:hover { opacity: 0.8; }

/* 파일 버블: 내용 너비에 맞게 수축 + template literal 공백 제거 */
.message-bubble:has(.file-msg-wrap) {
  max-width: 280px;
  width: fit-content;
  white-space: normal;
}

.img-load-err {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.06);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
}
/* 이미지 뷰어 fadeIn 애니메이션 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ════════════════════════════════════════════
   스티커 피커 팝업
   ════════════════════════════════════════════ */
.sticker-picker-popup {
  position: fixed;
  z-index: 9999;
  width: 560px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow: hidden;
  animation: popIn 0.15s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sticker-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--card-border);
  flex: 0 0 auto;
}

.sticker-picker-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.sticker-picker-close {
  width: 28px; height: 28px;
  border: none; background: transparent;
  border-radius: 50%; cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}
.sticker-picker-close:hover {
  background: var(--body-bg);
  color: var(--text-primary);
}

/* 카테고리 탭 */
.sticker-picker-tabs-shell {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border-bottom: 1px solid var(--card-border);
  flex: 0 0 auto;
  background: var(--card-bg);
}

.sticker-tabs-scroll-btn {
  width: 30px;
  flex: 0 0 30px;
  border: 0;
  border-right: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.sticker-tabs-scroll-btn:last-child {
  border-right: 0;
  border-left: 1px solid var(--card-border);
}

.sticker-tabs-scroll-btn:hover {
  background: var(--body-bg);
  color: var(--text-primary);
}

.sticker-picker-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sticker-picker-tabs::-webkit-scrollbar { display: none; }

.sticker-tab-btn {
  flex: 0 0 38px;
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s, transform 0.1s;
  position: relative;
}
.sticker-tab-btn:hover { background: var(--body-bg); transform: scale(1.1); }
.sticker-tab-btn.active {
  background: var(--primary-surface, rgba(var(--primary-rgb,255,107,0),0.12));
}
.sticker-tab-btn.active::after {
  content: '';
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 2px;
  background: var(--primary);
  border-radius: 2px;
}
.sticker-tab-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  pointer-events: none;
}

.sticker-picker-pack-title {
  padding: 7px 12px 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
}

/* 스티커 그리드 */
.sticker-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 124px;
  gap: 12px;
  padding: 12px;
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--card-border) transparent;
  align-content: start;
}
.sticker-picker-grid::-webkit-scrollbar { width: 4px; }
.sticker-picker-grid::-webkit-scrollbar-track { background: transparent; }
.sticker-picker-grid::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 4px; }

.sticker-item {
  width: 116px; height: 116px;
  border: none; background: transparent;
  border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 4px;
  transition: background 0.1s, transform 0.1s;
  position: relative;
  justify-self: center;
}
.sticker-item:hover {
  background: var(--body-bg);
  transform: scale(1.08);
  z-index: 1;
}
.sticker-item:active { transform: scale(0.96); }
.sticker-item.selected {
  background: var(--primary-surface, rgba(var(--primary-rgb,255,107,0),0.14));
  box-shadow: inset 0 0 0 2px var(--primary);
}
.sticker-item img {
  width: 108px; height: 108px;
  object-fit: contain;
  pointer-events: none;
}
.sticker-item-fallback {
  width: 108px;
  height: 108px;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--body-bg);
  border-radius: 8px;
  font-size: 18px;
  pointer-events: none;
}
.sticker-animated-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  pointer-events: none;
}
.sticker-picker-empty {
  grid-column: 1 / -1;
  padding: 28px 8px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.sticker-picker-preview {
  border-top: 1px solid var(--card-border);
  min-height: 0;
  flex: 0 0 auto;
}
.sticker-picker-preview:empty {
  display: none;
}
.sticker-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 12px;
  background: var(--surface-2, var(--body-bg));
  min-height: 126px;
}
.sticker-preview-media {
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sticker-preview-media .sticker-msg-img,
.sticker-preview-media .sticker-lottie,
.sticker-preview-media .sticker-lottie svg {
  width: 104px !important;
  height: 104px !important;
}
.sticker-preview-side {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sticker-preview-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.sticker-preview-send {
  height: 34px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s;
}

@media (max-width: 640px) {
  .sticker-picker-popup.mobile {
    border-radius: 14px;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.22);
  }
  .sticker-picker-popup.mobile .sticker-picker-tabs {
    padding: 5px 8px;
  }
  .sticker-picker-popup.mobile .sticker-picker-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 108px;
    gap: 8px;
    min-height: 0;
    padding: 10px 12px;
  }
  .sticker-picker-popup.mobile .sticker-item {
    width: 100px;
    height: 100px;
    justify-self: center;
  }
  .sticker-picker-popup.mobile .sticker-item img,
  .sticker-picker-popup.mobile .sticker-item-fallback {
    width: 94px;
    height: 94px;
  }
  .sticker-picker-popup.mobile .sticker-preview-card {
    min-height: 104px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
  }
  .sticker-picker-popup.mobile .sticker-preview-media {
    width: 82px;
    height: 82px;
    flex-basis: 82px;
  }
  .sticker-picker-popup.mobile .sticker-preview-media .sticker-msg-img,
  .sticker-picker-popup.mobile .sticker-preview-media .sticker-lottie,
  .sticker-picker-popup.mobile .sticker-preview-media .sticker-lottie svg {
    width: 82px !important;
    height: 82px !important;
  }
  .sticker-picker-popup.mobile .sticker-preview-send {
    height: 36px;
    width: 100%;
  }
}
.sticker-preview-send:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.sticker-preview-send:active {
  transform: translateY(0);
}

/* ════════════════════════════════════════════
   스티커 메시지 버블
   ════════════════════════════════════════════ */
.sticker-msg-wrap {
  display: inline-block;
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
}
.sticker-msg-wrap:hover { transform: scale(1.06); }

.sticker-msg-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
  transition: filter 0.15s;
}
.sticker-msg-wrap:hover .sticker-msg-img {
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.22));
}
.sticker-animated-shell {
  width: 120px;
  height: 120px;
}
.sticker-lottie {
  width: 120px;
  height: 120px;
  position: absolute;
  inset: 0;
  z-index: 1;
}
.sticker-lottie svg {
  width: 120px !important;
  height: 120px !important;
  display: block;
}
.sticker-lottie.is-playing + .sticker-fallback-img {
  display: none !important;
  animation: none !important;
}
.sticker-fallback-img {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.sticker-native-motion .sticker-fallback-img {
  transform-origin: center center;
  animation: stickerFallbackSoft 1.35s ease-in-out infinite;
}
.sticker-native-motion.sticker-motion-wave .sticker-fallback-img {
  animation-name: stickerFallbackWave;
}
.sticker-native-motion.sticker-motion-spark .sticker-fallback-img {
  animation-name: stickerFallbackSpark;
}
.sticker-native-motion.sticker-motion-bounce .sticker-fallback-img {
  animation-name: stickerFallbackBounce;
}
.sticker-native-motion.sticker-motion-urgent .sticker-fallback-img {
  animation-name: stickerFallbackUrgent;
}
@keyframes stickerFallbackSoft {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.03); }
}
@keyframes stickerFallbackWave {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-7deg) scale(1.02); }
  75% { transform: rotate(7deg) scale(1.02); }
}
@keyframes stickerFallbackSpark {
  0%, 100% { transform: translateY(0) scale(0.96); filter: saturate(1); }
  50% { transform: translateY(-5px) scale(1.06); filter: saturate(1.2); }
}
@keyframes stickerFallbackBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-8px) scale(1.04); }
  70% { transform: translateY(1px) scale(0.99); }
}
@keyframes stickerFallbackUrgent {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  20% { transform: translateX(-3px) rotate(-2deg); }
  40% { transform: translateX(3px) rotate(2deg); }
  60% { transform: translateX(-2px) rotate(-1deg); }
  80% { transform: translateX(2px) rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .sticker-native-motion .sticker-fallback-img {
    animation: none !important;
  }
}
.mf-sticker .sticker-msg-img,
.mf-sticker .sticker-lottie,
.mf-sticker .sticker-lottie svg,
.mf-sticker.sticker-animated-shell {
  width: 104px;
  height: 104px;
}
.sticker-missing {
  width: 120px;
  height: 120px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed var(--card-border);
  border-radius: 10px;
  color: var(--text-muted);
  background: var(--body-bg);
  font-size: 12px;
}
.mf-sticker.sticker-missing {
  width: 104px;
  height: 104px;
}

[data-theme="dark"] .sticker-msg-img {
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

/* 스티커 버튼 (입력창) 활성 상태 */
#stickerBtn.active,
#stickerBtn:has(+ #stickerPickerPopup) {
  color: var(--primary) !important;
}

/* ════════════════════════════════════════════
   Phase 9: 멘션 하이라이트 + 자동완성
   ════════════════════════════════════════════ */
.mention-highlight {
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-surface, rgba(232,116,0,0.12));
  border-radius: 4px;
  padding: 0 3px;
}

#mentionDropdown .mention-item:hover,
#mentionDropdown .mention-item.selected {
  background: var(--primary-surface) !important;
}

/* ════════════════════════════════════════════
   Calendar — 완전 재설계 (모바일 대응)
   ════════════════════════════════════════════ */

/* ── 레이아웃: 데스크톱 사이드 / 모바일 스택 ── */
.cal-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-rows: auto;
  gap: 16px;
  align-items: start;
}
.cal-main  { grid-column: 1; }
.cal-sidebar { grid-column: 2; display: flex; flex-direction: column; gap: 12px; }

/* ── 헤더 영역 ── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cal-nav-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.cal-title {
  font-size: 1rem;
  font-weight: 700;
  min-width: 120px;
  text-align: center;
  color: var(--text-main);
  white-space: nowrap;
}
.cal-today-btn { flex-shrink: 0; }
.cal-add-btn   { flex-shrink: 0; }
.cal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.cal-view-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--body-bg, #F1F5F9);
  border: 1px solid var(--card-border);
}
.cal-view-switch button {
  min-width: 34px;
  min-height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.cal-view-switch button.active {
  background: var(--card-bg);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(15,23,42,.12);
}

/* ── 요일 헤더 ── */
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}
.cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 0;
}
.cal-weekday-sun { color: #EF4444; }
.cal-weekday-sat { color: #3B82F6; }

/* ── 날짜 그리드 ── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
}

/* ── 날짜 셀 ── */
.cal-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-height: 90px;
  cursor: pointer;
  transition: background 0.15s;
  background: var(--card-bg);
}
.cal-cell:hover   { background: var(--primary-surface, rgba(232,116,0,0.05)); }
.cal-cell-out     { background: var(--sidebar-bg, #F8FAFC); }
.cal-cell-today   { background: var(--primary-surface, rgba(232,116,0,0.06)); }

.cal-cell-head {
  padding: 4px 6px 2px;
  display: flex;
  align-items: center;
}
.cal-cell-body {
  padding: 0 4px 4px;
}

/* ── 날짜 숫자 ── */
.cal-day-num {
  font-size: 12px;
  font-weight: 500;
  line-height: 24px;
}
.cal-today-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ── 이벤트 바 (데스크톱) ── */
.cal-event-bar {
  font-size: 11px;
  line-height: 1.3;
  padding: 1px 5px;
  border-radius: 3px;
  margin-bottom: 2px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-event-bar:hover { opacity: 0.85; }
.cal-event-more {
  font-size: 10px;
  color: var(--text-muted);
  padding-left: 4px;
}

/* ── 이벤트 도트 (모바일) ── */
.cal-dots-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 2px 2px 0;
  min-height: 8px;
}
.cal-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-dot-more {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 6px;
}
.cal-dots-row { display: none; }

.cal-week-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  min-height: 560px;
  overflow-x: auto;
}
.cal-week-col {
  min-width: 120px;
  border-right: 1px solid var(--border);
  background: var(--card-bg);
}
.cal-week-col:last-child { border-right: none; }
.cal-week-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--sidebar-bg, #F8FAFC);
  color: var(--text-main);
  cursor: pointer;
}
.cal-week-head.today { color: var(--primary); background: var(--primary-surface); }
.cal-week-head span { font-size: 12px; color: var(--text-muted); }
.cal-week-head strong { font-size: 18px; }
.cal-week-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}
.cal-compact-event {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--card-border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}
.cal-compact-event-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cal-compact-event-info {
  min-width: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
}
.cal-event-inline-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.cal-event-action-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
}
.cal-compact-event span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.cal-compact-event strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.cal-compact-event small,
.cal-event-location {
  font-size: 11px;
  color: var(--text-muted);
}
.cal-empty-slot,
.cal-day-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  border: 1px dashed var(--card-border);
  border-radius: 8px;
}
.cal-day-board {
  min-height: 560px;
  padding: 14px;
}
.cal-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.cal-day-head div { display: flex; flex-direction: column; gap: 2px; }
.cal-day-head strong { font-size: 18px; color: var(--text-main); }
.cal-day-head span { font-size: 12px; color: var(--text-muted); }
.cal-day-agenda {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
}
.cal-agenda-roomy {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px;
  background: var(--card-bg);
}
.cal-check-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-secondary);
}
.cal-manage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cal-manage-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
}
.cal-manage-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
}
.cal-manage-row strong {
  display: block;
  font-size: 13px;
  color: var(--text-main);
}
.cal-manage-row small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}
.cal-manage-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--card-border);
}
.cal-manage-form h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

/* ── 사이드 패널 ── */
.cal-legend-card { margin-bottom: 0; }
.cal-section-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-main);
}
.cal-legend-list  { display: flex; flex-direction: column; gap: 8px; }
.cal-legend-item  { display: flex; align-items: center; gap: 8px; }
.cal-legend-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cal-legend-label { font-size: 12px; color: var(--text-sub); }

.cal-today-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.cal-today-item:last-child { border-bottom: none; }
.cal-today-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.cal-today-info { flex: 1; min-width: 0; }
.cal-today-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-today-time { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.cal-no-event   { text-align: center; font-size: 13px; color: var(--text-muted); padding: 12px 0; }

/* ════════════════════════════════════════════
   Calendar — 모바일 반응형 (<640px)
   ════════════════════════════════════════════ */
@media (max-width: 639px) {

  /* 레이아웃: 1열 스택, 사이드바를 하단 */
  .cal-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .cal-main    { grid-column: 1; grid-row: 1; }
  .cal-sidebar { grid-column: 1; grid-row: 2; flex-direction: row; flex-wrap: wrap; }
  .cal-sidebar > .card { flex: 1 1 calc(50% - 6px); min-width: 0; }

  /* 헤더: 버튼들 컴팩트 */
  .cal-header { padding: 10px 12px 8px; }
  .cal-nav { width: 100%; justify-content: space-between; }
  .cal-actions { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .cal-view-switch { flex-shrink: 0; }
  .cal-title  { font-size: 15px; min-width: 100px; }
  .cal-add-label { display: none; }   /* "새 일정" 텍스트 숨김, + 아이콘만 */
  .cal-nav-btn,
  .cal-add-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .cal-add-btn i { margin: 0 !important; }

  /* 셀: 모바일 최소 높이 줄임 */
  .cal-cell { min-height: 44px; }
  .cal-month-bars { display: none; }
  .cal-dots-row { display: flex; }
  .cal-week-board {
    grid-template-columns: 1fr;
    min-height: auto;
    overflow-x: visible;
  }
  .cal-week-col {
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .cal-week-events { padding: 8px 10px 12px; }
  .cal-day-board { min-height: auto; padding: 10px; }
  .cal-day-head { align-items: flex-start; }
  .cal-event-form input,
  .cal-event-form select,
  .cal-event-form textarea { font-size: 16px !important; }
  .cal-modal-actions {
    position: sticky;
    bottom: -1px;
    background: var(--card-bg);
    padding-top: 10px;
  }
  .cal-modal-actions .btn { flex: 1 1 0; justify-content: center; }

  /* 요일 텍스트 더 작게 */
  .cal-weekday { font-size: 10px; padding: 4px 0; }

  /* 날짜 숫자 */
  .cal-day-num    { font-size: 11px; }
  .cal-today-badge { width: 20px; height: 20px; font-size: 11px; }
}

/* ── 태블릿 (~1023px): 그리드 유지, 사이드바 폭 축소 ── */
@media (max-width: 1023px) and (min-width: 640px) {
  .cal-layout { grid-template-columns: 1fr 200px; }
  .cal-cell   { min-height: 70px; }
}

/* ═══════════════════════════════════════════════
   결재 이력 타임라인 (v3.9.8)
   ═══════════════════════════════════════════════ */
.approval-timeline {
  position: relative;
  padding: 4px 0;
}
.approval-timeline-item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 20px;
}
.approval-timeline-item.last {
  padding-bottom: 0;
}
/* 세로 연결선 */
.approval-timeline-line {
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--card-border);
  z-index: 0;
}
.approval-timeline-line.final {
  background: linear-gradient(to bottom, var(--card-border), transparent);
}
.approval-timeline-item.last .approval-timeline-line {
  display: none;
}
/* 아이콘 원 */
.approval-timeline-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  background: var(--card-bg);
}
/* 본문 영역 */
.approval-timeline-body {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}
.approval-timeline-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.approval-timeline-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.approval-timeline-info {
  flex: 1;
  min-width: 0;
}
.approval-timeline-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.approval-timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}
.approval-timeline-comment {
  background: var(--body-bg);
  border-left: 3px solid var(--card-border);
  border-radius: 0 6px 6px 0;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}
[data-theme="dark"] .approval-timeline-comment {
  background: rgba(255,255,255,0.04);
}

/* ═══════════════════════════════════════════════
   전자결재 사이드바 레이아웃 (v3.10.21)
   ═══════════════════════════════════════════════ */
.approval-layout {
  display: flex;
  height: calc(100dvh - 56px - 48px);
  min-height: 400px;
  gap: 0;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  border: 1px solid var(--card-border, #E5E7EB);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.approval-sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid #F3F4F6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card-bg, #fff);
}
.approval-sidebar-header {
  padding: 14px 12px;
  border-bottom: 1px solid #F3F4F6;
}
.approval-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8px;
}
.approval-sidebar-section {
  border-bottom: 1px solid #F9FAFB;
  padding: 2px 0;
}
.approval-sidebar-section:last-child { border-bottom: none; }
.approval-sidebar-section-title {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.approval-sidebar-collapsible {
  cursor: pointer;
  user-select: none;
}
.approval-sidebar-collapsible:hover { color: var(--primary); }
.approval-sidebar-section-body {}
.approval-sidebar-subsection {
  padding: 4px 14px 2px;
  font-size: 11px;
  color: #9CA3AF;
}
.approval-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-secondary, #374151);
  border: none;
  border-right: 2px solid transparent;
  background: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-align: left;
  position: relative;
  border-radius: 0;
}
.approval-sidebar-icon {
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  font-size: 12px;
  opacity: 0.6;
}
.approval-sidebar-item:hover {
  background: var(--table-row-hover, #F9FAFB);
  color: var(--text-primary, #111827);
}
.approval-sidebar-item:hover .approval-sidebar-icon { opacity: 0.9; }
.approval-sidebar-item.active {
  background: var(--primary-surface, #FFF7F0);
  color: var(--primary);
  font-weight: 600;
  border-right-color: var(--primary);
}
.approval-sidebar-item.active .approval-sidebar-icon { opacity: 1; }
.approval-sidebar-badge {
  margin-left: auto;
  background: #F59E0B;
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}
.approval-sidebar-badge-blue { background: #3B82F6; }
.approval-sidebar-badge-gray { background: #9CA3AF; }
.approval-sidebar-badge-red  { background: #EF4444; }

/* ── 임시저장 문서함 카드 ──────────────────────────── */
.local-draft-list { display: flex; flex-direction: column; gap: 10px; }
.local-draft-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: 10px;
  border: 1px solid var(--card-border); background: var(--card-bg);
  transition: box-shadow 0.15s;
}
.local-draft-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.local-draft-card-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.local-draft-abbr {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.local-draft-meta { min-width: 0; }
.local-draft-title {
  font-weight: 600; font-size: 14px; color: var(--text-main);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px;
}
.local-draft-sub {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.local-draft-sep { opacity: 0.4; }
.local-draft-actions { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 600px) {
  .local-draft-card { flex-direction: column; align-items: flex-start; }
  .local-draft-actions { width: 100%; }
  .local-draft-actions .btn { flex: 1; justify-content: center; }
  .local-draft-title { max-width: 100%; }
}

.approval-main {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 결재 홈 */
.approval-home-layout { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
/* 결재 문서 작성 (사이드바 고정 모드) */
.approval-draft-wrap { padding: 20px 24px; width: 100%; box-sizing: border-box; }
.approval-home-header { display: flex; align-items: center; justify-content: space-between; }
.approval-home-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border, #E5E7EB);
  border-radius: 12px;
  overflow: hidden;
}
.approval-home-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid #F3F4F6;
}
.approval-home-pending-card {
  padding: 16px;
}
.approval-home-no-pending {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 32px; text-align: center;
}
.approval-home-pending-meta {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px;
  background: #F9FAFB;
  border-radius: 8px;
  font-size: 13px;
}
.approval-home-table-wrap { overflow-x: auto; }
.approval-home-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.approval-home-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6B7280;
  background: #F9FAFB;
  border-bottom: 1px solid #E5E7EB;
}
.approval-home-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #F9FAFB;
  color: #374151;
}
.approval-home-table tr:last-child td { border-bottom: none; }

/* 결재 문서 목록 레이아웃 */
.approval-list-layout { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.approval-list-header { display: flex; align-items: center; justify-content: space-between; }

/* 모바일 — 메일과 동일한 패널 전환 방식 */
.approval-mobile-bar { display: none; }
@media (max-width: 768px) {
  /* 레이아웃: 블록으로 전환 */
  .approval-layout {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    overflow: visible !important;
  }
  /* 기본: 사이드바(메뉴) 전체화면, 메인 숨김 */
  .approval-sidebar {
    width: 100% !important;
    max-height: none !important;
    min-height: calc(100dvh - 56px - 48px);
    border-right: none !important;
    border-bottom: none !important;
    display: flex !important;
    flex-direction: column;
    overflow-y: auto !important;
  }
  .approval-main {
    display: none !important;
    min-height: calc(100dvh - 56px - 48px);
    width: 100%;
  }
  /* approval-show-main 클래스 활성화 시: 사이드바 숨기고 메인 표시 */
  .approval-layout.approval-show-main .approval-sidebar {
    display: none !important;
  }
  .approval-layout.approval-show-main .approval-main {
    display: block !important;
  }
  /* 사이드바 항목 — 일반 리스트 스타일 복원 */
  .approval-sidebar-section { display: block !important; }
  .approval-sidebar-item {
    display: flex !important;
    width: 100% !important;
    border-radius: 0 !important;
    font-size: 14px !important;
    padding: 13px 18px !important;
    border-right: none !important;
  }
  .approval-sidebar-item.active {
    background: var(--primary-surface) !important;
    color: var(--primary) !important;
    border-right: 3px solid var(--primary) !important;
    font-weight: 700;
  }
  .approval-sidebar-item.active .approval-sidebar-icon { opacity: 1 !important; }
  .approval-sidebar-icon { display: inline-flex !important; }
  .approval-sidebar-section-title { display: flex !important; font-size: 12px; padding: 10px 18px 4px; }
  /* 모바일 상단 뒤로가기 바 (메인 패널 상단) */
  .approval-mobile-bar {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--card-border);
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .approval-mobile-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
  }
  .approval-mobile-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
  }

  /* 모바일 결재 문서 작성 화면 */
  .approval-layout.approval-show-main .approval-main {
    overflow-x: hidden !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .approval-draft-wrap {
    width: 100%;
    max-width: 100%;
    padding: 10px 8px 18px !important;
    overflow-x: hidden;
  }
  .approval-draft-actions {
    gap: 8px;
    margin-bottom: 10px !important;
  }
  .approval-draft-actions .btn {
    min-width: 0;
    min-height: 40px;
    padding: 7px 10px;
    justify-content: center;
    white-space: nowrap;
  }
  .approval-draft-card.card {
    padding: 14px !important;
    border-radius: 12px;
    overflow: visible;
  }
  .approval-draft-form-header {
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
    padding-bottom: 12px !important;
  }
  .approval-draft-form-header > div:first-child {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px;
    border-radius: 10px !important;
    font-size: 14px !important;
  }
  .approval-draft-form-header h3 {
    font-size: 17px !important;
    line-height: 1.35;
    color: var(--text-main);
  }
  .approval-draft-form-header p {
    font-size: 13px !important;
    line-height: 1.45;
    word-break: keep-all;
  }
  .approval-draft-meta {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 12px !important;
    overflow: visible;
  }
  .approval-draft-meta > * {
    min-width: 0;
  }
  .approval-draft-meta p,
  .approval-draft-meta span,
  .approval-draft-meta label {
    min-width: 0;
  }
  .approval-draft-meta .form-input {
    min-width: 0;
  }
  .approval-draft-meta-wide,
  .approval-draft-field {
    grid-column: 1 / -1 !important;
  }
  .approval-draft-urgency-options {
    flex-wrap: wrap;
    gap: 8px 12px !important;
  }
  .approval-draft-urgency-options label {
    min-height: 32px;
  }
  .approval-draft-wrap .form-group {
    margin-bottom: 14px;
  }
  .approval-draft-wrap .form-input {
    min-width: 0;
  }
  .approval-draft-wrap .tox-tinymce {
    width: 100% !important;
    min-height: 320px;
  }
  .approval-draft-wrap .tox .tox-toolbar__primary {
    white-space: normal !important;
  }
  .approval-draft-wrap .tox .tox-toolbar__group {
    flex-wrap: wrap;
  }
  .approval-budget-table-wrap,
  .approval-expense-table-wrap {
    width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .approval-budget-table-wrap table {
    min-width: 620px;
  }
  .approval-expense-table-wrap table {
    min-width: 680px;
  }
  .approval-budget-actions,
  .approval-budget-section-head,
  .approval-expense-table-head {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px !important;
    align-items: stretch !important;
  }
  .approval-budget-actions .btn,
  .approval-budget-section-head .btn,
  .approval-expense-table-head .btn {
    width: 100%;
    justify-content: center;
    min-width: 0;
    white-space: normal;
    line-height: 1.25;
  }
  .approval-related-doc-box {
    padding: 12px !important;
  }
  .approval-draft-wrap #approvalLineArea > .flex {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px !important;
  }
  .approval-draft-wrap #approvalLineArea > .flex .btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    min-width: 0;
    white-space: normal;
    line-height: 1.25;
  }
  .approval-draft-wrap #approvalLineArea > .flex .btn-primary {
    flex-basis: 100%;
  }
  #relDocBrowseOverlay.approval-related-doc-modal-overlay,
  #approvalLineModalOverlay.approval-line-modal-overlay {
    align-items: stretch !important;
    justify-content: center !important;
    padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)) !important;
  }
  #relDocBrowseOverlay .approval-related-doc-modal-card,
  #approvalLineModalOverlay .approval-line-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    height: calc(var(--vvh, 100dvh) - 16px) !important;
    max-height: calc(var(--vvh, 100dvh) - 16px) !important;
    min-width: 0;
    overflow: hidden;
    border-radius: 16px !important;
  }
  #relDocBrowseOverlay .approval-related-doc-modal-body,
  #approvalLineModalOverlay .approval-line-modal-body {
    flex-direction: column !important;
    overflow: hidden !important;
    min-height: 0;
  }
  #relDocBrowseOverlay .approval-related-doc-list-pane,
  #approvalLineModalOverlay .approval-line-left-pane {
    width: 100% !important;
    flex: 0 0 46% !important;
    max-height: 46% !important;
    min-height: 250px;
    min-width: 0;
    border-right: 0 !important;
    border-bottom: 1px solid var(--card-border, #e5e7eb) !important;
  }
  #relDocBrowseOverlay .approval-related-doc-preview-pane,
  #approvalLineModalOverlay .approval-line-right-pane {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0;
    min-height: 0;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  #relDocBrowseOverlay .approval-related-doc-search-row,
  #relDocBrowseOverlay .approval-related-doc-filter-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  #relDocBrowseOverlay #relDocBrowseFormFilter,
  #relDocBrowseOverlay #relDocBrowseStatusFilter {
    width: 100% !important;
    min-width: 0;
  }
  #relDocBrowseOverlay #relDocBrowsePager {
    flex-wrap: wrap;
    gap: 8px;
  }
  #approvalLineModalOverlay .approval-line-right-pane {
    padding: 12px !important;
  }
  #approvalLineModalOverlay .approval-line-right-pane > .overflow-auto {
    overflow-x: hidden !important;
    max-height: none !important;
    -webkit-overflow-scrolling: touch;
  }
  #approvalLineModalOverlay .approval-line-right-pane table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
  }
  #approvalLineModalOverlay .approval-line-right-pane thead {
    display: none;
  }
  #approvalLineModalOverlay .approval-line-right-pane tbody {
    display: block;
    width: 100%;
  }
  #approvalLineModalOverlay .approval-line-right-pane tr {
    display: block;
    position: relative;
    width: 100%;
    min-width: 0 !important;
    margin-bottom: 8px;
    padding: 10px 74px 10px 10px;
    border: 1px solid var(--card-border, #e5e7eb);
    border-radius: 10px;
    background: var(--card-bg, #fff);
  }
  #approvalLineModalOverlay .approval-line-right-pane td,
  #approvalLineModalOverlay .approval-line-right-pane th {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    white-space: normal !important;
  }
  #approvalLineModalOverlay .approval-line-right-pane td:nth-child(1) {
    margin-bottom: 6px;
  }
  #approvalLineModalOverlay .approval-line-right-pane td:nth-child(2) {
    font-size: 14px;
    line-height: 1.35;
  }
  #approvalLineModalOverlay .approval-line-right-pane td:nth-child(3) {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-muted, #6b7280);
  }
  #approvalLineModalOverlay .approval-line-right-pane td:nth-child(4) {
    position: absolute;
    top: 10px;
    right: 34px;
    width: auto !important;
  }
  #approvalLineModalOverlay .approval-line-right-pane td:nth-child(5) {
    position: absolute;
    top: 10px;
    right: 10px;
    width: auto !important;
  }
  #approvalLineModalOverlay .approval-line-right-pane td[colspan] {
    position: static !important;
    padding: 18px 8px !important;
    text-align: center;
  }
  #approvalLineModalOverlay .approval-line-modal-footer,
  #relDocBrowseOverlay .approval-related-doc-modal-footer {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px !important;
  }
  #approvalLineModalOverlay .approval-line-modal-footer > div {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }
  #approvalLineModalOverlay .approval-line-modal-footer > .btn {
    width: 100%;
    justify-content: center;
  }
  #approvalLineModalOverlay .approval-line-modal-footer > div .btn,
  #relDocBrowseOverlay .approval-related-doc-modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
  .approval-draft-footer {
    flex-direction: column;
    align-items: stretch !important;
    gap: 12px !important;
    margin-top: 18px !important;
  }
  .approval-draft-footer .draft-status-bar {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }
  .approval-draft-footer-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
  }
  .approval-draft-footer-actions .btn {
    width: 100%;
    justify-content: center;
    min-width: 0;
  }
  .approval-draft-autosave-hint {
    line-height: 1.5;
  }
}

@media (max-width: 380px) {
  .approval-draft-meta {
    grid-template-columns: 1fr !important;
  }
  .approval-draft-actions {
    flex-direction: column;
    align-items: stretch !important;
  }
  .approval-draft-actions .btn {
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════
   결재 현황판 대시보드 (v3.9.8)
   ═══════════════════════════════════════════════ */
.approval-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.approval-dash-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow .15s, transform .15s;
}
.approval-dash-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  transform: translateY(-1px);
}
.approval-dash-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.approval-dash-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}
.approval-dash-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.approval-dash-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .approval-dash-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .approval-dash-panels {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Slack 스타일 메신저 — v3.11 신규 CSS
   ============================================================ */

/* 워크스페이스 헤더 */
.ms-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.ms-workspace-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .15s;
}
.ms-workspace-name:hover { background: rgba(0,0,0,.06); }
.ms-workspace-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.ms-compose-btn {
  width: 32px; height: 32px;
  border: none; background: transparent;
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: background .15s;
}
.ms-compose-btn:hover { background: rgba(0,0,0,.08); }

/* 상태 표시줄 */
.ms-my-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .15s;
  font-size: 13px;
  color: var(--text-primary);
}
.ms-my-status:hover { background: rgba(0,0,0,.06); }
.ms-status-dot { font-size: 12px; }
.ms-status-name { font-weight: 600; }
.ms-status-text { color: var(--text-muted); font-size: 11px; }

/* 검색 */
.ms-search-wrap {
  position: relative;
  padding: 6px 10px;
}
.ms-search-icon {
  position: absolute;
  left: 20px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 12px;
}
.ms-search-input {
  width: 100%;
  padding: 6px 10px 6px 28px;
  border: 1px solid var(--input-border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 13px;
  outline: none;
}
.ms-search-input:focus { border-color: var(--primary); }

/* 사이드바 스크롤 영역 */
.ms-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}
.ms-sidebar-scroll::-webkit-scrollbar { width: 4px; }
.ms-sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 2px; }

/* 사이드바 하단 */
.ms-sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--card-border);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  flex-shrink: 0;
}
.ms-footer-btn {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 4px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ms-footer-btn:hover { background: var(--primary-surface, #EEF2FF); color: var(--primary); }
.ms-footer-btn i { font-size: 14px; }
.ms-footer-btn span {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
  line-height: 1.1;
}

/* 빈 사이드바 */
.ms-empty-sidebar {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
}
.ms-empty-sidebar i { font-size: 32px; margin-bottom: 8px; opacity: .4; }
.ms-empty-sidebar p { font-size: 13px; }
.ms-room-load-error {
  margin: 12px;
  padding: 24px 14px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: var(--card-bg);
}
.ms-room-load-error i {
  color: var(--warning, #f59e0b);
  opacity: .9;
}
.ms-room-load-error-title {
  color: var(--text-primary);
  font-weight: 700;
}
.ms-room-load-error-hint {
  margin-top: 6px;
  color: var(--text-muted);
}

/* 사이드바 섹션 */
.ms-sidebar-section { margin-bottom: 2px; }
.ms-section-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 6px;
  margin: 0 6px;
  user-select: none;
  transition: background .15s;
}
.ms-section-header:hover { background: rgba(0,0,0,.06); }
.ms-section-chevron { font-size: 9px; color: var(--text-muted); width: 12px; }
.ms-section-label { font-size: 12px; font-weight: 700; color: var(--text-muted); flex: 1; }
.ms-section-unread-dot {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
}
.ms-section-badge {
  min-width: 18px;
  flex-shrink: 0;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.ms-section-add {
  width: 20px; height: 20px;
  border: none; background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  transition: background .15s, color .15s;
}
.ms-section-add:hover { background: rgba(0,0,0,.1); color: var(--primary); }
.ms-section-items { padding: 2px 0; }

/* 채팅방 아이템 */
.ms-room-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  cursor: pointer;
  border-radius: 6px;
  margin: 1px 6px;
  transition: background .12s;
  font-size: 14px;
  color: var(--text-secondary);
  position: relative;
}
.ms-room-item:hover { background: rgba(0,0,0,.06); color: var(--text-primary); }
.ms-room-item.locked { color: var(--text-muted); }
.ms-room-item.active {
  background: var(--primary-surface, #EEF2FF);
  color: var(--primary);
  font-weight: 600;
}
.ms-room-item.unread { color: var(--text-primary); font-weight: 600; }
.ms-room-hash {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.ms-room-item.active .ms-room-hash,
.ms-room-item:hover .ms-room-hash { color: inherit; }
.ms-lock-icon { font-size: 9px; position: relative; top: -1px; margin-left: 2px; }
.ms-room-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.ms-room-badge {
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  flex-shrink: 0;
}
.ms-room-more-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ms-room-more-btn:hover {
  background: rgba(0,0,0,.08);
  color: var(--primary);
}

.ms-folder-manager,
.ms-folder-picker,
.ms-secret-unlock {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ms-folder-create {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ms-folder-create.compact {
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--body-bg);
}
.ms-folder-create .form-input { flex: 1; min-width: 0; }
.ms-folder-list,
.ms-folder-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ms-folder-row,
.ms-folder-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
}
.ms-folder-row .form-input { flex: 1; min-width: 0; }
.ms-folder-check {
  cursor: pointer;
  user-select: none;
}
.ms-folder-check span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 600;
}
.ms-folder-room-name {
  font-weight: 700;
  color: var(--text-primary);
}
.ms-secret-unlock {
  align-items: stretch;
  text-align: center;
}
.ms-secret-unlock-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  background: var(--primary-surface, #eef2ff);
  color: var(--primary);
  font-size: 22px;
}
.ms-secret-unlock p {
  margin: 0;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .ms-folder-create,
  .ms-folder-row {
    align-items: stretch;
    flex-direction: column;
  }
  .ms-folder-row .btn,
  .ms-folder-create .btn {
    width: 100%;
  }
}
.ms-room-avatar-wrap { position: relative; flex-shrink: 0; }
.ms-dm-avatar {
  width: 22px; height: 22px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.ms-dm-status {
  position: absolute;
  bottom: -3px; right: -3px;
  font-size: 9px;
  line-height: 1;
}
.ms-mute-icon { font-size: 10px; opacity: .6; }

/* Thread 패널 */
.ms-thread-panel {
  width: var(--ms-thread-panel-width, 420px);
  min-width: 340px;
  border-left: 1px solid var(--card-border);
  background: var(--chat-bg, var(--card-bg));
  display: none;
  flex-direction: column;
  flex-shrink: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
}
.ms-thread-resizer { display: none; }
@media (min-width: 769px) {
  .ms-thread-resizer {
    display: block;
    position: absolute;
    top: 0;
    left: -7px;
    bottom: 0;
    width: 14px;
    cursor: col-resize;
    z-index: 4;
    touch-action: none;
  }
  .ms-thread-resizer::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 6px;
    width: 2px;
    background: rgba(148, 163, 184, .42);
    background: color-mix(in srgb, var(--card-border) 70%, transparent);
    opacity: .45;
    transition: background .12s ease, opacity .12s ease;
  }
  .ms-thread-resizer:hover::after,
  body.ms-thread-resizing .ms-thread-resizer::after {
    background: var(--primary);
    opacity: 1;
  }
  body.ms-thread-resizing {
    cursor: col-resize;
    user-select: none;
  }
  body.ms-thread-resizing * {
    cursor: col-resize !important;
  }
}
.ms-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}
.ms-thread-close {
  width: 28px; height: 28px;
  border: none; background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
}
.ms-thread-close:hover { background: var(--card-border); }
.ms-thread-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
.ms-thread-body .message-content {
  max-width: calc(100% - 48px);
}
.ms-thread-body .message-group.own .message-content {
  max-width: calc(100% - 28px);
}
.ms-thread-parent { padding-bottom: 12px; border-bottom: 1px solid var(--card-border); margin-bottom: 8px; }
.ms-thread-reply-count { font-size: 12px; color: var(--text-muted); padding: 4px 0 8px; font-weight: 600; }
.ms-thread-reply { padding: 4px 0; }
.ms-thread-input-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px 10px max(8px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--card-border);
  flex-shrink: 0;
  min-width: 0;
}
.ms-thread-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}
.ms-thread-input {
  width: 100%;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--input-text);
  font-size: 13px;
  outline: none;
}
.ms-thread-input:focus { border-color: var(--primary); }
.ms-thread-send-btn {
  width: 36px; height: 36px;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.ms-thread-send-btn:hover { opacity: .85; }

/* 메시지 내 스레드 열기 링크 */
.ms-thread-link {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
  margin-left: 4px;
  transition: background .12s;
}
.ms-thread-link:hover { background: var(--primary-surface, #EEF2FF); }
.ms-thread-unread {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

/* 스레드 입력창 툴바 */
.ms-thread-toolbar {
  display: flex;
  gap: 4px;
  padding: 0;
  min-width: 0;
}

/* Thread 열렸을 때 chat-view-panel 축소 */
.chat-view-panel.with-thread { flex: 1; min-width: 0; }

/* Reaction 관련 */
.ms-reactions-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding: 0 2px;
}
.ms-reaction-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: var(--card-bg);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.ms-reaction-badge:hover { border-color: var(--primary); background: var(--primary-surface, #EEF2FF); }
.ms-reaction-badge.mine { border-color: var(--primary); background: var(--primary-surface, #EEF2FF); color: var(--primary); font-weight: 600; }
.ms-reaction-badge span { font-size: 12px; color: var(--text-secondary); }
.ms-reaction-badge.mine span { color: var(--primary); }

.ms-reaction-picker {
  background: var(--dropdown-bg, #fff);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  padding: 6px 8px;
  display: flex;
  gap: 2px;
}
.ms-reaction-emoji-btn {
  width: 32px; height: 32px;
  border: none; background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, transform .1s;
}
.ms-reaction-emoji-btn:hover { background: var(--primary-surface, #EEF2FF); transform: scale(1.2); }

/* 컨텍스트 메뉴 */
.ms-ctx-menu {
  box-sizing: border-box;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ms-ctx-menu button.ms-ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background .12s;
  white-space: normal;
  line-height: 1.35;
}
.ms-ctx-menu button.ms-ctx-item span { min-width: 0; }
.ms-ctx-menu button.ms-ctx-item:hover { background: var(--primary-surface, #EEF2FF); }
.ms-ctx-menu button.ms-ctx-item.danger { color: #ef4444; }
.ms-ctx-menu button.ms-ctx-item i { width: 16px; text-align: center; }

/* ── roomMenuDropdown 버튼 스타일 ────────────────────────── */
.ms-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px !important;
  line-height: 1.4;
  font-family: inherit;
  -webkit-text-size-adjust: 100%;
  color: var(--text-main);
  text-align: left;
  white-space: nowrap;
  transition: background 0.1s;
  box-sizing: border-box;
}
.ms-menu-item:hover { background: var(--primary-surface, #EEF2FF); }
.ms-menu-item i { width: 16px; text-align: center; flex-shrink: 0; font-size: 13px !important; }
.ms-menu-item span { font-size: 13px !important; }
.ms-menu-item.text-red-500 { color: #ef4444; }
#roomMenuDropdown { -webkit-text-size-adjust: 100%; }


.ms-channel-welcome {
  padding: 40px 20px;
  text-align: center;
}
.ms-welcome-icon {
  font-size: 56px;
  margin-bottom: 12px;
  line-height: 1;
}
.ms-welcome-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.ms-welcome-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 호버 메뉴 버튼 - 반응/스레드 추가 */
.msg-hover-btn { font-size: 13px; }

/* 🔴 [v3.45.9] 터치 디바이스 강제 표시 규칙 제거
   기존: @media (hover: none) { .msg-hover-menu { opacity: 1 !important } }
   문제: iOS/iPad/Android의 모든 메시지 옵션이 상시 표시되어 사용자 보고됨.
   해결: 이 강제 규칙을 제거하여 .is-hovered 클래스 기반 토글만 적용 (JS가 탭 시에만 추가). */

/* 메시지 그룹 focus-within 호버 메뉴 표시 (데스크톱 키보드 접근성 전용)
   🔴 [v3.45.9] @media (hover: hover) and (pointer: fine) 격리 — 터치 디바이스에서는
   옵션 버튼 탭 후 포커스가 남아 sticky 표시되던 부수 버그 차단 */
@media (hover: hover) and (pointer: fine) {
  .message-group:focus-within .msg-hover-menu {
    opacity: 1;
    pointer-events: auto;
  }
}

/* 업무 변환 알림 카드 */
.ms-task-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--primary-surface, #EEF2FF);
  color: var(--primary);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

/* 고정 메시지 바 */
#pinnedBar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--primary-surface, #EEF2FF);
  border-bottom: 1px solid var(--primary, #6366f1);
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

/* 반응형: 모바일에서 thread 패널 전체 오버레이 */
@media (max-width: 768px) {
  .ms-thread-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    height: 100dvh;
    max-height: 100dvh;
    z-index: 1000;
    display: none;
    flex-direction: column;
  }
  .ms-thread-resizer { display: none !important; }
  .ms-thread-input-wrap {
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
  }
  .ms-thread-toolbar .msg-toolbar-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
  }
  .ms-thread-input-row {
    grid-template-columns: minmax(0, 1fr) 38px;
  }
  .ms-thread-send-btn {
    width: 38px;
    height: 38px;
  }
}

/* ── ApprovalDocModal — 결재 문서 상세 모달 오버레이 ──────── */
#approvalDocModalOverlay {
  animation: adModalIn 180ms ease;
}
@keyframes adModalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#adModalPanel {
  animation: adPanelIn 200ms ease;
}
@keyframes adPanelIn {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
/* Ensure max-width is full screen on mobile */
@media (max-width: 900px) {
  #adModalPanel { max-width: 100% !important; }
}

/* 🔴 [v3.45.12 / iOS E] safe-area-inset 보강 — notch / Dynamic Island 가림 방지
   기존엔 .header / .sidebar / .modal 하단시트 / .chat-input-wrap / .toast 만 보호.
   추가 보강 대상: 메신저 채팅방 상단 헤더(.chat-header) + 매뉴얼 우측 슬라이드 패널(#manualPanel).
   iPhone X 이후 모든 notch/Dynamic Island 디바이스에서 풀스크린 진입 시 상단이 가리던 문제 해결. */
@supports (padding-top: env(safe-area-inset-top)) {
  /* 메신저 채팅 헤더 — notch 영역만큼 상단 패딩 추가 (모바일에서만 영향) */
  .chat-header {
    padding-top: max(10px, env(safe-area-inset-top));
  }
  /* 매뉴얼 패널은 inline style로 생성되므로 #manualPanel 강제 적용 */
  #manualPanel {
    padding-top: env(safe-area-inset-top);
  }
}

/* 🔴 [v3.45.16 / iOS H+I] 터치 디바이스 hover 효과 sticky 차단 + 모멘텀 스크롤 글로벌 보강
   I — 모바일/iPad에서 .nav-item/.card 등 :hover 효과가 탭 후 한 번 sticky로 남는 경향이 있어,
        hover 매체를 가지지 않는 디바이스에서는 hover 효과를 무효화.
        가장 사용 빈도 높은 4개 셀렉터만 우선 가드. 다른 hover는 사용자 보고 시 추가.
   H — iOS 13+ 는 모멘텀 스크롤이 기본 활성화되지만 명시적으로 핵심 컨테이너에 보강. */
@media (hover: none) {
  .nav-item:hover { background: inherit; }
  .card:hover { box-shadow: inherit; transform: none; }
  .calendar-cell:hover { background: inherit; }
  .org-node-header:hover { background: inherit; }
}

/* 모멘텀 스크롤 — 글로벌 스크롤 가능 컨테이너에 명시 (iOS 12 이하 안전망) */
html, body {
  -webkit-overflow-scrolling: touch;
}

/* ─── AI 어시스턴트 패널 (v3.77.0) ──────────────────────────────────────── */
#aiOverlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  z-index: 1089; opacity: 0; transition: opacity .25s;
}
#aiPanel {
  position: fixed; top: 0; right: 0; width: 420px; max-width: 100vw;
  height: 100dvh; background: var(--card-bg); border-left: 1px solid var(--card-border);
  z-index: 1090; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}
#aiPanel .ai-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--card-border); flex-shrink: 0;
}
#aiPanel .ai-header h3 {
  font-size: 1rem; font-weight: 600; color: var(--text-main);
  display: flex; align-items: center; gap: 8px; margin: 0;
}
#aiPanel .ai-header h3 i { color: var(--primary); }
#aiPanel .ai-body {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
  min-height: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
#aiPanel .ai-body::-webkit-scrollbar { width: 4px; }
#aiPanel .ai-body::-webkit-scrollbar-track { background: transparent; }
#aiPanel .ai-body::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 4px; }
#aiPanel .ai-bubble {
  max-width: 88%; padding: 10px 13px; border-radius: 14px;
  font-size: .9rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
#aiPanel .ai-bubble.user {
  align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px;
}
#aiPanel .ai-bubble.assistant {
  align-self: flex-start; background: var(--primary-surface); color: var(--text-main); border-bottom-left-radius: 4px;
}
#aiPanel .ai-bubble.error {
  align-self: flex-start; background: #FEF2F2; color: #DC2626;
  border: 1px solid #FECACA; border-bottom-left-radius: 4px;
}
#aiPanel .ai-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; color: var(--text-secondary); gap: 8px; text-align: center;
}
#aiPanel .ai-empty i { font-size: 2rem; opacity: .35; }
#aiPanel .ai-footer {
  padding: 12px 16px; border-top: 1px solid var(--card-border);
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
}
#aiPanel .ai-input-row { display: flex; align-items: flex-end; gap: 8px; }
#aiPanel #aiInput {
  flex: 1; resize: none; border: 1px solid var(--card-border);
  border-radius: 10px; padding: 8px 12px; font-size: .9rem;
  background: var(--input-bg); color: var(--text-main);
  min-height: 40px; max-height: 120px; outline: none; line-height: 1.5;
  transition: border-color .15s;
}
#aiPanel #aiInput:focus { border-color: var(--primary); }
#aiPanel .ai-send-btn {
  width: 38px; height: 38px; border: none; border-radius: 10px;
  background: var(--primary); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s; font-size: .9rem;
}
#aiPanel .ai-send-btn:hover { filter: brightness(1.1); }
#aiPanel .ai-send-btn:disabled { opacity: .45; cursor: not-allowed; }
#aiPanel .ai-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .75rem; color: var(--text-secondary); padding: 0 2px;
}
.ai-dots { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.ai-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); opacity: .4;
  animation: aiDotBounce .9s infinite ease-in-out both;
}
.ai-dots span:nth-child(1) { animation-delay: -.32s; }
.ai-dots span:nth-child(2) { animation-delay: -.16s; }
.ai-dots span:nth-child(3) { animation-delay: 0s; }
@keyframes aiDotBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: .3; }
  40%           { transform: scale(1.0); opacity: 1; }
}
@media (max-width: 480px) {
  #aiPanel { width: 100vw; border-left: none; }
}
.modal-overlay.ai-panel-confirm-modal {
  z-index: 10040 !important;
}
.modal-overlay.ai-panel-confirm-modal .modal {
  z-index: 10041;
}
/* ─── /AI 어시스턴트 패널 ─────────────────────────────────────────────────── */

/* AI 글쓰기 어시스턴트 툴바 버튼 (v3.79.x) */
.tox .tox-tbtn[data-mce-name="ai_draft"],
.tox .tox-tbtn[data-mce-name="ai_improve"] {
  background: var(--primary-surface, #EEF2FF) !important;
  border-radius: 6px !important;
  color: var(--primary, #6366f1) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 0 8px !important;
  margin-right: 2px !important;
  height: 28px !important;
  transition: background .15s, opacity .15s !important;
}
.tox .tox-tbtn[data-mce-name="ai_draft"]:hover,
.tox .tox-tbtn[data-mce-name="ai_improve"]:hover {
  background: var(--primary, #6366f1) !important;
  color: #fff !important;
}
.tox .tox-tbtn[data-mce-name="ai_improve"]:disabled,
.tox .tox-tbtn[data-mce-name="ai_improve"].tox-tbtn--disabled {
  opacity: .4 !important;
  cursor: not-allowed !important;
}

/* ==========================================
   Moncher Warm Preview — visible polish layer v3.83.33
   CSS-only layer. Routing, viewport, polling, modal history, and input logic stay untouched.
   ========================================== */
html[data-theme="moncher-warm-preview"] {
  color-scheme: light;
  background: var(--surface-canvas);
}

html[data-theme="moncher-warm-preview"] body {
  background:
    linear-gradient(180deg, #F8FAFC 0%, var(--surface-canvas) 38%, #EFF4F8 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[data-theme="moncher-warm-preview"] .content,
[data-theme="moncher-warm-preview"] .main-area,
[data-theme="moncher-warm-preview"] #pageContent {
  background:
    linear-gradient(180deg, rgba(248,250,252,0.96) 0%, var(--surface-canvas) 42%, #EEF3F8 100%) !important;
}

[data-theme="moncher-warm-preview"] .header {
  background: var(--topbar-bg) !important;
  border-bottom: 1px solid var(--topbar-border) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.74) inset, 0 14px 34px rgba(17,24,39,0.08) !important;
  backdrop-filter: saturate(1.08) blur(18px);
  -webkit-backdrop-filter: saturate(1.08) blur(18px);
}

[data-theme="moncher-warm-preview"] .header button,
[data-theme="moncher-warm-preview"] .room-list-actions button,
[data-theme="moncher-warm-preview"] .chat-header-actions button,
[data-theme="moncher-warm-preview"] .chat-input-actions button,
[data-theme="moncher-warm-preview"] .global-search-close,
[data-theme="moncher-warm-preview"] .community-writer-close,
[data-theme="moncher-warm-preview"] .ms-thread-close {
  background: rgba(255,255,255,0.78) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 1px 2px rgba(17,24,39,0.04), 0 8px 18px rgba(17,24,39,0.06) !important;
  color: var(--text-sub) !important;
}

[data-theme="moncher-warm-preview"] .header button:hover,
[data-theme="moncher-warm-preview"] .room-list-actions button:hover,
[data-theme="moncher-warm-preview"] .chat-header-actions button:hover,
[data-theme="moncher-warm-preview"] .chat-input-actions button:hover,
[data-theme="moncher-warm-preview"] .global-search-close:hover,
[data-theme="moncher-warm-preview"] .community-writer-close:hover,
[data-theme="moncher-warm-preview"] .ms-thread-close:hover {
  background: var(--topbar-icon-hover) !important;
  border-color: rgba(var(--primary-rgb),0.34) !important;
  color: var(--primary) !important;
  box-shadow: 0 1px 2px rgba(17,24,39,0.05), 0 12px 24px rgba(var(--primary-rgb),0.12) !important;
}

[data-theme="moncher-warm-preview"] .sidebar {
  background:
    linear-gradient(180deg, #2B211C 0%, #1E1916 54%, #151412 100%) !important;
  box-shadow: 10px 0 34px rgba(17,24,39,0.18) !important;
}

[data-theme="moncher-warm-preview"] .sidebar-header,
[data-theme="moncher-warm-preview"] .sidebar-footer {
  background: rgba(255,244,232,0.035) !important;
  border-color: rgba(255,244,232,0.10) !important;
}

[data-theme="moncher-warm-preview"] .nav-item {
  border-radius: var(--radius-md);
  color: var(--nav-text) !important;
}

[data-theme="moncher-warm-preview"] .nav-item i {
  color: rgba(232,225,217,0.78);
}

[data-theme="moncher-warm-preview"] .nav-item:hover {
  background: rgba(255,244,232,0.10) !important;
  border-color: rgba(255,244,232,0.12) !important;
  color: #FFFFFF !important;
}

[data-theme="moncher-warm-preview"] .nav-item.active {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 52%, var(--primary-light)) !important;
  border-color: rgba(255,244,232,0.22) !important;
  color: #FFFFFF !important;
  box-shadow: 0 12px 28px rgba(var(--primary-rgb),0.32) !important;
}

[data-theme="moncher-warm-preview"] .nav-item.active i {
  color: #FFFFFF;
}

[data-theme="moncher-warm-preview"] .card,
[data-theme="moncher-warm-preview"] .dash-widget,
[data-theme="moncher-warm-preview"] .approval-layout,
[data-theme="moncher-warm-preview"] .approval-home-section,
[data-theme="moncher-warm-preview"] .approval-dash-card,
[data-theme="moncher-warm-preview"] .approval-sidebar,
[data-theme="moncher-warm-preview"] .approval-main,
[data-theme="moncher-warm-preview"] .community-sidebar,
[data-theme="moncher-warm-preview"] .community-right-card,
[data-theme="moncher-warm-preview"] .local-draft-card,
[data-theme="moncher-warm-preview"] .version-item,
[data-theme="moncher-warm-preview"] .admin-card,
[data-theme="moncher-warm-preview"] .mail-sidebar,
[data-theme="moncher-warm-preview"] .mail-list,
[data-theme="moncher-warm-preview"] .mail-reader,
[data-theme="moncher-warm-preview"] .work-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, #FFFFFF 72%, rgba(248,250,252,0.82) 100%) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}

[data-theme="moncher-warm-preview"] .dash-widget > div:first-child,
[data-theme="moncher-warm-preview"] .card-header,
[data-theme="moncher-warm-preview"] .approval-home-section-header,
[data-theme="moncher-warm-preview"] .room-list-header,
[data-theme="moncher-warm-preview"] .chat-header,
[data-theme="moncher-warm-preview"] .community-sidebar-header,
[data-theme="moncher-warm-preview"] .community-top-tabs,
[data-theme="moncher-warm-preview"] .comm-channel-tabs-wrap,
[data-theme="moncher-warm-preview"] .approval-sidebar-header,
[data-theme="moncher-warm-preview"] .modal-header,
[data-theme="moncher-warm-preview"] .community-writer-header,
[data-theme="moncher-warm-preview"] #manualPanel .manual-panel-header,
[data-theme="moncher-warm-preview"] #aiPanel .ai-header {
  background: linear-gradient(180deg, rgba(248,250,252,0.95), rgba(255,255,255,0.82)) !important;
  border-color: var(--border) !important;
}

[data-theme="moncher-warm-preview"] .card-title,
[data-theme="moncher-warm-preview"] h1,
[data-theme="moncher-warm-preview"] h2,
[data-theme="moncher-warm-preview"] h3,
[data-theme="moncher-warm-preview"] h4,
[data-theme="moncher-warm-preview"] .approval-dash-value,
[data-theme="moncher-warm-preview"] .chat-header-name,
[data-theme="moncher-warm-preview"] .room-list-title h2,
[data-theme="moncher-warm-preview"] .ms-welcome-title {
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] p,
[data-theme="moncher-warm-preview"] .text-muted,
[data-theme="moncher-warm-preview"] .approval-dash-label,
[data-theme="moncher-warm-preview"] .chat-header-status,
[data-theme="moncher-warm-preview"] .ms-welcome-desc {
  color: var(--text-sub);
}

[data-theme="moncher-warm-preview"] .btn,
[data-theme="moncher-warm-preview"] button[style*="background:var(--primary)"],
[data-theme="moncher-warm-preview"] button[style*="background: var(--primary)"] {
  border-radius: var(--radius-md) !important;
  box-shadow: 0 1px 2px rgba(17,24,39,0.04);
}

[data-theme="moncher-warm-preview"] .btn-primary,
[data-theme="moncher-warm-preview"] .chat-send-btn,
[data-theme="moncher-warm-preview"] .ms-thread-send-btn,
[data-theme="moncher-warm-preview"] .ai-send-btn {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 56%, var(--primary-light)) !important;
  border-color: transparent !important;
  color: #FFFFFF !important;
  box-shadow: 0 10px 22px rgba(var(--primary-rgb),0.24) !important;
}

[data-theme="moncher-warm-preview"] .btn-primary:hover,
[data-theme="moncher-warm-preview"] .chat-send-btn:hover:not(:disabled),
[data-theme="moncher-warm-preview"] .ms-thread-send-btn:hover,
[data-theme="moncher-warm-preview"] .ai-send-btn:hover {
  filter: none !important;
  box-shadow: 0 14px 30px rgba(var(--primary-rgb),0.30) !important;
}

[data-theme="moncher-warm-preview"] .btn-outline,
[data-theme="moncher-warm-preview"] .btn:not(.btn-primary):not(.btn-danger):not(.btn-success),
[data-theme="moncher-warm-preview"] button[class*="bg-gray-100"],
[data-theme="moncher-warm-preview"] button[class*="bg-slate-100"] {
  background: rgba(255,255,255,0.86) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] .form-input,
[data-theme="moncher-warm-preview"] input[type="text"],
[data-theme="moncher-warm-preview"] input[type="email"],
[data-theme="moncher-warm-preview"] input[type="password"],
[data-theme="moncher-warm-preview"] input[type="search"],
[data-theme="moncher-warm-preview"] input[type="tel"],
[data-theme="moncher-warm-preview"] input[type="url"],
[data-theme="moncher-warm-preview"] input[type="number"],
[data-theme="moncher-warm-preview"] input[type="date"],
[data-theme="moncher-warm-preview"] input[type="time"],
[data-theme="moncher-warm-preview"] input[type="datetime-local"],
[data-theme="moncher-warm-preview"] textarea,
[data-theme="moncher-warm-preview"] select,
[data-theme="moncher-warm-preview"] .chat-input-container,
[data-theme="moncher-warm-preview"] .ms-thread-input,
[data-theme="moncher-warm-preview"] .global-search-input-wrap {
  background: rgba(255,255,255,0.94) !important;
  border-color: var(--input-border) !important;
  box-shadow: 0 1px 2px rgba(17,24,39,0.03) inset !important;
}

[data-theme="moncher-warm-preview"] .form-input:focus,
[data-theme="moncher-warm-preview"] input:focus,
[data-theme="moncher-warm-preview"] textarea:focus,
[data-theme="moncher-warm-preview"] select:focus,
[data-theme="moncher-warm-preview"] .chat-input-container:focus-within,
[data-theme="moncher-warm-preview"] .ms-thread-input:focus-within,
[data-theme="moncher-warm-preview"] .global-search-input-wrap:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--focus-ring), 0 1px 2px rgba(17,24,39,0.03) inset !important;
}

[data-theme="moncher-warm-preview"] .modal,
[data-theme="moncher-warm-preview"] .community-writer-sheet,
[data-theme="moncher-warm-preview"] #manualPanel,
[data-theme="moncher-warm-preview"] #aiPanel,
[data-theme="moncher-warm-preview"] .global-search-box,
[data-theme="moncher-warm-preview"] #langMenu,
[data-theme="moncher-warm-preview"] #notifDropdown,
[data-theme="moncher-warm-preview"] .ms-reaction-picker,
[data-theme="moncher-warm-preview"] #roomMenuDropdown {
  background: rgba(255,255,255,0.97) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-popover) !important;
}

[data-theme="moncher-warm-preview"] .modal {
  box-shadow: var(--shadow-modal) !important;
}

[data-theme="moncher-warm-preview"] .modal-overlay,
[data-theme="moncher-warm-preview"] .global-search-overlay,
[data-theme="moncher-warm-preview"] #aiOverlay {
  background: rgba(17,24,39,0.44) !important;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

[data-theme="moncher-warm-preview"] th,
[data-theme="moncher-warm-preview"] .approval-home-table th {
  background: linear-gradient(180deg, #F7FAFD, var(--table-header-bg)) !important;
  border-color: var(--table-border) !important;
  color: var(--table-header-text) !important;
}

[data-theme="moncher-warm-preview"] td,
[data-theme="moncher-warm-preview"] .approval-home-table td,
[data-theme="moncher-warm-preview"] .mail-item,
[data-theme="moncher-warm-preview"] .gs-result-item,
[data-theme="moncher-warm-preview"] .manual-section-header,
[data-theme="moncher-warm-preview"] .manual-item-header,
[data-theme="moncher-warm-preview"] .ms-menu-item {
  border-color: var(--border-subtle) !important;
}

[data-theme="moncher-warm-preview"] tr:hover td,
[data-theme="moncher-warm-preview"] .mail-item:hover,
[data-theme="moncher-warm-preview"] .gs-result-item:hover,
[data-theme="moncher-warm-preview"] .manual-section-header:hover,
[data-theme="moncher-warm-preview"] .manual-item-header:hover,
[data-theme="moncher-warm-preview"] .ms-menu-item:hover {
  background: var(--surface-hover) !important;
}

[data-theme="moncher-warm-preview"] .badge,
[data-theme="moncher-warm-preview"] .approval-sidebar-badge,
[data-theme="moncher-warm-preview"] .community-sidebar-badge,
[data-theme="moncher-warm-preview"] .ms-task-badge {
  box-shadow: 0 6px 14px rgba(var(--primary-rgb),0.14);
}

[data-theme="moncher-warm-preview"] .messenger-container,
[data-theme="moncher-warm-preview"] .chat-view-panel,
[data-theme="moncher-warm-preview"] .room-list-panel,
[data-theme="moncher-warm-preview"] .chat-messages,
[data-theme="moncher-warm-preview"] .chat-empty-state,
[data-theme="moncher-warm-preview"] .ms-thread-panel {
  background: var(--chat-bg) !important;
}

[data-theme="moncher-warm-preview"] .room-list-panel,
[data-theme="moncher-warm-preview"] .chat-view-panel,
[data-theme="moncher-warm-preview"] .ms-thread-panel {
  border-color: var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}

[data-theme="moncher-warm-preview"] .room-item,
[data-theme="moncher-warm-preview"] .ms-room-item {
  border-radius: var(--radius-md);
}

[data-theme="moncher-warm-preview"] .room-item:hover,
[data-theme="moncher-warm-preview"] .ms-room-item:hover,
[data-theme="moncher-warm-preview"] .ms-section-header:hover,
[data-theme="moncher-warm-preview"] .community-sidebar-item:hover,
[data-theme="moncher-warm-preview"] .community-rank-item:hover,
[data-theme="moncher-warm-preview"] .approval-sidebar-item:hover {
  background: var(--surface-hover) !important;
}

[data-theme="moncher-warm-preview"] .room-item.active,
[data-theme="moncher-warm-preview"] .ms-room-item.active,
[data-theme="moncher-warm-preview"] .community-sidebar-item.active,
[data-theme="moncher-warm-preview"] .approval-sidebar-item.active,
[data-theme="moncher-warm-preview"] .comm-channel-tab--active {
  background: linear-gradient(135deg, rgba(var(--primary-rgb),0.16), rgba(var(--primary-rgb),0.07)) !important;
  border-color: rgba(var(--primary-rgb),0.28) !important;
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] .message-bubble,
[data-theme="moncher-warm-preview"] .typing-indicator {
  border: 1px solid var(--border) !important;
  box-shadow: 0 6px 18px rgba(17,24,39,0.07) !important;
}

[data-theme="moncher-warm-preview"] .message-group.own .message-bubble {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 62%, var(--primary-light)) !important;
  border-color: rgba(var(--primary-rgb),0.22) !important;
  color: #FFFFFF !important;
  box-shadow: 0 10px 24px rgba(var(--primary-rgb),0.22) !important;
}

[data-theme="moncher-warm-preview"] .message-bubble.message-bubble-image,
[data-theme="moncher-warm-preview"] .message-group.own .message-bubble.message-bubble-image {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

[data-theme="moncher-warm-preview"] .reply-quote {
  background: rgba(255,244,232,0.86) !important;
  border-left-color: var(--primary-light) !important;
  color: var(--text-main) !important;
}

[data-theme="moncher-warm-preview"] .message-group.own .reply-quote {
  background: rgba(255,255,255,0.18) !important;
  border-left-color: rgba(255,255,255,0.82) !important;
  color: #FFFFFF !important;
}

[data-theme="moncher-warm-preview"] .file-msg-wrap,
[data-theme="moncher-warm-preview"] .file-upload-progress,
[data-theme="moncher-warm-preview"] .approval-related-doc-box,
[data-theme="moncher-warm-preview"] .community-write-trigger,
[data-theme="moncher-warm-preview"] .community-img-thumb,
[data-theme="moncher-warm-preview"] .draft-list-modal {
  background: rgba(255,255,255,0.9) !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-xs) !important;
}

[data-theme="moncher-warm-preview"] .dropzone,
[data-theme="moncher-warm-preview"] [class*="dropzone"],
[data-theme="moncher-warm-preview"] [style*="border: 2px dashed"],
[data-theme="moncher-warm-preview"] [style*="border:2px dashed"] {
  background: var(--dropzone-bg) !important;
  border-color: var(--dropzone-border) !important;
}

[data-theme="moncher-warm-preview"] .approval-dash-icon,
[data-theme="moncher-warm-preview"] .community-rank-num,
[data-theme="moncher-warm-preview"] #manualPanel .manual-section-icon,
[data-theme="moncher-warm-preview"] .gs-type-badge {
  background: var(--primary-bg) !important;
  color: var(--primary) !important;
}

[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background: var(--card-bg)"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background:var(--card-bg)"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background: #FFFFFF"],
[data-theme="moncher-warm-preview"] .work-mgr-wrap [style*="background:#FFFFFF"] {
  background: #FFFFFF !important;
  border-color: var(--border) !important;
  box-shadow: var(--shadow-xs) !important;
}

[data-theme="moncher-warm-preview"] .tox-tinymce,
[data-theme="moncher-warm-preview"] .tox .tox-toolbar__primary,
[data-theme="moncher-warm-preview"] .tox .tox-menubar,
[data-theme="moncher-warm-preview"] .tox .tox-statusbar {
  border-color: var(--editor-border) !important;
}

[data-theme="moncher-warm-preview"] .tox .tox-toolbar__primary,
[data-theme="moncher-warm-preview"] .tox .tox-menubar,
[data-theme="moncher-warm-preview"] .tox .tox-statusbar {
  background: var(--editor-toolbar-bg) !important;
}

@media (hover: hover) and (pointer: fine) {
  [data-theme="moncher-warm-preview"] .card:hover,
  [data-theme="moncher-warm-preview"] .dash-widget:hover,
  [data-theme="moncher-warm-preview"] .approval-dash-card:hover,
  [data-theme="moncher-warm-preview"] .community-right-card:hover,
  [data-theme="moncher-warm-preview"] .admin-card:hover,
  [data-theme="moncher-warm-preview"] .version-item:hover {
    border-color: rgba(var(--primary-rgb),0.32) !important;
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px);
  }

  [data-theme="moncher-warm-preview"] .btn:hover,
  [data-theme="moncher-warm-preview"] .header button:hover,
  [data-theme="moncher-warm-preview"] .room-list-actions button:hover,
  [data-theme="moncher-warm-preview"] .chat-header-actions button:hover,
  [data-theme="moncher-warm-preview"] .chat-input-actions button:hover,
  [data-theme="moncher-warm-preview"] .community-img-thumb:hover img {
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-theme="moncher-warm-preview"] *,
  [data-theme="moncher-warm-preview"] *::before,
  [data-theme="moncher-warm-preview"] *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================
   Theme expansion layer v3.83.36
   기존 6개 테마와 Liquid Glass 테마까지 같은 표면 체계를 확장한다. 기능 JS/라우터/모바일 동작은 건드리지 않는다.
   ========================================== */
html:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) {
  color-scheme: light;
  background: var(--surface-canvas);
}

html[data-theme="dark"] {
  color-scheme: dark;
  background: var(--surface-canvas);
}

html[data-theme="liquid-glass"] {
  color-scheme: dark;
  background: var(--surface-canvas);
}

html:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) body {
  background: var(--theme-page-bg);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .content,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .main-area,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) #pageContent {
  background: var(--theme-page-bg) !important;
  color: var(--text-main);
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .header {
  background: var(--topbar-bg) !important;
  border-bottom: 1px solid var(--topbar-border) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 14px 34px var(--theme-shadow-ambient) !important;
  backdrop-filter: saturate(1.08) blur(18px);
  -webkit-backdrop-filter: saturate(1.08) blur(18px);
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .sidebar {
  background: var(--theme-sidebar-bg) !important;
  box-shadow: 10px 0 34px var(--theme-shadow-ambient) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .sidebar-header,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .sidebar-footer {
  background: var(--theme-sidebar-panel-bg) !important;
  border-color: var(--theme-sidebar-border) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .nav-item {
  border-radius: var(--radius-md);
  color: var(--nav-text) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .nav-item i {
  color: var(--theme-nav-icon);
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .nav-item:hover {
  background: var(--nav-hover) !important;
  border-color: var(--theme-sidebar-border) !important;
  color: #FFFFFF !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .nav-item.active {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 52%, var(--primary-light)) !important;
  border-color: var(--theme-sidebar-border) !important;
  color: var(--nav-active-text) !important;
  box-shadow: 0 12px 28px rgba(var(--primary-rgb),0.30) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .card,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .dash-widget,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .approval-layout,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .approval-home-section,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .approval-dash-card,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .approval-sidebar,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .approval-main,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .community-sidebar,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .community-right-card,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .local-draft-card,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .version-item,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .admin-card,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .mail-sidebar,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .mail-list,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .mail-reader,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .work-card {
  background: var(--theme-card-bg) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .dash-widget > div:first-child,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .card-header,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .approval-home-section-header,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .room-list-header,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .chat-header,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .community-sidebar-header,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .community-top-tabs,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .comm-channel-tabs-wrap,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .approval-sidebar-header,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .modal-header,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .community-writer-header,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) #aiPanel .ai-header {
  background: var(--theme-panel-head-bg) !important;
  border-color: var(--border) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .header button,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .room-list-actions button,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .chat-header-actions button,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .chat-input-actions button,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .global-search-close,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .community-writer-close,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .ms-thread-close {
  background: var(--theme-control-bg) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 1px 2px var(--theme-shadow-ambient), 0 8px 18px var(--theme-shadow-ambient) !important;
  color: var(--text-sub) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .btn-primary,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .chat-send-btn,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .ms-thread-send-btn,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .ai-send-btn {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 56%, var(--primary-light)) !important;
  border-color: transparent !important;
  color: var(--button-primary-text) !important;
  box-shadow: 0 10px 22px rgba(var(--primary-rgb),0.24) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .form-input,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) input[type="text"],
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) input[type="email"],
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) input[type="password"],
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) input[type="search"],
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) input[type="tel"],
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) input[type="url"],
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) input[type="number"],
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) input[type="date"],
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) input[type="time"],
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) input[type="datetime-local"],
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) textarea,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) select,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .chat-input-container,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .ms-thread-input,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .global-search-input-wrap {
  background: var(--theme-input-bg) !important;
  border-color: var(--input-border) !important;
  color: var(--input-text) !important;
  box-shadow: 0 1px 2px var(--theme-shadow-ambient) inset !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .modal,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .community-writer-sheet,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) #manualPanel,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) #aiPanel,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .global-search-box,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) #langMenu,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) #notifDropdown,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .ms-reaction-picker,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) #roomMenuDropdown {
  background: var(--theme-popover-bg) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-popover) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .messenger-container,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .chat-view-panel,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .room-list-panel,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .chat-messages,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .chat-empty-state,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .ms-thread-panel {
  background: var(--chat-bg) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .message-bubble,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .typing-indicator {
  background: var(--chat-bubble-in) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 6px 18px var(--theme-shadow-ambient) !important;
  color: var(--text-main) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .message-group.own .message-bubble {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary) 62%, var(--primary-light)) !important;
  border-color: rgba(var(--primary-rgb),0.22) !important;
  color: var(--chat-bubble-out-text) !important;
  box-shadow: 0 10px 24px rgba(var(--primary-rgb),0.22) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .message-bubble.message-bubble-image,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .message-group.own .message-bubble.message-bubble-image {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .room-item:hover,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .ms-room-item:hover,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .community-sidebar-item:hover,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .approval-sidebar-item:hover,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) tr:hover td {
  background: var(--surface-hover) !important;
}

:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .room-item.active,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .ms-room-item.active,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .community-sidebar-item.active,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .approval-sidebar-item.active,
:is(
  [data-theme="moncher-warm-preview"],
  [data-theme="mc-orange"],
  [data-theme="dark-brown"],
  [data-theme="dark"],
  [data-theme="mint"],
  [data-theme="navy"],
  [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
) .comm-channel-tab--active {
  background: linear-gradient(135deg, rgba(var(--primary-rgb),0.16), rgba(var(--primary-rgb),0.07)) !important;
  border-color: rgba(var(--primary-rgb),0.28) !important;
  color: var(--text-main) !important;
}

@media (hover: hover) and (pointer: fine) {
  :is(
    [data-theme="moncher-warm-preview"],
    [data-theme="mc-orange"],
    [data-theme="dark-brown"],
    [data-theme="dark"],
    [data-theme="mint"],
    [data-theme="navy"],
    [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
  ) .card:hover,
  :is(
    [data-theme="moncher-warm-preview"],
    [data-theme="mc-orange"],
    [data-theme="dark-brown"],
    [data-theme="dark"],
    [data-theme="mint"],
    [data-theme="navy"],
    [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
  ) .dash-widget:hover,
  :is(
    [data-theme="moncher-warm-preview"],
    [data-theme="mc-orange"],
    [data-theme="dark-brown"],
    [data-theme="dark"],
    [data-theme="mint"],
    [data-theme="navy"],
    [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
  ) .approval-dash-card:hover,
  :is(
    [data-theme="moncher-warm-preview"],
    [data-theme="mc-orange"],
    [data-theme="dark-brown"],
    [data-theme="dark"],
    [data-theme="mint"],
    [data-theme="navy"],
    [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
  ) .community-right-card:hover,
  :is(
    [data-theme="moncher-warm-preview"],
    [data-theme="mc-orange"],
    [data-theme="dark-brown"],
    [data-theme="dark"],
    [data-theme="mint"],
    [data-theme="navy"],
    [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
  ) .admin-card:hover,
  :is(
    [data-theme="moncher-warm-preview"],
    [data-theme="mc-orange"],
    [data-theme="dark-brown"],
    [data-theme="dark"],
    [data-theme="mint"],
    [data-theme="navy"],
    [data-theme="rose-gold"],
  [data-theme="liquid-glass"]
  ) .version-item:hover {
    border-color: rgba(var(--primary-rgb),0.32) !important;
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px);
  }
}

/* ==========================================
   Appearance personalization final overrides v3.83.36
   테마 공통 레이어 이후에도 사용자 개인 설정이 최종 적용되도록 보장한다.
   ========================================== */
html[data-sidebar-glass="on"] .sidebar {
  background:
    linear-gradient(180deg, rgba(var(--primary-rgb),0.18), rgba(2,6,23,0.18)),
    var(--theme-sidebar-bg) !important;
  border-right: 1px solid rgba(255,255,255,0.13) !important;
  backdrop-filter: saturate(1.18) blur(20px);
  -webkit-backdrop-filter: saturate(1.18) blur(20px);
}

html[data-ui-density="compact"] .card,
html[data-ui-density="compact"] .dash-widget,
html[data-ui-density="compact"] .approval-home-section,
html[data-ui-density="compact"] .community-right-card,
html[data-ui-density="compact"] .version-item,
html[data-ui-density="compact"] .admin-card {
  border-radius: var(--radius-md) !important;
}

html[data-ui-density="compact"] .btn {
  min-height: 34px;
  padding-top: 7px;
  padding-bottom: 7px;
}

html[data-ui-density="compact"] .form-input,
html[data-ui-density="compact"] select,
html[data-ui-density="compact"] textarea {
  min-height: 36px;
}

html[data-motion="reduced"],
html[data-motion="reduced"] * {
  scroll-behavior: auto !important;
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  transition-duration: 1ms !important;
  animation-duration: 1ms !important;
}

.message-bubble:not(.message-bubble-image),
.mf-bubble,
#messageInput,
.mf-input {
  font-size: var(--messenger-message-font-size, var(--appearance-ui-font-size, 14px)) !important;
}

.reply-quote-title,
.mf-reply-title {
  font-size: max(11px, calc(var(--messenger-message-font-size, 14px) - 3px)) !important;
}

.reply-quote-text,
.mf-reply-text,
.message-time,
.mf-time {
  font-size: max(10px, calc(var(--messenger-message-font-size, 14px) - 4px)) !important;
}

/* ==========================================
   WorkCapture v3.83.79
   본문 선택 텍스트를 업무/체크리스트/AI 업무 초안으로 전환하는 공통 UI.
   ========================================== */
.work-capture-toolbar,
.work-capture-sheet {
  position: fixed;
  z-index: 10020;
  width: min(460px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md, 8px);
  background: var(--card-bg);
  color: var(--text-main);
  box-shadow: var(--shadow-lg, 0 18px 45px rgba(15, 23, 42, 0.18));
  pointer-events: auto;
  transform: translateZ(0);
}

.work-capture-sheet {
  left: 12px;
  right: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  width: auto;
}

.work-capture-preview {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 2px 2px 8px;
}

.work-capture-preview span {
  font-size: 11px;
  color: var(--text-muted);
}

.work-capture-preview strong {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-main);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.work-capture-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 34px;
  gap: 6px;
  align-items: center;
}

.work-capture-btn,
.work-capture-icon-btn {
  min-height: 34px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm, 6px);
  background: var(--body-bg);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.work-capture-btn:hover,
.work-capture-icon-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-surface);
}

.work-capture-icon-btn {
  width: 34px;
  padding: 0;
}

.work-capture-ai-btn {
  border-color: color-mix(in srgb, var(--primary) 38%, var(--card-border));
  background: var(--primary-surface);
  color: var(--primary);
}

.work-capture-modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.work-capture-source-notice {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--card-border);
  background: var(--body-bg);
}

.work-capture-source-notice div {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.work-capture-source-notice span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-capture-source-notice p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.work-capture-ai-loading,
.work-capture-ai-status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md, 8px);
  background: var(--body-bg);
  color: var(--text-secondary);
}

.work-capture-ai-loading {
  align-items: center;
  justify-content: center;
  min-height: 180px;
  text-align: center;
}

.work-capture-ai-loading i {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-surface);
  color: var(--primary);
  animation: workCapturePulse 1.1s ease-in-out infinite;
}

.work-capture-ai-loading strong,
.work-capture-ai-status strong {
  color: var(--text-main);
}

.work-capture-ai-loading span,
.work-capture-ai-status span,
.work-capture-ai-status p,
.work-capture-ai-status li {
  font-size: 12px;
  line-height: 1.45;
}

.work-capture-ai-status div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.work-capture-ai-status i {
  color: var(--primary);
}

.work-capture-ai-status p {
  margin: 0;
  color: var(--text-secondary);
}

.work-capture-ai-status ul {
  margin: 0;
  padding-left: 18px;
  color: var(--semantic-warning-text, #b45309);
}

@keyframes workCapturePulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 1; }
}

.work-capture-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.work-capture-field label,
.work-capture-check {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.work-capture-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.work-capture-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 6px;
}

.work-capture-target-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding: 2px;
}

.work-capture-target {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md, 8px);
  background: var(--card-bg);
  cursor: pointer;
}

.work-capture-target.selected {
  border-color: var(--primary);
  background: var(--primary-surface);
}

.work-capture-target span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.work-capture-target strong {
  font-size: 13px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-capture-target em {
  font-size: 11px;
  color: var(--text-muted);
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-capture-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.work-capture-loading,
.work-capture-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 92px;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-md, 8px);
  color: var(--text-muted);
  font-size: 12px;
}

.work-capture-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Approval AI follow-up work candidates */
.approval-ai-followup-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.approval-ai-summary {
  margin-bottom: 2px;
}

.approval-ai-gap-box,
.approval-ai-schedule,
.approval-ai-card {
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md, 8px);
  background: var(--card-bg);
}

.approval-ai-gap-box {
  padding: 12px;
  color: var(--text-secondary);
}

.approval-ai-gap-box strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--text-main);
  font-size: 13px;
}

.approval-ai-gap-box i {
  color: var(--semantic-warning-text, #b45309);
}

.approval-ai-gap-box ul,
.approval-ai-details ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.55;
}

.approval-ai-schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  background: var(--body-bg);
}

.approval-ai-schedule span,
.approval-ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--primary-surface);
  color: var(--primary);
  font-size: 12px;
  line-height: 1.25;
}

.approval-ai-candidates {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.approval-ai-card {
  padding: 12px;
}

.approval-ai-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.approval-ai-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.approval-ai-check input {
  margin-top: 3px;
}

.approval-ai-check span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.approval-ai-check strong {
  color: var(--text-main);
  font-size: 14px;
}

.approval-ai-check em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 12px;
}

.approval-ai-badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--semantic-success-bg, #ecfdf5);
  color: var(--semantic-success-text, #047857);
  font-size: 11px;
  font-weight: 700;
}

.approval-ai-badge.warning {
  background: var(--semantic-warning-bg, #fffbeb);
  color: var(--semantic-warning-text, #b45309);
}

.approval-ai-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.approval-ai-grid label,
.approval-ai-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.approval-ai-grid span,
.approval-ai-field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.approval-ai-field {
  margin-top: 10px;
}

.approval-ai-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.approval-ai-meta > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-md, 8px);
  background: var(--body-bg);
}

.approval-ai-meta b {
  color: var(--text-secondary);
  font-size: 12px;
  margin-right: 2px;
}

.approval-ai-muted,
.approval-ai-empty-line {
  color: var(--text-muted);
  font-size: 12px;
}

.approval-ai-details {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md, 8px);
  background: var(--body-bg);
  color: var(--text-secondary);
}

.approval-ai-details summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.approval-ai-details div {
  margin-top: 8px;
}

.approval-ai-details b {
  display: block;
  margin-bottom: 4px;
  color: var(--text-main);
  font-size: 12px;
}

.approval-ai-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-md, 8px);
  color: var(--text-muted);
  font-size: 13px;
}

.approval-ai-actions {
  position: sticky;
  bottom: -1px;
  padding-top: 10px;
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
}

@media (max-width: 640px) {
  .work-capture-grid {
    grid-template-columns: 1fr;
  }

  .approval-ai-grid,
  .approval-ai-meta {
    grid-template-columns: 1fr;
  }

  .approval-ai-card-head {
    flex-direction: column;
  }

  .approval-ai-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .work-capture-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
  }

  .work-capture-ai-btn {
    grid-column: span 2;
  }

  .work-capture-btn,
  .work-capture-icon-btn {
    min-height: 40px;
    touch-action: manipulation;
  }

  .work-capture-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
