@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #24a1de;
    --primary-hover: #1e87bb;
    --primary-light: #45b3e6;
    --primary-subtle: #e8f5fd;
    --secondary: #f37021;
    --secondary-hover: #db5e12;
    --secondary-subtle: #fff7ed;

    --bg-app: #f4f6fa;
    --surface: #ffffff;
    --surface-secondary: #f1f5f9;
    --surface-hover: #f8fafc;
    --surface-active: #e2e8f0;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-on-primary: #ffffff;

    --border: #e2e8f0;
    --border-subtle: #f1f5f9;

    --bubble-outgoing: #e1f3fc;
    --bubble-outgoing-text: #0f172a;
    --bubble-incoming: #ffffff;
    --bubble-incoming-text: #0f172a;

    --whatsapp-green: #24a1de;
    --whatsapp-green-hover: #1e87bb;
    --status-online: #34b7f1;
    --status-offline: #94a3b8;
    --status-read: #34b7f1;
    --status-delivered: #94a3b8;

    /* WhatsApp Mobile Style Header Variables */
    --whatsapp-header-bg: #24a1de;
    --whatsapp-header-text: #ffffff;
    --whatsapp-header-sub: #d0f0ff;
    --whatsapp-header-icon: #ffffff;

    --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --header-height: 60px;
    --composer-height: 64px;
}

[data-theme="dark"] {
    --primary: #2ab3f2;
    --primary-hover: #24a1de;
    --primary-light: #52c3f5;
    --primary-subtle: rgba(36, 161, 222, 0.15);

    --bg-app: #0e1621;
    --surface: #182533;
    --surface-secondary: #202b36;
    --surface-hover: #2b394a;
    --surface-active: #2b5278;

    --text-primary: #f5f6f7;
    --text-secondary: #7f91a4;
    --text-muted: #536577;

    --border: #101921;
    --border-subtle: #0f1620;

    --bubble-outgoing: #2b5278;
    --bubble-outgoing-text: #f5f6f7;
    --bubble-incoming: #182533;
    --bubble-incoming-text: #f5f6f7;

    --whatsapp-green: #2ab3f2;
    --whatsapp-green-hover: #24a1de;
    --secondary-subtle: rgba(243, 112, 33, 0.15);

    /* WhatsApp Mobile Style Header Variables */
    --whatsapp-header-bg: #182533;
    --whatsapp-header-text: #f5f6f7;
    --whatsapp-header-sub: #7f91a4;
    --whatsapp-header-icon: #7f91a4;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

/* App Shell Layout */
.app-container {
    display: flex;
    width: 100vw;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    background-color: var(--surface);
    position: relative;
    overflow: hidden;
}

/* Left Sidebar (Desktop & Tablet Split Layout) */
.sidebar {
    width: 380px;
    min-width: 320px;
    max-width: 420px;
    height: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background-color: var(--surface);
    z-index: 100;
    position: relative;
    box-sizing: border-box;
}

.sidebar-header {
    height: var(--header-height);
    padding: 0 14px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background-color: var(--whatsapp-header-bg);
    width: 100%;
    box-sizing: border-box;
    position: relative;
    flex-shrink: 0;
    z-index: 105;
}

.brand-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-width: 0;
    overflow: hidden;
}

.brand-logo-icon {
    width: 38px;
    height: 38px;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 700;
    font-size: 19px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--whatsapp-header-text);
}

.brand-text span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--whatsapp-header-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sidebar-header .icon-btn {
    color: var(--whatsapp-header-icon);
}

.sidebar-header .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.icon-btn:hover {
    background-color: var(--surface-hover);
    color: var(--primary);
}

.icon-btn.active {
    color: var(--secondary);
}

.chat-header-actions .icon-btn:hover {
    background-color: var(--surface-hover);
}

.chat-options-menu {
    position: absolute;
    top: 48px;
    right: 0;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    z-index: 99999;
    display: none;
    flex-direction: column;
    padding: 8px 0;
    border: 1px solid var(--border);
    animation: fadeIn 0.15s ease;
}

