/* 🌟 HM Chat System - Modern, Responsive & High Performance */
.hm-chat {
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.hm-chat [hidden],
.hm-chat form[hidden],
.hm-chat .hc-start[hidden],
.hm-chat .hc-guest-start-form[hidden],
.hm-chat .hc-resume-form[hidden],
.hm-chat .hc-guest-resume-toggle[hidden],
.hc-start[hidden],
.hc-guest-start-form[hidden],
.hc-resume-form[hidden] {
    display: none !important;
}

/* Global Buttons & Form Controls */
.hm-chat button {
    cursor: pointer;
    border: 0;
    border-radius: 8px;
    padding: 8px 16px;
    background: #2563eb;
    color: white;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hm-chat button:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.hm-chat button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.hm-chat button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.hm-chat input,
.hm-chat select,
.hm-chat textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 12px;
    background: white;
    color: #1e293b;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hm-chat input:focus,
.hm-chat input:focus-visible,
.hm-chat select:focus,
.hm-chat select:focus-visible,
.hm-chat textarea:focus,
.hm-chat textarea:focus-visible {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Chat Page Wrapper inside card */
.chat-directory-wrapper {
    margin-bottom: 24px;
}

.chat-card-body {
    background: #ffffff;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

/* Floating Widget Styles */
.hm-chat-floating {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1040;
}

.hc-launch {
    border-radius: 30px !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    background: linear-gradient(135deg, #1e3a8a, #2563eb) !important;
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.35) !important;
}

.hc-launch:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(30, 58, 138, 0.45) !important;
}

.hc-launch .hc-unread {
    margin-left: 6px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
}

.hc-launch .hc-unread:empty {
    display: none;
}

/* Main Panel */
.hc-panel {
    padding: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
}

.hm-chat-floating .hc-panel {
    position: absolute;
    right: 0;
    bottom: 58px;
    width: 380px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 100px);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

/* Header */
.hm-chat-full .hc-header {
    display: none !important;
    /* Hide redundant inner header on full page view */
}

.hc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
}

.hc-header-info strong {
    font-size: 17px;
    font-weight: 700;
    display: block;
    line-height: 1.25;
}

.hc-header-info small {
    display: block;
    opacity: .9;
    font-size: 12px;
    margin-top: 2px;
}

.hm-chat .hc-close {
    background: rgba(255, 255, 255, 0.15) !important;
    font-size: 20px;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50% !important;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.hm-chat .hc-close:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* Admin Start & User Search Bar */
.hc-admin-start-area {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 18px;
}

.hc-search-user-wrapper {
    position: relative;
    width: 100%;
}

.hc-search-user-label {
    display: block;
    width: 100%;
    margin: 0;
}

.hc-search-title-text {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.hc-search-box-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.hc-search-icon {
    position: absolute;
    left: 12px;
    color: #64748b;
    font-size: 13px;
    pointer-events: none;
}

.hc-user-search-input {
    padding-left: 36px !important;
    padding-right: 32px !important;
    height: 40px !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    font-size: 13.5px !important;
    width: 100% !important;
    transition: all 0.2s ease !important;
}

.hc-user-search-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.hc-search-clear-btn {
    position: absolute;
    right: 8px;
    background: transparent !important;
    color: #94a3b8 !important;
    border: 0 !important;
    font-size: 18px !important;
    padding: 0 6px !important;
    cursor: pointer;
    line-height: 1;
}

.hc-search-clear-btn:hover {
    color: #334155 !important;
}

.hc-user-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 1060;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
    max-height: 240px;
    overflow-y: auto;
}

.hc-search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
    outline: none;
}

.hc-search-result-item:last-child {
    border-bottom: 0;
}

.hc-search-result-item:hover,
.hc-search-result-item:focus {
    background: #eff6ff;
    color: #1e40af;
}

.hc-search-item-name {
    flex: 1;
    font-weight: 600;
    font-size: 13.5px;
    color: #1e293b;
}

.hc-search-role-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
}

.hc-search-role-badge.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.hc-search-role-badge.badge-light {
    background: #f1f5f9;
    color: #475569;
}

/* Guest Start & Resume Area */
.hc-guest-entry-area {
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.hc-guest-start-fields {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.hc-guest-start-fields input {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    margin: 0;
    padding: 8px 12px;
    font-size: 13.5px;
}

.hc-start-chat-btn {
    flex: 0 0 auto;
    height: 38px;
    padding: 0 10px !important;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 8px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hc-start-chat-btn i {
    font-size: 13px;
}

.hc-guest-resume-toggle {
    margin-top: 10px;
    text-align: center;
}

.hc-toggle-resume-btn {
    background: transparent !important;
    color: #2563eb !important;
    border: none !important;
    padding: 4px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    text-decoration: underline;
    cursor: pointer;
}

.hc-toggle-resume-btn:hover {
    color: #1d4ed8 !important;
}

.hc-resume-form {
    padding: 0;
    background: transparent;
    border: none;
    margin: 0;
    box-shadow: none;
}

.hc-resume-label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #1e3a8a;
    margin-bottom: 6px;
}

.hc-resume-contact-input,
.hc-resume-form input {
    width: 100%;
    margin-top: 2px;
    margin-bottom: 8px;
    height: 38px;
    box-sizing: border-box;
}

.hc-resume-submit-btn {
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
}

.hc-resume-cancel-btn {
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
}

.hc-resume-cancel-btn:hover {
    background: #e2e8f0 !important;
}

/* Guest in-thread identity & Save modal button */
.hc-thread-header-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hc-guest-identity-badge {
    font-size: 11px;
    color: #475569;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 4px;
    line-height: 1.25;
}

.hc-chatting-as-text {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    color: #475569;
    font-size: 11px;
}

.hc-chatting-as-text strong {
    color: #0f172a;
    font-weight: 600;
    margin-left: 2px;
}

.hc-save-action-wrap {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.hc-v-sep {
    display: inline-block;
    color: #94a3b8;
    margin: 0 2px;
    font-weight: 300;
    font-size: 11px;
    line-height: 1;
    user-select: none;
}

.hc-save-chat-modal-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer;
    line-height: 1.3 !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Edit icon container: on icon only one hover */
.hc-save-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    color: #2563eb;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    transition: all 0.15s ease;
    cursor: pointer;
    font-size: 10.5px;
}

.hc-save-icon-wrap:hover {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #60a5fa;
    transform: scale(1.08);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* The icon uses its native title tooltip, without a second CSS tooltip. */

/* Text after icon: "add mobile or email to resume chat" */
.hc-save-btn-text {
    font-size: 11px;
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.hc-save-chat-modal-btn:hover .hc-save-btn-text {
    color: #1d4ed8;
}

/* Saved state */
.hc-save-chat-modal-btn.hc-saved .hc-save-icon-wrap {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #86efac;
}

.hc-save-chat-modal-btn.hc-saved .hc-save-icon-wrap:hover {
    background: #dcfce7;
    color: #15803d;
    border-color: #4ade80;
}

.hc-save-chat-modal-btn.hc-saved .hc-save-btn-text {
    color: #16a34a;
}

/* In-box Modal Overlay (positioned within the chat box) */
.hc-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: hcModalFadeIn 0.2s ease-out;
}

.hc-modal-overlay[hidden] {
    display: none !important;
}

@keyframes hcModalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.hc-modal-dialog {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 320px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: hcModalZoomIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hcModalZoomIn {
    from {
        transform: scale(0.94) translateY(6px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.hc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.hc-modal-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
}

.hc-modal-close {
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 22px !important;
    line-height: 1 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    cursor: pointer;
}

.hc-modal-close:hover {
    color: #1e293b !important;
    background: #e2e8f0 !important;
}

.hc-modal-body {
    padding: 16px;
}

.hc-modal-note {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 14px;
    line-height: 1.45;
}

.hc-form-group {
    margin-bottom: 12px;
}

.hc-modal-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.hc-modal-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.hc-modal-input-wrap input {
    height: 36px !important;
    font-size: 13px !important;
}

.hc-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.hc-modal-cancel-btn {
    flex: 1;
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    padding: 8px 12px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
}

.hc-modal-cancel-btn:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

.hc-modal-submit-btn {
    flex: 1.5;
    padding: 8px 14px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
}

/* ==========================================================================
   Leave Chat Confirmation Modal - Premium Design
   ========================================================================== */
.hc-leave-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: hcLeaveFadeIn 0.2s ease-out;
}

.hc-leave-modal-overlay[hidden] {
    display: none !important;
}

@keyframes hcLeaveFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.hc-leave-modal-dialog {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(226, 232, 240, 0.9);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: hcLeaveZoomIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
}

@keyframes hcLeaveZoomIn {
    from {
        transform: scale(0.92) translateY(6px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.hc-leave-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(180deg, #fff5f5 0%, #ffffff 100%);
}

.hc-leave-header-lead {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hc-leave-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fee2e2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.15);
}

.hc-leave-header-text {
    display: flex;
    flex-direction: column;
}

.hc-leave-modal-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
}

.hc-leave-modal-subtitle {
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
    line-height: 1.2;
}

.hc-leave-modal-close {
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 22px !important;
    line-height: 1 !important;
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.15s ease !important;
    box-shadow: none !important;
}

.hc-leave-modal-close:hover {
    color: #1e293b !important;
    background: #f1f5f9 !important;
}

.hc-leave-modal-body {
    padding: 14px 16px 12px;
}

.hc-leave-confirm-text {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px;
    line-height: 1.4;
}

.hc-leave-resume-hint {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 9px 11px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #166534;
    line-height: 1.4;
}

.hc-leave-hint-icon {
    color: #16a34a;
    font-size: 13px;
    margin-top: 2px;
    flex-shrink: 0;
}

.hc-leave-modal-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px 14px;
    background: #fafafa;
    border-top: 1px solid #f1f5f9;
}

.hc-leave-cancel-btn {
    flex: 1;
    height: 36px !important;
    padding: 0 12px !important;
    background: #ffffff !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.hc-leave-cancel-btn:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-color: #94a3b8 !important;
}

.hc-leave-confirm-btn {
    flex: 1.2;
    height: 36px !important;
    padding: 0 12px !important;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3) !important;
}

.hc-leave-confirm-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    box-shadow: 0 5px 14px rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-1px);
}

.hc-leave-confirm-btn:active {
    transform: translateY(0);
}

/* Save Toast */
.hc-save-toast {
    position: absolute;
    top: 50px;
    left: 14px;
    right: 14px;
    background: #0f172a;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 60;
    animation: hcToastSlide 0.25s ease-out;
}

.hc-save-toast[hidden] {
    display: none !important;
}

@keyframes hcToastSlide {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Start Bar (Legacy / Form fallback) */
.hc-start {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    padding: 0;
    background: transparent;
}

/* Admin Access Details */
.hc-access {
    padding: 10px 18px;
    border-bottom: 1px solid #e2e8f0;
    background: #f1f5f9;
    font-size: 13px;
}

.hc-access summary {
    cursor: pointer;
    font-weight: 700;
    color: #1e3a8a;
    outline: none;
}

.hc-access p {
    margin: 6px 0 10px;
    color: #64748b;
    font-size: 12px;
}

.hc-responders {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    max-height: 150px;
    overflow-y: auto;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.hc-responder-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #334155;
    margin: 0;
    cursor: pointer;
}

.hc-responder-label input {
    width: auto !important;
    cursor: pointer;
}

/* Workspace (Inbox + Thread) */
.hc-workspace {
    display: flex;
    min-height: 480px;
    height: calc(100vh - 310px);
    max-height: 720px;
}

.hm-chat-floating .hc-workspace {
    min-height: 320px;
    height: 380px;
    max-height: 420px;
}

/* Inbox Sidebar */
.hc-inbox {
    width: 280px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid #e2e8f0;
    padding: 10px;
    background: #f8fafc;
}

.hm-chat-floating .hc-inbox {
    width: 140px;
    padding: 6px;
}

.hm-chat .hc-inbox button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
    margin-bottom: 6px;
    background: #ffffff;
    color: #334155;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    box-shadow: none;
    transition: all 0.15s ease;
}

.hm-chat .hc-inbox button:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: none;
}

.hm-chat .hc-inbox button.hc-selected {
    background: #eff6ff !important;
    color: #1e40af !important;
    border-color: #93c5fd !important;
    font-weight: 700;
    border-left: 4px solid #2563eb !important;
}

.hc-inbox-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hc-inbox-badge {
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 12px;
    margin-left: 8px;
    flex-shrink: 0;
}

/* Thread Area */
.hc-thread {
    position: relative;
    overflow: hidden;
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.hc-thread-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

.hc-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0 !important;
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
}

.hc-back-btn:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

.hc-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    padding: 0;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: none;
    letter-spacing: normal;
}

/* Messages Stream */
.hc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hm-chat-floating .hc-messages {
    height: 250px;
}

.hm-chat .hc-older {
    align-self: center;
    margin: 0 auto 12px;
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.hm-chat .hc-older:hover {
    background: #f8fafc;
    color: #1e293b;
    border-color: #94a3b8;
}

/* Message Bubble */
.hc-bubble {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px 14px 14px 2px;
    padding: 10px 14px;
    width: fit-content;
    max-width: 80%;
    margin: 0 auto 0 0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 13.5px;
    line-height: 1.45;
    color: #1e293b;
}

.hc-bubble.hc-mine {
    background: #dcf8c6;
    border-color: #c7ebae;
    margin-left: auto;
    margin-right: 0;
    border-radius: 14px 14px 2px 14px;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.1);
}

.hc-bubble-text {
    word-break: break-word;
}

.hc-bubble small {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    font-size: 10.5px;
    color: #64748b;
    margin-top: 5px;
}

.hc-time {
    display: inline-block;
}

/* Seen / Sent Double Tick & Single Tick */
.hc-seen {
    color: #0284c7 !important;
    font-weight: 800 !important;
    letter-spacing: -1px;
    font-size: 12px;
}

.hc-sent {
    color: #94a3b8 !important;
    font-weight: 600;
    letter-spacing: -1px;
    font-size: 12px;
}

/* Compose Box */
.hc-compose {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
}

.hc-compose label {
    flex: 1;
    margin: 0;
    font-size: 0;
}

.hm-chat .hc-compose textarea {
    font-size: 13.5px;
    line-height: 1.4;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    padding: 8px 12px;
    border-radius: 10px;
}

.hc-compose button {
    height: 40px;
    padding: 0 18px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* Footer Meta */
.hc-thread-footer-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px 8px;
    background: #ffffff;
}

.hc-have-account-btn {
    display: inline-flex !important;
    align-items: center !important;
    background: transparent !important;
    border: none !important;
    color: #2563eb !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    padding: 2px 6px !important;
    cursor: pointer !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    line-height: 1 !important;
    box-shadow: none !important;
    transform: none !important;
    transition: color 0.15s ease, background 0.15s ease;
}

.hc-have-account-btn:hover {
    color: #1d4ed8 !important;
    background: #eff6ff !important;
    border-radius: 4px;
}

.hc-receipt-help {
    display: inline-block;
    color: #64748b;
    font-size: 11px;
}

.hc-receipt-help span {
    color: #0284c7;
    font-weight: 800;
}

.hc-hint-help {
    font-size: 11px;
    color: #94a3b8;
}

/* Alerts & Empty states */
.hc-error {
    margin: 10px 16px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 13px;
}

.hc-empty {
    color: #64748b;
    text-align: center;
    margin: auto;
    padding: 24px;
    font-size: 13.5px;
}

/* Custom Scrollbars */
.hc-messages::-webkit-scrollbar,
.hc-inbox::-webkit-scrollbar,
.hc-responders::-webkit-scrollbar {
    width: 6px;
}

.hc-messages::-webkit-scrollbar-track,
.hc-inbox::-webkit-scrollbar-track,
.hc-responders::-webkit-scrollbar-track {
    background: transparent;
}

.hc-messages::-webkit-scrollbar-thumb,
.hc-inbox::-webkit-scrollbar-thumb,
.hc-responders::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.hc-messages::-webkit-scrollbar-thumb:hover,
.hc-inbox::-webkit-scrollbar-thumb:hover,
.hc-responders::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   Responsive Breakpoints: Desktop, Tablet / Mini-Tab, and Mobile Phones
   ========================================================================== */

/* 💻 Medium Desktops & Mini Tab Landscape (992px to 1199px) */
@media (max-width: 1199.98px) {
    .hc-inbox {
        width: 250px;
    }
}

/* 📱 Tablets & Mini Tab Portrait (768px to 991.98px) */
@media (max-width: 991.98px) {
    .hc-inbox {
        width: 220px;
    }

    .hc-bubble {
        max-width: 85%;
    }

    .hc-workspace {
        min-height: 440px;
        height: calc(100vh - 300px);
    }
}

/* 📲 Mobile Phones & Small Tablets (< 768px) */
@media (max-width: 767.98px) {
    .hc-workspace {
        position: relative;
        min-height: 450px;
        height: calc(100vh - 270px);
    }

    /* By default on mobile, show inbox full width and hide thread */
    .hc-inbox {
        width: 100%;
        height: 100%;
        max-height: none;
        border-right: 0;
        display: block;
    }

    .hc-thread {
        display: none;
        width: 100%;
        height: 100%;
    }

    /* When conversation is selected on mobile, switch view to thread */
    .hc-workspace.hc-thread-open .hc-inbox {
        display: none !important;
    }

    .hc-workspace.hc-thread-open .hc-thread {
        display: flex !important;
    }

    .hc-workspace.hc-thread-open .hc-back-btn {
        display: inline-flex !important;
    }

    .hc-start {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .hc-start button {
        width: 100%;
    }

    /* Floating widget for mobile */
    .hm-chat-floating {
        right: 12px;
        bottom: 12px;
        left: 12px;
    }

    .hm-chat-floating .hc-launch {
        position: fixed;
        right: 16px;
        bottom: 16px;
    }

    .hm-chat-floating .hc-panel {
        position: fixed;
        right: 10px;
        left: 10px;
        bottom: 68px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 90px);
    }

    .hm-chat-floating .hc-workspace {
        min-height: 320px;
        height: calc(100vh - 220px);
    }

    .hc-bubble {
        max-width: 90%;
        font-size: 13px;
    }
}

/* 📱 Extra Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
    .hc-header {
        padding: 10px 14px;
    }

    .hc-header-info strong {
        font-size: 15px;
    }

    .hc-messages {
        padding: 10px;
    }

    .hc-bubble {
        max-width: 94%;
        padding: 8px 11px;
    }

    .hc-compose {
        padding: 8px 10px;
        gap: 6px;
    }

    .hc-compose button {
        padding: 0 12px;
        font-size: 12.5px;
    }

    .hc-thread-footer-meta {
        padding: 0 10px 6px;
    }
}

/* =========================================================
   Admin Panel Header Toolbar & Dropdowns
   ========================================================= */
.hc-header-toolbar {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.hc-header-subtitle-text {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.hc-header-v-sep {
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 300;
    margin: 0 2px;
    user-select: none;
}

/* Header Dropdown Containers */
.hc-header-dropdown {
    position: relative;
    display: inline-block;
}

.hc-header-dropdown-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 500;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
    white-space: nowrap;
}

.hc-header-dropdown-btn:hover,
.hc-header-dropdown.hc-open .hc-header-dropdown-btn {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1);
}

.hc-header-dropdown-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.hc-dropdown-caret {
    font-size: 10px;
    transition: transform 0.15s ease;
}

.hc-header-dropdown.hc-open .hc-dropdown-caret {
    transform: rotate(180deg);
}

/* Dropdown Menu Box */
.hc-header-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1060;
    width: 320px;
    max-width: 90vw;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.15), 0 4px 12px -2px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: hcDropdownFade 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.hc-header-dropdown-menu[hidden] {
    display: none !important;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Box inside dropdowns */
.hc-dropdown-search-wrap {
    position: relative;
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.hc-dropdown-search-wrap .hc-head-search-input {
    width: 100%;
    padding: 6px 26px 6px 30px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #1e293b;
    outline: none;
    transition: all 0.15s ease;
}

.hc-dropdown-search-wrap .hc-head-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.hc-dropdown-search-wrap .hc-dropdown-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 11px;
    pointer-events: none;
}

.hc-dropdown-search-wrap .hc-dropdown-search-clear {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

/* User List inside PM Dropdown */
.hc-dropdown-user-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 4px 0;
}

.hc-dropdown-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 12px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.hc-dropdown-user-item:hover,
.hc-dropdown-user-item:focus {
    background: #eff6ff;
    outline: none;
}

.hc-dropdown-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.hc-dropdown-user-name {
    font-size: 12.5px;
    font-weight: 500;
    color: #1e293b;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hc-dropdown-user-role {
    font-size: 10.5px;
    padding: 2px 7px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

/* Guest Support Access Dropdown */
.hc-access-dropdown-header {
    background: #f8fafc;
}

.hc-access-dropdown-desc {
    font-size: 11px;
    color: #64748b;
    padding: 6px 12px 6px;
    line-height: 1.35;
    border-bottom: 1px solid #f1f5f9;
}

.hc-access-roles-container {
    max-height: 280px;
    overflow-y: auto;
    padding: 6px 10px;
}

.hc-access-role-group {
    margin-bottom: 8px;
}

.hc-access-role-heading {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    padding: 4px 8px;
    background: #f1f5f9;
    border-radius: 4px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
}

.hc-access-role-users {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hc-access-user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 0;
    user-select: none;
    transition: background 0.12s ease;
}

.hc-access-user-row:hover {
    background: #f8fafc;
}

.hc-access-user-row input[type="checkbox"] {
    cursor: pointer;
    accent-color: #2563eb;
    width: 14px;
    height: 14px;
    margin: 0;
}

.hc-access-user-name {
    font-size: 12px;
    color: #1e293b;
    font-weight: 500;
}

.hc-access-dropdown-footer {
    padding: 8px 12px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.hc-access-save-btn {
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 500;
}

.hc-access-save-msg {
    font-size: 11.5px;
    font-weight: 600;
}

/* Hide duplicate in-widget admin start area when header toolbar is in DOM */
body:has(.hc-header-toolbar) .hm-chat-full .hc-admin-start-area {
    display: none !important;
}

/* Responsive adjustments for toolbar on mobile */
@media (max-width: 768px) {
    .hc-header-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .hc-header-v-sep {
        display: none;
    }

    .hc-header-dropdown-menu {
        left: 0;
        right: auto;
        width: 290px;
    }
}

/* Keep conversation navigation and the composer inside the chat panel. */
.hm-chat .hc-workspace {
    flex-direction: row;
    min-width: 0;
    overflow: hidden;
}

.hc-inbox-pane {
    display: flex;
    flex-direction: column;
    width: 280px;
    min-width: 0;
    min-height: 0;
    flex: 0 0 auto;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
}

.hm-chat-floating .hc-inbox-pane {
    width: 140px;
}

.hc-conversation-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    color: #64748b;
}

.hc-conversation-search input {
    min-width: 0;
}

.hm-chat .hc-conversation-search input:focus,
.hm-chat .hc-emoji-picker input:focus,
.hm-chat .hc-emoji-picker select:focus {
    outline: none;
    box-shadow: none;
    border-color: #0d9488;
}

.hm-chat .hc-reset-conversations {
    flex-shrink: 0;
    padding: 0;
    width: 24px;
    height: 28px;
    background: transparent;
    color: #64748b;
    font-size: 20px;
}

.hm-chat .hc-inbox {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-height: 0;
    flex: 1;
    height: auto;
    max-height: none;
    box-sizing: border-box;
    overflow: auto;
    border: 0;
    scrollbar-width: thin;
}

.hm-chat .hc-inbox button {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    margin: 0;
}

.hc-inbox::-webkit-scrollbar {
    height: 7px;
}

.hm-chat .hc-thread {
    min-height: 0;
    width: 100%;
}

.hm-chat .hc-messages {
    min-height: 0;
}

.hm-chat .hc-compose {
    position: relative;
    align-items: center;
    flex-shrink: 0;
    gap: 6px;
    padding: 10px;
}

.hm-chat:not(.hc-staff-chat) .hc-compose {
    padding-bottom: 2px;
}

.hm-chat .hc-compose label {
    min-width: 0;
}

.hm-chat .hc-compose input[name="body"] {
    box-sizing: border-box;
    height: 40px;
    min-height: 40px;
    margin: 0;
}

.hm-chat .hc-compose input[name="body"]:focus {
    outline: none;
    box-shadow: none;
    border-color: #2563eb;
}

.hm-chat .hc-compose .hc-emoji-toggle,
.hm-chat .hc-compose .hc-attach {
    width: 34px;
    padding: 0;
    background: #f1f5f9;
    color: #475569;
    font-size: 19px;
}

.hc-emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 330px;
    max-width: calc(100% - 20px);
    box-sizing: border-box;
    padding: 12px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    box-shadow: 0 12px 36px #16304b26;
}

.hc-emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
    grid-auto-rows: 38px;
    min-height: 0;
    max-height: min(200px, 25dvh);
    overflow-y: auto;
    overflow-x: hidden;
    gap: 2px;
    align-content: start;
    scrollbar-gutter: stable;
}

