/* ------------------------------------------------------------------
   Agent Biz chat (/agent/crm/biz-chat.html)
   Desktop : rail | conversations | chat | products
   Tablet  : rail | conversations | chat   (products = drawer)
   Mobile  : conversations <-> chat        (rail = bottom bar)
   ------------------------------------------------------------------ */
:root {
    --bc-primary: var(--x-primary, #5C60F5);
    --bc-primary-soft: rgba(92, 96, 245, .1);
    --bc-danger: #e5484d;
    --bc-bg: #f5f6fa;
    --bc-surface: #ffffff;
    --bc-border: #e7eaf0;
    --bc-text: #16192c;
    --bc-muted: #6b7b93;
    --bc-rail-w: 68px;
    --bc-list-w: 340px;
    --bc-side-w: 340px;
    --bc-bar-h: 60px;
    --bc-safe-b: env(safe-area-inset-bottom, 0px);
}
html, body {
    height: 100%;
}
body.bc-body {
    margin: 0;
    overflow: hidden;
    background: var(--bc-bg);
    color: var(--bc-text);
}
.bc-app {
    display: flex;
    height: 100vh;
    height: 100dvh;
}

/* ---------- Shared bits ---------- */
.bc-icon-btn {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--bc-muted);
    font-size: 1.125rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.bc-icon-btn:hover,
.bc-icon-btn:focus-visible {
    background: var(--bc-primary-soft);
    color: var(--bc-primary);
}
.bc-icon-btn.bc-danger:hover,
.bc-icon-btn.bc-danger:focus-visible {
    background: rgba(229, 72, 77, .1);
    color: var(--bc-danger);
}
.bc-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}
.bc-count {
    margin-left: 6px;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--bc-muted);
}
.bc-search {
    position: relative;
    margin: 0;
}
.bc-search input {
    width: 100%;
    height: 42px;
    padding: 0 44px 0 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: var(--bc-bg);
    color: var(--bc-text);
    font-size: 1rem;
    outline: 0;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.bc-search input:focus {
    border-color: var(--bc-primary);
    background: var(--bc-surface);
    box-shadow: 0 0 0 3px var(--bc-primary-soft);
}
.bc-search .bc-icon-btn {
    position: absolute;
    top: 1px;
    right: 1px;
}
.bc-scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d4d9e3 transparent;
}

/* ---------- Rail (desktop: left bar, mobile: bottom bar) ---------- */
.bc-rail {
    flex: 0 0 var(--bc-rail-w);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 0;
    background: var(--bc-surface);
    border-right: 1px solid var(--bc-border);
}
.bc-rail-logo {
    margin-bottom: 10px;
}
.bc-rail-logo img {
    display: block;
    width: 52px;
    height: auto;
}
.bc-rail-spacer {
    flex: 1;
}
.bc-rail-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--bc-muted);
    font-size: 1.2rem;
    line-height: 1;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
.bc-rail-btn span {
    display: none;
}
.bc-rail-btn:hover,
.bc-rail-btn:focus-visible {
    background: var(--bc-primary-soft);
    color: var(--bc-primary);
}
.bc-rail-btn.active {
    background: var(--bc-primary-soft);
    color: var(--bc-primary);
}

