* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-main: #090b10;
    --bg-shell: #0d1016;
    --bg-panel: #131821;
    --bg-panel-2: #191f2a;
    --bg-card: rgba(255, 255, 255, 0.045);
    --bg-card-2: rgba(255, 255, 255, 0.03);
    --bg-hover: rgba(255, 140, 0, 0.12);
    --bg-active: rgba(255, 140, 0, 0.18);

    --orange: #ff8c00;
    --orange-2: #ffb347;
    --orange-3: #ff6a00;
    --orange-soft: rgba(255, 140, 0, 0.16);
    --orange-ring: rgba(255, 140, 0, 0.22);

    --text-main: #ffffff;
    --text-soft: #e8ecf3;
    --text-muted: #9ea8ba;
    --text-faint: #7f8898;

    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.12);

    --success: #ff8c00;
    --danger: #ff5d5d;

    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.38);
    --shadow-orange: 0 14px 30px rgba(255, 140, 0, 0.18);

    --transition: 0.25s ease;
}

html,
body {
    height: 100%;
}

body {
    min-height: 100vh;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(255, 140, 0, 0.12), transparent 24%),
        radial-gradient(circle at bottom right, rgba(255, 140, 0, 0.08), transparent 20%),
        linear-gradient(180deg, #090b10 0%, #0d1016 100%);
    overflow: hidden;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
textarea,
select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    height: 100vh;
    padding: 14px;
    background: transparent;
}

.chat-layout {
    position: relative;
    height: calc(100vh - 28px);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background:
        linear-gradient(rgba(9, 11, 16, 0.3), rgba(9, 11, 16, 0.8)),
        url('../../img/back.png') center/cover,
        linear-gradient(180deg, #0c1017 0%, #0f141d 100%);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: var(--shadow-lg);
    isolation: isolate;
}

.chat-layout::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 140, 0, 0.08), transparent 20%),
        radial-gradient(circle at 85% 80%, rgba(255, 140, 0, 0.05), transparent 18%);
    pointer-events: none;
    z-index: 0;
}

.chat-layout > * {
    position: relative;
    z-index: 1;
}

/* SIDEBAR */
.sidebar {
    position: relative;
    height: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, rgba(24, 28, 37, 0.98) 0%, rgba(13, 16, 22, 0.99) 100%);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--orange-3), var(--orange), var(--orange-2));
    box-shadow: 0 0 16px rgba(255, 140, 0, 0.35);
}

.sidebar-header {
    padding: 20px 18px 16px;
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
}

.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 140, 0, 0.24);
    box-shadow: 0 10px 22px rgba(255, 140, 0, 0.14);
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
    letter-spacing: 0.2px;
}

.brand-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.35;
}

.icon-glass-btn,
.action-btn,
.mobile-menu-btn {
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border-radius: 14px;
    padding: 10px 14px;
    transition: var(--transition);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.icon-glass-btn:hover,
.action-btn:hover,
.mobile-menu-btn:hover {
    border-color: rgba(255, 140, 0, 0.34);
    background: rgba(255, 140, 0, 0.1);
    color: var(--orange-2);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(255, 140, 0, 0.08);
}

.search-box {
    position: relative;
    margin-bottom: 14px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-faint);
    font-size: 0.95rem;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    outline: none;
    border-radius: 18px;
    padding: 14px 16px 14px 44px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-main);
    transition: var(--transition);
}

.search-box input:focus {
    border-color: rgba(255, 140, 0, 0.34);
    box-shadow: 0 0 0 4px rgba(255, 140, 0, 0.08);
    background: rgba(255, 255, 255, 0.06);
}

.search-box input::placeholder {
    color: #bcc4d2;
}

.chat-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chat-filter {
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    border-radius: var(--radius-pill);
    padding: 9px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.chat-filter.active,
.chat-filter:hover {
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: #111;
    border-color: transparent;
    box-shadow: var(--shadow-orange);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px 18px;
    scroll-behavior: smooth;
}

.chat-list::-webkit-scrollbar,
.chat-body::-webkit-scrollbar,
.offcanvas-body::-webkit-scrollbar {
    width: 8px;
}

.chat-list::-webkit-scrollbar-thumb,
.chat-body::-webkit-scrollbar-thumb,
.offcanvas-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.11);
    border-radius: 999px;
}