.hc-emoji-picker>input,
.hc-emoji-picker>select {
    flex-shrink: 0;
    box-sizing: border-box;
}

.hm-chat-floating .hc-emoji-grid {
    max-height: 100px;
}

.hm-chat .hc-emoji-picker button {
    padding: 2px;
    min-width: 0;
    width: 100%;
    height: 36px;
    color: #1e293b;
    background: white;
    font-size: 23px;
    line-height: 1;
    overflow: hidden;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}

.hm-chat .hc-emoji-picker button:hover {
    background: #e0f2fe;
    box-shadow: none;
}

.hc-file-selection {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 10px;
    padding: 8px 12px;
    margin: 0 10px 8px;
    overflow-x: auto;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 10px;
}

.hc-file-selection>* {
    flex-shrink: 0;
}

.hc-local-preview {
    width: 64px;
    height: 52px;
    object-fit: cover;
    border-radius: 6px;
}

.hc-file-selection span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.hc-attachment {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    white-space: normal;
    padding: 10px;
    margin-top: 4px;
    border-radius: 10px;
    background: #ffffffa6;
    border: 1px solid #dbe5ec;
    max-width: 280px;
}

.hc-image-link {
    display: block;
    width: 100%;
}

.hc-image-preview {
    display: block;
    width: 260px;
    max-width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 8px;
}