/* ---------- Conversations ---------- */
.bc-list {
    flex: 0 0 var(--bc-list-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bc-surface);
    border-right: 1px solid var(--bc-border);
}
.bc-list-head {
    flex: none;
    padding: 18px 18px 12px;
}
.bc-list-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.bc-list-title .bc-home {
    display: none;
}
.bc-list-title .bc-home img {
    display: block;
    width: auto;
    height: 28px;
}
.bc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.bc-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.bc-chip label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid var(--bc-border);
    border-radius: 999px;
    color: var(--bc-muted);
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s, color .15s, border-color .15s;
}
.bc-chip input:checked + label {
    border-color: transparent;
    background: var(--bc-primary-soft);
    color: var(--bc-primary);
}
.bc-chip input:focus-visible + label {
    box-shadow: 0 0 0 3px var(--bc-primary-soft);
}
.bc-chip-count {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(107, 123, 147, .16);
    font-size: .6875rem;
    line-height: 1.5;
    text-align: center;
}
.bc-chip input:checked + label .bc-chip-count {
    background: var(--bc-primary);
    color: #fff;
}
.bc-chip-count:empty {
    display: none;
}
.bc-rooms {
    flex: 1;
    min-height: 0;
    padding: 4px 8px 12px;
}
.bc-rooms:empty::after {
    content: "No conversations";
    display: block;
    padding: 40px 16px;
    color: var(--bc-muted);
    font-size: .875rem;
    text-align: center;
}
.comroom-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color .15s;
}
.comroom-item:hover,
.comroom-item:focus-visible {
    background: var(--bc-bg);
    outline: 0;
}
.comroom-item.active {
    background: var(--bc-primary-soft);
}
.bc-avatar {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bc-bg);
}
.bc-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bc-avatar.bc-avatar-sm {
    width: 32px;
    height: 32px;
}
.bc-room-body {
    flex: 1;
    min-width: 0;
}
.bc-room-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.bc-room-name {
    flex: 1;
    min-width: 0;
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.comroom-item.active .bc-room-name {
    color: var(--bc-primary);
}
.comroom-item.bc-unread .bc-room-name {
    font-weight: 700;
}
.comroom-item.bc-unread .bc-room-top::after {
    content: "";
    flex: none;
    align-self: center;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bc-primary);
}
.bc-room-time {
    flex: none;
    max-width: 50%;
    color: var(--bc-muted);
    font-size: .75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bc-room-last {
    margin-top: 2px;
    color: var(--bc-muted);
    font-size: .8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bc-room-last * {
    display: inline;
}

/* ---------- Chat ---------- */
.bc-chat {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bc-bg);
}
.bc-chat-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 64px;
    padding: 0 16px 0 20px;
    background: var(--bc-surface);
    border-bottom: 1px solid var(--bc-border);
}
.bc-back {
    display: none;
}
.bc-chat-head .active-room-avatar {
    width: 40px;
    height: 40px;
}
.bc-chat-head .active-room-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bc-chat-head .active-room-rename {
    display: none;
    flex: 1;
    min-width: 0;
    height: 38px;
    margin-left: -9px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--bc-text);
    font-size: 1rem;
    font-weight: 600;
    text-overflow: ellipsis;
    outline: 0;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.bc-chat-head .active-room-rename:hover {
    background: var(--bc-bg);
}
.bc-chat-head .active-room-rename:focus {
    border-color: var(--bc-primary);
    background: var(--bc-surface);
    box-shadow: 0 0 0 3px var(--bc-primary-soft);
}
.bc-chat-head .active-room-rename.bc-saving {
    opacity: .6;
}
body.bc-room-guest .bc-chat-head .active-room-rename {
    display: block;
}
body.bc-room-guest .bc-chat-head .active-room-name {
    display: none;
}
.bc-actions {
    flex: none;
    display: flex;
    align-items: center;
    gap: 2px;
}
.bc-actions-sep {
    width: 1px;
    height: 22px;
    margin: 0 6px;
    background: var(--bc-border);
}
.btn-zoom-call-out.calling {
    color: var(--bc-primary);
    animation: bc-pulse 1.2s ease-in-out infinite;
}
@keyframes bc-pulse {
    50% { opacity: .35; }
}
.bc-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px;
    color: var(--bc-muted);
    text-align: center;
}
.bc-empty i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--bc-primary-soft);
    color: var(--bc-primary);
    font-size: 1.75rem;
}
.bc-empty b {
    color: var(--bc-text);
    font-size: 1.0625rem;
}
body.bc-has-room .bc-empty,
body:not(.bc-has-room) .bc-chat-head,
body:not(.bc-has-room) .bizchat-messages-container,
body:not(.bc-has-room) .bc-composer {
    display: none;
}

