.bd-chatroom {
    --bm-bg: #dfe6ee;
    --bm-bg-chat: #e6ebf0;
    --bm-surface: rgba(255, 255, 255, 0.94);
    --bm-surface-soft: rgba(248, 251, 255, 0.88);
    --bm-border: rgba(180, 198, 220, 0.55);
    --bm-text: #0f2038;
    --bm-text-soft: #5a7397;
    --bm-text-muted: #6480a4;
    --bm-primary: #3390ec;
    --bm-primary-soft: rgba(51, 144, 236, 0.14);
    --bm-bubble-in: #ffffff;
    --bm-bubble-out: #effdde;
    --bm-bubble-out-border: rgba(120, 180, 100, 0.35);
    --bm-bubble-in-border: rgba(163, 188, 224, 0.32);
    --bm-shadow: 0 8px 22px rgba(18, 42, 80, 0.08);
    --bm-shadow-out: 0 4px 14px rgba(60, 120, 60, 0.1);
    --bm-accent-read: #4fae4e;
    --bm-typing: #3390ec;
    --bm-transition: 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    direction: rtl;
    width: min(1320px, 100%);
    margin: 0 auto;
    padding: 20px 12px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
    color: var(--bm-text);
    font-family: inherit;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    background: var(--bm-bg);
    transition: background-color var(--bm-transition), color var(--bm-transition);
}

.bd-chatroom,
.bd-chatroom * {
    box-sizing: border-box;
}

.bd-chatroom-header,
.bd-chatroom-sidebar,
.bd-chatroom-thread-item,
.bd-chatroom-message,
.bd-chatroom-file-item,
.bd-chatroom-reply,
.bd-chatroom-empty,
.bd-chatroom-empty-mini {
    backdrop-filter: saturate(165%) blur(18px);
    -webkit-backdrop-filter: saturate(165%) blur(18px);
}

.bd-chatroom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    background: var(--bm-surface);
    border: 1px solid var(--bm-border);
    border-radius: 24px;
    padding: 18px 20px;
    box-shadow: var(--bm-shadow);
    transition: background-color var(--bm-transition), border-color var(--bm-transition);
}

.bd-chatroom-header-main {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 420px;
    min-width: 0;
}

.bd-chatroom-brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #3c6fbe, #5b7cf0);
    box-shadow: 0 16px 30px rgba(60, 111, 190, 0.25);
}

.bd-chatroom-header-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.bd-chatroom-kicker {
    color: var(--bm-text-soft);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.bd-chatroom-header h2 {
    margin: 0;
    color: var(--bm-text);
    font-size: clamp(1.18rem, 2vw, 1.68rem);
}

.bd-chatroom-header p {
    margin: 0;
    color: var(--bm-text-soft);
    font-size: 0.84rem;
    line-height: 1.9;
}

.bd-chatroom-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.bd-chatroom-header-badge {
    display: grid;
    gap: 4px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid var(--bm-border);
    background: var(--bm-surface-soft);
    color: var(--bm-text-soft);
    min-width: 148px;
}

.bd-chatroom-header-badge span {
    font-size: 0.72rem;
}

.bd-chatroom-header-badge strong {
    font-size: 0.88rem;
    color: var(--bm-text);
}

.bd-chatroom-layout {
    display: grid;
    grid-template-columns: minmax(270px, 350px) minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    height: 100%;
    align-items: stretch;
    overflow: hidden;
}

.bd-chatroom-sidebar,
.bd-chatroom-main {
    border-radius: 20px;
    border: 1px solid var(--bm-border);
    background: var(--bm-surface);
    box-shadow: var(--bm-shadow);
    transition: background-color var(--bm-transition), border-color var(--bm-transition);
}

.bd-chatroom-sidebar {
    padding: 14px;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

.bd-chatroom-sidebar-head {
    display: grid;
    gap: 4px;
    padding: 4px 2px 0;
}

.bd-chatroom-sidebar-head strong {
    color: #173d6d;
    font-size: 0.96rem;
}

.bd-chatroom-sidebar-head span {
    color: #6480a4;
    font-size: 0.74rem;
    line-height: 1.8;
}

.bd-chatroom-filter-row {
    display: flex;
    gap: 8px;
}

.bd-chatroom-pill {
    border: 1px solid rgba(151, 176, 212, 0.48);
    background: rgba(255, 255, 255, 0.68);
    color: #355984;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bd-chatroom-pill:hover {
    border-color: rgba(83, 124, 185, 0.55);
}

.bd-chatroom-pill.is-active {
    border-color: rgba(31, 86, 164, 0.58);
    background: rgba(224, 238, 255, 0.86);
    color: #1e4e91;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.bd-chatroom-search-wrap input,
.bd-chatroom-topbar-actions input {
    width: 100%;
    border: 1px solid rgba(161, 185, 222, 0.42);
    background: rgba(255, 255, 255, 0.74);
    border-radius: 13px;
    padding: 9px 11px;
    font-family: inherit;
    font-size: 0.8rem;
    color: #143760;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bd-chatroom-search-wrap input:focus,
.bd-chatroom-topbar-actions input:focus {
    outline: none;
    border-color: rgba(63, 112, 183, 0.6);
    box-shadow: 0 0 0 3px rgba(56, 103, 172, 0.14);
}

.bd-chatroom-thread-list {
    overflow: auto;
    padding-inline: 2px 4px;
    display: grid;
    gap: 8px;
    min-height: 0;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.bd-chatroom-thread-item {
    border: 1px solid var(--bm-border);
    background: var(--bm-surface-soft);
    border-radius: 18px;
    padding: 10px;
    text-align: right;
    cursor: pointer;
    display: grid;
    gap: 6px;
    transition: all var(--bm-transition);
}

.bd-chatroom-thread-item:hover {
    border-color: var(--bm-primary);
    box-shadow: var(--bm-shadow);
}

.bd-chatroom-thread-item.is-active {
    border-color: var(--bm-primary);
    background: var(--bm-primary-soft);
    box-shadow: var(--bm-shadow);
    transform: translateY(-1px);
}

.bd-chatroom-thread-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bd-chatroom-thread-top strong {
    color: #183e6c;
    font-size: 0.86rem;
}

.bd-chatroom-unread {
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(53, 109, 193, 0.95), rgba(43, 90, 167, 0.95));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.71rem;
    font-weight: 800;
    padding: 0 5px;
    box-shadow: 0 8px 16px rgba(30, 73, 139, 0.28);
}

.bd-chatroom-thread-info {
    color: #4e698d;
    font-size: 0.75rem;
    line-height: 1.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bd-chatroom-thread-course {
    color: #2f5f98;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(230, 242, 255, 0.72);
    border: 1px solid rgba(152, 184, 226, 0.42);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 2px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bd-chatroom-thread-meta {
    color: #6b7f9f;
    font-size: 0.7rem;
}

.bd-chatroom-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.bd-chatroom-dashboard-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(188, 207, 235, 0.32);
    background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(246,251,255,0.54));
}

.bd-chatroom-dashboard-card {
    border-radius: 18px;
    border: 1px solid rgba(180, 200, 230, 0.42);
    background: rgba(255,255,255,0.92);
    padding: 14px;
    display: grid;
    gap: 6px;
    min-height: 98px;
    align-content: start;
}

.bd-chatroom-dashboard-card span {
    color: #607799;
    font-size: 0.72rem;
}

.bd-chatroom-dashboard-card strong {
    color: #173d6d;
    font-size: 0.92rem;
}


.bd-chatroom-composer-meta {
    display: none;
    color: #5b7498;
    font-size: 0.72rem;
    line-height: 1.7;
}

.bd-chatroom-composer-meta.is-visible {
    display: block;
}

.bd-chatroom-topbar {
    border-bottom: 1px solid rgba(188, 207, 235, 0.32);
    padding: 12px 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 1.15fr);
    align-items: start;
    gap: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(246, 251, 255, 0.58));
}

.bd-chatroom-topbar strong {
    display: block;
    color: #183c68;
    font-size: 1rem;
}

.bd-chatroom-topbar [data-thread-presence] {
    font-size: 0.75rem;
    color: #5f7698;
}

.bd-chatroom-topbar-actions {
    display: grid;
    gap: 6px;
    justify-items: stretch;
}

.bd-chatroom-thread-identity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bd-chatroom-thread-avatar {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(60, 111, 190, 0.14), rgba(91, 124, 240, 0.18));
    color: #214e8b;
    font-size: 0.98rem;
    font-weight: 800;
    border: 1px solid rgba(182, 204, 237, 0.72);
    position: relative;
}

.bd-chatroom-thread-avatar.is-online::after {
    content: '';
    position: absolute;
    bottom: -2px;
    inset-inline-end: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22b878;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(20, 130, 80, 0.35);
}

.bd-chatroom-thread-summary {
    display: grid;
    gap: 4px;
}

.bd-chatroom-search-inline {
    display: block;
}

.bd-chatroom-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bd-chatroom-action-group-primary {
    justify-content: flex-start;
}

.bd-chatroom-action-group-secondary {
    justify-content: flex-start;
}

.bd-chatroom-pinned,
.bd-chatroom-typing {
    display: none;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(193, 210, 235, 0.32);
}

.bd-chatroom-pinned.is-visible {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
}

.bd-chatroom-pinned-item {
    flex: 0 0 auto;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(248, 252, 255, 0.76));
    border: 1px solid rgba(173, 194, 226, 0.38);
    color: #426086;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 0.73rem;
    white-space: nowrap;
    cursor: pointer;
}