.chat-list::-webkit-scrollbar-track,
.chat-body::-webkit-scrollbar-track,
.offcanvas-body::-webkit-scrollbar-track {
    background: transparent;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 20px;
    color: var(--text-main);
    transition: var(--transition);
    margin-bottom: 10px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.025);
}

.chat-item:hover,
.chat-item.active {
    background: linear-gradient(180deg, rgba(255, 140, 0, 0.12), rgba(255, 140, 0, 0.08));
    border-color: rgba(255, 140, 0, 0.22);
    transform: translateY(-1px);
}

.chat-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 18px;
    object-fit: cover;
    border: 1px solid rgba(255, 140, 0, 0.22);
    background: rgba(255, 255, 255, 0.04);
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.chat-name {
    font-size: 0.98rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    color: #c7ced9;
    font-size: 0.8rem;
    white-space: nowrap;
}

.chat-preview {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-meta {
    display: flex;
    flex-direction: column;
    align-items: end;
    gap: 8px;
}

.badge-unread {
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 10px 18px rgba(255, 140, 0, 0.22);
}

/* CHAT PANEL */
.chat-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    background: transparent;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.chat-header-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.chat-header-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid rgba(255, 140, 0, 0.28);
    background: rgba(255,255,255,0.05);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--orange);
    border: 2px solid #111;
    position: absolute;
    right: -1px;
    bottom: -1px;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.45);
}