/* Messages */
.bizchat-messages-container {
    position: relative;
    flex: 1;
    min-height: 0;
}
.room-messages-container {
    display: none;
}
.room-messages-container.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d4d9e3 transparent;
}
.room-messages-container.active > :first-child {
    margin-top: auto;
}
.msg-item-container {
    flex: none;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: min(78%, 640px);
    margin-top: 14px;
}
.msg-item-container.bc-in {
    align-self: flex-start;
}
.msg-item-container.bc-out {
    align-self: flex-end;
}
.msg-item-container.bc-msg-grouped {
    margin-top: 3px;
}
.bc-msg-avatar {
    margin-top: 20px;
}
.bc-msg-grouped .bc-msg-avatar {
    height: 0;
    margin-top: 0;
    visibility: hidden;
}
.bc-msg-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.bc-out .bc-msg-main {
    align-items: flex-end;
}
.uname-time {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 4px 4px;
    color: var(--bc-muted);
    font-size: .75rem;
    line-height: 1.3;
}
.bc-msg-name {
    color: var(--bc-text);
    font-weight: 600;
}
.bc-msg-grouped .uname-time {
    display: none;
}
.msg-item-content {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
}
.bc-out .msg-item-content {
    flex-direction: row-reverse;
}
.bc-bubble {
    min-width: 0;
    padding: 9px 14px;
    border: 1px solid var(--bc-border);
    border-radius: 18px;
    background: var(--bc-surface);
    color: var(--bc-text);
    font-size: .9375rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
.bc-in .bc-bubble {
    border-top-left-radius: 6px;
}
.bc-out .bc-bubble {
    border-color: transparent;
    border-top-right-radius: 6px;
    background: var(--bc-primary);
    color: #fff;
}
.bc-out .bc-bubble a:not(.btn) {
    color: #fff;
    text-decoration: underline;
}
.bc-msg-grouped.bc-in .bc-bubble {
    border-top-left-radius: 18px;
}
.bc-msg-grouped.bc-out .bc-bubble {
    border-top-right-radius: 18px;
}
/* Rich content (product, media, form, call invite) sits outside the bubble */
.bc-bubble:has(.card, img, video, audio, .msg-sform-container, .pdf-viewer-container, .file-pdf-click-to-view, .file-3d-click-to-view) {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bc-text);
}
.bc-bubble:has(.msg-content > i.bi:only-child) {
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: #f5a524;
    font-size: 2rem;
    line-height: 1.2;
}
.msg-content img,
.msg-content video {
    display: block;
    max-width: 100%;
    max-height: 320px;
    border-radius: 14px;
}
.msg-content audio {
    display: block;
    max-width: 100%;
}
.msg-content .card {
    margin-bottom: 0 !important;
    border: 1px solid var(--bc-border);
    border-radius: 14px;
    color: var(--bc-text);
    overflow: hidden;
}
.card-product {
    max-width: 340px;
}
.card-product img {
    max-width: 100%;
    max-height: 96px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}
.card-product .card-title {
    font-size: .9375rem;
}
.card-product .card-text {
    color: var(--bc-muted);
    font-size: .8125rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
/* Video call invite (markup comes from enet-docs-util.js, shared with the guest pages) */
.msg-content .vcall-invite {
    width: 264px;
    max-width: 100% !important;
    min-width: 0 !important;
    border: 1px solid var(--bc-border) !important;
    border-radius: 16px;
    box-shadow: none !important;
}
.vcall-invite .card-body {
    padding: 14px !important;
}
.vcall-invite .card-body > .d-flex {
    gap: 12px;
    margin-bottom: 12px !important;
}
.vcall-invite .bi-camera-video-fill {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 !important;
    border-radius: 50%;
    background: var(--bc-primary-soft);
    color: var(--bc-primary) !important;
    font-size: 1.125rem !important;
}
.vcall-invite b {
    min-width: 0;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.35;
}
.vcall-invite .btn,
.vcall-invite .btn:hover,
.vcall-invite .btn:focus {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: var(--bc-primary);
    color: #fff;
    font-size: .875rem;
    font-weight: 600;
    box-shadow: none;
}
.vcall-invite .btn:hover {
    filter: brightness(1.08);
}
.vcall-invite .btn i {
    margin: 0 !important;
}
.file-pdf-click-to-view,
.file-3d-click-to-view {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    font-size: 1.25rem;
    cursor: pointer;
}
.file-pdf-click-to-view::after,
.file-3d-click-to-view::after {
    font-size: .8125rem;
}
.file-pdf-click-to-view::after {
    content: "PDF · View";
}
.file-3d-click-to-view::after {
    content: "3D · View";
}
.msg-sform-container {
    min-width: min(320px, 68vw);
    padding: 14px;
    border: 1px solid var(--bc-border);
    border-radius: 14px;
    background: var(--bc-surface);
}
.bc-msg-menu > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--bc-muted);
    opacity: 0;
    transition: opacity .15s, background-color .15s;
}
.msg-item-container:hover .bc-msg-menu > a,
.bc-msg-menu > a:focus-visible,
.bc-msg-menu > a.show {
    opacity: 1;
}
.bc-msg-menu > a:hover {
    background: rgba(107, 123, 147, .14);
}
@media (hover: none) {
    .bc-msg-menu > a {
        opacity: .55;
    }
}
.comment-action-add-into-bank {
    color: #b6bfcc !important;
}
.inbank-0 .comment-action-add-into-bank {
    color: var(--bc-primary) !important;
}