.hc-document-icon {
    font-size: 30px;
    color: #0f766e;
    padding: 6px 0;
}

.hc-bubble .hc-file-details {
    width: 100%;
    justify-content: flex-start;
    margin: 0;
    color: #64748b;
}

.hc-attachment span {
    width: 100%;
    font-weight: 600;
}

.hc-attachment a {
    color: #1d4ed8;
    text-decoration: underline;
}

.hc-bubble .hc-file-details {
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.hc-file-details .hc-file-divider {
    width: auto;
    color: #94a3b8;
    font-weight: 400;
}

.hc-file-details a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    color: #0f766e;
    font-size: 14px;
    text-decoration: none;
}

.hc-file-details a:hover {
    background: #ccfbf1;
    border-radius: 6px;
}

.hm-chat .hc-gallery {
    position: absolute;
    inset: 0;
    z-index: 130;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    padding: 10px;
    overflow: hidden;
    background: #122b35;
    color: #fff;
}

.hc-gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hm-chat .hc-gallery button {
    background: #ffffff1f;
    color: #fff;
    padding: 6px 12px;
}

.hc-gallery-toolbar {
    flex-shrink: 0;
    gap: 10px;
}

.hc-gallery-count {
    flex: 1;
}

.hc-gallery-download {
    color: #fff;
    padding: 8px;
}