.chat-options-menu.active {
    display: flex;
}

.chat-options-item {
    padding: 11px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    background: transparent;
    border: none;
    text-align: left;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.12s ease;
}

.chat-options-item:hover {
    background: var(--surface-hover);
    color: var(--primary);
}

.chat-options-item.danger {
    color: #ef4444;
}

.chat-options-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Chat Messages Area */
.messages-container {
    flex: 1;
}

/* Search Bar */
.search-container {
    padding: 10px 16px;
    background-color: var(--surface);
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 43, 92, 0.1);
    background-color: var(--surface);
}

.search-input-wrapper input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

/* Chat List Tabs */
.chat-tabs {
    display: flex;
    gap: 6px;
    padding: 6px 16px 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.chat-tabs::-webkit-scrollbar {
    display: none;
}

.tab-chip {
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background-color: var(--surface-secondary);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.tab-chip.active {
    background-color: var(--primary);
    color: #ffffff;
}

/* Conversations List */
.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    position: relative;
    border-bottom: 1px solid var(--border-subtle);
}

.chat-item:hover {
    background-color: var(--surface-hover);
}

.chat-item.active {
    background-color: var(--surface-active);
}

.chat-avatar-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.chat-avatar {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-full);
    object-fit: cover;
    background-color: var(--surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1.1rem;
    border: 1px solid var(--border-subtle);
}

/* WhatsApp-Style Story Status Rings */
.chat-avatar.has-status {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px var(--whatsapp-green);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-avatar.has-status:hover {
    transform: scale(1.06);
}

.chat-avatar.has-status-viewed {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px #8696a0;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-avatar.has-status-viewed:hover {
    transform: scale(1.06);
}

/* Stories / Status Tray at the top of the chat list */
.status-tray-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.status-tray-container::-webkit-scrollbar {
    display: none;
}

.status-tray-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
    width: 60px;
    text-align: center;
}

.status-tray-avatar-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.status-tray-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    background-color: var(--surface-secondary);
    color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px var(--whatsapp-green);
    transition: transform 0.15s ease;
}

.status-tray-avatar.viewed {
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 4.5px #8696a0;
}

.status-tray-avatar.my-avatar-none {
    box-shadow: none;
    border: 1px dashed var(--border);
}

.status-tray-plus-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--whatsapp-green);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.status-tray-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    max-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

/* WhatsApp Fullscreen Story / Status Viewer Modal */
.story-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0b141a;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.story-viewer-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 100vh;
    max-height: 840px;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    user-select: none;
}

@media (max-width: 600px) {
    .story-viewer-card {
        border-radius: 0;
        max-height: 100vh;
    }
}

.story-progress-bar-row {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.story-progress-segment {
    flex: 1;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    width: 0%;
    background-color: #ffffff;
    border-radius: 2px;
}

.story-header {
    position: absolute;
    top: 24px;
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.story-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.story-author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.story-author-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.story-time-ago {
    font-size: 0.75rem;
    opacity: 0.8;
}

.story-close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.story-content-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 40px 24px 80px;
    text-align: center;
}

.story-text-content {
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
    word-break: break-word;
    max-height: 70vh;
    overflow-y: auto;
}

.story-image-content {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
}

.story-caption-overlay {
    position: absolute;
    bottom: 24px;
    left: 16px;
    right: 16px;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.4;
    text-align: center;
}

.story-nav-tap-left, .story-nav-tap-right {
    position: absolute;
    top: 60px;
    bottom: 60px;
    width: 40%;
    z-index: 5;
    cursor: pointer;
}

.story-nav-tap-left { left: 0; }
.story-nav-tap-right { right: 0; }

.story-footer-meta {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    font-weight: 600;
    z-index: 10;
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    background-color: var(--status-online);
    border: 2px solid var(--surface);
    border-radius: 50%;
}

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

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

.chat-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.community-badge-tag {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 4px;
    background-color: var(--secondary-subtle);
    color: var(--secondary);
    font-weight: 700;
}

.chat-time {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.chat-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.chat-snippet {
    font-size: 0.82rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unread-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background-color: var(--whatsapp-green);
    color: #ffffff;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Main Chat Pane */
.main-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    background-color: var(--surface-secondary);
    position: relative;
    box-sizing: border-box;
}

.chat-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--whatsapp-header-bg);
    border-bottom: 1px solid var(--border-subtle);
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    z-index: 5;
    width: 100%;
    box-sizing: border-box;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    min-width: 0;
}