/* Composer */
.bc-composer {
    flex: none;
    padding: 12px 20px calc(12px + var(--bc-safe-b));
    background: var(--bc-surface);
    border-top: 1px solid var(--bc-border);
}
.bc-composer-inner {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--bc-bg);
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.bc-composer-inner:focus-within {
    border-color: var(--bc-primary);
    background: var(--bc-surface);
    box-shadow: 0 0 0 3px var(--bc-primary-soft);
}
.bc-composer-inner .bc-icon-btn {
    border-radius: 50%;
}
#write_msg {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--bc-text);
    font-size: 1rem;
    outline: 0;
    box-shadow: none;
}
.send_btn,
.send_btn:hover,
.send_btn:focus-visible {
    background: var(--bc-primary);
    color: #fff;
}
.send_btn:hover {
    filter: brightness(1.08);
}
/* Speech to text (speech-to-text.js) */
.stt-mic {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--bc-muted);
    font-size: 1.125rem;
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
.stt-mic:hover {
    background: var(--bc-primary-soft);
    color: var(--bc-primary);
}
.stt-mic.is-recording,
.stt-mic.is-recording:hover {
    background: var(--bc-danger);
    color: #fff;
}
.stt-rec {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
}
.stt-rec.is-on {
    display: inline-flex;
}
.stt-rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bc-danger);
    animation: bc-pulse 1.2s ease-in-out infinite;
}
.stt-rec-wave {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 16px;
}
.stt-rec-wave i {
    width: 3px;
    height: 100%;
    border-radius: 2px;
    background: var(--bc-danger);
    transform: scaleY(.3);
    animation: bc-wave 1s ease-in-out infinite;
}
.stt-rec-wave i:nth-child(2) { animation-delay: .15s; }
.stt-rec-wave i:nth-child(3) { animation-delay: .3s; }
.stt-rec-wave i:nth-child(4) { animation-delay: .45s; }
.stt-rec-wave i:nth-child(5) { animation-delay: .6s; }
@keyframes bc-wave {
    50% { transform: scaleY(1); }
}

/* ---------- Products ---------- */
.bc-side {
    flex: 0 0 var(--bc-side-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bc-surface);
    border-left: 1px solid var(--bc-border);
}
.bc-side-head {
    flex: none;
    padding: 18px 18px 12px;
}
.bc-side-title {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
}
.bc-side-title .bc-icon-btn {
    margin: -6px -8px -6px auto;
}
.list-products-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 14px calc(16px + var(--bc-safe-b));
}
.list-products-container:empty::after {
    content: "No products";
    padding: 40px 16px;
    color: var(--bc-muted);
    font-size: .875rem;
    text-align: center;
}
.list-products-container > div {
    flex: none;
}
.list-products-container .card {
    max-width: none;
    margin-bottom: 0 !important;
    border: 1px solid var(--bc-border);
    border-radius: 14px;
    box-shadow: none;
}
.list-products-container .card-body {
    padding-right: 48px !important;
}
.send-product-to-chat {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bc-primary-soft);
    color: var(--bc-primary);
    text-decoration: none;
    transition: background-color .15s, color .15s;
}
.send-product-to-chat:hover,
.send-product-to-chat:focus-visible {
    background: var(--bc-primary);
    color: #fff;
}
.bc-backdrop {
    display: none;
}

/* ---------- Floating panels: my files / members / message bank ---------- */
.dragable-section {
    display: none;
}
.dragable-section.show {
    position: fixed;
    top: 5vh;
    left: max(16px, calc(50vw - 380px));
    z-index: 1045;
    display: flex;
    width: min(760px, calc(100vw - 32px));
    height: min(640px, 90vh);
    min-width: 300px;
    min-height: 240px;
    border-radius: 16px;
    background: var(--bc-surface);
    box-shadow: 0 24px 64px rgba(22, 25, 44, .24), 0 0 0 1px var(--bc-border);
    overflow: hidden;
    resize: both;
}
.members-section.show {
    left: max(16px, calc(50vw - 210px));
    width: min(420px, calc(100vw - 32px));
}
.lmsgbank-section.show {
    left: max(16px, calc(50vw - 550px));
    width: min(1100px, calc(100vw - 32px));
    height: 90vh;
}
.myfiles-container,
.members-container,
.lmsgbank-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}
.myfiles-section-header,
.members-section-header,
.lmsgbank-section-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 54px;
    padding: 0 8px 0 18px;
    border-bottom: 1px solid var(--bc-border);
    cursor: move;
    user-select: none;
}
.myfiles-section-header .title,
.members-section-header .title,
.lmsgbank-section-header .title {
    font-size: 1rem;
    font-weight: 700;
}
.myfiles-section-body,
.members-section-body,
.lmsgbank-section-body {
    position: relative;
    flex: 1;
    min-height: 0;
    padding: 16px 18px;
    overflow-y: auto;
}
.lmsgbank-section-body {
    padding: 0;
    overflow: hidden;
}
.responsive-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.bc-member {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}
.bc-member-name {
    flex: 1;
    min-width: 0;
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.myfile-list .list-group-item {
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid var(--bc-border);
}
.myfile-list .myfile-name {
    min-width: 0;
    font-size: .9375rem;
    overflow-wrap: anywhere;
}
.btn-send-myfile {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bc-primary-soft);
    color: var(--bc-primary);
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.btn-send-myfile:hover {
    background: var(--bc-primary);
    color: #fff;
}
#enet-myfiles-dropzone {
    min-height: 180px;
    padding: 40px 16px;
    border: 2px dashed var(--bc-border);
    border-radius: 14px;
    color: var(--bc-muted);
    text-align: center;
}
.sform-list-result .card {
    border: 1px solid var(--bc-border);
    border-radius: 14px;
    box-shadow: none;
}
.sform-list-result .card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
}
.sform-list-result .sform-name {
    min-width: 0;
    font-size: .875rem;
    overflow-wrap: anywhere;
}
.btn-send-sform {
    flex: none;
    width: 32px;
    height: 32px;
    border: 0;
}