.bd-chatroom-typing {
    font-size: 0.72rem;
    color: #51719b;
    min-height: 0;
    line-height: 1.8;
}

.bd-chatroom-typing.is-visible {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    color: var(--bm-typing);
    animation: bdChatroomTypingFade 0.22s ease;
}

.bd-chatroom-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.bd-chatroom-typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--bm-typing);
    animation: bmTypingDot 1.2s ease-in-out infinite;
}

.bd-chatroom-typing-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.bd-chatroom-typing-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes bmTypingDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-4px); opacity: 1; }
}

@keyframes bdChatroomTypingFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.bd-chatroom-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 14px;
    display: grid;
    gap: 6px;
    align-content: start;
    background: var(--bm-bg-chat);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.bd-chatroom-message {
    max-width: min(78%, 560px);
    border: 1px solid var(--bm-bubble-in-border);
    border-radius: 16px 16px 16px 4px;
    background: var(--bm-bubble-in);
    padding: 9px 12px 7px;
    display: grid;
    gap: 5px;
    justify-self: start;
    box-shadow: var(--bm-shadow);
    position: relative;
    transition: box-shadow var(--bm-transition), transform var(--bm-transition), background-color var(--bm-transition);
    animation: bmMessageIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.bd-chatroom-message::after {
    content: '';
    position: absolute;
    bottom: 0;
    inset-inline-start: -5px;
    width: 10px;
    height: 10px;
    background: var(--bm-bubble-in);
    border-inline-start: 1px solid var(--bm-bubble-in-border);
    border-bottom: 1px solid var(--bm-bubble-in-border);
    border-end-start-radius: 10px;
    clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

@keyframes bmMessageIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.bd-chatroom-message.is-actions-open {
    z-index: 40;
}

.bd-chatroom-message.is-me {
    justify-self: end;
    background: var(--bm-bubble-out);
    border-color: var(--bm-bubble-out-border);
    border-radius: 16px 16px 4px 16px;
    box-shadow: var(--bm-shadow-out);
}

.bd-chatroom-message.is-me::after {
    inset-inline-start: auto;
    inset-inline-end: -5px;
    background: var(--bm-bubble-out);
    border-inline-start: none;
    border-inline-end: 1px solid var(--bm-bubble-out-border);
    border-bottom: 1px solid var(--bm-bubble-out-border);
    border-end-start-radius: 0;
    border-end-end-radius: 10px;
    clip-path: polygon(0 0, 0 100%, 100% 100%);
}

.bd-chatroom-message.is-me .bd-chatroom-message-head {
    display: none;
}

.bd-chatroom-message.is-pending {
    opacity: 0.82;
}

.bd-chatroom-message.is-failed {
    border-color: rgba(189, 93, 93, 0.5);
    box-shadow: 0 10px 22px rgba(173, 83, 83, 0.12);
}

.bd-chatroom-message.is-flash {
    animation: bdChatroomFlash 0.75s ease;
}

@keyframes bdChatroomFlash {
    0% { box-shadow: 0 0 0 0 rgba(57, 106, 175, 0.45); }
    100% { box-shadow: 0 0 0 12px rgba(57, 106, 175, 0); }
}

.bd-chatroom-message-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.71rem;
    color: var(--bm-text-soft);
}

.bd-chatroom-message-head strong {
    color: var(--bm-text);
    font-weight: 700;
}

.bd-chatroom-message-body {
    display: grid;
    gap: 6px;
}

.bd-chatroom-message-reply {
    appearance: none;
    width: 100%;
    border: 1px solid rgba(166, 191, 226, 0.42);
    border-inline-start: 3px solid rgba(76, 121, 188, 0.62);
    background: rgba(241, 247, 255, 0.82);
    border-radius: 10px;
    padding: 5px 8px;
    font-size: 0.74rem;
    color: #3e628f;
    text-align: right;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.bd-chatroom-message-reply:hover {
    transform: translateY(-1px);
    border-color: rgba(89, 133, 194, 0.58);
    box-shadow: 0 8px 16px rgba(32, 73, 132, 0.1);
}

.bd-chatroom-message-quote {
    margin: 0;
    border-inline-start: 3px solid rgba(117, 148, 195, 0.62);
    background: rgba(242, 248, 255, 0.8);
    border-radius: 10px;
    padding: 5px 8px;
    font-size: 0.74rem;
    color: #3f5f85;
}

.bd-chatroom-forwarded {
    font-size: 0.72rem;
    color: #4d6d98;
}

.bd-chatroom-message-content {
    color: #1f3e65;
    font-size: 0.78rem;
    line-height: 1.85;
    word-break: break-word;
    display: grid;
    gap: 6px;
}

.bd-chatroom-image {
    width: min(360px, 100%);
    max-height: 360px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid rgba(166, 190, 224, 0.42);
    display: block;
    background: rgba(255, 255, 255, 0.72);
}

.bd-chatroom-attachment {
    color: #245a9c;
    font-size: 0.77rem;
    text-decoration: none;
    width: fit-content;
    font-weight: 700;
}

.bd-chatroom-attachment:hover {
    text-decoration: underline;
}

.bd-chatroom-message-content audio {
    width: min(380px, 100%);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    outline: none;
    box-shadow: 0 4px 14px rgba(20, 50, 100, 0.1);
}

.bd-chatroom-message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
    margin-top: 2px;
}

.bd-chatroom-message-time {
    font-size: 0.66rem;
    color: var(--bm-text-muted);
    white-space: nowrap;
    line-height: 1;
}

.bd-chatroom-receipt {
    color: var(--bm-text-muted);
    font-size: 0.72rem;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
    transition: color var(--bm-transition);
}

.bd-chatroom-message.is-me .bd-chatroom-receipt {
    color: var(--bm-text-muted);
}

.bd-chatroom-receipt.is-sent {
    color: var(--bm-text-muted);
}

.bd-chatroom-receipt.is-delivered {
    color: #6a8ab0;
}

.bd-chatroom-receipt.is-pending {
    color: var(--bm-text-soft);
    animation: bmReceiptPulse 1.2s ease-in-out infinite;
}

.bd-chatroom-receipt.is-failed {
    color: #b54747;
}

@keyframes bmReceiptPulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}

.bd-chatroom-message-actions-wrap {
    position: relative;
}

.bd-chatroom-message-actions-trigger {
    border: 1px solid rgba(156, 183, 220, 0.48);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(246, 251, 255, 0.64));
    color: #315580;
    border-radius: 11px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bd-chatroom-message-actions-trigger:hover {
    border-color: rgba(74, 119, 184, 0.6);
    color: #235493;
}

.bd-chatroom-message-actions-trigger svg {
    width: 16px;
    height: 16px;
    display: block;
}

.bd-chatroom-message-actions {
    position: absolute;
    bottom: calc(100% + 6px);
    top: auto;
    inset-inline-end: 0;
    min-width: 140px;
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(167, 191, 224, 0.42);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(246, 251, 255, 0.74));
    box-shadow: 0 14px 26px rgba(19, 45, 83, 0.16);
    backdrop-filter: saturate(165%) blur(18px);
    -webkit-backdrop-filter: saturate(165%) blur(18px);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    z-index: 6;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.bd-chatroom-message-actions-wrap.is-open .bd-chatroom-message-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.bd-chatroom-analysis-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 32, 56, 0.42);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
}

.bd-chatroom-analysis-overlay[hidden] {
    display: none !important;
}

.bd-chatroom-analysis-modal {
    width: min(860px, 100%);
    max-height: min(78vh, 720px);
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(242, 248, 255, 0.94));
    color: #173d6d;
    border: 1px solid rgba(180, 198, 220, 0.55);
    box-shadow: 0 26px 70px rgba(18, 42, 80, 0.18);
}

.bd-chatroom-analysis-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(180, 198, 220, 0.42);
    background: rgba(255, 255, 255, 0.72);
}

.bd-chatroom-analysis-title {
    font-size: 14px;
    font-weight: 700;
    color: #173d6d;
}

.bd-chatroom-analysis-close {
    appearance: none;
    border: 1px solid rgba(161, 186, 222, 0.5);
    background: rgba(255, 255, 255, 0.88);
    color: #285280;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
}

.bd-chatroom-analysis-close:hover {
    background: rgba(234, 244, 255, 0.94);
    border-color: rgba(56, 114, 190, 0.62);
}