.back-btn-mobile {
    display: none;
    background: none;
    border: none;
    color: #ffffff !important;
    cursor: pointer;
    margin-right: 4px;
    padding: 6px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.back-btn-mobile:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-header-text h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--whatsapp-header-text);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.verified-icon {
    color: var(--secondary);
    display: inline-flex;
}

.chat-header-sub {
    font-size: 0.75rem;
    color: var(--whatsapp-header-sub);
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-header-actions .icon-btn,
.sidebar-header .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease, transform 0.1s ease;
    opacity: 0.95;
    padding: 0;
}

.chat-header-actions .icon-btn:hover,
.sidebar-header .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    opacity: 1;
}

.chat-header-actions .icon-btn:active,
.sidebar-header .icon-btn:active {
    transform: scale(0.93);
    background-color: rgba(255, 255, 255, 0.3) !important;
}

.chat-header-actions .icon-btn svg,
.sidebar-header .icon-btn svg,
.back-btn-mobile svg {
    width: 22px;
    height: 22px;
    display: block;
    stroke-width: 2.2;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

/* Messages History Area */
.messages-container {
    flex: 1 1 0%;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--bg-app);
    background-image: radial-gradient(rgba(15, 43, 92, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
}

.messages-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(180px, 28vw, 280px);
    height: clamp(180px, 28vw, 280px);
    background-image: url('/clevchatlogo.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    opacity: 0.042;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}

[data-theme="dark"] .messages-container::before {
    opacity: 0.038;
    filter: brightness(0.9) contrast(0.95);
}

.messages-container > * {
    position: relative;
    z-index: 1;
}

.date-divider {
    align-self: center;
    padding: 4px 12px;
    background-color: var(--surface);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    margin: 8px 0;
}

.system-message-banner {
    align-self: center;
    padding: 6px 16px;
    background-color: var(--primary-subtle);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    max-width: 80%;
    margin: 4px 0;
}

/* Message Bubble */
.message-wrap {
    display: flex;
    flex-direction: column;
    max-width: 68%;
    position: relative;
    animation: fadeIn 0.15s ease;
}

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

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

.message-wrap.outgoing {
    align-self: flex-end;
}

.message-wrap.incoming {
    align-self: flex-start;
}

.message-sender-title {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 2px;
    padding-left: 2px;
}

.message-bubble {
    padding: 8px 12px;
    border-radius: var(--radius-md);
    position: relative;
    box-shadow: var(--shadow-sm);
    word-break: break-word;
}

.message-wrap.outgoing .message-bubble {
    background-color: var(--bubble-outgoing);
    color: var(--bubble-outgoing-text);
    border-bottom-right-radius: 4px;
}

.message-wrap.incoming .message-bubble {
    background-color: var(--bubble-incoming);
    color: var(--bubble-incoming-text);
    border-bottom-left-radius: 4px;
}

.quote-snippet {
    background-color: rgba(0, 0, 0, 0.05);
    border-left: 3px solid var(--secondary);
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 0.78rem;
}

.quote-author {
    font-weight: 700;
    color: var(--secondary);
}

.message-text {
    font-size: 0.9rem;
    line-height: 1.45;
}

.message-attachment-img {
    max-width: 100%;
    max-height: 320px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-top: 4px;
    display: block;
}

.message-attachment-doc {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background-color: rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    text-decoration: none;
    color: inherit;
}

.message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.status-tick {
    font-size: 0.75rem;
}

.status-tick.read {
    color: var(--status-read);
}

/* Reactions Bar */
.reactions-tray {
    display: flex;
    gap: 4px;
    margin-top: -6px;
    z-index: 2;
}

.reaction-pill {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 2px 6px;
    font-size: 0.72rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

/* Sticky Message Composer (WhatsApp Mobile Design) */
.composer-container {
    flex-shrink: 0;
    min-height: var(--composer-height);
    background-color: transparent;
    padding: 6px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 10;
}

.reply-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface);
    padding: 8px 14px;
    border-left: 4px solid var(--whatsapp-green);
    border-radius: 8px;
    font-size: 0.82rem;
    box-shadow: var(--shadow-sm);
}

.composer-main-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.composer-input-box {
    flex: 1;
    background-color: var(--surface);
    border-radius: 24px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(11, 20, 26, 0.15);
}

.composer-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    resize: none;
    max-height: 120px;
    min-height: 24px;
    line-height: 1.4;
    padding: 3px 0;
}

.composer-icon-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    border-radius: 50%;
    transition: opacity 0.15s ease;
}