/* ---------- Viewers / loader ---------- */
video {
    max-width: 100%;
    height: auto;
}
.pdf-viewer-container {
    position: relative;
    width: min(520px, 68vw);
    border: 1px solid var(--bc-border);
    border-radius: 12px;
    background: var(--bc-surface);
    overflow: hidden;
}
.pdf-viewer-container .pdf-viewer-preview canvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}
.pdf-viewer-container .current-page-number {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(22, 25, 44, .7);
    color: #fff;
    font-size: .75rem;
}
.pdf-viewer-container .pdf-viewer-controller .btn {
    position: absolute;
    top: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(22, 25, 44, .7);
    color: #fff;
    transform: translateY(-50%);
}
.pdf-viewer-container .pdf-viewer-controller .btn-previous {
    left: 8px;
}
.pdf-viewer-container .pdf-viewer-controller .btn-next {
    right: 8px;
}
.pdf-viewer-container.missing-file .pdf-viewer-preview,
.pdf-viewer-container.missing-file .pdf-viewer-controller {
    display: none;
}
.ajax-sending-loader {
    display: none;
}
.ajax-sending-loader.show {
    display: block;
}
.ajax-sending-loader.show .ajax-sending-loader-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(22, 25, 44, .35);
}
.ajax-sending-loader .ajax-sending-loader-content {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 9999999;
    padding: 20px 28px;
    border-radius: 16px;
    background: var(--bc-surface);
    box-shadow: 0 24px 64px rgba(22, 25, 44, .24);
    text-align: center;
    transform: translate(-50%, -50%);
}
.ajax-sending-loader .ajax-sending-loader-content:empty {
    display: none;
}