.hc-gallery-stage {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 6px;
    min-width: 0;
    min-height: 0;
    margin: 8px 0;
}

.hc-gallery-content {
    flex: 1;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: auto;
}

.hc-gallery-image {
    display: block;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hc-gallery-document {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 0;
    background: white;
}

.hc-gallery-content>small {
    font-size: 11px;
    padding: 4px;
}

.hc-gallery-text {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 12px;
    background: #fff;
    color: #1e293b;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 14px/1.6 sans-serif;
}

.hc-gallery-thumbs {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 0;
}

.hm-chat .hc-gallery-thumbs button {
    padding: 3px;
    flex: 0 0 64px;
    border: 2px solid transparent;
}

.hm-chat .hc-gallery-thumbs button[aria-current="true"] {
    border-color: #5eead4;
}

.hc-gallery-thumbs img {
    width: 54px;
    height: 48px;
    object-fit: cover;
    display: block;
}

.hc-photo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    width: 360px;
    max-width: 100%;
    white-space: normal;
}

.hm-chat .hc-photo-tile {
    display: block;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
}

.hc-photo-tile .hc-image-link {
    position: relative;
    height: 130px;
}

.hc-photo-tile .hc-image-preview {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
}

.hc-photo-tile .hc-file-details {
    padding: 4px;
    box-sizing: border-box;
    gap: 4px;
    font-size: 10px;
}