.bd-chatroom-analysis-body {
    margin: 0;
    padding: 14px 16px 16px;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
    max-height: calc(min(78vh, 720px) - 58px);
    line-height: 1.8;
    font-size: 13px;
    color: #2f4f78;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (max-width: 1024px) {
    .bd-chatroom-message-actions {
        position: fixed;
        inset-inline: 12px;
        bottom: 12px;
        top: auto;
        transform: translateY(12px);
        max-width: none;
        min-width: 0;
    }

    .bd-chatroom-message-actions-wrap.is-open .bd-chatroom-message-actions {
        transform: translateY(0);
    }
}

.bd-chatroom-action-btn,
.bd-chatroom-btn {
    border: 1px solid rgba(148, 178, 220, 0.5);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(242, 249, 255, 0.72));
    color: #285280;
    border-radius: 11px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 10px;
    min-height: 34px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.01em;
}

.bd-chatroom-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: block;
}

.bd-chatroom-action-btn {
    width: 100%;
    text-align: right;
}

.bd-chatroom-action-btn:hover,
.bd-chatroom-btn:hover {
    border-color: rgba(56, 114, 190, 0.62);
    background: rgba(234, 244, 255, 0.94);
    color: #1a4a88;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(30, 70, 148, 0.1);
}

.bd-chatroom-btn-cancel {
    width: 30px;
    min-width: 30px;
    height: 30px;
    padding: 0;
    color: #9f3c3c;
    border-color: rgba(186, 112, 112, 0.52);
    background: linear-gradient(145deg, rgba(255, 244, 244, 0.92), rgba(254, 236, 236, 0.82));
}

.bd-chatroom-btn-cancel:hover {
    color: #8b2d2d;
    border-color: rgba(173, 80, 80, 0.64);
}

.bd-chatroom-btn-cancel svg {
    width: 14px;
    height: 14px;
    display: block;
}

.bd-chatroom-btn.is-primary {
    background: linear-gradient(135deg, rgba(55, 118, 210, 0.95), rgba(38, 90, 172, 0.96));
    border-color: rgba(42, 90, 158, 0.72);
    color: #fff;
    box-shadow: 0 10px 22px rgba(28, 72, 148, 0.28);
}

.bd-chatroom-btn.is-primary:hover {
    filter: brightness(1.06);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(28, 72, 148, 0.36);
    color: #fff;
}

.bd-chatroom-btn.is-loading {
    opacity: 0.75;
    pointer-events: none;
    position: relative;
}

.bd-chatroom-btn.is-loading::after {
    content: '';
    position: absolute;
    inset: 50% 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bdChatroomSpin 0.7s linear infinite;
}

@keyframes bdChatroomSpin {
    to { transform: rotate(360deg); }
}

.bd-chatroom-upload-label,
[data-chatroom-voice] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(161, 186, 222, 0.5);
    border-radius: 11px;
    min-width: 36px;
    height: 36px;
    cursor: pointer;
    color: #3e6492;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(244, 250, 255, 0.76));
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 2px 8px rgba(30, 60, 120, 0.08);
}

.bd-chatroom-upload-label:hover,
[data-chatroom-voice]:hover:not(.is-recording) {
    background: rgba(238, 246, 255, 0.96);
    border-color: rgba(100, 150, 220, 0.55);
    transform: scale(1.06);
}

.bd-chatroom-upload-label svg,
[data-chatroom-voice] svg {
    width: 15px;
    height: 15px;
    display: block;
}

.bd-chatroom-upload-label.is-attached {
    border-color: rgba(44, 120, 82, 0.52);
    color: #236046;
    background: linear-gradient(145deg, rgba(232, 252, 240, 0.9), rgba(224, 248, 234, 0.78));
    box-shadow: 0 2px 8px rgba(24, 110, 64, 0.1);
}

[data-chatroom-voice].is-recording {
    border-color: rgba(196, 56, 56, 0.56);
    color: #9a2f2f;
    background: linear-gradient(145deg, rgba(255, 236, 236, 0.94), rgba(255, 224, 224, 0.82));
    box-shadow: 0 0 0 3px rgba(220, 68, 68, 0.12);
    animation: bdVoiceRecordPulse 1s ease-in-out infinite;
}

@keyframes bdVoiceRecordPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(220, 68, 68, 0.12); }
    50% { box-shadow: 0 0 0 5px rgba(220, 68, 68, 0.2); }
}

.bd-chatroom-files {
    flex: 0 0 auto;
    border-top: 1px solid rgba(185, 206, 234, 0.32);
    padding: 8px 12px;
    display: none;
    gap: 8px;
    max-height: 184px;
    overflow: auto;
}

.bd-chatroom-files.is-open {
    display: grid;
}

.bd-chatroom-file-item {
    border: 1px solid rgba(166, 190, 224, 0.34);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.84), rgba(246, 251, 255, 0.68));
    border-radius: 12px;
    padding: 8px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.bd-chatroom-file-item a {
    color: #245c9f;
    text-decoration: none;
    font-size: 0.77rem;
    font-weight: 700;
}

.bd-chatroom-file-item a:hover {
    text-decoration: underline;
}

.bd-chatroom-file-item span {
    color: #5f789d;
    font-size: 0.71rem;
}

.bd-chatroom-composer {
    flex: 0 0 auto;
    position: relative;
    margin-top: auto;
    border-top: 1px solid var(--bm-border);
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    display: grid;
    gap: 8px;
    background: var(--bm-surface);
    box-shadow: 0 -8px 24px rgba(18, 42, 80, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color var(--bm-transition), border-color var(--bm-transition);
}

.bd-chatroom-reply {
    border: 1px solid rgba(161, 187, 222, 0.44);
    background: linear-gradient(145deg, rgba(241, 248, 255, 0.82), rgba(233, 243, 255, 0.7));
    border-radius: 12px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bd-chatroom-reply-preview {
    color: #3c618e;
    font-size: 0.74rem;
    line-height: 1.7;
}

.bd-chatroom-reply-close {
    border: none;
    background: transparent;
    color: #8d3a3a;
    font-size: 0.73rem;
    font-weight: 700;
    cursor: pointer;
}

.bd-chatroom-compose-row {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 5px 6px 5px 10px;
    border-radius: 22px;
    border: 1px solid var(--bm-border);
    background: #ffffff;
    box-shadow: inset 0 1px 2px rgba(18, 42, 80, 0.04);
    transition: border-color var(--bm-transition), box-shadow var(--bm-transition);
}

.bd-chatroom-compose-row:focus-within {
    border-color: var(--bm-primary);
    box-shadow: 0 0 0 3px var(--bm-primary-soft);
}

.bd-chatroom-compose-row textarea {
    resize: none;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 38px;
    max-height: 150px;
    line-height: 1.75;
    border: none;
    background: transparent;
    padding: 8px 4px;
    outline: none;
    box-shadow: none;
    writing-mode: horizontal-tb;
    word-break: normal;
    overflow-wrap: break-word;
    unicode-bidi: plaintext;
}

.bd-chatroom-compose-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    flex-shrink: 0;
}

.bd-chatroom-compose-actions .bd-chatroom-btn {
    min-width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bd-chatroom-compose-actions .bd-chatroom-btn.is-primary {
    min-width: 42px;
    height: 42px;
    border-radius: 50%;
}

.bd-chatroom-upload-label {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--bm-text-soft);
    transition: color var(--bm-transition), background-color var(--bm-transition);
}

.bd-chatroom-upload-label:hover {
    color: var(--bm-primary);
    background: var(--bm-primary-soft);
}

.bd-chatroom-status {
    display: none;
    min-height: 18px;
    font-size: 0.73rem;
    color: #2f629a;
}

.bd-chatroom-status.is-visible {
    display: block;
}

.bd-chatroom-status.is-error {
    color: #ad3a3a;
}

.bd-chatroom-status.is-success {
    color: #2b7f56;
}

.bd-chatroom-empty,
.bd-chatroom-empty-mini {
    border: 1px solid rgba(160, 186, 222, 0.38);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(246, 251, 255, 0.68));
    color: #59739a;
    border-radius: 13px;
    padding: 10px;
    text-align: center;
    font-size: 0.76rem;
}

.bd-chatroom-composer.is-dragover,
.bd-chatroom-composer[data-chatroom-dropzone].is-dragover {
    border: 1px dashed rgba(70, 116, 181, 0.72);
    background: linear-gradient(150deg, rgba(233, 244, 255, 0.88), rgba(222, 238, 255, 0.72));
}

@media (max-width: 1120px) {
    .bd-chatroom-layout {
        grid-template-columns: minmax(240px, 310px) minmax(0, 1fr);
    }

    .bd-chatroom-topbar {
        grid-template-columns: 1fr;
    }

    .bd-chatroom-message {
        max-width: 92%;
    }
}