/* ---------- Attachments: tray, attach menu, drop zone, file card ---------- */
.bc-composer {
    position: relative;
}
.bc-attach-tray {
    display: flex;
    gap: 8px;
    padding: 2px 2px 10px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.bc-attach-tray:empty {
    display: none;
}
.bc-attach {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 220px;
    padding: 8px 30px 8px 8px;
    border: 1px solid var(--bc-border);
    border-radius: 12px;
    background: var(--bc-surface);
    overflow: hidden;
}
.bc-attach-thumb {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bc-primary-soft);
    color: var(--bc-primary);
    font-size: 1.25rem;
    overflow: hidden;
}
.bc-attach-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.bc-attach-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.bc-attach-name {
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bc-attach-meta {
    color: var(--bc-muted);
    font-size: .75rem;
}
.bc-attach-error {
    border-color: var(--bc-danger);
}
.bc-attach-error .bc-attach-meta {
    color: var(--bc-danger);
}
.bc-attach-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(22, 25, 44, .08);
    color: var(--bc-muted);
    font-size: .875rem;
}
.bc-attach-remove:hover {
    background: var(--bc-danger);
    color: #fff;
}
.bc-attach-bar {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    height: 3px;
    background: var(--bc-primary-soft);
}
.bc-attach-uploading .bc-attach-bar {
    display: block;
}
.bc-attach-bar i {
    display: block;
    width: 0;
    height: 100%;
    background: var(--bc-primary);
    transition: width .2s;
}
.bc-attach-uploading .bc-attach-thumb,
.bc-attach-uploading .bc-attach-info {
    opacity: .55;
}
.bc-attach-menu {
    position: absolute;
    bottom: calc(100% - 4px);
    left: 20px;
    z-index: 20;
    display: none;
    min-width: 220px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 14px;
    background: rgba(246, 246, 248, .78);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    box-shadow: 0 18px 48px rgba(22, 25, 44, .22), 0 0 0 .5px rgba(22, 25, 44, .14);
}
.bc-attach-menu.show {
    display: block;
    animation: bc-menu-in .16s ease;
}
@keyframes bc-menu-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}
.bc-attach-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    color: var(--bc-text);
    font-size: .875rem;
    font-weight: 500;
    text-decoration: none;
}
.bc-attach-menu a i {
    color: var(--bc-primary);
    font-size: 1rem;
}
.bc-attach-menu a:hover,
.bc-attach-menu a:focus-visible {
    background: var(--bc-primary);
    color: #fff;
    outline: 0;
}
.bc-attach-menu a:hover i,
.bc-attach-menu a:focus-visible i {
    color: #fff;
}
.bc-drop {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: none;
    padding: 16px;
    background: rgba(245, 246, 250, .6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    pointer-events: none;
}
.bc-chat.bc-dragging .bc-drop {
    display: block;
}
.bc-drop-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    border: 2px dashed var(--bc-primary);
    border-radius: 20px;
    color: var(--bc-primary);
}
.bc-drop-inner i {
    font-size: 2.5rem;
    line-height: 1;
}
.bc-file {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 260px;
    max-width: 100%;
    padding: 10px 14px 10px 10px;
    border: 1px solid var(--bc-border);
    border-radius: 14px;
    background: var(--bc-surface);
    color: var(--bc-text);
    text-decoration: none;
    transition: border-color .15s;
}
.bc-file:hover {
    border-color: var(--bc-primary);
    color: var(--bc-text);
}
.bc-out .bc-bubble a.bc-file {
    color: var(--bc-text);
    text-decoration: none;
}
.bc-file-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bc-primary-soft);
    color: var(--bc-primary);
    font-size: 1.25rem;
}
.bc-file-name {
    flex: 1;
    min-width: 0;
    font-size: .875rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.bc-file > .bi-download {
    flex: none;
    color: var(--bc-muted);
}
.bc-bubble:has(.bc-file) {
    padding: 0;
    border: 0;
    background: transparent;
}
@media (max-width: 767.98px) {
    .bc-attach-menu {
        left: 10px;
    }
    .bc-attach {
        width: 190px;
    }
}

/* ---------- PDF viewer modal (BC_UI.viewPdf) ---------- */
.bc-viewer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1990;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(22, 25, 44, .3);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: bc-fade-in .18s ease;
    transition: opacity .18s ease;
}
.bc-viewer-backdrop.bc-leave {
    opacity: 0;
}
.bc-viewer {
    display: flex;
    flex-direction: column;
    width: min(1000px, 100%);
    height: 100%;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 18px;
    background: rgba(246, 246, 248, .8);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    box-shadow: 0 24px 64px rgba(22, 25, 44, .3), 0 0 0 .5px rgba(22, 25, 44, .14);
    overflow: hidden;
    animation: bc-dialog-in .28s cubic-bezier(.2, .9, .3, 1.1);
}
.bc-viewer-bar {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding: 0 8px 0 14px;
    border-bottom: 1px solid rgba(22, 25, 44, .1);
}
.bc-viewer-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(160deg, #ff8a80, var(--bc-danger));
    color: #fff;
    font-size: 1rem;
}
.bc-viewer-name {
    flex: 1;
    min-width: 0;
    font-size: .9375rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bc-viewer-pages {
    flex: none;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(22, 25, 44, .08);
    color: rgba(22, 25, 44, .7);
    font-size: .75rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.bc-viewer-pages:empty {
    display: none;
}
.bc-viewer-body {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(22, 25, 44, .06);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.bc-viewer-body canvas {
    flex: none;
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(22, 25, 44, .18);
}
.bc-viewer-body.bc-viewer-native {
    padding: 0;
}
.bc-viewer-body iframe {
    flex: 1;
    width: 100%;
    border: 0;
    background: #fff;
}
.bc-viewer-loading {
    margin: auto;
}
.bc-viewer-loading span {
    display: block;
    width: 34px;
    height: 34px;
    border: 3px solid var(--bc-primary-soft);
    border-top-color: var(--bc-primary);
    border-radius: 50%;
    animation: bc-spin .8s linear infinite;
}
@keyframes bc-spin {
    to { transform: rotate(360deg); }
}
@media (max-width: 767.98px) {
    .bc-viewer-backdrop {
        padding: 0;
    }
    .bc-viewer {
        border: 0;
        border-radius: 0;
    }
    .bc-viewer-bar {
        padding-top: env(safe-area-inset-top, 0px);
        height: calc(54px + env(safe-area-inset-top, 0px));
    }
    .bc-viewer-body {
        gap: 10px;
        padding: 10px;
    }
}

/* ---------- macOS-style notifications & dialogs (BC_UI in agent-chat.js) ---------- */
.bc-noti,
.bc-dialog {
    background: rgba(246, 246, 248, .72);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .7);
    box-shadow: 0 18px 48px rgba(22, 25, 44, .22), 0 0 0 .5px rgba(22, 25, 44, .14);
    color: var(--bc-text);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .bc-noti,
    .bc-dialog {
        background: rgba(248, 248, 250, .97);
    }
}
.bc-noti-stack {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 2100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 28px));
    pointer-events: none;
}
.bc-noti {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    pointer-events: auto;
    animation: bc-noti-in .4s cubic-bezier(.2, .9, .3, 1.15);
    transition: opacity .25s ease, transform .25s ease;
}
.bc-noti.bc-leave {
    opacity: 0;
    transform: translateX(40px);
}
@keyframes bc-noti-in {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
}
.bc-noti-icon,
.bc-dialog-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #8a8df9, var(--bc-primary));
    color: #fff;
    box-shadow: 0 2px 6px rgba(22, 25, 44, .2), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.bc-noti-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 1.125rem;
}
.bc-dialog:has(.bc-dialog-ok.bc-danger) .bc-dialog-icon,
.bc-noti-error .bc-noti-icon {
    background: linear-gradient(160deg, #ff8a80, var(--bc-danger));
}
.bc-noti-success .bc-noti-icon {
    background: linear-gradient(160deg, #5fe0a5, #12a366);
}
.bc-noti-body {
    flex: 1;
    min-width: 0;
}
.bc-noti-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: .8125rem;
    line-height: 1.3;
}
.bc-noti-head span {
    color: rgba(22, 25, 44, .5);
    font-size: .75rem;
}
.bc-noti-text {
    margin-top: 2px;
    font-size: .8125rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.bc-noti-close {
    position: absolute;
    top: -7px;
    left: -7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 50%;
    background: rgba(236, 236, 240, .95);
    box-shadow: 0 1px 4px rgba(22, 25, 44, .2);
    color: rgba(22, 25, 44, .7);
    font-size: .875rem;
    opacity: 0;
    transition: opacity .15s;
}
.bc-noti:hover .bc-noti-close,
.bc-noti-close:focus-visible {
    opacity: 1;
}
@media (hover: none) {
    .bc-noti-close {
        opacity: 1;
    }
}
.bc-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(22, 25, 44, .22);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: bc-fade-in .18s ease;
    transition: opacity .18s ease;
}
.bc-dialog-backdrop.bc-leave {
    opacity: 0;
}
.bc-dialog {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(300px, 100%);
    max-height: 100%;
    padding: 22px 18px 18px;
    border-radius: 20px;
    text-align: center;
    overflow-y: auto;
    animation: bc-dialog-in .28s cubic-bezier(.2, .9, .3, 1.2);
}
.bc-dialog.bc-dialog-prompt {
    width: min(400px, 100%);
}
@keyframes bc-fade-in {
    from { opacity: 0; }
}
@keyframes bc-dialog-in {
    from {
        opacity: 0;
        transform: scale(1.12);
    }
}
.bc-dialog-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    border-radius: 15px;
    font-size: 1.625rem;
}
.bc-dialog-title {
    font-size: .9375rem;
    font-weight: 700;
    line-height: 1.3;
}
.bc-dialog-text {
    margin-top: 6px;
    color: rgba(22, 25, 44, .72);
    font-size: .8125rem;
    line-height: 1.4;
}
.bc-dialog-text:empty {
    display: none;
}
.bc-dialog-input {
    width: 100%;
    min-height: 84px;
    margin-top: 14px;
    padding: 9px 11px;
    border: 1px solid rgba(22, 25, 44, .16);
    border-radius: 10px;
    background: rgba(255, 255, 255, .78);
    color: var(--bc-text);
    font-size: 1rem;
    line-height: 1.4;
    text-align: left;
    outline: 0;
    resize: vertical;
}
.bc-dialog-input:focus {
    border-color: var(--bc-primary);
    box-shadow: 0 0 0 3px rgba(92, 96, 245, .25);
}
.bc-dialog-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-top: 18px;
}
.bc-dialog-btn {
    flex: 1;
    min-width: 0;
    height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    background: rgba(22, 25, 44, .09);
    color: var(--bc-text);
    font-size: .875rem;
    font-weight: 600;
    transition: filter .15s, background-color .15s;
}
.bc-dialog-btn:hover {
    background: rgba(22, 25, 44, .14);
}
.bc-dialog-btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(92, 96, 245, .35);
}
.bc-dialog-ok,
.bc-dialog-ok:hover {
    background: var(--bc-primary);
    color: #fff;
}
.bc-dialog-ok.bc-danger,
.bc-dialog-ok.bc-danger:hover {
    background: var(--bc-danger);
}
.bc-dialog-ok:hover {
    filter: brightness(1.08);
}
@media (max-width: 767.98px) {
    .bc-noti-stack {
        top: calc(10px + env(safe-area-inset-top, 0px));
        right: 10px;
        left: 10px;
        width: auto;
    }
    .bc-noti {
        animation-name: bc-noti-in-top;
    }
    .bc-noti.bc-leave {
        transform: translateY(-30px);
    }
    .bc-dialog-btn {
        height: 42px;
    }
}
@keyframes bc-noti-in-top {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
}
@media (prefers-reduced-motion: reduce) {
    .bc-noti,
    .bc-dialog,
    .bc-dialog-backdrop {
        animation: none;
        transition: none;
    }
}