.hc-photo-tile .hc-photo-more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #0f172a99;
    font-size: 28px;
    font-weight: 700;
}

@media (max-width: 480px) {
    .hc-photo-tile .hc-image-link {
        height: 95px;
    }

    .hm-chat .hc-gallery {
        padding: 6px;
    }

    .hm-chat .hc-gallery-stage>button {
        padding: 6px;
    }

    .hc-gallery-thumbs img {
        height: 36px;
    }
}

.hm-chat .hc-have-account-btn {
    align-self: flex-start;
    text-align: left;
    justify-content: flex-start;
    line-height: 1.5 !important;
    padding: 2px 0 !important;
    margin: 0 10px 6px 50px;
}

.hm-chat:has(.hc-emoji-toggle[hidden]) .hc-have-account-btn {
    margin-left: 10px;
}

.hc-guest-header-row {
    display: grid;
    grid-template-columns: minmax(60px, 1fr) minmax(0, 1.5fr);
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
}

.hc-guest-header-row .hc-title {
    grid-column: 1;
    grid-row: 1;
    white-space: normal;
    overflow-wrap: anywhere;
}

.hc-guest-header-row .hc-peer-status {
    grid-column: 1;
    grid-row: 2;
}

.hc-guest-header-row .hc-support-typing {
    grid-column: 1;
    grid-row: 3;
}