@media (max-width: 1024px) {
    .bd-chatroom-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
        min-height: 0;
        height: 100%;
    }

    .bd-chatroom-header {
        padding: 16px 18px;
        gap: 14px;
    }

    .bd-chatroom-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .bd-chatroom-sidebar {
        max-height: min(34vh, 290px);
        min-height: 0;
        padding: 12px;
    }

    .bd-chatroom-main {
        min-height: 0;
        height: 100%;
        overflow: hidden;
        position: relative;
    }

    .bd-chatroom-dashboard-strip,
    .bd-chatroom-guidance {
        padding: 10px;
        gap: 8px;
    }

    .bd-chatroom-dashboard-card,
    .bd-chatroom-guidance-card,
    .bd-chatroom-policy-note {
        border-radius: 14px;
        padding: 12px;
    }

    .bd-chatroom-topbar {
        padding: 12px;
        border-bottom-color: rgba(188, 207, 235, 0.24);
    }

    .bd-chatroom-thread-avatar {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 0.92rem;
    }

    .bd-chatroom-thread-summary strong {
        font-size: 0.92rem;
    }

    .bd-chatroom-score-strip,
    .bd-chatroom-thread-scores {
        gap: 6px;
    }

    .bd-chatroom-score-chip {
        padding: 4px 8px;
        font-size: 0.66rem;
    }

    .bd-chatroom-messages {
        padding: 12px;
        gap: 8px;
    }

    .bd-chatroom-message {
        max-width: 96%;
        border-radius: 16px;
    }

    .bd-chatroom-composer {
        position: relative;
        left: auto;
        right: auto;
        width: auto;
        max-width: none;
        margin-inline: 0;
        bottom: auto;
        z-index: auto;
        transform: none;
        will-change: auto;
    }

    .bd-chatroom.is-mobile-floating-composer-active .bd-chatroom-composer {
        position: fixed;
        left: 8px;
        right: 8px;
        width: auto;
        max-width: min(1320px, calc(100vw - 16px));
        margin-inline: auto;
        bottom: calc(max(8px, env(safe-area-inset-bottom)) + var(--bd-vp-offset, 0px));
        z-index: 9999;
        border: 1px solid rgba(169, 192, 223, 0.5);
        border-radius: 16px;
        box-shadow: 0 18px 34px rgba(20, 43, 79, 0.2);
        backdrop-filter: saturate(165%) blur(16px);
        -webkit-backdrop-filter: saturate(165%) blur(16px);
        background: linear-gradient(160deg, rgba(251, 253, 255, 0.94), rgba(242, 248, 255, 0.88));
        transform: translateZ(0);
        will-change: bottom;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        gap: 6px;
    }

    .bd-chatroom.is-mobile-floating-composer-active .bd-chatroom-composer.is-floating-mobile {
        display: grid;
        visibility: visible;
    }

    .bd-chatroom.is-mobile-floating-composer-active .bd-chatroom-messages {
        padding-bottom: calc(var(--bd-mobile-composer-space, 164px) + 14px + env(safe-area-inset-bottom));
        -webkit-overflow-scrolling: touch;
    }

    .bd-chatroom-compose-row,
    .bd-chatroom.is-mobile-floating-composer-active .bd-chatroom-compose-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 10px;
    }

    .bd-chatroom-compose-row textarea,
    .bd-chatroom.is-mobile-floating-composer-active .bd-chatroom-compose-row textarea {
        width: 100%;
        min-width: 100%;
        flex: none;
        max-height: 110px;
        min-height: 44px;
        padding: 10px 12px;
        font-size: 0.84rem;
        line-height: 1.75;
    }

    .bd-chatroom-compose-actions,
    .bd-chatroom.is-mobile-floating-composer-active .bd-chatroom-compose-actions {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
    }

    .bd-chatroom-compose-actions .bd-chatroom-upload-label,
    .bd-chatroom-compose-actions [data-chatroom-voice],
    .bd-chatroom-compose-actions [data-chatroom-cancel-attachment] {
        flex: 0 0 auto;
    }

    .bd-chatroom-compose-actions [data-chatroom-send] {
        width: auto;
        min-width: 72px;
        min-height: 38px;
        flex: 0 0 auto;
        border-radius: 999px;
        padding-inline: 14px;
    }
}

@media (max-width: 640px) {
    .bd-chatroom {
        padding: 10px 6px;
        gap: 10px;
    }

    .bd-chatroom-header,
    .bd-chatroom-sidebar,
    .bd-chatroom-main {
        border-radius: 16px;
    }

    .bd-chatroom-header {
        padding: 12px;
    }

    .bd-chatroom-header-main {
        align-items: flex-start;
        gap: 10px;
    }

    .bd-chatroom-brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 13px;
        font-size: 0.88rem;
    }

    .bd-chatroom-kicker {
        font-size: 0.66rem;
    }

    .bd-chatroom-header h2 {
        font-size: 1.08rem;
    }

    .bd-chatroom-header p {
        font-size: 0.74rem;
        line-height: 1.75;
    }

    .bd-chatroom-header-badge {
        min-width: 110px;
        padding: 7px 9px;
        border-radius: 12px;
    }

    .bd-chatroom-topbar {
        padding: 10px;
    }

    .bd-chatroom-thread-identity {
        gap: 8px;
    }

    .bd-chatroom-thread-avatar {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        font-size: 0.84rem;
    }

    .bd-chatroom-thread-summary {
        gap: 2px;
    }

    .bd-chatroom-topbar strong {
        font-size: 0.9rem;
    }

    .bd-chatroom-topbar [data-thread-presence] {
        font-size: 0.7rem;
    }

    .bd-chatroom-topbar-actions {
        width: 100%;
        gap: 6px;
    }

    .bd-chatroom-search-inline,
    .bd-chatroom-action-group {
        width: 100%;
    }

    .bd-chatroom-action-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .bd-chatroom-topbar-actions input {
        flex: 1 1 100%;
        padding: 8px 10px;
        min-height: 38px;
    }

    .bd-chatroom-compose-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 10px;
    }

    .bd-chatroom-compose-row textarea {
        width: 100%;
        min-width: 100%;
        flex: none;
        max-height: 110px;
        min-height: 44px;
        padding: 10px 12px;
        font-size: 0.84rem;
        line-height: 1.75;
    }

    .bd-chatroom-compose-actions {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
    }

    .bd-chatroom-compose-actions .bd-chatroom-upload-label,
    .bd-chatroom-compose-actions [data-chatroom-voice],
    .bd-chatroom-compose-actions [data-chatroom-cancel-attachment] {
        flex: 0 0 auto;
    }

    .bd-chatroom-compose-actions [data-chatroom-send] {
        width: auto;
        min-width: 72px;
        min-height: 38px;
        flex: 0 0 auto;
        border-radius: 999px;
        padding-inline: 14px;
    }

    .bd-chatroom-btn,
    .bd-chatroom-action-btn {
        font-size: 0.66rem;
        padding: 4px 6px;
        min-height: 28px;
    }

    .bd-chatroom-upload-label,
    [data-chatroom-voice],
    .bd-chatroom-btn-cancel {
        min-width: 28px;
        width: 28px;
        height: 28px;
    }

    .bd-chatroom-upload-label svg,
    [data-chatroom-voice] svg,
    .bd-chatroom-btn-cancel svg {
        width: 13px;
        height: 13px;
    }

    .bd-chatroom-messages {
        padding: 10px;
        gap: 8px;
    }

    .bd-chatroom-message {
        max-width: 100%;
        padding: 9px 10px;
        border-radius: 15px;
    }

    .bd-chatroom-message-content {
        font-size: 0.75rem;
        line-height: 1.8;
    }

    .bd-chatroom-message-head,
    .bd-chatroom-message-footer {
        gap: 6px;
    }

    .bd-chatroom-message-actions {
        border-radius: 14px;
        padding: 7px;
    }

    .bd-chatroom-files {
        padding: 8px 10px;
    }

    .bd-chatroom-file-item {
        padding: 7px 8px;
    }

    .bd-chatroom-call-panel,
    .bd-chatroom-screen-panel {
        margin: 0 10px;
        border-radius: 14px;
    }

    .bd-chatroom-call-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }

    .bd-chatroom-call-left {
        justify-content: center;
    }

    .bd-chatroom-call-actions {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }

    .bd-chatroom-connection-badge {
        padding: 6px 10px;
        font-size: 0.68rem;
    }

    .bd-chatroom-topbar-screen-indicator {
        font-size: 0.65rem;
    }

    .bd-chatroom-voice-player {
        min-width: 0;
        width: 100%;
    }
}

.bd-chatroom-call-panel {
    margin: 0 12px 6px;
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid rgba(94, 135, 199, 0.28);
    background: linear-gradient(145deg, rgba(237, 246, 255, 0.94), rgba(248, 252, 255, 0.82));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 10px 28px rgba(32, 74, 142, 0.1), 0 2px 8px rgba(32, 74, 142, 0.06);
    transition: all 0.26s ease;
}

.bd-chatroom-call-panel[hidden] {
    display: none !important;
}

.bd-chatroom-call-panel.is-incoming {
    border-color: rgba(37, 103, 200, 0.42);
    box-shadow: 0 14px 32px rgba(37, 87, 153, 0.18), 0 0 0 3px rgba(55, 116, 210, 0.1);
    animation: bdCallIncomingPulse 1.8s ease-in-out infinite;
}

@keyframes bdCallIncomingPulse {
    0%, 100% { box-shadow: 0 14px 32px rgba(37, 87, 153, 0.18), 0 0 0 3px rgba(55, 116, 210, 0.1); }
    50% { box-shadow: 0 14px 32px rgba(37, 87, 153, 0.26), 0 0 0 6px rgba(55, 116, 210, 0.14); }
}