/* ---------- < 1200px: products become a drawer ---------- */
@media (min-width: 1200px) {
    .toggle-products {
        display: none;
    }
}
@media (max-width: 1199.98px) {
    :root {
        --bc-list-w: 300px;
    }
    .bc-side {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1041;
        width: min(380px, 100vw);
        border-left: 0;
        box-shadow: -16px 0 48px rgba(22, 25, 44, .18);
        transform: translateX(100%);
        visibility: hidden;
        transition: transform .25s ease, visibility .25s;
    }
    body.bc-products-open .bc-side {
        transform: none;
        visibility: visible;
    }
    .bc-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1040;
        display: block;
        background: rgba(22, 25, 44, .4);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s;
    }
    body.bc-products-open .bc-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

/* ---------- < 768px: one pane at a time ---------- */
@media (max-width: 767.98px) {
    .bc-rail {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 10;
        flex-direction: row;
        justify-content: space-around;
        gap: 0;
        height: calc(var(--bc-bar-h) + var(--bc-safe-b));
        padding: 0 4px var(--bc-safe-b);
        border-top: 1px solid var(--bc-border);
        border-right: 0;
    }
    .bc-rail-logo,
    .bc-rail-spacer {
        display: none;
    }
    .bc-rail-btn {
        flex: 1;
        gap: 4px;
        width: auto;
        max-width: 84px;
        height: 100%;
        border-radius: 0;
        font-size: 1.25rem;
    }
    .bc-rail-btn span {
        display: block;
        font-size: .625rem;
        font-weight: 600;
        white-space: nowrap;
    }
    .bc-rail-btn:hover,
    .bc-rail-btn:focus-visible,
    .bc-rail-btn.active {
        background: transparent;
    }
    .bc-list {
        flex: 1 1 auto;
        border-right: 0;
        padding-bottom: calc(var(--bc-bar-h) + var(--bc-safe-b));
    }
    .bc-list-head {
        padding: 14px 14px 10px;
    }
    .bc-list-title .bc-home {
        display: block;
    }
    .bc-rooms {
        padding: 4px 6px 12px;
    }
    .comroom-item {
        padding: 12px 8px;
    }
    .bc-chat {
        display: none;
    }
    body.bc-room-open .bc-list,
    body.bc-room-open .bc-rail {
        display: none;
    }
    body.bc-room-open .bc-chat {
        display: flex;
    }
    .bc-back {
        display: inline-flex;
    }
    .bc-chat-head {
        gap: 8px;
        height: 58px;
        padding: 0 6px;
    }
    .bc-chat-head .active-room-avatar {
        width: 36px;
        height: 36px;
    }
    .bc-actions-sep {
        display: none;
    }
    .bc-actions .bc-icon-btn {
        width: 36px;
    }
    .room-messages-container.active {
        padding: 14px 12px;
    }
    .msg-item-container {
        max-width: 90%;
    }
    .bc-composer {
        padding: 8px 10px calc(8px + var(--bc-safe-b));
    }
    .bc-side {
        width: 100vw;
    }
    .dragable-section.show {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0;
        box-shadow: none;
        resize: none;
    }
    .myfiles-section-header,
    .members-section-header,
    .lmsgbank-section-header {
        cursor: default;
    }
}
@media (prefers-reduced-motion: reduce) {
    .bc-side,
    .bc-backdrop {
        transition: none;
    }
    .btn-zoom-call-out.calling,
    .stt-rec-dot,
    .stt-rec-wave i {
        animation: none;
    }
}