.hc-guest-header-row .hc-guest-identity-badge {
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: stretch;
    display: flex;
    align-items: center;
    min-width: 0;
    border-left: 1px solid #cbd5e1;
    padding-left: 10px;
}

.hc-guest-header-row .hc-save-action-wrap {
    min-width: 0;
    width: 100%;
}

.hc-guest-header-row .hc-save-chat-modal-btn {
    min-width: 0;
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    white-space: normal;
}

.hc-guest-header-row .hc-save-icon-wrap {
    flex: 0 0 20px;
    box-sizing: border-box;
}

.hc-guest-header-row .hc-save-btn-text {
    display: block;
    flex: 1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .hm-chat .hc-have-account-btn {
        margin-left: 46px;
    }

    .hm-chat:has(.hc-emoji-toggle[hidden]) .hc-have-account-btn {
        margin-left: 8px;
    }
}

@media (max-width: 359px) {
    .hm-chat .hc-have-account-btn {
        margin-left: 40px;
    }
}

.hc-thread-footer-meta {
    flex-wrap: wrap;
    gap: 6px;
}

/* Staff workspace: navy navigation, teal accents, and soft message surfaces. */
.hc-staff-chat .hc-panel {
    border-color: #d8e4ed;
    border-radius: 16px;
    box-shadow: 0 8px 30px #16304b12;
}