.bd-chatroom-call-panel.is-active {
    border-color: rgba(32, 143, 100, 0.4);
    background: linear-gradient(145deg, rgba(230, 252, 240, 0.96), rgba(243, 255, 248, 0.86));
    box-shadow: 0 12px 28px rgba(20, 124, 84, 0.14);
}

.bd-chatroom-call-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bd-chatroom-call-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #2a6ae8, #1650c9);
    box-shadow: 0 8px 18px rgba(38, 90, 195, 0.28);
    flex-shrink: 0;
}

.bd-chatroom-call-panel.is-active .bd-chatroom-call-avatar {
    background: linear-gradient(135deg, #20a070, #168a5a);
    box-shadow: 0 8px 18px rgba(24, 130, 82, 0.28);
}

.bd-chatroom-call-panel.is-incoming .bd-chatroom-call-avatar {
    animation: bdCallAvatarBounce 0.6s ease-in-out infinite alternate;
}

@keyframes bdCallAvatarBounce {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

.bd-chatroom-call-meta {
    display: grid;
    gap: 3px;
}

.bd-chatroom-call-meta strong {
    color: #0f2a4e;
    font-size: 0.9rem;
    font-weight: 800;
}

.bd-chatroom-call-meta span {
    color: #4e6f98;
    font-size: 0.74rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bd-chatroom-call-meta span::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #64b88a;
    flex-shrink: 0;
    display: none;
}

.bd-chatroom-call-panel.is-active .bd-chatroom-call-meta span::before {
    display: inline-block;
    animation: bdCallDotPulse 1.4s ease-in-out infinite;
}

@keyframes bdCallDotPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.bd-chatroom-call-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bd-chatroom-call-actions .bd-chatroom-btn {
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.8rem;
}

.bd-chatroom-btn-accept {
    background: linear-gradient(135deg, #20a070, #168a5a) !important;
    border-color: rgba(22, 138, 90, 0.5) !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(20, 124, 84, 0.28) !important;
}

.bd-chatroom-btn-accept:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.bd-chatroom-btn-danger {
    background: rgba(255, 232, 233, 0.9);
    border-color: rgba(218, 110, 118, 0.38);
    color: #a83a42;
}

.bd-chatroom-btn-danger:hover {
    background: rgba(255, 215, 217, 0.94);
    border-color: rgba(200, 75, 85, 0.48);
    color: #8a2d35;
    transform: translateY(-1px);
}


.bd-chatroom-policy-note {
    border-radius: 14px;
    border: 1px solid rgba(214, 191, 143, 0.42);
    background: linear-gradient(145deg, rgba(255, 250, 239, 0.92), rgba(255, 246, 227, 0.84));
    padding: 12px 14px;
    color: #6c5120;
    display: grid;
    gap: 6px;
}

.bd-chatroom-policy-note strong {
    color: #68470b;
    font-size: 0.82rem;
}

.bd-chatroom-policy-note p {
    margin: 0;
    line-height: 1.9;
    font-size: 0.75rem;
}

/* Screen Share Panel */
.bd-chatroom-screen-panel {
    background: linear-gradient(145deg, rgba(228, 238, 255, 0.96), rgba(240, 248, 255, 0.88));
    border: 1px solid rgba(157, 191, 237, 0.42);
    border-radius: 20px;
    margin: 0 12px 6px;
    padding: 14px 16px;
    box-shadow: 0 12px 28px rgba(28, 68, 140, 0.12), 0 2px 8px rgba(28, 68, 140, 0.06);
    display: grid;
    gap: 12px;
    transition: all 0.26s ease;
}

.bd-chatroom-screen-panel[hidden] {
    display: none !important;
}

.bd-chatroom-screen-panel.is-sharing {
    background: linear-gradient(145deg, rgba(226, 252, 238, 0.96), rgba(240, 255, 247, 0.88));
    border-color: rgba(92, 189, 145, 0.42);
    box-shadow: 0 12px 28px rgba(20, 130, 80, 0.14);
}

.bd-chatroom-screen-panel.is-receiving {
    background: linear-gradient(145deg, rgba(232, 244, 255, 0.96), rgba(225, 240, 255, 0.88));
    border-color: rgba(90, 155, 225, 0.46);
    box-shadow: 0 12px 28px rgba(30, 100, 190, 0.16);
}

.bd-chatroom-screen-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bd-chatroom-screen-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bd-chatroom-screen-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(155, 190, 235, 0.48);
    font-size: 0.72rem;
    font-weight: 800;
    color: #1a4d8f;
}

.bd-chatroom-screen-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3a7ad4;
    flex-shrink: 0;
}

.bd-chatroom-screen-panel.is-sharing .bd-chatroom-screen-badge {
    background: rgba(216, 252, 236, 0.8);
    border-color: rgba(80, 184, 130, 0.48);
    color: #0f6e43;
}

.bd-chatroom-screen-panel.is-sharing .bd-chatroom-screen-badge::before {
    background: #22b878;
    animation: bdCallDotPulse 1.4s ease-in-out infinite;
}

.bd-chatroom-screen-meta strong {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0d2a52;
}

.bd-chatroom-screen-meta span {
    font-size: 0.76rem;
    color: #4a6b98;
}

.bd-chatroom-screen-video-container {
    position: relative;
    background: rgba(10, 18, 36, 0.92);
    border-radius: 14px;
    overflow: hidden;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(60, 100, 170, 0.22);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.3);
}

.bd-chatroom-screen-video-container video {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

.bd-chatroom-screen-video-container video[hidden] {
    display: none;
}

.bd-chatroom-screen-video-container [data-chatroom-local-screen] {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 200px;
    height: auto;
    border: 2px solid rgba(255,255,255,0.88);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    z-index: 10;
    transition: width 0.2s ease;
}

.bd-chatroom-screen-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
}

.bd-chatroom-screen-placeholder-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(255,255,255,0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.16);
}

.bd-chatroom-screen-placeholder-icon svg {
    width: 24px;
    height: 24px;
}

.bd-chatroom-screen-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Screen Share Toggle Button */
[data-chatroom-screen-toggle] {
    background: linear-gradient(135deg, rgba(74, 124, 220, 0.92), rgba(50, 96, 198, 0.92));
    color: #fff;
    border: 1px solid rgba(74, 124, 220, 0.5) !important;
    box-shadow: 0 10px 22px rgba(42, 86, 188, 0.24);
}

[data-chatroom-screen-toggle]:hover:not(:disabled) {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(42, 86, 188, 0.32);
}

[data-chatroom-screen-toggle].is-sharing {
    background: linear-gradient(135deg, rgba(22, 145, 95, 0.92), rgba(16, 118, 76, 0.92)) !important;
    border-color: rgba(22, 145, 95, 0.5) !important;
    box-shadow: 0 10px 22px rgba(16, 118, 76, 0.26) !important;
}

[data-chatroom-screen-toggle]:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .bd-chatroom-screen-video-container {
        min-height: 160px;
        max-height: 32vh;
    }

    .bd-chatroom-screen-video-container video {
        max-height: 32vh;
        pointer-events: none;
    }

    .bd-chatroom-screen-video-container [data-chatroom-local-screen] {
        width: 120px;
        bottom: 8px;
        right: 8px;
    }

    .bd-chatroom-screen-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 1024px) {
    .bd-chatroom.is-screen-receiving-active .bd-chatroom-main,
    .bd-chatroom.is-screen-sharing-active .bd-chatroom-main {
        min-height: 0;
    }

    .bd-chatroom.is-screen-receiving-active .bd-chatroom-screen-panel,
    .bd-chatroom.is-screen-sharing-active .bd-chatroom-screen-panel {
        flex: 0 0 auto;
        max-height: 42vh;
        overflow: hidden;
    }

    .bd-chatroom.is-screen-receiving-active .bd-chatroom-messages,
    .bd-chatroom.is-screen-sharing-active .bd-chatroom-messages {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }
}

.bd-chatroom-topbar-main {
    display: grid;
    gap: 6px;
}

.bd-chatroom-score-strip,
.bd-chatroom-thread-scores {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bd-chatroom-score-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 0.68rem;
    font-weight: 800;
    background: rgba(241, 247, 255, 0.95);
    border: 1px solid rgba(171, 196, 232, 0.7);
    color: #234a7c;
}

.bd-chatroom-score-chip.is-level {
    background: rgba(237, 233, 254, 0.95);
    border-color: rgba(196, 181, 253, 0.8);
    color: #6d28d9;
}

.bd-chatroom-score-chip.is-readiness {
    background: rgba(236, 253, 245, 0.95);
    border-color: rgba(167, 243, 208, 0.9);
    color: #0f766e;
}

.bd-chatroom-thread-scores {
    margin-top: 4px;
}

/* Shared UI system alignment */
.bd-chatroom {
    width: min(var(--bd-ui-content-width), 100%);
}