.composer-icon-btn:hover {
    opacity: 0.8;
}

.send-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background-color: var(--whatsapp-green);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.send-btn:hover {
    background-color: var(--whatsapp-green-hover);
    transform: scale(1.04);
}

.send-btn:active {
    transform: scale(0.95);
}

/* WhatsApp-Style Voice Note Pill Message */
.audio-message-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 2px 2px 2px;
    width: 290px;
    max-width: 100%;
    user-select: none;
}

.audio-play-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--whatsapp-green);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, background-color 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.audio-play-btn:hover {
    transform: scale(1.06);
    background-color: var(--whatsapp-green-hover);
}

.audio-play-btn:active {
    transform: scale(0.95);
}

.audio-waveform-track {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    min-width: 0;
}

.waveform-bars {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 26px;
    overflow: hidden;
}

.waveform-bar {
    width: 2.5px;
    background-color: #8696a0;
    opacity: 0.45;
    border-radius: 3px;
    transition: background-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.waveform-bar.played {
    background-color: var(--whatsapp-green);
    opacity: 1;
}

.audio-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    line-height: 1;
}

.audio-avatar-badge {
    position: relative;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.audio-avatar-badge .audio-sender-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--surface-secondary, #e9edef);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.audio-avatar-badge .audio-mic-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    font-size: 0.68rem;
    background: var(--surface);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* WhatsApp Composer Voice Recording Live Bar */
.composer-recording-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    background-color: var(--surface);
    border-radius: 24px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    animation: fadeIn 0.2s ease;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.recording-pulse-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ef4444;
    animation: recordingBlink 1s infinite alternate;
}

@keyframes recordingBlink {
    0% { transform: scale(0.85); opacity: 0.4; }
    100% { transform: scale(1.15); opacity: 1; box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); }
}

.recording-timer {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.recording-wave-visualizer {
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 1;
    justify-content: center;
    height: 20px;
}

.rec-bar {
    width: 3px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 2px;
    animation: recWave 0.8s infinite ease-in-out alternate;
}

.rec-bar:nth-child(2) { animation-delay: 0.1s; }
.rec-bar:nth-child(3) { animation-delay: 0.2s; }
.rec-bar:nth-child(4) { animation-delay: 0.3s; }
.rec-bar:nth-child(5) { animation-delay: 0.4s; }
.rec-bar:nth-child(6) { animation-delay: 0.5s; }
.rec-bar:nth-child(7) { animation-delay: 0.6s; }
.rec-bar:nth-child(8) { animation-delay: 0.7s; }

@keyframes recWave {
    0% { height: 4px; opacity: 0.4; }
    100% { height: 18px; opacity: 1; }
}

.recording-cancel-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    transition: background-color 0.15s ease;
}

.recording-cancel-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Pinned Link / Announcement Banner */
.pinned-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(11, 20, 26, 0.05);
}

