/* ============================================================
   Feature Styles - Messenger / AI Assistant / Directory
   ============================================================ */

/* ---------------- Messenger ---------------- */
.messenger {
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
  height: calc(100vh - var(--topbar-h) - 76px);
  min-height: 560px;
  max-height: 900px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.msg-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: #FCFDFF; }
.msg-side-head { flex: none; padding: 16px 14px 10px; }
.msg-side-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 10px; }
.msg-side-title strong { color: var(--ink); font-size: 16px; font-weight: 780; letter-spacing: -.03em; }
.msg-side-title span { color: var(--muted); font-size: 10px; }
.msg-side-title .icon-btn { width: 31px; height: 31px; border-radius: 9px; background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }
.msg-side-title .icon-btn .icon { width: 15px; height: 15px; }
.msg-side .search-field { height: 36px; }
.msg-filter { display: flex; gap: 4px; padding: 9px 14px 6px; }
.msg-filter button {
  height: 25px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}
.msg-filter button.is-active { background: #fff; border-color: var(--line); color: var(--brand-700); box-shadow: var(--shadow-sm); }
.conv-list { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 8px 10px; }
.conv-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.conv-item:hover { background: #F6F9FF; }
.conv-item.is-active { border-color: var(--brand-100); background: linear-gradient(120deg, #F1F6FF, #EEF9FF); }
.conv-copy { flex: 1; min-width: 0; }
.conv-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.conv-top strong { color: var(--ink); font-size: 11.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-top time { color: var(--muted-light); font-size: 8.5px; white-space: nowrap; flex: none; }
.conv-preview { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item.is-unread .conv-top strong { font-weight: 800; }
.conv-item.is-unread .conv-preview { color: var(--ink-soft); font-weight: 550; }
.conv-unread {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  background: var(--rose-500);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
}
.conv-pin { width: 12px; height: 12px; flex: none; color: var(--muted-light); }
.msg-side-foot { flex: none; padding: 8px 14px 12px; border-top: 1px solid var(--line); color: var(--muted-light); font-size: 8.5px; display: flex; align-items: center; justify-content: space-between; }
.msg-side-foot .online-dot { display: inline-block; width: 5px; height: 5px; margin-right: 4px; border-radius: 50%; background: var(--mint-500); }

.msg-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; }
.msg-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
}
.msg-back { display: none; }
.msg-head-copy { flex: 1; min-width: 0; }
.msg-head-copy strong { display: block; color: var(--ink); font-size: 13.5px; font-weight: 750; }
.msg-head-copy small { display: flex; align-items: center; gap: 4px; margin-top: 1px; color: var(--muted); font-size: 9.5px; }
.msg-head-copy small i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint-500); }
.msg-head-actions { display: flex; align-items: center; gap: 3px; flex: none; }
.msg-head-actions .icon-btn { width: 32px; height: 32px; border-radius: 9px; }
.msg-head-actions .icon-btn .icon { width: 16px; height: 16px; }
.msg-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background:
    radial-gradient(500px 300px at 100% 0, rgba(242, 246, 255, .8), transparent 70%),
    linear-gradient(180deg, #FDFEFF, #FBFCFE);
}
.msg-day { display: flex; align-items: center; justify-content: center; margin: 4px 0 14px; }
.msg-day span { padding: 4px 10px; border-radius: 99px; background: #F1F5FB; color: var(--muted); font-size: 9px; font-weight: 650; }
.msg-bubble-row { display: flex; align-items: flex-end; gap: 7px; margin-bottom: 12px; }
.msg-bubble-row.is-me { flex-direction: row-reverse; }
.msg-bubble-wrap { max-width: min(72%, 480px); }
.msg-sender { display: block; margin: 0 0 3px 2px; color: var(--muted); font-size: 8.5px; font-weight: 600; }
.msg-bubble {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px 13px 13px 13px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.62;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(78, 94, 130, .03);
}
.msg-bubble-row.is-me .msg-bubble { border-color: var(--brand-100); border-radius: 13px 4px 13px 13px; background: linear-gradient(135deg, #EEF4FF, #E6EEFF); color: var(--brand-700); }
.msg-time { flex: none; padding-bottom: 2px; color: var(--muted-light); font-size: 8px; white-space: nowrap; }
.msg-typing { display: flex; align-items: center; gap: 4px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 4px 13px 13px 13px; background: #fff; width: fit-content; }
.msg-typing span { width: 5px; height: 5px; border-radius: 50%; background: var(--muted-light); animation: pulseSoft 1.1s infinite; }
.msg-typing span:nth-child(2) { animation-delay: .16s; }
.msg-typing span:nth-child(3) { animation-delay: .32s; }
.msg-composer { flex: none; padding: 10px 14px 13px; border-top: 1px solid var(--line); background: #fff; }
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 5px 5px 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #FBFCFE;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.composer-box:focus-within { border-color: var(--brand-300, #AFC1FF); background: #fff; box-shadow: 0 0 0 4px rgba(109, 141, 255, .09); }
.composer-box textarea {
  flex: 1;
  min-height: 34px;
  max-height: 110px;
  padding: 7px 0 5px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  resize: none;
}
.composer-box textarea::placeholder { color: var(--muted-light); }
.composer-tools { display: flex; align-items: center; gap: 1px; flex: none; }
.composer-tools .icon-btn { width: 30px; height: 30px; border-radius: 8px; }
.composer-tools .icon-btn .icon { width: 16px; height: 16px; }
.composer-send {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #7E99FF, #5B7CFA);
  color: #fff;
  box-shadow: 0 5px 12px -6px rgba(91, 124, 250, .7);
  transition: transform .18s;
}
.composer-send:hover { transform: translateY(-1px); }
.composer-send .icon { width: 16px; height: 16px; }
.msg-composer-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; padding: 0 3px; color: var(--muted-light); font-size: 8.5px; }
.msg-composer-hint kbd { display: inline-flex; align-items: center; height: 15px; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-family: inherit; font-size: 8px; }
.msg-empty { flex: 1; display: flex; align-items: center; justify-content: center; padding: 30px; }
.msg-empty .empty-state { padding: 0; }

/* ---------------- AI assistant ---------------- */
.ai-page { display: flex; flex-direction: column; gap: 16px; }
.ai-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border: 1px solid #E7E2FB;
  border-radius: var(--radius-xl);
  background: linear-gradient(120deg, #F7F4FF 0%, #EFF4FF 47%, #F0FBF8 100%);
  box-shadow: var(--shadow-card);
}
.ai-hero::before {
  content: '';
  position: absolute;
  width: 280px;
  height: 280px;
  right: -70px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, .26), transparent 68%);
}
.ai-hero::after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  right: 210px;
  bottom: -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 211, 153, .18), transparent 68%);
}
.ai-hero-copy { position: relative; z-index: 1; min-width: 0; }
.ai-hero-badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 1px solid rgba(255, 255, 255, .85); border-radius: 99px; background: rgba(255, 255, 255, .72); color: var(--lavender-700); font-size: 9.5px; font-weight: 750; }
.ai-hero-badge .icon { width: 12px; height: 12px; }
.ai-hero-title { margin-top: 8px; color: var(--ink); font-size: 24px; font-weight: 800; letter-spacing: -.045em; }
.ai-hero-title span { color: var(--lavender-600); }
.ai-hero-desc { margin-top: 4px; max-width: 600px; color: var(--ink-soft); font-size: 11.5px; line-height: 1.7; }
.ai-hero-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.ai-hero-chips span { display: inline-flex; align-items: center; gap: 4px; height: 23px; padding: 0 8px; border-radius: 6px; background: rgba(255, 255, 255, .72); color: var(--ink-soft); font-size: 9px; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(228, 234, 248, .8); }
.ai-hero-chips .icon { width: 11px; height: 11px; color: var(--lavender-500); }
.ai-hero-art {
  position: relative;
  z-index: 1;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(244, 240, 255, .8));
  box-shadow: 0 18px 36px -20px rgba(108, 87, 204, .45);
}
.ai-hero-art .icon { width: 40px; height: 40px; color: var(--lavender-500); }
.ai-hero-art::after { content: ''; position: absolute; width: 10px; height: 10px; right: 14px; top: 14px; border-radius: 50%; background: var(--mint-400, #6EE7B7); box-shadow: 0 0 0 4px rgba(110, 231, 183, .18); }

.ai-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; min-height: 560px; align-items: stretch; }
.ai-side { display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.ai-side-card { padding: 15px; }
.ai-assistant { display: flex; align-items: center; gap: 9px; }
.ai-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #C9B8FF, #8FA8FF);
  color: #fff;
  box-shadow: 0 7px 16px -8px rgba(122, 102, 216, .6);
}
.ai-avatar .icon { width: 21px; height: 21px; }
.ai-avatar::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--mint-500); }
.ai-assistant-copy strong { display: block; color: var(--ink); font-size: 12.5px; font-weight: 750; }
.ai-assistant-copy small { display: block; color: var(--muted); font-size: 9px; }
.ai-capabilities { display: flex; flex-direction: column; gap: 3px; margin-top: 12px; }
.ai-capability { display: flex; align-items: flex-start; gap: 7px; padding: 6px 0; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.ai-capability .icon { width: 13px; height: 13px; flex: none; margin-top: 1px; color: var(--lavender-500); }
.ai-suggest-title { padding: 12px 14px 4px; color: var(--muted-light); font-size: 9px; font-weight: 750; letter-spacing: .05em; }
.ai-suggest-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 10px 12px; }
.ai-suggest {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 550;
  text-align: left;
  line-height: 1.4;
  transition: background .15s, border-color .15s;
}
.ai-suggest:hover { border-color: var(--lavender-100); background: var(--lavender-50); }
.ai-suggest .icon { width: 13px; height: 13px; flex: none; color: var(--lavender-500); }
.ai-suggest span { flex: 1; }
.ai-side-foot { padding: 10px 13px; border: 1px solid var(--line); border-radius: 12px; background: #FCFDFF; color: var(--muted); font-size: 8.5px; line-height: 1.6; }
.ai-side-foot strong { display: flex; align-items: center; gap: 4px; color: var(--mint-700); font-size: 9px; font-weight: 700; }
.ai-side-foot strong .icon { width: 11px; height: 11px; }
.ai-side-foot p { margin-top: 2px; }

.ai-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.ai-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, #FCFDFF, #F9FBFF); }
.ai-chat-head-copy strong { display: block; color: var(--ink); font-size: 13px; font-weight: 750; }
.ai-chat-head-copy small { display: flex; align-items: center; gap: 4px; margin-top: 1px; color: var(--muted); font-size: 9px; }
.ai-chat-head-copy small i { width: 5px; height: 5px; border-radius: 50%; background: var(--mint-500); }
.ai-chat-head-actions { display: flex; gap: 4px; flex: none; }
.ai-chat-head-actions .btn { height: 30px; padding: 0 9px; border-radius: 8px; font-size: 10px; }
.ai-chat-head-actions .btn .icon { width: 13px; height: 13px; }
.ai-chat-body { flex: 1; min-height: 340px; overflow-y: auto; padding: 20px 22px; background: radial-gradient(560px 320px at 90% 0, rgba(247, 244, 255, .7), transparent 70%), #FDFEFF; }
.ai-message { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
.ai-message.is-user { flex-direction: row-reverse; }
.ai-message-avatar { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 9px; background: linear-gradient(135deg, #D9CDFF, #AFC3FF); color: #fff; }
.ai-message-avatar .icon { width: 14px; height: 14px; }
.ai-message.is-user .ai-message-avatar { background: var(--brand-50); color: var(--brand-600); }
.ai-message-content { max-width: min(78%, 640px); }
.ai-message-meta { display: flex; align-items: center; gap: 5px; margin: 0 2px 4px; color: var(--muted-light); font-size: 8.5px; }
.ai-message.is-user .ai-message-meta { justify-content: flex-end; }
.ai-message-meta strong { color: var(--ink-soft); font-size: 9.5px; font-weight: 650; }
.ai-message-bubble {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px 14px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 2px 6px rgba(78, 94, 130, .03);
}
.ai-message.is-user .ai-message-bubble { border-color: var(--brand-100); border-radius: 14px 4px 14px 14px; background: linear-gradient(135deg, #EEF4FF, #E4EDFF); color: var(--brand-700); }
.ai-message-bubble strong { color: var(--ink); font-weight: 700; }
.ai-message-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.ai-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 27px;
  padding: 0 9px;
  border: 1px solid var(--lavender-100);
  border-radius: 7px;
  background: var(--lavender-50);
  color: var(--lavender-700);
  font-size: 9.5px;
  font-weight: 650;
}
.ai-action:hover { background: var(--lavender-100); }
.ai-action .icon { width: 12px; height: 12px; }
.ai-message.is-user .ai-message-bubble { white-space: pre-wrap; }
.ai-typing { display: inline-flex; align-items: center; gap: 4px; padding: 13px 15px; }
.ai-typing span { width: 5px; height: 5px; border-radius: 50%; background: var(--lavender-400, #B7A5F7); animation: pulseSoft 1.1s infinite; }
.ai-typing span:nth-child(2) { animation-delay: .16s; }
.ai-typing span:nth-child(3) { animation-delay: .32s; }
.ai-composer { flex: none; padding: 10px 14px 12px; border-top: 1px solid var(--line); background: #fff; }
.ai-input-box {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 5px 5px 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #FBFCFE;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.ai-input-box:focus-within { border-color: var(--lavender-300, #C9B8FF); background: #fff; box-shadow: 0 0 0 4px rgba(167, 139, 250, .10); }
.ai-input-box textarea {
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  padding: 8px 0 6px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  line-height: 1.55;
  resize: none;
}
.ai-input-box textarea::placeholder { color: var(--muted-light); }
.ai-input-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.ai-input-tools .icon-btn { width: 29px; height: 29px; border-radius: 8px; }
.ai-input-tools .icon-btn .icon { width: 15px; height: 15px; }
.ai-send {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #B39BFF, #7E99FF);
  color: #fff;
  box-shadow: 0 5px 12px -6px rgba(122, 102, 216, .7);
}
.ai-send:disabled { opacity: .45; cursor: not-allowed; }
.ai-send .icon { width: 16px; height: 16px; }
.ai-disclaimer { margin-top: 5px; text-align: center; color: var(--muted-light); font-size: 8.5px; }

/* ---------------- Directory ---------------- */
.org-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border: 1px solid #E2ECF9;
  border-radius: var(--radius-xl);
  background: linear-gradient(120deg, #F2F8FF, #F4F1FF 58%, #F0FBF7);
  box-shadow: var(--shadow-card);
}
.org-hero-copy strong { display: block; color: var(--ink); font-size: 20px; font-weight: 800; letter-spacing: -.035em; }
.org-hero-copy p { margin-top: 3px; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
.org-hero-stats { display: flex; gap: 8px; flex: none; }
.org-hero-stat { min-width: 88px; padding: 10px 13px; border: 1px solid rgba(255, 255, 255, .9); border-radius: 12px; background: rgba(255, 255, 255, .8); text-align: center; }
.org-hero-stat span { display: block; color: var(--muted); font-size: 8.5px; }
.org-hero-stat strong { display: block; margin-top: 1px; color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -.04em; }
.org-hero-stat strong small { color: var(--muted); font-size: 8.5px; font-weight: 550; }
.directory-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.directory-toolbar .search-field { width: 260px; }
.dept-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.dept-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 650;
  transition: all .18s;
}
.dept-tab em { font-style: normal; color: var(--muted-light); font-size: 9px; }
.dept-tab:hover { border-color: var(--brand-200); color: var(--brand-700); }
.dept-tab.is-active { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand-700); }
.dept-tab.is-active em { color: var(--brand-500); }
.employee-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.employee-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-card);
  text-align: left;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.employee-card:hover { transform: translateY(-2px); border-color: #DDE7F8; box-shadow: 0 14px 28px -20px rgba(78, 94, 130, .28); }
.employee-top { display: flex; align-items: flex-start; gap: 9px; }
.employee-copy { flex: 1; min-width: 0; }
.employee-copy strong { display: block; color: var(--ink); font-size: 13px; font-weight: 750; }
.employee-copy span { display: block; margin-top: 1px; color: var(--muted); font-size: 9.5px; }
.employee-dept { display: inline-flex; align-items: center; height: 19px; margin-top: 8px; padding: 0 7px; border-radius: 5px; background: #F5F8FD; color: var(--ink-soft); font-size: 8.5px; font-weight: 650; }
.employee-contact { display: flex; flex-direction: column; gap: 3px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.employee-contact span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.employee-contact .icon { width: 11px; height: 11px; flex: none; color: var(--muted-light); }
.employee-card-actions { display: flex; gap: 5px; margin-top: 10px; }
.employee-card-actions .btn { flex: 1; height: 29px; border-radius: 8px; font-size: 9.5px; }
.employee-card-actions .btn .icon { width: 12px; height: 12px; }
.org-section { display: flex; flex-direction: column; gap: 10px; }
.org-section-head { display: flex; align-items: center; gap: 8px; }
.org-section-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; }
.org-section-icon .icon { width: 14px; height: 14px; }
.org-section-head strong { color: var(--ink); font-size: 13px; font-weight: 750; }
.org-section-head small { color: var(--muted); font-size: 9.5px; }

/* department overview */
.dept-overview { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.dept-card {
  position: relative;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  transition: transform .18s, border-color .18s;
}
.dept-card:hover { transform: translateY(-2px); border-color: var(--brand-200); }
.dept-card-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; }
.dept-card-icon .icon { width: 16px; height: 16px; }
.dept-card strong { display: block; margin-top: 8px; color: var(--ink); font-size: 11.5px; font-weight: 750; }
.dept-card small { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.dept-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 8.5px; }
.dept-card-foot strong { display: inline; margin: 0; color: var(--brand-600); font-size: 9.5px; font-weight: 700; }

/* employee modal */
.employee-hero { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: linear-gradient(120deg, #F2F6FF, #F2FBF8); }
.employee-hero .avatar { width: 58px; height: 58px; font-size: 21px; }
.employee-hero-copy { flex: 1; min-width: 0; }
.employee-hero-copy strong { display: block; color: var(--ink); font-size: 18px; font-weight: 800; letter-spacing: -.03em; }
.employee-hero-copy span { display: block; margin-top: 1px; color: var(--ink-soft); font-size: 11px; }
.employee-hero-copy small { display: inline-flex; align-items: center; height: 20px; margin-top: 5px; padding: 0 7px; border-radius: 5px; background: #fff; color: var(--brand-600); font-size: 8.5px; font-weight: 650; }
.employee-contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.employee-contact-item { display: flex; align-items: center; gap: 8px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: #FCFDFF; }
.employee-contact-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 8px; background: var(--brand-50); color: var(--brand-600); }
.employee-contact-icon .icon { width: 14px; height: 14px; }
.employee-contact-item span { display: block; color: var(--muted); font-size: 8.5px; }
.employee-contact-item strong { display: block; color: var(--ink); font-size: 10.5px; font-weight: 650; word-break: break-all; }
.employee-note { margin-top: 12px; }
.employee-actions { display: flex; gap: 6px; margin-top: 14px; }
.employee-actions .btn { flex: 1; }

/* ---------------- Messenger / AI / Directory responsive ---------------- */
@media (max-width: 1380px) {
  .employee-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dept-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .messenger { grid-template-columns: 280px minmax(0, 1fr); }
  .ai-shell { grid-template-columns: 248px minmax(0, 1fr); }
}
@media (max-width: 1024px) {
  .messenger { height: calc(100vh - 160px); min-height: 520px; }
  .employee-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dept-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .org-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .org-hero-stats { width: 100%; }
  .org-hero-stat { flex: 1; }
}
@media (max-width: 900px) {
  .messenger { grid-template-columns: 1fr; height: calc(100vh - 150px); min-height: 500px; border-radius: 20px; }
  .msg-side { border-right: 0; }
  .msg-main { display: none; }
  .messenger.is-chat-view .msg-side { display: none; }
  .messenger.is-chat-view .msg-main { display: flex; }
  .msg-back { display: inline-grid; }
  .ai-shell { grid-template-columns: 1fr; }
  .ai-side { flex-direction: row; flex-wrap: wrap; }
  .ai-side-card:first-child { display: none; }
  .ai-side > .card:first-of-type { flex: 1 1 100%; }
  .ai-side > .card:last-of-type { order: 3; flex: 1 1 100%; }
  .ai-side-card { padding: 10px; }
  .ai-suggest-title { padding: 6px 4px 2px; }
  .ai-suggest-list { flex-direction: row; flex-wrap: wrap; padding: 2px; gap: 4px; }
  .ai-suggest { width: auto; border: 1px solid var(--line); background: #fff; padding: 7px 9px; white-space: nowrap; }
  .ai-suggest .icon { display: none; }
  .ai-side-foot { display: none; }
  .ai-chat-body { min-height: 320px; }
  .employee-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .ai-hero { padding: 20px; }
  .ai-hero-title { font-size: 20px; }
  .ai-hero-art { display: none; }
  .ai-chat-body { padding: 15px; }
  .ai-message-content { max-width: 86%; }
  .ai-side > .card:first-of-type { display: none; }
  .ai-shell { gap: 10px; }
  .ai-chat { border-radius: 18px; }
  .ai-chat-head { padding: 11px 14px; }
  .ai-chat-head-actions .btn span { display: none; }
  .ai-chat-head-actions .btn { width: 30px; padding: 0; }
  .ai-composer { padding: 8px 10px 10px; }
  .ai-input-box { padding-left: 9px; }
  .ai-message-bubble { font-size: 11px; }
  .org-hero { padding: 18px; }
  .org-hero-copy strong { font-size: 18px; }
  .org-hero-stats { flex-wrap: wrap; gap: 6px; }
  .org-hero-stat { min-width: 0; flex: 1 1 30%; }
  .directory-toolbar .search-field { width: 100%; }
  .dept-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dept-card { padding: 12px; }
  .dept-card small { display: none; }
  .dept-card-icon { width: 28px; height: 28px; }
  .dept-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
  .dept-tabs::-webkit-scrollbar { display: none; }
  .dept-tab { flex: none; }
  .employee-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .employee-card { padding: 12px; }
  .employee-copy strong { font-size: 12px; }
  .employee-contact { display: flex; margin-top: 6px; padding-top: 6px; }
  .employee-contact span:nth-child(n+3) { display: none; }
  .employee-card-actions .btn { font-size: 9px; height: 27px; }
  .employee-card-actions .btn .icon { width: 11px; height: 11px; }
  .employee-card-actions .btn--send { display: none; }
  .org-section-head strong { font-size: 12px; }
  .employee-contact-list { grid-template-columns: 1fr; }
  .employee-actions { flex-direction: column; }
  .msg-side-head { padding: 12px 12px 8px; }
  .msg-body { padding: 13px; }
  .msg-bubble-wrap { max-width: 80%; }
  .msg-bubble { font-size: 11px; }
  .msg-head { padding: 9px 12px; }
  .msg-composer { padding: 8px 10px calc(9px + env(safe-area-inset-bottom, 0px)); }
  .msg-composer-hint { display: none; }
  .msg-side-foot { padding-bottom: 12px; }
  .messenger { height: calc(100dvh - 168px); min-height: 440px; max-height: none; }
  .messenger-page { gap: 10px; }
  .msg-filter { padding: 8px 12px 4px; }
}
@media (max-width: 420px) {
  .employee-grid { grid-template-columns: 1fr; }
  .employee-card { flex-direction: row; align-items: flex-start; gap: 9px; flex-wrap: wrap; }
  .employee-top { flex: 1; }
  .employee-dept { margin-top: 6px; }
  .employee-card-actions { width: 100%; margin-top: 8px; }
  .dept-overview { grid-template-columns: 1fr 1fr; }
  .ai-hero-chips span:nth-child(n+4) { display: none; }
  .msg-bubble-wrap { max-width: 84%; }
}