.hc-staff-chat .hc-inbox-pane {
    background: #f1f5f9;
    border-color: #dbe5ee;
}

.hc-staff-chat .hc-conversation-search {
    background: #edf6f5;
    padding: 7px 10px;
    border-bottom: 1px solid #dbe5ee;
}

.hc-staff-chat .hc-conversation-search input {
    height: 34px;
    padding: 6px 9px;
}

.hc-staff-chat .hc-inbox {
    background: transparent;
    padding: 12px;
}

.hc-staff-chat .hc-inbox button {
    border-radius: 10px;
    padding: 13px 12px;
    border-color: #e2e8f0;
    background: #fff;
    color: #334155;
}

.hc-staff-chat .hc-inbox button.hc-selected {
    background: #e0f2f1 !important;
    color: #115e59 !important;
    border-color: #99d8d2 !important;
    border-left-color: #0d9488 !important;
}

.hc-staff-chat .hc-thread-bar {
    min-height: 48px;
    padding: 7px 12px;
    box-sizing: border-box;
    background: linear-gradient(110deg, #0f766e, #168b83);
    border: 0;
}

.hc-staff-chat .hc-title {
    color: #f8fafc;
}

.hc-avatar {
    position: relative;
    display: inline-flex;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    background: #dbeafe;
    color: #376593;
    vertical-align: middle;
}

.hc-avatar svg {
    width: 100%;
    height: 100%;
}

.hc-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #dbeafe;
}

.hc-avatar-guest {
    background: #fef3c7;
    color: #a16207;
}

.hc-thread-avatar {
    flex-shrink: 0;
    line-height: 0;
}

.hc-thread-avatar .hc-avatar {
    width: 32px;
    height: 32px;
}

.hm-chat .hc-inbox button {
    gap: 9px;
}

.hc-list-status {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.2;
}

.hc-list-status::before,
.hc-peer-status::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 5px;
    border-radius: 50%;
    background: #94a3b8;
    vertical-align: middle;
}

.hc-list-status.hc-is-online {
    color: #0f766e;
}

.hc-is-online::before {
    background: #22c55e;
}

.hc-peer-status {
    display: block;
    font-size: 11px;
    line-height: 1.2;
    color: #64748b;
    font-weight: 400;
}

.hc-staff-chat .hc-peer-status {
    color: #e2f6f2;
}

.hc-support-typing {
    font-size: 11px;
    color: #0f766e;
    font-style: italic;
}

.hc-guest-settings {
    padding: 9px 14px;
    background: #f0f7f6;
    border-bottom: 1px solid #dbe5ee;
}

.hc-guest-settings summary {
    cursor: pointer;
    font-weight: 600;
    color: #115e59;
}

.hc-guest-settings-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
}

.hc-guest-settings-form label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.hm-chat .hc-guest-settings-form input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #0f766e;
}

.hc-settings-feedback {
    color: #115e59;
}

.hc-is-typing {
    font-style: italic;
}

.hc-is-typing::before {
    animation: hcTypingPulse 1s ease-in-out infinite;
}