.bd-chatroom-header,
.bd-chatroom-sidebar,
.bd-chatroom-main,
.bd-chatroom-thread-item,
.bd-chatroom-message,
.bd-chatroom-file-item,
.bd-chatroom-reply,
.bd-chatroom-policy-note,
.bd-chatroom-dashboard-card,
.bd-chatroom-composer,
.bd-chatroom-screen-panel {
    border-color: var(--bd-ui-border);
}

.bd-chatroom-header,
.bd-chatroom-sidebar,
.bd-chatroom-main,
.bd-chatroom-policy-note,
.bd-chatroom-dashboard-card,
.bd-chatroom-composer,
.bd-chatroom-screen-panel {
    box-shadow: var(--bd-ui-shadow);
}

.bd-chatroom-thread-item,
.bd-chatroom-message,
.bd-chatroom-file-item,
.bd-chatroom-reply,
.bd-chatroom-composer-meta,
.bd-chatroom-score-chip {
    box-shadow: var(--bd-ui-shadow-soft);
}

.bd-chatroom-dashboard-card,
.bd-chatroom-policy-note,
.bd-chatroom-composer,
.bd-chatroom-screen-panel,
.bd-chatroom-composer-meta {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(242, 247, 255, 0.8));
}

.bd-chatroom-btn,
.bd-chatroom-pill {
    min-height: 42px;
    font-weight: 700;
}

.bd-chatroom-pill.is-active,
.bd-chatroom-btn.is-primary,
[data-chatroom-screen-toggle] {
    box-shadow: 0 16px 28px rgba(42, 109, 246, 0.16);
}

.bd-chatroom-thread-item.is-active,
.bd-chatroom-thread-item:hover,
.bd-chatroom-message:hover {
    box-shadow: 0 18px 30px rgba(23, 48, 84, 0.12);
}

.bd-chatroom-guidance {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid rgba(188, 207, 235, 0.32);
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.82), rgba(242, 247, 255, 0.56));
}

.bd-chatroom-guidance-card {
    border-radius: 16px;
    border: 1px solid rgba(201, 216, 240, 0.84);
    background: linear-gradient(145deg, rgba(255,255,255,0.94), rgba(242,247,255,0.84));
    padding: 14px;
    display: grid;
    gap: 6px;
}

.bd-chatroom-guidance-card.is-accent {
    background: linear-gradient(145deg, rgba(236, 244, 255, 0.98), rgba(227, 239, 255, 0.9));
    border-color: rgba(176, 201, 238, 0.94);
}

.bd-chatroom-guidance-card span,
.bd-chatroom-thread-guide,
.bd-chatroom-empty-description,
.bd-chatroom-empty-list {
    color: #567090;
    font-size: 0.75rem;
}

.bd-chatroom-guidance-card strong,
.bd-chatroom-empty-title {
    color: #173d6d;
    font-size: 0.92rem;
}

.bd-chatroom-guidance-card p {
    margin: 0;
    line-height: 1.9;
    color: #3e5b80;
}

.bd-chatroom-guidance-plan {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bd-chatroom-guidance-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(173, 197, 231, 0.86);
    color: #2a568c;
    font-size: 0.71rem;
    font-weight: 700;
}

.bd-chatroom-thread-guide {
    line-height: 1.8;
    padding: 7px 8px;
    border-radius: 10px;
    background: rgba(241, 246, 255, 0.88);
    border: 1px solid rgba(208, 220, 241, 0.88);
}

.bd-chatroom-empty.is-rich {
    padding: 22px;
    border-radius: 20px;
    border: 1px dashed rgba(163, 188, 223, 0.82);
    background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(240,246,255,0.84));
    box-shadow: var(--bd-ui-shadow-soft);
}

.bd-chatroom-empty-title {
    display: block;
}

.bd-chatroom-empty-description {
    margin: 0;
    line-height: 2;
}

.bd-chatroom-empty-list {
    margin: 0;
    padding: 0 18px 0 0;
    line-height: 1.95;
}

@media (max-width: 960px) {
    .bd-chatroom-guidance {
        grid-template-columns: 1fr;
    }
}


.bd-chatroom-thread-list {
    padding-inline: 2px 4px;
}

.bd-chatroom-thread-guide {
    line-height: 1.85;
    padding: 8px 10px;
    border-radius: 12px;
}

.bd-chatroom-score-strip,
.bd-chatroom-thread-scores {
    gap: 8px;
}

.bd-chatroom-score-chip {
    padding: 5px 10px;
    font-size: 0.7rem;
}

.bd-chatroom-message-content {
    font-size: 0.84rem;
    line-height: 2;
}

.bd-chatroom.is-user-view {
    grid-template-rows: auto minmax(0, 1fr);
}

body.admin-bar .bd-chatroom {
    min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px));
    height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px));
    max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px));
}

body.admin-bar .bd-chatroom.is-admin-view {
    min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 32px));
    height: auto;
    max-height: none;
}

@media (max-width: 782px) {
    body.admin-bar .bd-chatroom {
        min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 46px));
        height: calc(100dvh - var(--wp-admin--admin-bar--height, 46px));
        max-height: calc(100dvh - var(--wp-admin--admin-bar--height, 46px));
    }

    body.admin-bar .bd-chatroom.is-admin-view {
        min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 46px));
        height: auto;
        max-height: none;
    }
}

.bd-chatroom.is-user-view .bd-chatroom-layout {
    grid-template-columns: minmax(0, 1fr);
}

.bd-chatroom.is-user-view .bd-chatroom-sidebar {
    display: none;
}

.bd-chatroom.is-user-view .bd-chatroom-topbar {
    grid-template-columns: minmax(0, 1fr);
}

.bd-chatroom.is-user-view .bd-chatroom-score-strip,
.bd-chatroom.is-user-view .bd-chatroom-thread-scores {
    display: none;
}

.bd-chatroom.is-user-view .bd-chatroom-header {
    padding: 14px 16px;
    gap: 12px;
}

.bd-chatroom.is-admin-view {
    min-height: 100dvh;
    height: auto;
    max-height: none;
    overflow: visible;
}

.bd-chatroom.is-admin-view .bd-chatroom-layout {
    min-height: 0;
    height: auto;
    overflow: visible;
}

.bd-chatroom.is-admin-view .bd-chatroom-main {
    min-height: 0;
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.bd-chatroom.is-admin-view .bd-chatroom-topbar,
.bd-chatroom.is-admin-view .bd-chatroom-guidance,
.bd-chatroom.is-admin-view .bd-chatroom-policy-note,
.bd-chatroom.is-admin-view .bd-chatroom-pinned,
.bd-chatroom.is-admin-view .bd-chatroom-typing,
.bd-chatroom.is-admin-view .bd-chatroom-call-panel,
.bd-chatroom.is-admin-view .bd-chatroom-screen-panel,
.bd-chatroom.is-admin-view .bd-chatroom-files,
.bd-chatroom.is-admin-view .bd-chatroom-composer {
    flex: 0 0 auto;
}

.bd-chatroom.is-admin-view .bd-chatroom-sidebar {
    min-height: 0;
    max-height: none;
    overflow: visible;
}

.bd-chatroom.is-admin-view .bd-chatroom-thread-list,
.bd-chatroom.is-admin-view .bd-chatroom-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.bd-chatroom.is-admin-view .bd-chatroom-composer {
    position: sticky;
    bottom: 0;
    z-index: 12;
}

.bd-chatroom.is-admin-view .bd-chatroom-dashboard-strip {
    gap: 8px;
    padding: 10px 12px;
}

.bd-chatroom.is-admin-view .bd-chatroom-dashboard-card {
    min-height: 72px;
    padding: 10px 12px;
    gap: 4px;
}

.bd-chatroom.is-admin-view .bd-chatroom-dashboard-card span {
    font-size: 0.68rem;
}

.bd-chatroom.is-admin-view .bd-chatroom-dashboard-card strong {
    font-size: 0.84rem;
    line-height: 1.65;
}

.bd-chatroom.is-admin-view .bd-chatroom-topbar {
    padding: 10px 12px;
    gap: 8px;
}

.bd-chatroom.is-admin-view .bd-chatroom-topbar-actions {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
}

.bd-chatroom.is-admin-view .bd-chatroom-search-inline,
.bd-chatroom.is-admin-view .bd-chatroom-action-group {
    width: 100%;
}

.bd-chatroom.is-admin-view .bd-chatroom-action-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.bd-chatroom.is-admin-view .bd-chatroom-action-group .bd-chatroom-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
    min-height: 34px;
    padding-inline: 10px;
}

.bd-chatroom.is-admin-view .bd-chatroom-guidance {
    gap: 8px;
    padding: 8px 12px;
}

.bd-chatroom.is-admin-view .bd-chatroom-guidance-card {
    padding: 10px 12px;
    gap: 4px;
}

.bd-chatroom.is-admin-view .bd-chatroom-guidance-card span,
.bd-chatroom.is-admin-view .bd-chatroom-thread-guide,
.bd-chatroom.is-admin-view .bd-chatroom-empty-description,
.bd-chatroom.is-admin-view .bd-chatroom-empty-list {
    font-size: 0.71rem;
    line-height: 1.75;
}