.chat-header-name {
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-header-subtitle {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.action-btn {
    min-width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
}

/* CHAT BODY */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background:
        linear-gradient(rgba(6, 9, 14, 0.70), rgba(6, 9, 14, 0.78)),
        url('../../img/back.png') center center / cover no-repeat;
    background-attachment: scroll;
}

.day-divider {
    align-self: center;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 4px 0 2px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.message-row {
    display: flex;
    width: 100%;
}

.message-row.incoming {
    justify-content: flex-start;
}

.message-row.outgoing {
    justify-content: flex-end;
}

.message-bubble {
    max-width: min(72%, 760px);
    padding: 14px 16px 10px;
    border-radius: 20px;
    position: relative;
    box-shadow: var(--shadow-md);
    animation: fadeUp 0.22s ease;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.incoming .message-bubble {
    background: linear-gradient(180deg, #ffffff, #f5f7fb);
    color: #1d222c;
    border-top-left-radius: 8px;
}

.outgoing .message-bubble {
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: #181818;
    border-top-right-radius: 8px;
}

.sender-name {
    font-weight: 800;
    font-size: 0.92rem;
    margin-bottom: 6px;
    color: #915100;
}

.message-text {
    font-size: 0.98rem;
    line-height: 1.65;
    white-space: pre-line;
    word-break: break-word;
}

.message-time {
    display: block;
    text-align: right;
    margin-top: 8px;
    font-size: 0.78rem;
    opacity: 0.72;
}

/* REPLY */
.reply-box {
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
    position: sticky;
    bottom: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.reply-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 8px 10px;
    border-radius: 22px;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.reply-icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: var(--text-main);
    font-size: 1.1rem;
    transition: var(--transition);
}

.reply-icon-btn:hover {
    background: rgba(255, 140, 0, 0.12);
    color: var(--orange-2);
}

.reply-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-main);
    font-size: 0.98rem;
    padding: 8px 4px;
}

.reply-input::placeholder {
    color: #c3c7d1;
}

.send-btn {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: #111;
    font-size: 1.02rem;
    transition: var(--transition);
    box-shadow: 0 10px 24px rgba(255, 140, 0, 0.22);
}

.send-btn:hover {
    transform: scale(1.04);
    box-shadow: 0 0 20px rgba(255, 140, 0, 0.28);
}

/* FOOTER / UTILITIES */
.footer {
    background: transparent !important;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.mobile-menu-btn {
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mobile-only {
    display: none;
}

.desktop-only {
    display: inline-flex;
}

.offcanvas.offcanvas-start {
    width: 100%;
    background:
        linear-gradient(180deg, rgba(24, 28, 37, 0.99) 0%, rgba(13, 16, 22, 1) 100%);
    color: #fff;
    border-right: 1px solid var(--line);
}

.offcanvas-header {
    border-bottom: 1px solid var(--line);
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* RESPONSIVE */
@media (max-width: 1199.98px) {
    .message-bubble {
        max-width: 80%;
    }
}

@media (max-width: 991.98px) {
    body {
        overflow: hidden;
    }

    .app-shell {
        padding: 0;
    }

    .chat-layout {
        height: 100vh;
        border-radius: 0;
        border: 0;
        background:
            linear-gradient(rgba(9, 11, 16, 0.2), rgba(9, 11, 16, 0.2)),
            linear-gradient(180deg, #0c1017 0%, #0f141d 100%);
    }

    .sidebar {
        display: none;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .mobile-only {
        display: inline-flex;
    }

    .desktop-only {
        display: none;
    }

    .chat-header {
        padding: 12px 14px;
        gap: 10px;
    }

    .chat-header-left {
        gap: 10px;
    }

    .chat-header-avatar {
        width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .chat-header-name {
        font-size: 0.98rem;
    }

    .chat-header-subtitle {
        font-size: 0.8rem;
    }

    .chat-actions {
        gap: 6px;
    }

    .action-btn,
    .mobile-menu-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        padding: 0;
        border-radius: 12px;
    }

    .chat-body {
        padding: 16px 12px 14px;
        gap: 14px;
    }

    .message-bubble {
        max-width: 90%;
        padding: 12px 14px 9px;
        border-radius: 18px;
    }

    .sender-name {
        font-size: 0.86rem;
    }

    .message-text {
        font-size: 0.94rem;
    }

    .reply-box {
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    }

    .reply-wrap {
        gap: 6px;
        padding: 8px;
        min-height: 58px;
        border-radius: 18px;
    }

    .reply-icon-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .send-btn {
        width: 42px;
        height: 42px;
        min-width: 42px;
        border-radius: 13px;
    }
}

@media (max-width: 575.98px) {
    .chat-header-name {
        max-width: 120px;
    }

    .chat-header-subtitle {
        max-width: 130px;
    }

    .message-bubble {
        max-width: 94%;
    }

    .reply-wrap {
        display: grid;
        grid-template-columns: auto 1fr 42px;
        align-items: center;
        gap: 6px;
    }

    .reply-wrap .reply-icon-left {
        display: flex;
        align-items: center;
        gap: 4px;
        min-width: 84px;
    }

    .reply-wrap .reply-icon-left .reply-icon-btn {
        flex: 0 0 40px;
    }

    .reply-wrap .reply-input {
        width: 100%;
        min-width: 0;
    }

    .reply-wrap .reply-icon-right {
        display: none;
    }
}

.mobile-chat-drawer {
    border-right: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.mobile-drawer-header {
    padding: 18px 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mobile-brand {
    width: 100%;
}

.mobile-brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mobile-brand-text .offcanvas-title {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
}

.mobile-brand-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.mobile-search-wrap {
    padding-bottom: 14px;
    background: transparent;
}

.footer {
    position: relative;
    z-index: 2;
}

.footer p {
    letter-spacing: 0.2px;
}
.mobile-search-wrap {
    padding: 14px 14px 12px;
    background: transparent;
}

.mobile-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-search-row .search-box {
    flex: 1;
    margin: 0;
}

.mobile-search-row .search-box input {
    height: 48px;
    padding-right: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.08);
}

.mobile-search-row .search-box i {
    left: 15px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.mobile-add-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    padding: 0;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(14, 14, 14, 0.24);
    color: white;
    box-shadow: 0 10px 20px rgba(255,140,0,0.08);
}

.mobile-add-btn i {
    font-size: 1.15rem;
}

.mobile-add-btn:hover {
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: #111;
    border-color: transparent;
    transform: translateY(-1px);
}

@media (max-width: 575.98px) {
    .mobile-search-wrap {
        padding: 12px;
    }

    .mobile-search-row {
        gap: 8px;
    }

    .mobile-search-row .search-box input {
        height: 44px;
        font-size: 0.92rem;
        border-radius: 14px;
    }

    .mobile-add-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        border-radius: 14px;
    }
}

.chat-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    width: 220px;
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: none;
    animation: fadeMenu 0.2s ease;
    z-index: 100;
}

@keyframes fadeMenu {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-dropdown.active {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    font-size: 0.92rem;
    cursor: pointer;
    color: var(--text-soft);
    transition: var(--transition);
}

.dropdown-item i {
    font-size: 1rem;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--orange);
}

.dropdown-item.danger:hover {
    background: rgba(255, 93, 93, 0.12);
    color: var(--danger);
}


/* Responsive fixes for compact mobile chat layout */
.chat-panel,.sidebar{min-height:0}
.chat-header-left,.chat-info,.min-w-0{min-width:0}
.chat-header-name,.chat-preview,.chat-name{word-break:break-word}
.message-bubble{max-width:min(82vw,420px)}
.chat-body{overflow:auto}
.chat-compose,.chat-compose-form,.message-form{min-width:0}
@media (max-width: 991.98px){
  body{overflow:auto}
  .app-shell{padding:0;height:auto;min-height:100vh}
  .chat-layout{height:auto;min-height:100vh;border-radius:0}
  .sidebar{display:none !important}
  .chat-panel{width:100%;min-height:100vh}
  .chat-header{padding:14px;position:sticky;top:0;z-index:20;background:rgba(19,24,33,.96);backdrop-filter:blur(10px)}
  .chat-body{padding:14px 12px 90px}
  .message-bubble{max-width:88vw}
  .chat-compose,.chat-input-wrap{padding-bottom:max(12px, env(safe-area-inset-bottom))}
  .chat-dropdown{right:0;left:auto;max-width:calc(100vw - 24px)}
}


/* Mobile chat header and menu fixes */
.chat-header{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px}
.chat-header-left{min-width:0;overflow:hidden}
.chat-header-left .min-w-0{overflow:hidden}
.chat-header-name,.chat-header-subtitle{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-header-tools{display:flex;align-items:center;gap:8px}
.chat-actions{justify-self:end;position:relative;z-index:25}
.chat-dropdown{z-index:1300}
@media (max-width: 991.98px){
  .chat-header{grid-template-columns:minmax(0,1fr) auto !important;gap:8px !important;padding:10px 12px !important}
  .chat-header-tools{display:none !important}
  .chat-header-left{gap:10px;min-width:0}
  .chat-header-name{font-size:.98rem;max-width:100%}
  .chat-header-subtitle{font-size:.8rem;max-width:100%}
  .chat-actions{margin-left:0;justify-self:end}
  .chat-actions .action-btn{width:40px;height:40px;min-width:40px;padding:0}
  .chat-dropdown{position:fixed;top:72px;left:12px;right:12px;width:auto;max-width:none;max-height:calc(100vh - 88px);overflow-y:auto;border-radius:18px}
}
@media (max-width: 575.98px){
  .chat-header{padding:10px 10px 10px 8px !important}
  .chat-header-left{gap:8px}
  .chat-header-avatar{width:42px;height:42px;border-radius:14px}
  .mobile-menu-btn,.chat-actions .action-btn{width:40px;height:40px;min-width:40px}
  .chat-header-name{font-size:.94rem}
  .chat-header-subtitle{font-size:.76rem}
  .chat-dropdown{top:66px;left:10px;right:10px}
}

/* MOBILE LIVE CHAT FIX */
@media (max-width: 991.98px) {
  .chat-panel {
    position: relative;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
  .chat-panel .chat-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
  }
  .chat-panel .chat-body {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    bottom: 86px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .chat-panel .reply-box {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
  }
  .chat-panel .chat-dropdown {
    z-index: 1300;
  }
  .chat-panel .emoji-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 74px;
    z-index: 1300;
  }
}
@media (max-width: 575.98px) {
  .chat-panel .chat-body {
    top: 66px;
    bottom: 82px;
  }
}