.pinned-banner-icon {
    font-size: 1rem;
    color: var(--whatsapp-green);
}

/* Message Bubble Actions & Popover */
.message-bubble {
    position: relative;
}

.message-bubble:hover .msg-action-btn {
    opacity: 1;
}

.msg-action-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background-color 0.15s ease;
    z-index: 4;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.msg-action-btn:hover {
    background: var(--surface-hover);
    color: var(--primary);
}

.msg-menu-popover {
    position: absolute;
    top: 28px;
    right: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    animation: fadeIn 0.12s ease;
}

.msg-menu-item {
    padding: 8px 14px;
    font-size: 0.85rem;
    color: var(--text-primary);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.msg-menu-item:hover {
    background: var(--surface-hover);
}

.msg-menu-item.danger {
    color: #ef4444;
}

.pinned-highlight {
    animation: highlightPulse 2s ease;
}

/* Rich Emoji Picker Popover */
.emoji-picker-popover {
    position: absolute;
    bottom: 48px;
    left: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
    padding: 10px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    width: 260px;
    max-height: 240px;
    overflow: hidden;
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    max-height: 185px;
    overflow-y: auto;
}

.emoji-picker-item {
    font-size: 1.25rem;
    padding: 6px;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: transform 0.1s ease, background-color 0.1s ease;
}

.emoji-picker-item:hover {
    background: var(--surface-hover);
    transform: scale(1.2);
}

@keyframes highlightPulse {
    0% {
        background-color: rgba(36, 161, 222, 0.35);
    }

    100% {
        background-color: transparent;
    }
}

/* Floating scroll to bottom */
.floating-scroll-btn {
    position: absolute;
    bottom: 74px;
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 15;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Empty State */
.empty-chat-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
}

.empty-icon-circle {
    width: 80px;
    height: 80px;
    background: var(--surface);
    border: 2px dashed var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--secondary);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--surface);
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--surface-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    background-color: var(--surface);
}

.btn-primary {
    padding: 9px 18px;
    background-color: var(--primary);
    color: #ffffff;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: background-color 0.15s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.99);
}

.btn-secondary {
    padding: 9px 18px;
    background-color: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-secondary:hover {
    background-color: var(--surface-hover);
    border-color: var(--border);
}

.btn-secondary:active {
    transform: scale(0.99);
}

/* WhatsApp-style Slide-out Group Info Drawer (Right Panel) */
.info-drawer {
    width: 400px;
    min-width: 340px;
    max-width: 420px;
    height: 100%;
    background-color: var(--surface);
    border-left: 1px solid var(--border);
    display: none;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 15;
    animation: slideInRight 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-drawer.active {
    display: flex;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.drawer-header {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.drawer-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-app);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drawer-section-card {
    background-color: var(--surface);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.drawer-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px 16px;
}

.drawer-hero-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    margin-bottom: 12px;
}

.drawer-hero-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.drawer-hero-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.drawer-action-buttons {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 18px;
    width: 100%;
}

.drawer-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 700;
}

.drawer-action-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background-color: var(--surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.15s ease;
}

.drawer-action-item:hover .drawer-action-circle {
    background-color: var(--primary-subtle);
    border-color: var(--primary);
}

.drawer-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.drawer-member-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid var(--border-subtle);
}

.drawer-member-row:hover {
    background-color: var(--surface-hover);
}

.drawer-member-row:last-child {
    border-bottom: none;
}