.bd-chatroom.is-admin-view .bd-chatroom-guidance-card strong,
.bd-chatroom.is-admin-view .bd-chatroom-empty-title {
    font-size: 0.84rem;
}

.bd-chatroom.is-admin-view .bd-chatroom-guidance-card p {
    line-height: 1.75;
}

.bd-chatroom.is-admin-view .bd-chatroom-guidance-pill {
    padding: 4px 8px;
    font-size: 0.67rem;
}

.bd-chatroom.is-admin-view .bd-chatroom-policy-note {
    padding: 8px 12px;
}

.bd-chatroom.is-admin-view .bd-chatroom-policy-note strong {
    font-size: 0.8rem;
}

.bd-chatroom.is-admin-view .bd-chatroom-policy-note p {
    font-size: 0.72rem;
    line-height: 1.8;
}

@media (max-width: 1200px) {
    .bd-chatroom.is-admin-view .bd-chatroom-topbar-actions {
        grid-template-columns: 1fr;
    }

    .bd-chatroom.is-admin-view .bd-chatroom-action-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bd-chatroom.is-admin-view .bd-chatroom-dashboard-strip {
        grid-template-columns: 1fr;
    }

    .bd-chatroom.is-admin-view .bd-chatroom-guidance {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .bd-chatroom.is-admin-view .bd-chatroom-action-group {
        grid-template-columns: 1fr;
    }

    .bd-chatroom.is-admin-view .bd-chatroom-composer {
        position: relative;
        bottom: auto;
    }
}

.bd-chatroom.is-user-view .bd-chatroom-header-badge {
    min-width: 124px;
    padding: 8px 10px;
}

.bd-chatroom.is-user-view .bd-chatroom-header-copy p {
    font-size: 0.78rem;
}

.bd-chatroom.is-user-view .bd-chatroom-topbar-actions {
    gap: 8px;
}

.bd-chatroom.is-user-view .bd-chatroom-action-group-secondary {
    display: none;
}

@media (max-width: 1024px) {
    .bd-chatroom {
        min-height: 100dvh;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
    }

    .bd-chatroom.is-user-view .bd-chatroom-layout {
        height: 100%;
    }

    .bd-chatroom.is-user-view .bd-chatroom-main {
        min-height: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .bd-chatroom.is-user-view .bd-chatroom-messages {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        overflow-y: auto;
        touch-action: pan-y;
    }

    .bd-chatroom.is-admin-view .bd-chatroom-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(220px, 34vh) minmax(0, 1fr);
    }

    .bd-chatroom.is-admin-view .bd-chatroom-sidebar {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .bd-chatroom.is-user-view .bd-chatroom-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .bd-chatroom.is-user-view .bd-chatroom-action-group {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bd-chatroom.is-user-view .bd-chatroom-header-copy {
        gap: 3px;
    }

    .bd-chatroom.is-user-view .bd-chatroom-header-badge {
        display: none;
    }

    .bd-chatroom.is-user-view .bd-chatroom-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .bd-chatroom.is-user-view .bd-chatroom-header-main {
        gap: 8px;
        align-items: center;
    }

    .bd-chatroom.is-user-view .bd-chatroom-brand-mark {
        width: 36px;
        height: 36px;
        border-radius: 11px;
        font-size: 0.8rem;
    }

    .bd-chatroom.is-user-view .bd-chatroom-kicker {
        font-size: 0.62rem;
    }

    .bd-chatroom.is-user-view .bd-chatroom-header h2 {
        font-size: 0.98rem;
    }

    .bd-chatroom.is-user-view .bd-chatroom-header-copy p {
        font-size: 0.7rem;
        line-height: 1.6;
    }

    .bd-chatroom.is-user-view .bd-chatroom-header-actions .bd-chatroom-btn {
        min-height: 34px;
        padding: 4px 10px;
    }

    .bd-chatroom.is-user-view .bd-chatroom-messages {
        min-height: 220px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 1024px) {
    .bd-chatroom.is-user-view.is-mobile-floating-composer-active .bd-chatroom-messages {
        padding-bottom: calc(var(--bd-mobile-composer-space, 164px) + 18px + env(safe-area-inset-bottom));
    }
}

.bd-chatroom-compose-row textarea {
    min-height: 40px;
}

.bd-chatroom-compose-actions .bd-chatroom-btn.is-primary {
    min-width: 42px;
}

.bd-chatroom-empty.is-rich {
    min-height: 220px;
    align-content: center;
}

.bd-chatroom-connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 12px;
    border: 1px solid var(--bm-border);
    background: var(--bm-surface-soft);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--bm-text-soft);
    transition: all var(--bm-transition);
}

.bd-chatroom-connection-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64b88a;
    flex-shrink: 0;
    transition: background-color var(--bm-transition);
}

.bd-chatroom-connection-badge.is-connecting::before {
    background: #e8a838;
    animation: bdCallDotPulse 1s ease-in-out infinite;
}

.bd-chatroom-connection-badge.is-offline::before {
    background: #d64568;
}

.bd-chatroom-connection-badge.is-reconnecting::before {
    background: #e8a838;
    animation: bdCallDotPulse 0.8s ease-in-out infinite;
}

.bd-chatroom-voice-player {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(300px, 100%);
    padding: 6px 10px 6px 6px;
    border-radius: 14px;
    background: var(--bm-primary-soft);
    position: relative;
}

.bd-chatroom-voice-body {
    display: grid;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
}

.bd-chatroom-voice-play {
    border: none;
    background: var(--bm-primary);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform var(--bm-transition), filter var(--bm-transition);
}

.bd-chatroom-voice-play:hover {
    filter: brightness(1.08);
    transform: scale(1.05);
}

.bd-chatroom-voice-play svg {
    width: 14px;
    height: 14px;
    display: block;
}

.bd-chatroom-voice-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 26px;
    min-width: 0;
    cursor: pointer;
    padding: 2px 0;
}

.bd-chatroom-voice-waveform span {
    flex: 1 1 3px;
    max-width: 4px;
    border-radius: 2px;
    background: var(--bm-primary);
    opacity: 0.28;
    transition: opacity 0.1s ease, height 0.1s ease, background-color 0.1s ease;
}

.bd-chatroom-voice-waveform span.is-played {
    opacity: 0.72;
}

.bd-chatroom-voice-track {
    position: relative;
    height: 3px;
    border-radius: 999px;
    background: rgba(51, 144, 236, 0.18);
    overflow: hidden;
    cursor: pointer;
}

.bd-chatroom-voice-track-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--bm-primary);
    transition: width 0.08s linear;
}

.bd-chatroom-voice-player.is-playing .bd-chatroom-voice-waveform span:not(.is-played) {
    animation: bmVoiceBar 0.75s ease-in-out infinite alternate;
}

.bd-chatroom-voice-player.is-playing .bd-chatroom-voice-waveform span:nth-child(odd):not(.is-played) {
    animation-delay: 0.1s;
}

.bd-chatroom-voice-player.is-playing .bd-chatroom-voice-waveform span:nth-child(3n):not(.is-played) {
    animation-delay: 0.2s;
}

@keyframes bmVoiceBar {
    from { height: 6px; opacity: 0.35; }
    to { height: 22px; opacity: 0.9; }
}

.bd-chatroom-voice-duration {
    font-size: 0.68rem;
    color: var(--bm-text-muted);
    white-space: nowrap;
    min-width: 36px;
    text-align: left;
    direction: ltr;
}

.bd-chatroom-voice-progress {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.bd-chatroom-call-btn-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bd-chatroom-call-btn-icon.is-active {
    background: var(--bm-primary-soft);
    border-color: var(--bm-primary);
    color: var(--bm-primary);
}

.bd-chatroom-call-btn-icon.is-muted {
    background: rgba(214, 69, 104, 0.12);
    border-color: rgba(214, 69, 104, 0.4);
    color: #d64568;
}

.bd-chatroom-receipt.is-read {
    color: var(--bm-accent-read);
}

.bd-chatroom-message.is-me .bd-chatroom-receipt.is-read {
    color: var(--bm-accent-read);
}

.bd-chatroom-call-panel.is-connecting {
    border-color: rgba(232, 168, 56, 0.45);
    background: linear-gradient(145deg, rgba(255, 248, 232, 0.96), rgba(255, 252, 244, 0.88));
}

.bd-chatroom-call-panel.is-connecting .bd-chatroom-call-meta span::before {
    display: inline-block;
    background: #e8a838;
    animation: bdCallDotPulse 1s ease-in-out infinite;
}

.bd-chatroom-call-panel.is-reconnecting {
    border-color: rgba(232, 168, 56, 0.5);
    background: linear-gradient(145deg, rgba(255, 245, 228, 0.96), rgba(255, 250, 238, 0.9));
}

.bd-chatroom-call-panel.is-reconnecting .bd-chatroom-call-meta span::before {
    display: inline-block;
    background: #e8a838;
    animation: bdCallDotPulse 0.7s ease-in-out infinite;
}

.bd-chatroom-call-panel.is-failed {
    border-color: rgba(214, 69, 104, 0.42);
    background: linear-gradient(145deg, rgba(255, 238, 242, 0.96), rgba(255, 246, 248, 0.9));
}

.bd-chatroom-call-panel.is-failed .bd-chatroom-call-meta span::before {
    display: inline-block;
    background: #d64568;
}

.bd-chatroom-topbar-screen-indicator {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(34, 184, 120, 0.12);
    border: 1px solid rgba(34, 184, 120, 0.35);
    font-size: 0.7rem;
    font-weight: 800;
    color: #0f6e43;
}

.bd-chatroom-topbar-screen-indicator.is-visible {
    display: inline-flex;
}

.bd-chatroom-topbar-screen-indicator::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22b878;
    animation: bdCallDotPulse 1.2s ease-in-out infinite;
}