@keyframes hcTypingPulse {
    50% {
        opacity: .35;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hc-is-typing::before {
        animation: none;
    }
}

.hc-search-result-item .hc-avatar,
.hc-dropdown-user-item .hc-avatar {
    margin-right: 6px;
}

.hc-access-user-row .hc-avatar {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
}

.hc-staff-chat .hc-thread-title-info {
    min-width: 0;
}

.hc-staff-chat .hc-messages {
    background-color: #f2f7f8;
    background-image: radial-gradient(#cddde366 0.8px, transparent 0.8px);
    background-size: 18px 18px;
    padding: 20px;
    gap: 14px;
}

.hc-staff-chat .hc-bubble {
    border-color: #e2e8f0;
    box-shadow: 0 2px 6px #16304b08;
}

.hc-staff-chat .hc-bubble.hc-mine {
    background: #d9f2eb;
    border-color: #bce4d8;
    color: #173c36;
}

.hc-staff-chat .hc-compose {
    padding: 14px 12px 10px;
    border-color: #dfe8ed;
}

.hc-staff-chat .hc-compose button[type="submit"] {
    background: #0f766e;
}

.hc-staff-chat .hc-compose button[type="submit"]:hover {
    background: #115e59;
}

.hc-staff-chat .hc-compose input[name="body"] {
    background: #f8fafc;
    border-color: #cbdbe3;
}

.hc-staff-chat .hc-compose input[name="body"]:focus {
    border-color: #0d9488;
}

.hc-staff-chat .hc-compose .hc-emoji-toggle,
.hc-staff-chat .hc-compose .hc-attach {
    color: #0f766e;
    background: #edf7f5;
}

.hc-staff-chat .hc-thread-footer-meta {
    padding-bottom: 10px;
}

@media (max-width: 767.98px) {
    .hm-chat .hc-inbox-pane {
        width: 100%;
    }

    .hm-chat .hc-workspace.hc-thread-open .hc-inbox-pane {
        display: none;
    }
}

/* Constrain each flex child so narrow screens never widen the chat panel. */
.hm-chat,
.hm-chat .hc-panel,
.hm-chat .hc-thread-bar {
    min-width: 0;
}

.hm-chat .hc-bubble,
.hm-chat .hc-attachment {
    box-sizing: border-box;
    min-width: 0;
}

.hm-chat .hc-thread-title-info {
    min-width: 0;
    flex: 1;
}

.hm-chat .hc-inbox-title {
    white-space: normal;
    overflow-wrap: anywhere;
}

.hm-chat .hc-compose label {
    display: block;
}

.hm-chat .hc-compose input[name="body"] {
    display: block;
}

.hm-chat-floating .hc-workspace {
    min-height: 0;
    height: min(420px, calc(100dvh - 180px));
}

.hm-chat-floating .hc-panel {
    max-height: calc(100dvh - 90px);
}

.hm-chat-floating .hc-inbox-pane {
    width: 100%;
}

.hm-chat-floating.hc-staff-chat .hc-thread {
    display: none;
}

.hm-chat-floating .hc-workspace.hc-thread-open .hc-inbox-pane {
    display: none;
}

.hm-chat-floating .hc-workspace.hc-thread-open .hc-thread {
    display: flex;
}

.hm-chat-floating .hc-workspace.hc-thread-open .hc-back-btn {
    display: inline-flex;
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hm-chat-full .hc-inbox-pane {
        width: 230px;
    }
}

@media (max-width: 767.98px) {
    .hm-chat-full .hc-workspace {
        min-height: 320px;
        height: calc(100dvh - 200px);
        max-height: 800px;
    }

    .hm-chat .hc-compose {
        padding: 8px;
        gap: 4px;
    }

    .hm-chat .hc-compose button[type="submit"] {
        padding: 0 10px;
    }

    .hm-chat .hc-messages {
        padding: 10px;
    }

    .hm-chat .hc-title {
        font-size: 13px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .hm-chat .hc-compose input,
    .hm-chat .hc-conversation-search input,
    .hm-chat .hc-emoji-picker input,
    .hm-chat .hc-emoji-picker select {
        font-size: 16px;
    }

    .hc-header-dropdown-menu {
        max-width: calc(100vw - 40px);
    }
}

@media (max-width: 359px) {

    .hm-chat .hc-compose .hc-emoji-toggle,
    .hm-chat .hc-compose .hc-attach {
        width: 28px;
    }

    .hm-chat .hc-compose input[name="body"] {
        padding: 8px 6px;
        font-size: 14px;
    }

    .hm-chat .hc-compose button[type="submit"] {
        padding: 0 7px;
        font-size: 12px;
    }
}

@media (max-height: 500px) {
    .hm-chat-floating .hc-panel {
        bottom: 12px;
        max-height: calc(100dvh - 24px);
    }

    .hm-chat-floating .hc-workspace {
        height: calc(100dvh - 100px);
    }

    .hm-chat .hc-emoji-picker {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        padding: 8px;
    }

    .hm-chat .hc-emoji-picker input,
    .hm-chat .hc-emoji-picker select {
        min-width: 0;
    }

    .hm-chat .hc-emoji-grid {
        grid-column: 1 / -1;
    }
}

/* Leave chat button in footer */
.hc-leave-chat-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s ease;
    line-height: 1;
}

.hc-leave-chat-btn:hover {
    color: #dc2626;
    text-decoration: underline;
}

/* Leave chat confirmation modal overlay */
.hc-leave-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: hcModalFadeIn 0.2s ease-out;
}

.hc-leave-modal-overlay[hidden] {
    display: none !important;
}

.hc-leave-modal-dialog {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 310px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: hcModalZoomIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.hc-leave-modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hc-leave-modal-title {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
}

.hc-leave-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 4px;
}

.hc-leave-modal-close:hover {
    color: #0f172a;
}

.hc-leave-modal-body {
    padding: 16px;
    font-size: 13px;
    color: #334155;
}

.hc-leave-confirm-text {
    font-weight: 600;
    color: #1e293b;
}

.hc-leave-modal-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}