.admin-tag-pill {
    padding: 2px 8px;
    background-color: var(--surface-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Lightbox Image Viewer */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #ffffff;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-fab {
    display: none;
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: var(--whatsapp-green);
    color: #ffffff;
    border: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.mobile-fab:active {
    transform: scale(0.92);
}

.mobile-fab:hover {
    background-color: var(--whatsapp-green-hover);
}

/* WhatsApp Mobile Bottom Navigation Bar */
.bottom-nav-bar {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
    align-items: center;
    justify-content: space-around;
    padding: 4px 8px env(safe-area-inset-bottom, 4px);
    box-sizing: border-box;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 6px 0;
    transition: color 0.15s ease, transform 0.1s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
    transform: scale(0.94);
}

.bottom-nav-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 18px;
    border-radius: 16px;
    transition: background-color 0.15s ease;
}

.bottom-nav-item.active .bottom-nav-icon-wrap {
    background-color: var(--primary-subtle);
    color: var(--primary);
}

.bottom-nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

[data-theme="dark"] .bottom-nav-item.active .bottom-nav-icon-wrap {
    background-color: rgba(42, 179, 242, 0.18);
    color: var(--primary);
}

.bottom-nav-label {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.bottom-nav-badge {
    position: absolute;
    top: -3px;
    right: 4px;
    background-color: var(--whatsapp-green);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
    border: 2px solid var(--surface);
}

.bottom-nav-dot {
    position: absolute;
    top: 0px;
    right: 12px;
    width: 8px;
    height: 8px;
    background-color: var(--whatsapp-green);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

/* WhatsApp Status Full View Screen */
.status-full-view {
    flex: 1;
    overflow-y: auto;
    background-color: var(--bg-app);
    display: flex;
    flex-direction: column;
    padding-bottom: 80px;
}

.status-my-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background-color: var(--surface);
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 8px;
}

.status-my-card:hover {
    background-color: var(--surface-hover);
}

.status-my-plus-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 18px;
    height: 18px;
    background-color: var(--whatsapp-green);
    color: #ffffff;
    border-radius: 50%;
    border: 2px solid var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.status-section-header {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    padding: 10px 18px 6px;
}

.status-card-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    background-color: var(--surface);
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid var(--border-subtle);
}

.status-card-item:hover {
    background-color: var(--surface-hover);
}

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

.status-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.status-card-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Status Dual Floating Action Buttons */
.status-floating-fabs {
    position: absolute;
    bottom: 74px;
    right: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 105;
}

.status-fab-mini {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.15s ease, background-color 0.15s ease;
    font-size: 1.1rem;
}

.status-fab-mini:hover {
    background-color: var(--surface-hover);
    color: var(--primary);
}

.status-fab-mini:active {
    transform: scale(0.92);
}

.status-fab-main {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--whatsapp-green);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.status-fab-main:hover {
    background-color: var(--whatsapp-green-hover);
}

.status-fab-main:active {
    transform: scale(0.92);
}

/* Mobile Phone Responsive Rules (640px and below) */
@media (max-width: 640px) {
    :root {
        --header-height: 56px;
    }

    .sidebar {
        width: 100%;
        max-width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .bottom-nav-bar {
        display: flex;
    }

    .desktop-only-tabs {
        display: none !important;
    }

    .desktop-only-tray {
        display: none !important;
    }

    .conversations-list {
        padding-bottom: 70px;
    }

    .status-full-view {
        padding-bottom: 75px;
    }

    .sidebar-header {
        padding: 0 8px;
        height: 56px;
    }

    .sidebar-header .brand-badge {
        gap: 6px;
        min-width: 0;
    }

    .sidebar-header .brand-logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        flex-shrink: 0;
    }

    .sidebar-header .brand-text h1 {
        font-size: 1.05rem;
        white-space: nowrap;
    }

    .sidebar-header .brand-text span {
        font-size: 0.62rem;
        display: none;
    }

    .sidebar-actions {
        gap: 2px;
        flex-shrink: 0;
    }

    .sidebar-header .icon-btn {
        width: 32px;
        height: 32px;
        padding: 0;
    }

    .sidebar-header .icon-btn svg {
        width: 18px;
        height: 18px;
    }

    .main-pane {
        width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        transform: translateX(100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .app-container.show-chat .sidebar {
        transform: translateX(-100%);
    }

    .app-container.show-chat .main-pane {
        transform: translateX(0);
    }

    .chat-header {
        padding: 0 6px 0 4px;
        height: 56px;
        gap: 4px;
    }

    .chat-header-info {
        gap: 6px;
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    .back-btn-mobile {
        display: flex;
        width: 30px;
        height: 30px;
        padding: 4px;
        margin-right: 0;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
    }

    .back-btn-mobile svg {
        width: 20px;
        height: 20px;
    }

    .chat-header-info .chat-avatar-wrap {
        width: 34px !important;
        height: 34px !important;
        flex-shrink: 0;
    }

    .chat-header-info .chat-avatar {
        width: 34px !important;
        height: 34px !important;
        font-size: 0.85rem;
    }

    .chat-header-text {
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    .chat-header-text h2 {
        font-size: 0.92rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .chat-header-sub {
        font-size: 0.68rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .chat-header-actions {
        gap: 2px;
        flex-shrink: 0;
    }

    .chat-header-actions .icon-btn {
        width: 32px;
        height: 32px;
        padding: 0;
    }

    .chat-header-actions .icon-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Composer on Mobile */
    .composer-container {
        padding: 4px 6px 6px;
        width: 100%;
        box-sizing: border-box;
    }

    .composer-main-row {
        gap: 6px;
        width: 100%;
    }

    .composer-input-box {
        padding: 4px 8px;
        gap: 4px;
        min-width: 0;
        flex: 1;
        border-radius: 24px;
    }

    .composer-textarea {
        font-size: 0.9rem;
        min-width: 50px;
        padding: 4px 0;
    }

    .composer-icon-btn {
        width: 26px;
        height: 26px;
        padding: 0;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .composer-icon-btn svg {
        width: 18px;
        height: 18px;
    }

    .send-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1.1rem;
        flex-shrink: 0;
    }

    .mobile-fab {
        display: flex;
        bottom: 74px !important;
        right: 18px !important;
    }

    /* Full Screen Modals on Mobile Phones */
    .modal-overlay {
        padding: 0;
        align-items: flex-start;
    }

    .modal-card {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        transform: translateY(0) !important;
    }

    .modal-header {
        padding: 12px 14px;
        height: 52px;
        flex-shrink: 0;
        border-bottom: 1px solid var(--border);
        background-color: var(--surface);
    }

    .modal-body {
        padding: 14px;
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    #search-users-results {
        max-height: none !important;
        flex: 1;
    }
}

/* Extra narrow screens (<=380px e.g. 360px Galaxy S8+) */
@media (max-width: 380px) {
    .composer-input-box label[title="Camera"] {
        display: none !important;
    }
    .sidebar-header .icon-btn {
        width: 30px;
        height: 30px;
    }
    .chat-header-actions .icon-btn {
        width: 30px;
        height: 30px;
    }
}

/* In-App Floating Toast Notifications */
.app-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.app-toast-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    cursor: pointer;
    animation: toastSlideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-toast-card:hover {
    transform: translateY(-2px);
}

.app-toast-card.hiding {
    animation: toastSlideUp 0.25s forwards cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes toastSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

.toast-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-snippet {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toast-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.15s ease;
}

.toast-close-btn:hover {
    color: var(--text-primary);
}

/* WhatsApp-Style Only Admins Can Send Messages Banner */
.composer-admin-only-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: var(--surface);
    border-top: 1px solid var(--border-subtle);
    padding: 16px 20px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    font-weight: 500;
    width: 100%;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.composer-admin-only-banner .lock-badge {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.composer-admin-only-banner .btn-message-admin {
    background-color: var(--whatsapp-green);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.composer-admin-only-banner .btn-message-admin:hover {
    background-color: var(--whatsapp-green-hover);
}

.composer-admin-only-banner .btn-message-admin:active {
    transform: scale(0.97);
}

.admin-composer-indicator {
    font-size: 0.76rem;
    color: var(--whatsapp-green);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
    padding: 3px 10px;
    background: rgba(37, 211, 102, 0.1);
    border-radius: 6px;
    width: fit-content;
}