.bd-chatroom-composer-recording {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 12px;
    background: rgba(214, 69, 104, 0.1);
    color: #c43838;
    font-size: 0.74rem;
    font-weight: 700;
}

.bd-chatroom-composer-recording-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}

.bd-chatroom-composer-recording-wave span {
    width: 3px;
    border-radius: 2px;
    background: #d64568;
    animation: bmVoiceBar 0.6s ease-in-out infinite alternate;
}

.bd-chatroom-composer-recording-wave span:nth-child(2) { animation-delay: 0.08s; }
.bd-chatroom-composer-recording-wave span:nth-child(3) { animation-delay: 0.16s; }
.bd-chatroom-composer-recording-wave span:nth-child(4) { animation-delay: 0.24s; }
.bd-chatroom-composer-recording-wave span:nth-child(5) { animation-delay: 0.32s; }

/* Day separators */
.bd-chatroom-day-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.bd-chatroom-day-separator span {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(171, 196, 232, 0.55);
    color: #4a6b98;
    font-size: 0.7rem;
    font-weight: 800;
    box-shadow: var(--bm-shadow);
}

/* Scroll to bottom FAB */
.bd-chatroom-scroll-bottom {
    position: absolute;
    inset-inline-end: 18px;
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(161, 186, 222, 0.55);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(242, 248, 255, 0.9));
    color: #2a5f9c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(18, 42, 80, 0.14);
    transition: transform var(--bm-transition), box-shadow var(--bm-transition);
}

.bd-chatroom-scroll-bottom[hidden] {
    display: none !important;
}

.bd-chatroom-scroll-bottom:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 28px rgba(18, 42, 80, 0.18);
}

.bd-chatroom-scroll-bottom.is-visible {
    animation: bmMessageIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Incoming call full-screen overlay */
.bd-chatroom-incoming-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 32, 56, 0.52);
    backdrop-filter: saturate(165%) blur(14px);
    -webkit-backdrop-filter: saturate(165%) blur(14px);
}

.bd-chatroom-incoming-overlay[hidden] {
    display: none !important;
}

.bd-chatroom-incoming-card {
    width: min(380px, 100%);
    border-radius: 28px;
    border: 1px solid rgba(180, 198, 220, 0.55);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(237, 246, 255, 0.94));
    box-shadow: 0 28px 60px rgba(18, 42, 80, 0.22);
    padding: 28px 24px 22px;
    display: grid;
    gap: 12px;
    justify-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.bd-chatroom-incoming-rings {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.bd-chatroom-incoming-rings span {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid rgba(51, 144, 236, 0.28);
    animation: bdIncomingRing 2.2s ease-out infinite;
}

.bd-chatroom-incoming-rings span:nth-child(2) {
    animation-delay: 0.45s;
}

.bd-chatroom-incoming-rings span:nth-child(3) {
    animation-delay: 0.9s;
}

@keyframes bdIncomingRing {
    0% { transform: scale(0.7); opacity: 0.7; }
    100% { transform: scale(2.2); opacity: 0; }
}

.bd-chatroom-incoming-avatar {
    width: 88px;
    height: 88px;
    border-radius: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #2a6ae8, #1650c9);
    box-shadow: 0 16px 32px rgba(38, 90, 195, 0.32);
    position: relative;
    z-index: 1;
    animation: bdCallAvatarBounce 0.6s ease-in-out infinite alternate;
}

.bd-chatroom-incoming-name {
    font-size: 1.15rem;
    color: #0f2a4e;
    position: relative;
    z-index: 1;
}

.bd-chatroom-incoming-status {
    font-size: 0.82rem;
    color: #4e6f98;
    position: relative;
    z-index: 1;
}

.bd-chatroom-incoming-actions {
    display: flex;
    gap: 14px;
    width: 100%;
    justify-content: center;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.bd-chatroom-incoming-decline,
.bd-chatroom-incoming-answer {
    min-width: 118px;
    min-height: 52px;
    border-radius: 16px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.76rem;
    font-weight: 800;
}

.bd-chatroom-incoming-decline {
    background: rgba(255, 232, 233, 0.94) !important;
    border-color: rgba(218, 110, 118, 0.42) !important;
    color: #a83a42 !important;
}

.bd-chatroom-incoming-answer {
    background: linear-gradient(135deg, #20a070, #168a5a) !important;
    border-color: rgba(22, 138, 90, 0.5) !important;
    color: #fff !important;
    box-shadow: 0 12px 24px rgba(20, 124, 84, 0.28) !important;
}

[data-chatroom-call-toggle].is-incoming-pulse {
    animation: bdCallIncomingPulse 1.4s ease-in-out infinite;
}

.bd-chatroom.is-incoming-call-active .bd-chatroom-main {
    pointer-events: none;
}

.bd-chatroom-screen-placeholder[hidden] {
    display: none !important;
}

.bd-chatroom-screen-video-container:fullscreen video {
    max-height: 100vh;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Search highlight in messages */
.bd-chatroom-search-hit {
    background: rgba(255, 214, 96, 0.55);
    color: inherit;
    border-radius: 3px;
    padding: 0 1px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Image lightbox preview */
.bd-chatroom-image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 32, 56, 0.58);
    backdrop-filter: saturate(165%) blur(14px);
    -webkit-backdrop-filter: saturate(165%) blur(14px);
}

.bd-chatroom-image-lightbox[hidden] {
    display: none !important;
}

.bd-chatroom-image-lightbox-frame {
    position: relative;
    width: min(920px, 100%);
    max-height: min(88vh, 820px);
    display: grid;
    gap: 10px;
    justify-items: center;
}

.bd-chatroom-image-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: min(78vh, 760px);
    width: auto;
    height: auto;
    border-radius: 16px;
    border: 1px solid rgba(180, 198, 220, 0.55);
    background: #fff;
    box-shadow: 0 28px 60px rgba(18, 42, 80, 0.22);
    object-fit: contain;
}

.bd-chatroom-image-lightbox-caption {
    width: 100%;
    text-align: center;
    color: #eef4ff;
    font-size: 0.82rem;
    line-height: 1.6;
    word-break: break-word;
}

.bd-chatroom-image-lightbox-caption[hidden] {
    display: none !important;
}

.bd-chatroom-image-lightbox-close {
    position: absolute;
    top: -6px;
    inset-inline-end: -6px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(161, 186, 222, 0.55);
    background: rgba(255, 255, 255, 0.96);
    color: #285280;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(18, 42, 80, 0.16);
    transition: transform var(--bm-transition), box-shadow var(--bm-transition);
}

.bd-chatroom-image-lightbox-close:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(18, 42, 80, 0.2);
}

.bd-chatroom-message .bd-chatroom-attachment-image {
    cursor: zoom-in;
}

body.bd-modal-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .bd-chatroom-scroll-bottom {
        bottom: calc(104px + env(safe-area-inset-bottom, 0px));
    }

    .bd-chatroom.is-mobile-floating-composer-active .bd-chatroom-scroll-bottom {
        bottom: calc(118px + env(safe-area-inset-bottom, 0px));
    }
}

/* ─── Focus-visible keyboard navigation ─── */
.bd-chatroom-btn:focus-visible,
.bd-chatroom-pill:focus-visible,
.bd-chatroom-score-chip:focus-visible,
.bd-chatroom-compose-row textarea:focus-visible,
.bd-chatroom-topbar-actions input:focus-visible,
.bd-chatroom-search-wrap input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(51, 144, 236, 0.28);
}

/* ─── Prefers reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
    .bd-chatroom-header,
    .bd-chatroom-sidebar,
    .bd-chatroom-main,
    .bd-chatroom-message,
    .bd-chatroom-thread-item,
    .bd-chatroom-btn,
    .bd-chatroom-pill,
    .bd-chatroom-topbar,
    .bd-chatroom-topbar-actions,
    .bd-chatroom-compose-row {
        transition: none !important;
        animation: none !important;
    }

    .bd-chatroom-composer-recording-wave span {
        animation: none;
        height: 12px;
    }

    .bd-chatroom-incoming-rings span {
        animation: none;
        opacity: 0.25;
    }

    .bd-chatroom-scroll-bottom.is-visible {
        animation: none;
    }

    .bd-chatroom-btn:hover,
    .bd-chatroom-image-lightbox-close:hover {
        transform: none;
    }
}
