/* BudunOS /messages page variants
 * Body: bos-messages-v-{id}
 * Root: .bos-dir--messages.bos-msg--{id}
 */

/* ---------- App dock — fused messenger shell ---------- */
body.bos-messages-v-dock .bos-dir--messages .bos-dir-hero {
  display: none;
}

body.bos-messages-v-dock .bos-dir--messages {
  margin-top: 12px;
}

body.bos-messages-v-dock .bos-dir--messages .bos-msg-layout {
  margin: 0;
  padding: 10px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--bos-dir-line, #e9ebef);
  box-shadow: 0 14px 40px -28px rgba(20, 24, 32, 0.16);
  overflow: hidden;
}

body.night-mode.bos-messages-v-dock .bos-dir--messages .bos-msg-layout,
html[data-bs-theme="dark"].bos-messages-v-dock .bos-dir--messages .bos-msg-layout {
  background: var(--card-dark-color, #262d34);
  border-color: rgba(255, 255, 255, 0.08);
}

body.bos-messages-v-dock .bos-dir--messages .bos-msg-panel {
  border: 0;
  border-radius: 0;
  min-height: 620px;
  background: transparent;
  box-shadow: none;
}

body.bos-messages-v-dock .bos-dir--messages .bos-msg-threads {
  border-right: 1px solid var(--bos-dir-line, #e9ebef);
  min-height: 620px;
}

body.night-mode.bos-messages-v-dock .bos-dir--messages .bos-msg-threads,
html[data-bs-theme="dark"].bos-messages-v-dock .bos-dir--messages .bos-msg-threads {
  border-right-color: rgba(255, 255, 255, 0.08);
}

body.bos-messages-v-dock .bos-dir--messages .bos-msg-panel-head {
  background: transparent;
}

@media (max-width: 767.98px) {
  body.bos-messages-v-dock .bos-dir--messages .bos-msg-threads {
    border-right: 0;
  }
}

/* ---------- Frost panes ---------- */
body.bos-messages-v-glass .bos-dir--messages .bos-msg-panel {
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}

body.night-mode.bos-messages-v-glass .bos-dir--messages .bos-msg-panel,
html[data-bs-theme="dark"].bos-messages-v-glass .bos-dir--messages .bos-msg-panel {
  background: rgba(30, 37, 43, 0.55);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
}

body.bos-messages-v-glass .bos-dir--messages .bos-msg-panel-head,
body.bos-messages-v-glass .bos-dir--messages .chat-form {
  background: rgba(255, 255, 255, 0.35) !important;
  backdrop-filter: blur(10px);
}

body.night-mode.bos-messages-v-glass .bos-dir--messages .bos-msg-panel-head,
body.night-mode.bos-messages-v-glass .bos-dir--messages .chat-form,
html[data-bs-theme="dark"].bos-messages-v-glass .bos-dir--messages .bos-msg-panel-head,
html[data-bs-theme="dark"].bos-messages-v-glass .bos-dir--messages .chat-form {
  background: rgba(255, 255, 255, 0.04) !important;
}

body.bos-messages-v-glass .bos-dir--messages .bos-dir-hero {
  background: rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  padding: 14px 16px;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

/* ---------- Night chat ---------- */
body.bos-messages-v-ink .bos-dir--messages {
  --bos-msg-ink: #f0f3f6;
  --bos-msg-muted: #8b949e;
  --bos-msg-line: rgba(255, 255, 255, 0.08);
  --bos-msg-soft: rgba(255, 255, 255, 0.06);
  --bos-msg-panel: #0f1419;
}

body.bos-messages-v-ink .bos-dir--messages .bos-dir-hero {
  background: var(--bos-msg-panel);
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid var(--bos-msg-line);
  color: var(--bos-msg-ink);
}

body.bos-messages-v-ink .bos-dir--messages .bos-dir-hero-title,
body.bos-messages-v-ink .bos-dir--messages .bos-dir-hero-copy strong,
body.bos-messages-v-ink .bos-dir--messages .bos-dir-hero p {
  color: var(--bos-msg-ink) !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-dir-hero p {
  color: var(--bos-msg-muted) !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-dir-cta {
  background: color-mix(in srgb, var(--link-color) 70%, #0f1419) !important;
  color: #fff !important;
  border-color: transparent !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-dir-cta .main-icon,
body.bos-messages-v-ink .bos-dir--messages .bos-dir-cta .svg-container {
  color: #fff !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-dir-cta svg,
body.bos-messages-v-ink .bos-dir--messages .bos-dir-cta svg * {
  stroke: #fff !important;
  color: #fff !important;
  fill: none !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-msg-panel {
  background:
    radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--link-color) 16%, transparent), transparent 55%),
    var(--bos-msg-panel);
  border-color: var(--bos-msg-line);
  color: var(--bos-msg-ink);
  box-shadow: 0 18px 48px -28px rgba(0, 0, 0, 0.65);
}

body.bos-messages-v-ink .bos-dir--messages .bos-msg-panel-head,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-panel-body,
body.bos-messages-v-ink .bos-dir--messages .chat-conversations,
body.bos-messages-v-ink .bos-dir--messages .chat-typing,
body.bos-messages-v-ink .bos-dir--messages .chat-to,
body.bos-messages-v-ink .bos-dir--messages .chat-voice-notes,
body.bos-messages-v-ink .bos-dir--messages .chat-attachments,
body.bos-messages-v-ink .bos-dir--messages .chat-form {
  background: transparent !important;
  border-color: var(--bos-msg-line) !important;
  color: var(--bos-msg-ink) !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-msg-panel-head {
  border-bottom: 1px solid var(--bos-msg-line);
}

body.bos-messages-v-ink .bos-dir--messages .bos-msg-panel-head strong,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-peer,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-peer a,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-thread-list .name,
body.bos-messages-v-ink .bos-dir--messages .chat-to .to,
body.bos-messages-v-ink .bos-dir--messages .chat-to .tags li,
body.bos-messages-v-ink .bos-dir--messages .chat-to .typeahead input {
  color: var(--bos-msg-ink) !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-msg-thread-list .text,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-thread-list .time,
body.bos-messages-v-ink .bos-dir--messages .chat-typing,
body.bos-messages-v-ink .bos-dir--messages .conversation-body .time {
  color: var(--bos-msg-muted) !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-msg-thread-list .feeds-item:hover,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-thread-list .feeds-item.unread {
  background: var(--bos-msg-soft) !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-msg-thread-list .feeds-item.unread .name {
  color: #fff !important;
}

/* Icons — white strokes on charcoal */
body.bos-messages-v-ink .bos-dir--messages .bos-msg-icon-btn {
  background: var(--bos-msg-soft) !important;
  border-color: var(--bos-msg-line) !important;
  color: #fff !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-msg-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

body.bos-messages-v-ink .bos-dir--messages .main-icon,
body.bos-messages-v-ink .bos-dir--messages .bos-sb-ico,
body.bos-messages-v-ink .bos-dir--messages .svg-container,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-icon-btn .main-icon,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-icon-btn .svg-container {
  color: #fff !important;
}

body.bos-messages-v-ink .bos-dir--messages .main-icon svg,
body.bos-messages-v-ink .bos-dir--messages .bos-sb-ico svg,
body.bos-messages-v-ink .bos-dir--messages .svg-container svg,
body.bos-messages-v-ink .bos-dir--messages .main-icon svg *,
body.bos-messages-v-ink .bos-dir--messages .bos-sb-ico svg path,
body.bos-messages-v-ink .bos-dir--messages .svg-container svg path,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-icon-btn .main-icon *,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-icon-btn .svg-container *,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-icon-btn path {
  color: #fff !important;
  stroke: #fff !important;
  fill: none !important;
}

body.bos-messages-v-ink .bos-dir--messages .chat-form .x-form-tools > li {
  color: #fff !important;
  background: var(--bos-msg-soft) !important;
}

body.bos-messages-v-ink .bos-dir--messages .chat-form .x-form-tools > li:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

body.bos-messages-v-ink .bos-dir--messages .chat-form .x-form-tools-post {
  background: color-mix(in srgb, var(--link-color) 75%, #0f1419) !important;
  color: #fff !important;
}

body.bos-messages-v-ink .bos-dir--messages .chat-form .x-form-tools svg,
body.bos-messages-v-ink .bos-dir--messages .chat-form .x-form-tools svg *,
body.bos-messages-v-ink .bos-dir--messages .chat-form .x-form-tools path {
  stroke: #fff !important;
  color: #fff !important;
  fill: none !important;
}

/* Bubbles — lit outgoing, soft incoming */
body.bos-messages-v-ink .bos-dir--messages .conversation.right .conversation-body .text {
  background: color-mix(in srgb, var(--link-color) 72%, #0f1419) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--link-color) 35%, transparent), 0 8px 24px rgba(0, 0, 0, 0.25) !important;
}

body.bos-messages-v-ink .bos-dir--messages .conversation.right .conversation-body .text a {
  color: #fff !important;
  text-decoration: underline;
}

body.bos-messages-v-ink .bos-dir--messages .conversation:not(.right) .conversation-body .text {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--bos-msg-ink) !important;
  border: 1px solid var(--bos-msg-line) !important;
}

body.bos-messages-v-ink .bos-dir--messages .conversation:not(.right) .conversation-body .text a {
  color: color-mix(in srgb, var(--link-color) 70%, #fff) !important;
}

body.bos-messages-v-ink .bos-dir--messages .chat-form-message {
  background: var(--bos-msg-soft) !important;
  border-color: var(--bos-msg-line) !important;
}

body.bos-messages-v-ink .bos-dir--messages .chat-form-message textarea,
body.bos-messages-v-ink .bos-dir--messages .chat-form-message input[type="text"] {
  color: var(--bos-msg-ink) !important;
  caret-color: #fff;
}

body.bos-messages-v-ink .bos-dir--messages .chat-form-message textarea::placeholder {
  color: var(--bos-msg-muted) !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-dir-empty strong,
body.bos-messages-v-ink .bos-dir--messages .bos-dir-empty p,
body.bos-messages-v-ink .bos-dir--messages .bos-msg-back .text-link,
body.bos-messages-v-ink .bos-dir--messages .see-more,
body.bos-messages-v-ink .bos-dir--messages .alert.see-more {
  color: var(--bos-msg-ink) !important;
  background: transparent !important;
  border-color: transparent !important;
}

body.bos-messages-v-ink .bos-dir--messages .bos-dir-empty p,
body.bos-messages-v-ink .bos-dir--messages .see-more span {
  color: var(--bos-msg-muted) !important;
}

body.bos-messages-v-ink .bos-dir--messages .chat-to .tags li {
  background: var(--bos-msg-soft) !important;
  border-color: var(--bos-msg-line) !important;
}

body.bos-messages-v-ink .bos-dir--messages .btn-voice-start,
body.bos-messages-v-ink .bos-dir--messages .btn-voice-stop,
body.bos-messages-v-ink .bos-dir--messages .js_voice-processing-message,
body.bos-messages-v-ink .bos-dir--messages .js_voice-success-message {
  color: var(--bos-msg-ink) !important;
}

/* ---------- Round chat / bubble ---------- */
body.bos-messages-v-bubble .bos-dir--messages .bos-msg-panel {
  border-radius: 24px;
}

body.bos-messages-v-bubble .bos-dir--messages .bos-msg-panel-head {
  padding: 16px 18px;
}

body.bos-messages-v-bubble .bos-dir--messages .bos-msg-icon-btn {
  border-radius: 999px !important;
  width: 36px;
  height: 36px;
}

body.bos-messages-v-bubble .bos-dir--messages .bos-msg-thread-list .feeds-item {
  border-radius: 16px;
  margin: 4px 6px;
  padding-inline: 8px;
}

body.bos-messages-v-bubble .bos-dir--messages .bos-msg-thread-list .data-avatar img {
  border-radius: 14px !important;
}

body.bos-messages-v-bubble .bos-dir--messages .conversation.right .conversation-body .text,
body.bos-messages-v-bubble .bos-dir--messages .conversation:not(.right) .conversation-body .text {
  border-radius: 20px !important;
  padding: 10px 14px !important;
}

body.bos-messages-v-bubble .bos-dir--messages .conversation.right .conversation-body .text {
  border-bottom-right-radius: 6px !important;
}

body.bos-messages-v-bubble .bos-dir--messages .conversation:not(.right) .conversation-body .text {
  border-bottom-left-radius: 6px !important;
}

body.bos-messages-v-bubble .bos-dir--messages .chat-form {
  border-radius: 0 0 24px 24px;
  padding: 10px 12px 12px !important;
}

body.bos-messages-v-bubble .bos-dir--messages .chat-form-message {
  border-radius: 999px !important;
  padding-inline: 14px !important;
}

body.bos-messages-v-bubble .bos-dir--messages .chat-form .x-form-tools > li {
  border-radius: 999px;
}

body.bos-messages-v-bubble .bos-dir--messages .chat-form .x-form-tools-post {
  background: var(--link-color) !important;
  color: #fff !important;
}

body.bos-messages-v-bubble .bos-dir--messages.bos-messages-app .chat-form .x-form-tools-post,
body.bos-messages-page .bos-dir--messages.bos-messages-app .chat-form .x-form-tools-post {
  background: var(--theme-primary, #df1118) !important;
  color: #fff !important;
}

/* =========================================================
   Messages app shell — /chat-like (no far-left rail)
   Layout: threads | chatbox | about/files/links
========================================================= */

body.bos-messages-page {
  overflow: hidden;
  overflow-x: hidden;
}

/* Full-bleed header only on messages page */
body.bos-messages-page .main-header .bos-header-inner.container,
body.bos-messages-page .main-header .bos-header-inner.container-fluid,
body.bos-messages-page .main-header > .container,
body.bos-messages-page .main-header > .container-fluid,
body.im-page .main-header .bos-header-inner.container,
body.im-page .main-header .bos-header-inner.container-fluid,
body.im-page .main-header > .container,
body.im-page .main-header > .container-fluid {
  max-width: none !important;
  width: 100% !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}

body.bos-messages-page,
body.n_chat.bos-messages-page {
  --bos-msg-page-bg: #f5f6f8;
  --bos-msg-primary: var(--theme-primary, #df1118);
  --bos-msg-primary-soft: color-mix(in srgb, var(--bos-msg-primary) 12%, #fff);
  --bos-msg-border: #e8eaed;
  --bos-msg-border-soft: #f0f1f3;
  --bos-msg-surface: #f7f8fa;
  --bos-msg-muted: #989fa9;
  background: var(--bos-msg-page-bg) !important;
}

body.bos-messages-page .chat-sidebar,
body.bos-messages-page .chat-widget,
body.bos-messages-page .chat-box {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.bos-messages-page #kt_app_content_container,
body.bos-messages-page #kt_app_content_container > .container,
body.bos-messages-page #kt_app_content_container > .container-fluid {
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.bos-messages-page .main-wrapper,
body.bos-messages-page .top-bar,
body.bos-messages-page .main-header,
body.bos-messages-page #kt_app_header,
body.bos-messages-page #kt_app_wrapper {
  padding-right: 0 !important;
}

body.bos-messages-page .footer,
body.bos-messages-page .main-footer,
body.bos-messages-page footer.footer,
body.bos-messages-page .footer-bottom-bar {
  display: none !important;
}

body.bos-messages-page #kt_app_content,
body.bos-messages-page .main-wrapper {
  background: var(--bos-msg-page-bg, #f5f6f8) !important;
}

body.night-mode.bos-messages-page,
html[data-bs-theme="dark"] body.bos-messages-page {
  --bos-msg-page-bg: #1e252b;
  --bos-msg-border: var(--card-dark-divider, #2e3f4d);
  --bos-msg-border-soft: rgba(255, 255, 255, 0.06);
  --bos-msg-surface: #1e252b;
  --bos-msg-muted: #7e8a96;
  --bos-msg-primary-soft: color-mix(in srgb, var(--bos-msg-primary) 18%, transparent);
  background: #1e252b !important;
}

.bos-dir--messages.bos-messages-app {
  --bos-msg-primary: var(--theme-primary, #df1118);
  --bos-msg-primary-soft: color-mix(in srgb, var(--bos-msg-primary) 12%, #fff);
  --bos-msg-border: #e8eaed;
  --bos-msg-border-soft: #f0f1f3;
  --bos-msg-surface: #f7f8fa;
  --bos-msg-muted: #989fa9;
  --bos-msg-left: 320px;
  --bos-msg-right: 300px;
  --bos-msg-radius: 18px;
  --bos-msg-gap: 12px;
  --bos-msg-header-h: 70px;
  width: 100%;
  max-width: 100%;
  margin: 0 !important;
  padding: 0;
}

body.n_activated.bos-messages-page,
body.n_live.bos-messages-page {
  --bos-msg-header-h: 120px;
}

body.night-mode .bos-dir--messages.bos-messages-app,
html[data-bs-theme="dark"] .bos-dir--messages.bos-messages-app {
  --bos-msg-primary-soft: color-mix(in srgb, var(--bos-msg-primary) 18%, transparent);
  --bos-msg-border: var(--card-dark-divider, #2e3f4d);
  --bos-msg-border-soft: rgba(255, 255, 255, 0.06);
  --bos-msg-surface: #1e252b;
  --bos-msg-muted: #7e8a96;
}

.bos-dir--messages.bos-messages-app .bos-dir-hero {
  display: none !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-shell {
  display: grid;
  grid-template-columns: var(--bos-msg-left) minmax(0, 1fr);
  gap: var(--bos-msg-gap);
  align-items: stretch;
  width: 100%;
  height: calc(100vh - var(--bos-msg-header-h));
  height: calc(100dvh - var(--bos-msg-header-h));
  max-height: calc(100vh - var(--bos-msg-header-h));
  max-height: calc(100dvh - var(--bos-msg-header-h));
  min-height: 0;
  padding: var(--bos-msg-gap);
  box-sizing: border-box;
  background: var(--bos-msg-page-bg, #f5f6f8);
  transition: grid-template-columns .22s ease;
}

.bos-dir--messages.bos-messages-app[data-sidebar="0"] .bos-msg-shell {
  grid-template-columns: 0 minmax(0, 1fr);
  column-gap: 0;
}

.bos-dir--messages.bos-messages-app .bos-msg-sidebar,
.bos-dir--messages.bos-messages-app .bos-msg-stage {
  min-width: 0;
  min-height: 0;
  position: relative;
  height: 100%;
}

.bos-dir--messages.bos-messages-app[data-sidebar="0"] .bos-msg-sidebar {
  width: 0 !important;
  min-width: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  margin: 0;
  border: 0;
}

.bos-dir--messages.bos-messages-app .bos-msg-stage-host {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.bos-dir--messages.bos-messages-app .bos-msg-back {
  flex: 0 0 auto;
}

.bos-dir--messages.bos-messages-app .bos-msg-stage-host > .bos-msg-stage-inner {
  flex: 1 1 auto;
  min-height: 0;
}

.bos-dir--messages.bos-messages-app .bos-msg-panel {
  display: flex !important;
  flex-direction: column;
  height: 100% !important;
  min-height: 0 !important;
  border: 1px solid var(--bos-msg-border) !important;
  border-radius: var(--bos-msg-radius) !important;
  background: #fff !important;
  box-shadow:
    0 4px 10px rgba(20, 25, 35, .03),
    0 18px 40px -28px rgba(20, 25, 35, .14) !important;
  overflow: hidden;
}

.bos-dir--messages.bos-messages-app .bos-msg-threads {
  min-height: 0 !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-panel-body {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bos-dir--messages.bos-messages-app .bos-msg-stage-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--bos-msg-right);
  gap: var(--bos-msg-gap);
  height: 100%;
  min-height: 0;
  transition: grid-template-columns .22s ease;
}

.bos-dir--messages.bos-messages-app[data-details="0"] .bos-msg-stage-inner {
  grid-template-columns: minmax(0, 1fr) 0fr;
  column-gap: 0;
}

.bos-dir--messages.bos-messages-app .bos-msg-chat {
  min-width: 0;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
}

.bos-dir--messages.bos-messages-app .bos-msg-info {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  opacity: 1;
  pointer-events: auto;
}

.bos-dir--messages.bos-messages-app[data-details="0"] .bos-msg-info {
  opacity: 0;
  pointer-events: none;
}

.bos-dir--messages.bos-messages-app .bos-msg-info-panel {
  height: 100%;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
}

.bos-dir--messages.bos-messages-app .bos-msg-chat-body {
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bos-dir--messages.bos-messages-app .bos-msg-chat-form,
.bos-dir--messages.bos-messages-app .chat-form.bos-msg-chat-form {
  flex: 0 0 auto;
  margin-top: auto;
}

.bos-dir--messages.bos-messages-app .chat-conversations,
.bos-dir--messages.bos-messages-app .chat-conversations.js_scroller,
.bos-dir--messages.bos-messages-app .chat-conversations .slimScrollDiv {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  overflow-y: auto !important;
}

.bos-dir--messages.bos-messages-app .chat-conversations .slimScrollBar,
.bos-dir--messages.bos-messages-app .chat-conversations .slimScrollRail {
  display: none !important;
}

body.night-mode .bos-dir--messages.bos-messages-app .bos-msg-panel,
html[data-bs-theme="dark"] .bos-dir--messages.bos-messages-app .bos-msg-panel {
  background: var(--card-dark-color, #262d34) !important;
  border-color: var(--card-dark-divider, #2e3f4d) !important;
}

/* sidebar head */
.bos-dir--messages.bos-messages-app .bos-msg-sidebar-head {
  height: 72px;
  padding: 0 14px 0 16px !important;
  border-bottom: 0 !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-sidebar-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.bos-dir--messages.bos-messages-app .bos-msg-sidebar-title {
  min-width: 0;
  flex: 1;
}

.bos-dir--messages.bos-messages-app .bos-msg-sidebar-title strong {
  display: block;
  font-size: 17px;
  font-weight: 780;
  letter-spacing: -.4px;
}

.bos-dir--messages.bos-messages-app .bos-msg-sidebar-title span {
  display: block;
  margin-top: 2px;
  color: var(--bos-msg-muted);
  font-size: 11px;
  font-weight: 500;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-search {
  padding: 4px 13px 12px;
}

.bos-dir--messages.bos-messages-app .bos-msg-search-field {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--bos-msg-border);
  border-radius: 11px;
  background: var(--bos-msg-surface);
  transition: .15s;
}

.bos-dir--messages.bos-messages-app .bos-msg-search-field:focus-within {
  border-color: rgba(223, 17, 24, .2);
  background: #fff;
  box-shadow: 0 0 0 3px var(--bos-msg-primary-soft);
}

.bos-dir--messages.bos-messages-app .bos-msg-search-field svg {
  width: 14px;
  height: 14px;
  color: #949ba4;
  flex: 0 0 auto;
}

.bos-dir--messages.bos-messages-app .bos-msg-search-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--bos-dir-ink, #17191e);
}

.bos-dir--messages.bos-messages-app .bos-msg-tabs {
  display: flex;
  gap: 4px;
  padding: 0 13px 11px;
  border-bottom: 1px solid var(--bos-msg-border-soft);
}

.bos-dir--messages.bos-messages-app .bos-msg-tab {
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7d848e;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.bos-dir--messages.bos-messages-app .bos-msg-tab.active {
  background: var(--bos-msg-primary-soft);
  color: var(--bos-msg-primary);
}

.bos-dir--messages.bos-messages-app .bos-msg-panel-body.js_live-messages-alt,
.bos-dir--messages.bos-messages-app .js_live-messages-alt {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-scroller {
  flex: 1;
  min-height: 0;
  max-height: none !important;
  height: auto !important;
  overflow-y: auto;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-list {
  padding: 8px !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-list .feeds-item,
.bos-dir--messages.bos-messages-app .bos-msg-thread {
  margin: 0 0 4px !important;
  border-radius: 12px !important;
  background: transparent !important;
  transition: .15s;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread:hover {
  background: #f8f9fa !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread.active {
  background: var(--bos-msg-primary-soft) !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread.active .name {
  color: #292d33 !important;
  font-weight: 750 !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread.unread .text {
  color: #515862 !important;
  font-weight: 650;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-list .data-container {
  gap: 10px !important;
  padding: 10px !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-avatar,
.bos-dir--messages.bos-messages-app .bos-msg-thread-list .data-avatar {
  position: relative;
  flex: 0 0 44px !important;
  width: 44px !important;
  height: 44px !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-list .data-avatar img {
  width: 44px !important;
  height: 44px !important;
  border-radius: 13px !important;
  object-fit: cover;
}

.bos-msg-status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #16a36d;
}

.bos-msg-status-dot.offline {
  background: #bcc1c8;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-top {
  display: flex;
  align-items: center;
  gap: 5px;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-top .name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px !important;
  font-weight: 720 !important;
}

.bos-msg-verified {
  color: var(--bos-msg-primary);
  font-size: 11px;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-top .time {
  margin: 0 !important;
  color: #a0a6af !important;
  font-size: 11px !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.bos-dir--messages.bos-messages-app .bos-msg-thread-bottom .text {
  min-width: 0;
  flex: 1;
  margin: 0 !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px !important;
}

.bos-msg-unread-count {
  min-width: 10px;
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  background: var(--bos-msg-primary);
  color: #fff;
  font-size: 0;
}

/* chat header */
.bos-dir--messages.bos-messages-app .bos-msg-chat-head {
  height: 72px;
  padding: 0 14px 0 16px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px;
}

.bos-msg-peer-card {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bos-msg-peer-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
}

.bos-msg-peer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.bos-dir--messages.bos-messages-app .bos-msg-peer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  font-size: 14px;
  line-height: 1.25;
}

.bos-msg-peer-status {
  color: #969da6;
  font-size: 12px;
  font-weight: 500;
}

.bos-msg-peer-status.is-online {
  color: #239b70;
}

.bos-dir--messages.bos-messages-app .bos-msg-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px;
  flex-shrink: 0;
  height: 40px;
}

.bos-dir--messages.bos-messages-app .bos-msg-icon-btn {
  display: inline-grid !important;
  place-items: center !important;
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #737a84 !important;
  line-height: 0 !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-icon-btn:hover {
  background: var(--bos-msg-surface) !important;
  color: #17191e !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-icon-btn svg,
.bos-dir--messages.bos-messages-app .bos-msg-icon-btn .main-icon,
.bos-dir--messages.bos-messages-app .bos-msg-icon-btn .svg-container {
  width: 16px !important;
  height: 16px !important;
  display: block !important;
  margin: 0 !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-icon-btn .main-icon *,
.bos-dir--messages.bos-messages-app .bos-msg-icon-btn .svg-container *,
.bos-dir--messages.bos-messages-app .bos-msg-icon-btn path {
  fill: currentColor !important;
  stroke: currentColor;
}

.bos-msg-panel-toggle,
.bos-msg-panel-reopen {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--bos-msg-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--bos-msg-surface) 80%, #fff);
  color: var(--bos-msg-muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
}

.bos-msg-panel-toggle:hover,
.bos-msg-panel-reopen:hover {
  color: var(--bos-msg-primary);
  border-color: color-mix(in srgb, var(--bos-msg-primary) 30%, var(--bos-msg-border));
  background: #fff;
}

.bos-msg-panel-reopen {
  position: absolute;
  top: 10px;
  z-index: 20;
  display: none;
  box-shadow: 0 2px 10px rgba(24, 28, 50, 0.1);
  background: #fff;
}

.bos-msg-panel-reopen-left { left: 10px; }
.bos-msg-panel-reopen-right { right: 10px; }

.bos-dir--messages.bos-messages-app[data-sidebar="0"] .bos-msg-panel-reopen-left,
.bos-dir--messages.bos-messages-app[data-details="0"] .bos-msg-panel-reopen-right {
  display: inline-flex;
}

.bos-dir--messages.bos-messages-app[data-sidebar="0"] .js_bos-msg-toggle-sidebar.bos-msg-panel-toggle,
.bos-dir--messages.bos-messages-app[data-details="0"] .bos-msg-chat-head .js_bos-msg-toggle-details.bos-msg-panel-toggle,
.bos-dir--messages.bos-messages-app[data-details="0"] .bos-msg-panel-reopen-right.js_bos-msg-toggle-details {
  display: none;
}

/* Never hide the About panel close control via the desktop collapse rule */
.bos-dir--messages.bos-messages-app .bos-msg-info-head .js_bos-msg-toggle-details.bos-msg-panel-toggle,
.bos-dir--messages.bos-messages-app .bos-msg-info-close.js_bos-msg-toggle-details {
  display: inline-grid !important;
}

.bos-dir--messages.bos-messages-app[data-sidebar="0"] .bos-msg-chat-head {
  padding-left: 46px !important;
}

.bos-dir--messages.bos-messages-app[data-details="0"] .bos-msg-chat-head {
  padding-right: 46px !important;
}

.bos-msg-info-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bos-msg-details-backdrop {
  display: none;
}

.bos-msg-info-close-mobile {
  display: none;
}

@media (min-width: 992px) {
  .bos-dir--messages.bos-messages-app .bos-msg-info-head .js_bos-msg-info-toggle {
    display: none !important;
  }
}

/* chat search */
.bos-msg-chat-search {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-bottom: 1px solid var(--bos-msg-border-soft);
  background: #fff;
}

.bos-msg-chat-search.open {
  display: flex;
}

.bos-msg-chat-search .bos-msg-search-field {
  flex: 1;
  height: 36px;
}

.bos-msg-search-count {
  color: #999fa8;
  font-size: 11px;
  white-space: nowrap;
}

.bos-msg-chat-search .search-nav-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--bos-msg-surface);
  color: #737a84;
  cursor: pointer;
}

.bos-msg-chat-search .search-nav-btn svg {
  width: 14px;
  height: 14px;
}

.bos-dir--messages.bos-messages-app .chat-conversations {
  padding: 18px 20px !important;
  background: #fff !important;
}

.bos-dir--messages.bos-messages-app.is-searching .conversation:not(.bos-chat-search-hit) .conversation-body .text {
  opacity: .28;
}

.bos-dir--messages.bos-messages-app.is-searching .conversation.bos-chat-search-active .conversation-body .text,
.bos-dir--messages.bos-messages-app.is-searching .conversation.right.bos-chat-search-active .conversation-body .text {
  background: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111 !important;
  opacity: 1 !important;
}

.bos-dir--messages.bos-messages-app .conversation.right .conversation-body .text,
.bos-dir--messages.bos-messages-app .conversation.right .conversation-body .text.js_chat-color-me {
  background: var(--chat-color, var(--bos-msg-primary)) !important;
  border-color: var(--chat-color, var(--bos-msg-primary)) !important;
  color: #fff !important;
}

.bos-dir--messages.bos-messages-app .panel-messages {
  --chat-color: var(--bos-msg-primary);
}

.bos-dir--messages.bos-messages-app .x-form-tools-colors {
  position: relative !important;
}

.bos-dir--messages.bos-messages-app .chat-colors-menu {
  bottom: calc(100% + 8px) !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  width: auto !important;
  min-width: 168px;
  padding: 8px !important;
  border: 1px solid var(--bos-msg-border) !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 12px 28px rgba(20, 25, 35, .12) !important;
}

.bos-dir--messages.bos-messages-app .chat-colors-menu .item {
  float: none !important;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 2px !important;
  padding: 0 !important;
  border-radius: 999px !important;
}

.bos-dir--messages.bos-messages-app .chat-colors-menu .item:hover {
  background: var(--bos-msg-surface) !important;
}

.bos-dir--messages.bos-messages-app .chat-form.bos-msg-chat-form,
.bos-dir--messages.bos-messages-app .bos-msg-chat-form {
  padding: 10px 14px 14px !important;
  border-top: 1px solid var(--bos-msg-border-soft) !important;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 40%) !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-chat-form .bos-chat-reply-bar {
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid var(--bos-msg-border);
  border-radius: 12px;
  background: #fff;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer:focus-within {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 !important;
  padding: 0 0 4px;
  float: none !important;
  list-style: none;
  flex-shrink: 0;
  height: auto;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer-tools--inline {
  padding: 0;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer-tools--send {
  padding: 0 0 2px;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  min-height: 44px;
  padding: 6px 8px 6px 14px;
  border: 1px solid var(--bos-msg-border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 25, 35, .03);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer:focus-within .bos-msg-composer-field {
  border-color: color-mix(in srgb, var(--bos-msg-primary) 28%, transparent);
  box-shadow: 0 0 0 3px var(--bos-msg-primary-soft);
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .chat-form-message {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  display: flex;
  align-items: center;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .chat-form-message textarea {
  width: 100%;
  min-height: 22px !important;
  max-height: 120px;
  margin: 0 !important;
  padding: 5px 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  resize: none;
  line-height: 1.4 !important;
  font-size: 14.5px !important;
  color: #17191e !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .chat-form-message textarea::placeholder {
  color: #9aa1aa !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .x-form-tools > li {
  float: none !important;
  width: 34px !important;
  height: 34px !important;
  display: inline-grid !important;
  place-items: center !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #7a828d !important;
  cursor: pointer;
  line-height: 0 !important;
  transition: background .12s ease, color .12s ease;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .x-form-tools > li:hover {
  background: var(--bos-msg-surface) !important;
  color: var(--bos-msg-primary) !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .x-form-tools > li > i,
.bos-dir--messages.bos-messages-app .bos-msg-composer .x-form-tools > li .js_x-uploader,
.bos-dir--messages.bos-messages-app .bos-msg-composer .x-uploader {
  font-size: 15px !important;
  line-height: 1 !important;
  width: auto !important;
  margin: 0 !important;
  display: inline-grid !important;
  place-items: center;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .x-uploader {
  position: relative;
  width: 100% !important;
  height: 100% !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .x-uploader input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .x-form-tools-colors > i {
  color: var(--chat-color, var(--bos-msg-primary)) !important;
  font-size: 12px !important;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .x-form-tools > li.x-form-tools-post {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  background: var(--bos-msg-primary) !important;
  color: #fff !important;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--bos-msg-primary) 28%, transparent);
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .x-form-tools > li.x-form-tools-post:hover {
  background: color-mix(in srgb, var(--bos-msg-primary) 88%, #000) !important;
  color: #fff !important;
  filter: none;
  transform: translateY(-1px);
}

.bos-dir--messages.bos-messages-app .bos-msg-composer .x-form-tools > li.x-form-tools-post > i {
  font-size: 14px !important;
  color: #fff !important;
  transform: translateX(1px);
}

body.bos-messages-page .bos-dir--messages.bos-messages-app .chat-form .x-form-tools-post,
body.bos-messages-v-bubble .bos-dir--messages.bos-messages-app .chat-form .x-form-tools-post,
body.bos-messages-v-ink .bos-dir--messages.bos-messages-app .chat-form .x-form-tools-post {
  background: var(--bos-msg-primary, var(--theme-primary, #df1118)) !important;
  color: #fff !important;
}

body.night-mode .bos-dir--messages.bos-messages-app .bos-msg-chat-form,
html[data-bs-theme="dark"] .bos-dir--messages.bos-messages-app .bos-msg-chat-form {
  background: linear-gradient(180deg, #222930 0%, var(--card-dark-color, #262d34) 45%) !important;
  border-top-color: var(--card-dark-divider, #2e3f4d) !important;
}

body.night-mode .bos-dir--messages.bos-messages-app .bos-msg-composer-field,
html[data-bs-theme="dark"] .bos-dir--messages.bos-messages-app .bos-msg-composer-field {
  background: #1e252b;
  border-color: var(--card-dark-divider, #2e3f4d);
}

body.night-mode .bos-dir--messages.bos-messages-app .bos-msg-composer .chat-form-message textarea,
html[data-bs-theme="dark"] .bos-dir--messages.bos-messages-app .bos-msg-composer .chat-form-message textarea {
  color: var(--body-color-dark, #c1d4e3) !important;
}

/* voice lives inside composer field */
.bos-dir--messages.bos-messages-app .chat-attachments {
  margin: 0 0 8px;
  padding: 0 2px;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer-field .chat-voice-notes {
  display: none;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.bos-dir--messages.bos-messages-app .bos-msg-composer-field .chat-voice-notes.is-open,
.bos-dir--messages.bos-messages-app .bos-msg-composer-field .chat-voice-notes[style*="display: block"],
.bos-dir--messages.bos-messages-app .bos-msg-composer-field .chat-voice-notes[style*="display:block"] {
  display: flex !important;
  align-items: center;
}

.bos-dir--messages.bos-messages-app .bos-voice-open .bos-msg-composer-field .chat-form-message,
.bos-dir--messages.bos-messages-app .bos-msg-composer-field:has(.chat-voice-notes.is-open) .chat-form-message,
.bos-dir--messages.bos-messages-app .bos-msg-composer-field:has(.chat-voice-notes[style*="display: block"]) .chat-form-message,
.bos-dir--messages.bos-messages-app .bos-msg-composer-field:has(.chat-voice-notes[style*="display:block"]) .chat-form-message {
  display: none !important;
}

.bos-dir--messages.bos-messages-app .bos-voice-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

.bos-dir--messages.bos-messages-app .bos-voice-start,
.bos-dir--messages.bos-messages-app .bos-voice-stop,
.bos-dir--messages.bos-messages-app .bos-voice-state {
  display: none;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5b6572;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.bos-dir--messages.bos-messages-app .bos-voice-start:not([style*="display: none"]),
.bos-dir--messages.bos-messages-app .bos-voice-stop[style*="display: block"],
.bos-dir--messages.bos-messages-app .bos-voice-stop[style*="display:block"],
.bos-dir--messages.bos-messages-app .bos-voice-state:not(.x-hidden):not([style*="display: none"]) {
  display: inline-flex !important;
}

.bos-dir--messages.bos-messages-app .bos-voice-start {
  display: inline-flex;
}

.bos-dir--messages.bos-messages-app .bos-voice-start i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bos-msg-primary-soft);
  color: var(--bos-msg-primary);
  font-size: 12px;
}

.bos-dir--messages.bos-messages-app .bos-voice-stop {
  cursor: default;
}

.bos-dir--messages.bos-messages-app .bos-voice-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  flex: 1;
  min-width: 0;
}

.bos-dir--messages.bos-messages-app .bos-voice-wave > i {
  display: block;
  width: 3px;
  height: 6px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--bos-msg-primary) 55%, #c5cad3);
  transform-origin: center bottom;
}

.bos-dir--messages.bos-messages-app .chat-voice-notes.is-recording .bos-voice-wave > i {
  animation: bos-voice-bar 900ms ease-in-out infinite;
  background: var(--bos-msg-primary);
}

.bos-dir--messages.bos-messages-app .bos-voice-wave > i:nth-child(2) { animation-delay: .05s; }
.bos-dir--messages.bos-messages-app .bos-voice-wave > i:nth-child(3) { animation-delay: .1s; }
.bos-dir--messages.bos-messages-app .bos-voice-wave > i:nth-child(4) { animation-delay: .16s; }
.bos-dir--messages.bos-messages-app .bos-voice-wave > i:nth-child(5) { animation-delay: .08s; }
.bos-dir--messages.bos-messages-app .bos-voice-wave > i:nth-child(6) { animation-delay: .2s; }
.bos-dir--messages.bos-messages-app .bos-voice-wave > i:nth-child(7) { animation-delay: .12s; }
.bos-dir--messages.bos-messages-app .bos-voice-wave > i:nth-child(8) { animation-delay: .18s; }
.bos-dir--messages.bos-messages-app .bos-voice-wave > i:nth-child(9) { animation-delay: .07s; }
.bos-dir--messages.bos-messages-app .bos-voice-wave > i:nth-child(10) { animation-delay: .14s; }
.bos-dir--messages.bos-messages-app .bos-voice-wave > i:nth-child(11) { animation-delay: .22s; }
.bos-dir--messages.bos-messages-app .bos-voice-wave > i:nth-child(12) { animation-delay: .09s; }

@keyframes bos-voice-bar {
  0%, 100% { height: 5px; opacity: .55; }
  40% { height: 16px; opacity: 1; }
  70% { height: 9px; opacity: .8; }
}

.bos-dir--messages.bos-messages-app .bos-voice-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-width: 54px;
  color: #5b6572;
  font-variant-numeric: tabular-nums;
}

.bos-dir--messages.bos-messages-app .bos-voice-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bos-msg-primary);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--bos-msg-primary) 35%, transparent);
  animation: bos-voice-pulse 1.2s ease-out infinite;
}

@keyframes bos-voice-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bos-msg-primary) 35%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.bos-dir--messages.bos-messages-app .bos-voice-stop-btn,
.bos-dir--messages.bos-messages-app .bos-voice-dismiss {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--bos-msg-primary-soft);
  color: var(--bos-msg-primary);
  cursor: pointer;
}

.bos-dir--messages.bos-messages-app .bos-voice-stop-btn:hover,
.bos-dir--messages.bos-messages-app .bos-voice-dismiss:hover {
  background: color-mix(in srgb, var(--bos-msg-primary) 18%, #fff);
}

.bos-dir--messages.bos-messages-app .bos-voice-stop-btn i {
  font-size: 10px;
}

.bos-dir--messages.bos-messages-app .bos-voice-dismiss svg {
  width: 12px;
  height: 12px;
}

.bos-dir--messages.bos-messages-app .bos-voice-state {
  cursor: default;
  color: #5b6572;
}

.bos-dir--messages.bos-messages-app .bos-voice-state .fa-circle-check {
  color: #16a34a;
}

.bos-dir--messages.bos-messages-app .bos-voice-spin {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--bos-msg-primary) 25%, #fff);
  border-top-color: var(--bos-msg-primary);
  border-radius: 50%;
  animation: bos-voice-spin .7s linear infinite;
}

@keyframes bos-voice-spin {
  to { transform: rotate(360deg); }
}

.bos-dir--messages.bos-messages-app .conversation,
.bos-dir--messages.bos-messages-app .conversation-body {
  overflow: visible;
}

/* info panel */
.bos-dir--messages.bos-messages-app .bos-msg-info-head {
  height: 72px;
  padding: 0 14px 0 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between;
  border-bottom: 0 !important;
}

.bos-msg-info-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
}

.bos-msg-info-panel {
  display: flex;
  flex-direction: column;
}

.bos-msg-info-profile {
  text-align: center;
}

.bos-msg-info-avatar {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto;
}

.bos-msg-info-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 21px;
}

.bos-msg-info-profile h3 {
  margin: 10px 0 3px;
  font-size: 15px;
  font-weight: 750;
}

.bos-msg-info-profile p {
  margin: 0;
  color: var(--bos-msg-muted);
  font-size: 12px;
}

.bos-msg-info-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
}

.bos-msg-info-action {
  display: block;
  padding: 10px 4px;
  border: 1px solid var(--bos-msg-border);
  border-radius: 10px;
  background: #fff;
  color: #656c76;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.bos-msg-info-action:hover {
  background: var(--bos-msg-surface);
  color: #656c76;
}

.bos-msg-info-action-ico {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border-radius: 8px;
  background: var(--bos-msg-surface);
  color: #747b84;
}

.bos-msg-info-action-ico svg {
  width: 14px;
  height: 14px;
}

.bos-msg-info-action > span:last-child {
  display: block;
  margin-top: 5px;
  font-size: 11px;
}

.bos-msg-info-section {
  margin-top: 20px;
  border-top: 1px solid var(--bos-msg-border-soft);
  padding-top: 14px;
}

.bos-msg-info-section-title {
  margin-bottom: 10px;
  color: #8a919a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.bos-msg-shared-media {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.bos-msg-shared-media img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.bos-msg-shared-empty {
  color: var(--bos-msg-muted);
  font-size: 12px;
}

.bos-msg-shared-media:not(:empty) + .bos-msg-shared-empty,
.bos-msg-shared-list:not(:empty) + .bos-msg-shared-empty {
  display: none;
}

.bos-msg-shared-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bos-msg-shared-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 8px;
  border-radius: 9px;
  color: #565d67;
  text-decoration: none;
  font-size: 12px;
  line-height: 1.3;
  transition: background .12s ease;
}

.bos-msg-shared-item:hover {
  background: var(--bos-msg-surface);
  color: #565d67;
}

.bos-msg-shared-item-ico {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--bos-msg-surface);
  color: #747b84;
  font-size: 11px;
}

.bos-msg-shared-item-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bos-msg-info-row {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--bos-msg-border-soft);
  background: transparent;
  color: #565d67;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.bos-msg-info-row-ico {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--bos-msg-surface);
  color: #747b84;
  font-size: 12px;
}

body.night-mode .bos-dir--messages.bos-messages-app .bos-msg-panel,
html[data-bs-theme="dark"] .bos-dir--messages.bos-messages-app .bos-msg-panel {
  background: var(--card-dark-color) !important;
  border-color: var(--card-dark-divider) !important;
}

body.night-mode .bos-dir--messages.bos-messages-app .bos-msg-thread.active,
html[data-bs-theme="dark"] .bos-dir--messages.bos-messages-app .bos-msg-thread.active {
  background: rgba(223, 17, 24, .16) !important;
}

@media (max-width: 1100px) {
  .bos-dir--messages.bos-messages-app {
    --bos-msg-left: 280px;
    --bos-msg-right: 260px;
  }
}

@media (max-width: 980px) {
  .bos-dir--messages.bos-messages-app {
    --bos-msg-left: 250px;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-stage-inner {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-stage {
    position: relative;
  }

  /* About = off-canvas drawer; closed by default (above site header) */
  .bos-dir--messages.bos-messages-app .bos-msg-info {
    position: fixed !important;
    z-index: 1105 !important;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto !important;
    width: min(320px, 88vw);
    max-width: 100%;
    opacity: 1 !important;
    pointer-events: none;
    transform: translate3d(105%, 0, 0);
    visibility: hidden;
    transition: transform .22s ease, visibility .22s ease;
    box-shadow: -16px 0 48px rgba(20, 25, 35, .14);
    overflow: hidden;
    background: #fff;
  }

  .bos-dir--messages.bos-messages-app.info-open[data-details="1"] .bos-msg-info,
  .bos-dir--messages.bos-messages-app[data-details="1"].info-open .bos-msg-info {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;
  }

  .bos-dir--messages.bos-messages-app[data-details="0"] .bos-msg-info,
  .bos-dir--messages.bos-messages-app:not(.info-open) .bos-msg-info {
    transform: translate3d(105%, 0, 0) !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-details-backdrop {
    display: block;
    position: fixed !important;
    inset: 0;
    z-index: 1100 !important;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(17, 20, 28, .36);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    cursor: pointer;
  }

  .bos-dir--messages.bos-messages-app.info-open[data-details="1"] .bos-msg-details-backdrop,
  .bos-dir--messages.bos-messages-app[data-details="1"].info-open .bos-msg-details-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .bos-dir--messages.bos-messages-app[data-details="0"] .bos-msg-details-backdrop,
  .bos-dir--messages.bos-messages-app:not(.info-open) .bos-msg-details-backdrop {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Desktop collapse/reopen chrome off; keep About close + chat header info */
  .bos-dir--messages.bos-messages-app .bos-msg-sidebar .bos-msg-panel-toggle,
  .bos-dir--messages.bos-messages-app .bos-msg-panel-reopen {
    display: none !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-info-head .js_bos-msg-toggle-details,
  .bos-dir--messages.bos-messages-app .bos-msg-info-close {
    display: inline-grid !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-info-close-desktop {
    display: none !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-info-close-mobile {
    display: block;
    width: 16px;
    height: 16px;
  }

  .bos-dir--messages.bos-messages-app[data-details="0"] .bos-msg-chat-head {
    padding-right: 14px !important;
  }

  .bos-dir--messages.bos-messages-app .js_bos-msg-info-toggle {
    display: inline-grid !important;
  }
}

@media (min-width: 981px) {
  .bos-dir--messages.bos-messages-app .bos-msg-details-backdrop {
    display: none !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-info-close-mobile {
    display: none !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-info-close-desktop {
    display: inline-block !important;
  }
}

@media (max-width: 767.98px) {
  body.bos-messages-page {
    /* Match body padding-top from theme header */
    --bos-msg-header-h: 70px;
    height: 100%;
    min-height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  html:has(body.bos-messages-page) {
    height: 100%;
    overflow: hidden;
  }

  body.bos-messages-page #kt_app_content,
  body.bos-messages-page .main-wrapper,
  body.bos-messages-page #kt_app_wrapper,
  body.bos-messages-page #kt_app_content_container {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  .bos-dir--messages.bos-messages-app {
    --bos-msg-gap: 0px;
    --bos-msg-radius: 0px;
    height: calc(100vh - var(--bos-msg-header-h) - env(safe-area-inset-bottom, 0px));
    height: calc(100dvh - var(--bos-msg-header-h) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100vh - var(--bos-msg-header-h) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - var(--bos-msg-header-h) - env(safe-area-inset-bottom, 0px));
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    height: 100% !important;
    max-height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    gap: 0;
    overflow: hidden;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-sidebar,
  .bos-dir--messages.bos-messages-app .bos-msg-stage {
    flex: 1 1 auto;
    width: 100%;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-sidebar {
    display: none;
  }

  .bos-dir--messages.bos-messages-app.active .bos-msg-sidebar {
    display: flex;
    flex-direction: column;
  }

  .bos-dir--messages.bos-messages-app.active .bos-msg-stage {
    display: none !important;
  }

  .bos-dir--messages.bos-messages-app:not(.active) .bos-msg-stage {
    display: flex !important;
    flex-direction: column;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-stage-host,
  .bos-dir--messages.bos-messages-app .bos-msg-stage-inner {
    height: 100% !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-stage-inner {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-back {
    margin: 0 !important;
    padding: 8px 12px 0 !important;
    background: #fff;
    border-bottom: 0;
    z-index: 2;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-panel,
  .bos-dir--messages.bos-messages-app .bos-msg-chat,
  .bos-dir--messages.bos-messages-app .bos-msg-threads {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-chat-head,
  .bos-dir--messages.bos-messages-app .bos-msg-sidebar-head {
    flex: 0 0 auto;
    height: 56px !important;
    min-height: 56px !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-chat-body,
  .bos-dir--messages.bos-messages-app .bos-msg-threads .bos-msg-panel-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .bos-dir--messages.bos-messages-app .chat-conversations,
  .bos-dir--messages.bos-messages-app .chat-conversations.js_scroller,
  .bos-dir--messages.bos-messages-app .bos-msg-thread-scroller {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .bos-dir--messages.bos-messages-app .chat-typing,
  .bos-dir--messages.bos-messages-app .chat-attachments,
  .bos-dir--messages.bos-messages-app .bos-msg-chat-form,
  .bos-dir--messages.bos-messages-app .chat-form.bos-msg-chat-form {
    flex: 0 0 auto !important;
    width: 100%;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-chat-form,
  .bos-dir--messages.bos-messages-app .chat-form.bos-msg-chat-form {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
    border-top: 1px solid var(--bos-msg-border-soft) !important;
    background: #fff !important;
    box-shadow: 0 -8px 24px rgba(20, 25, 35, .04);
  }

  /* Tools (photo/voice/etc) above input so the text field can use full width */
  .bos-dir--messages.bos-messages-app .bos-msg-composer {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    column-gap: 8px;
    row-gap: 6px;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-composer-tools--left {
    order: 1;
    flex: 0 0 100%;
    width: 100%;
    justify-content: flex-start;
    padding: 0 2px !important;
    gap: 4px;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-composer-field {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-composer-tools--send {
    order: 3;
    padding: 0 0 1px !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-composer .x-form-tools > li {
    width: 32px !important;
    height: 32px !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-composer .x-form-tools > li.x-form-tools-post {
    width: 40px !important;
    height: 40px !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-composer .chat-form-message textarea {
    max-height: 96px !important;
  }

  /* Full-screen About sheet on phones — above site header so X is usable */
  .bos-dir--messages.bos-messages-app .bos-msg-info {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    border-radius: 0;
    transform: translate3d(100%, 0, 0) !important;
    visibility: hidden;
    z-index: 1105 !important;
    box-shadow: none;
    background: #fff;
  }

  .bos-dir--messages.bos-messages-app.info-open[data-details="1"] .bos-msg-info,
  .bos-dir--messages.bos-messages-app[data-details="1"].info-open .bos-msg-info {
    transform: translate3d(0, 0, 0) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .bos-dir--messages.bos-messages-app[data-details="0"] .bos-msg-info,
  .bos-dir--messages.bos-messages-app:not(.info-open) .bos-msg-info {
    transform: translate3d(100%, 0, 0) !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-details-backdrop {
    position: fixed !important;
    inset: 0;
    z-index: 1100 !important;
    background: rgba(17, 20, 28, .45);
  }

  .bos-dir--messages.bos-messages-app .bos-msg-info-panel {
    border-radius: 0 !important;
    min-height: 100% !important;
    height: 100% !important;
    background: #fff;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-info-head {
    position: sticky;
    top: 0;
    z-index: 2;
    height: 56px !important;
    padding: 0 12px 0 16px !important;
    border-bottom: 1px solid var(--bos-msg-border-soft, #eceef2) !important;
    background: #fff !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-info-head .bos-msg-info-close,
  .bos-dir--messages.bos-messages-app .bos-msg-info-head .js_bos-msg-toggle-details {
    display: inline-grid !important;
    place-items: center;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    border-radius: 12px !important;
    background: var(--bos-msg-surface, #f3f4f6) !important;
    color: #17191e !important;
    pointer-events: auto !important;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-info-scroll {
    padding: 16px 14px 28px;
    -webkit-overflow-scrolling: touch;
  }

  .bos-dir--messages.bos-messages-app .bos-msg-info-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.bos-messages-page.bos-msg-details-lock,
  body.bos-messages-page:has(.bos-messages-app[data-details="1"]) {
    overflow: hidden;
  }
}
