
        :root {
            --bs-body-font-family: 'Inter', sans-serif;
            --wa-background: #E5DDD5;
            --wa-dark-background: #0D1418;
            --wa-light-panel-bg: #F0F2F5;
            --wa-dark-panel-bg: #202C33;
            --wa-light-header-bg: #F0F2F5;
            --wa-dark-header-bg: #202C33;
            --wa-light-bubble-in-bg: #FFFFFF;
            --wa-dark-bubble-in-bg: #202C33;
            --wa-light-bubble-out-bg: #D9FDD3;
            --wa-dark-bubble-out-bg: #005C4B;
            --wa-light-primary-text: #111B21;
            --wa-dark-primary-text: #E9EDEF;
            --wa-light-secondary-text: #667781;
            --wa-dark-secondary-text: #8696A0;
            --wa-active-chat-bg: #F0F2F5;
            --wa-dark-active-chat-bg: #2A3942;
            --wa-icon-color: #54656F;
            --wa-dark-icon-color: #AEBAC1;
            --wa-border-color: #e9edef;
            --wa-dark-border-color: #313d45;
        }
        @import url('https://rsms.me/inter/inter.css');
        
        html, body { 
            height: 100dvh; 
            overflow: hidden; 
            margin: 0; 
            padding: 0;
            background-color: #f0f2f5;
            -webkit-font-smoothing: antialiased;
        }
        body[data-bs-theme="dark"] { background-color: #111B21; }
        /* --- Google-Style High Density Sidebar Overrides --- */

/* 1. Condense the overall metrics container container */
.stats-bar-minimal {
    background-color: #ffffff !important;
    padding: 6px 8px !important;
    border-bottom: 1px solid #e0e0e0 !important;
}
body[data-bs-theme="dark"] .stats-bar-minimal {
    background-color: #111b21 !important;
    border-bottom-color: #222e35 !important;
}

/* 2. Flatten the New/Returning Value Pills into clean minimalist text specs */
.stat-pill-iconic {
    font-size: 11px !important;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.stat-pill-iconic border-start {
    border-color: #e0e0e0 !important;
}

/* 3. Transform Date Selectors into sleek compact input lines */
.minimal-date-input {
    max-width: 92px !important;
    height: 24px !important;
    font-size: 11px !important;
    padding: 0 4px !important;
    border: 1px solid #dadce0 !important;
    border-radius: 4px !important;
    background-color: #f8f9fa !important;
    color: #3c4043 !important;
}
body[data-bs-theme="dark"] .minimal-date-input {
    background-color: #202c33 !important;
    border-color: #313d45 !important;
    color: #e9edef !important;
}

/* 4. Compact the Plivo and Countdown Pills */
#plivo-status-pill, 
.stats-bar-minimal .font-monospace.text-secondary {
    height: 24px !important;
    padding: 2px 6px !important;
    font-size: 11px !important;
    background-color: #f1f3f4 !important;
    border: none !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    align-items: center !important;
}
body[data-bs-theme="dark"] #plivo-status-pill,
body[data-bs-theme="dark"] .stats-bar-minimal .font-monospace.text-secondary {
    background-color: #202c33 !important;
    color: #8696a0 !important;
}

/* 5. Shrink the Work Hours Monitor and performance ticker */
#agent-performance-clock {
    margin-top: 4px !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    box-shadow: none !important;
}
#display-agent-timer {
    font-size: 11px !important;
}
#staff-performance-ticker {
    font-size: 11px !important;
    padding: 0 !important;
}
.stats-bar-minimal .line-two.bg-light {
    background-color: transparent !important;
    padding: 0 !important;
    margin-top: 4px !important;
}
        main.container-fluid { 
            padding: 0; 
            flex-grow: 1; 
            height: 100dvh; 
            position: fixed; 
            top: 0; 
            left: 0; 
            width: 100%;
        }
        /* --- Predictive Stock Engine Badges --- */
.prediction-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
    padding: 6px;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    border: 1px dashed rgba(0, 0, 0, 0.05);
}
body[data-bs-theme="dark"] .prediction-wrapper {
    background-color: rgba(254, 254, 254, 0.02);
    border-color: rgba(255, 255, 255, 0.05);
}
.prediction-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    width: max-content;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.prediction-safe { background-color: #d1e7dd; color: #0f5132; }
.prediction-soon { background-color: #fff3cd; color: #664d03; }
.prediction-urgent { background-color: #f8d7da; color: #842029; }

.prediction-text {
    font-size: 0.75rem;
    color: var(--wa-light-secondary-text);
    font-weight: 500;
}
.minimal-date-input {
    max-width: 115px;
    font-size: 0.78rem;
    padding: 2px 6px;
}
.stat-pill-iconic {
    font-size: 0.82rem;
    white-space: nowrap;
}
#staff-performance-ticker {
    scrollbar-width: none; /* Firefox */
}
#staff-performance-ticker::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Webkit */
}
        #whatsapp-container { 
            display: flex; 
            height: 100%; 
            width: 100%;
            overflow: hidden; 
            position: relative;
        }
        
        #conversation-panel { 
            min-width: 340px; 
            max-width: 420px; 
            width: 30%; 
            border-right: 1px solid var(--wa-border-color); 
            background-color: var(--wa-light-bubble-in-bg);
            display: flex;
            flex-direction: column;
            height: 100%;
        }
        
        #wa-conversation-list { 
            overflow-y: auto; 
            flex-grow: 1; 
            -webkit-overflow-scrolling: touch;
        }
        
        .conversation-item { 
            cursor: pointer; 
            transition: background-color 0.15s ease; 
            user-select: none;
        }
        .conversation-item:hover { background-color: #f5f5f5; }
        .conversation-item.active { background-color: var(--wa-active-chat-bg); }
        
        .profile-pic {    
            width: 45px;
            height: 45px;
            border-radius: 50%;
            background-color: #68bde6;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            font-weight: bold;
            flex-shrink: 0;
        }
        
        .conversation-item-details { 
            flex-grow: 1; 
            overflow: hidden; 
            border-top: 1px solid var(--wa-border-color); 
        }
        
        .last-message { color: var(--wa-light-secondary-text); }
        
        #chat-panel-container { 
            flex-grow: 1; 
            height: 100%;
            display: flex;
            flex-direction: column;
            background-color: var(--wa-background); 
            background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARMAAAARCAYAAAA/I2f7AAAABHNCSVQICAgIfAhkiAAAAF1JREFUeJztwTEBAAAAwiD7p7bGD2x1gQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB4GX4aAAFMgH39AAAAAElFTSuQmCC'); 
        }
        
        #wa-chat-header { 
            background-color: var(--wa-light-header-bg); 
            border-bottom: 1px solid var(--wa-border-color); 
            height: 60px;
            flex-shrink: 0;
        }
        
        #wa-chat-messages { 
            overflow-y: auto; 
            flex-grow: 1; 
            -webkit-overflow-scrolling: touch;
        }
        
        .message-wrapper { margin-bottom: 4px; padding: 0 5px; }
        
        .message-bubble { 
            max-width: 85%; 
            padding: 8px 12px 24px 12px; 
            border-radius: 8px; 
            word-wrap: break-word; 
            position: relative; 
            box-shadow: 0 1px 1px rgba(0,0,0,0.06);
        }
        
        .message-in { background-color: var(--wa-light-bubble-in-bg); border-top-left-radius: 0; }
        .message-out { background-color: var(--wa-light-bubble-out-bg); border-top-right-radius: 0; }
        .message-content { font-size: 0.92rem; line-height: 1.4; }
        
        .message-timestamp { 
            position: absolute;
            bottom: 4px;
            right: 8px;
            font-size: 0.68rem; 
            color: var(--wa-light-secondary-text); 
        }
        
        .message-status i { font-size: 0.85rem; }
        .message-status.status-read i { color: #53bdeb; }
        
        .message-actions { 
            position: absolute; 
            top: 2px; 
            right: 4px; 
            opacity: 0; 
            visibility: hidden; 
            transition: opacity 0.15s ease, visibility 0.15s ease; 
        }
        .message-bubble:hover .message-actions { opacity: 1; visibility: visible; }
        
        #wa-message-form-footer { 
            background-color: var(--wa-light-header-bg); 
            padding: 10px;
            border-top: 1px solid var(--wa-border-color);
        }
        #wa-message-input { border-radius: 24px; padding-left: 15px; padding-right: 15px; }
        
        .date-separator { text-align: center; margin: 1.2rem 0; }
        .date-separator span {
            background-color: #e7f0e4;
            color: #5f7a73;
            padding: 6px 16px;
            border-radius: 8px;
            font-size: 0.78rem;
            font-weight: 500;
            box-shadow: 0 1px 1px rgba(0,0,0,0.04);
        }
        /* --- High-Fidelity Chat Bubble Upgrades --- */
.message-bubble {
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    border-radius: 7.5px !important;
}
/* Left tail accent for customer messages */
.message-in {
    border-top-left-radius: 0 !important;
}
.message-in::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 6px 10px 0;
    border-color: transparent var(--wa-light-bubble-in-bg) transparent transparent;
}
body[data-bs-theme="dark"] .message-in::before {
    border-color: transparent var(--wa-dark-bubble-in-bg) transparent transparent;
}

/* Right tail accent for agent replies */
.message-out {
    border-top-right-radius: 0 !important;
}
.message-out::before {
    content: "";
    position: absolute;
    right: -6px;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 6px 0 0;
    border-color: var(--wa-light-bubble-out-bg) transparent transparent transparent;
}
body[data-bs-theme="dark"] .message-out::before {
    border-color: var(--wa-dark-bubble-out-bg) transparent transparent transparent;
}
/* Clean Native Utility Remaps */
.text-xxs { font-size: 0.68rem; }
.text-xs { font-size: 0.75rem; }
.object-fit-cover { object-fit: cover; }

/* Micro Interaction System Transitions */
.conversation-item, .btn, .message-bubble {
    transition: all 0.2s ease-in-out;
}

/* Optimize Filters Pane Sub-Navigation */
#wa-filters {
    background-color: var(--wa-light-panel-bg) !important;
    border-bottom: 1px solid var(--wa-border-color) !important;
}
body[data-bs-theme="dark"] #wa-filters {
    background-color: var(--wa-dark-panel-bg) !important;
    border-bottom: 1px solid var(--wa-dark-border-color) !important;
}
#wa-filters select, #wa-filters input {
    font-size: 0.8rem;
}
#plivo-floating-panel {
    backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
body[data-bs-theme="dark"] #plivo-floating-panel {
    background-color: rgba(32, 44, 51, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}
        .media-placeholder {
            position: relative;
            display: block;
            max-width: 280px;
            min-width: 200px;
        }
        .media-placeholder img, .media-placeholder video {
            max-width: 100%;
            border-radius: 6px;
            opacity: 0.6;
        }
        .media-overlay {
            position: absolute;
            top: 0; left: 0; width: 100%; height: 100%;
            background-color: rgba(0, 0, 0, 0.3);
            display: flex; justify-content: center; align-items: center;
            border-radius: 6px; color: white;
        }
        
        .conversation-tags-container {
            display: flex;
            gap: 4px;
            overflow-x: auto;
            white-space: nowrap;
            margin-top: 6px;
        }
        .conversation-tags-container::-webkit-scrollbar { display: none; }
        
        /* Dark Theme Support overrides */
        body[data-bs-theme="dark"] #conversation-panel { background-color: #111B21; border-right-color: var(--wa-dark-border-color); }
        body[data-bs-theme="dark"] #conversation-panel-header,
        body[data-bs-theme="dark"] #wa-chat-header,
        body[data-bs-theme="dark"] #wa-message-form-footer { background-color: var(--wa-dark-header-bg); border-bottom-color: var(--wa-dark-border-color); }
        body[data-bs-theme="dark"] .conversation-item-details { border-top-color: var(--wa-dark-border-color); }
        body[data-bs-theme="dark"] .last-message,
        body[data-bs-theme="dark"] .message-timestamp { color: var(--wa-dark-secondary-text); }
        body[data-bs-theme="dark"] .conversation-item.active { background-color: var(--wa-dark-active-chat-bg); }
        body[data-bs-theme="dark"] .conversation-item:hover { background-color: #1a242b; }
        body[data-bs-theme="dark"] #chat-panel-container { background-color: var(--wa-dark-background); }
        body[data-bs-theme="dark"] .message-in { background-color: var(--wa-dark-bubble-in-bg); }
        body[data-bs-theme="dark"] .message-out { background-color: var(--wa-dark-bubble-out-bg); }
        body[data-bs-theme="dark"] .date-separator span { background-color: #202C33; color: var(--wa-dark-secondary-text); }

        /* Responsive Mobile Specific Logic */
        @media (max-width: 767.98px) {
            #conversation-panel { 
                width: 100%; 
                max-width: none; 
                position: absolute;
                left: 0; top: 0; height: 100%;
                z-index: 10;
                transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            }
            #chat-panel-container { 
                position: absolute; 
                top: 0; 
                left: 0; 
                width: 100%; 
                height: 100%; 
                transform: translateX(100%); 
                transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); 
                z-index: 20; 
            }
            #whatsapp-container.show-chat #conversation-panel { transform: translateX(-30%); }
            #whatsapp-container.show-chat #chat-panel-container { transform: translateX(0); }
            
            .stats-bar-minimal { font-size: 85%; }
            .stats-bar-minimal .line-one { gap: 4px !important; }
            .message-bubble { max-width: 90%; }
        }
        
        .spin-anim { animation: spin 1s linear infinite; }
        @keyframes spin { 100% { transform: rotate(360deg); } }

        #whatsapp-container {
            background-color: #f8f9fa;
            font-family: 'Inter', system-ui, -apple-system, sans-serif;
        }
        
        /* 80/20 Non-Wrapping Rigid Structural Grid Definitions */
        .top-proportional-row {
            display: flex !important;
            flex-wrap: nowrap !important;
            align-items: center !important;
            width: 100% !important;
            gap: 6px !important;
        }
        .col-80-proportional {
            width: 80% !important;
            flex: 0 0 80% !important;
            max-width: 80% !important;
        }
        .col-20-proportional {
            width: 20% !important;
            flex: 0 0 20% !important;
            max-width: 20% !important;
        }

        /* Ultra Compact Native Date Input Field Wrapper */
        .compact-date-wrapper {
            background-color: #f1f3f4;
            border: 1px solid #dadce0;
            border-radius: 6px;
            height: 28px;
            padding: 0 6px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .google-clean-input {
            border: none !important;
            background: transparent !important;
            color: #202124;
            font-size: 0.68rem !important;
            font-weight: 500;
            letter-spacing: -0.01em;
            padding: 0 !important;
            height: 22px;
            text-align: center;
        }
        .google-clean-input:focus {
            box-shadow: none !important;
            outline: none !important;
        }
        .google-clean-input::-webkit-calendar-picker-indicator {
            margin: 0 0 0 2px !important;
            padding: 0 !important;
            cursor: pointer;
            width: 12px;
            height: 12px;
        }
        
        /* Low-Profile Google Search Core Bar Shell */
        .google-search-wrap {
            background-color: #f1f3f4;
            border-radius: 8px;
            padding: 0 0.5rem;
            height: 26px;
            display: flex;
            align-items: center;
            transition: background-color 0.15s, box-shadow 0.15s;
        }
        .google-search-wrap:focus-within {
            background-color: #ffffff;
            box-shadow: 0 1px 2px 0 rgba(60,64,67,0.2), 0 1px 3px 1px rgba(60,64,67,0.1);
        }
        .search-field-node {
            border: none !important;
            background: transparent !important;
            color: #202124;
            padding: 0 0.25rem !important;
            height: 22px;
            font-size: 0.72rem !important;
        }
        .search-field-node:focus {
            box-shadow: none !important;
            outline: none !important;
        }
        
        /* Compact Form Dropdown Architecture */
        .google-dropdown {
            border: 1px solid #dadce0 !important;
            border-radius: 6px !important;
            color: #4a4a4a !important;
            font-weight: 500;
            background-color: #ffffff;
            height: 26px;
            padding: 0 1.25rem 0 0.4rem !important;
            font-size: 0.68rem !important;
            background-size: 8px 10px !important;
            transition: border-color 0.15s;
        }
        .google-dropdown:focus {
            border-color: #1a73e8 !important;
            color: #202124 !important;
            box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.12) !important;
        }

        /* Material Chips Navigation Tab UI */
        .material-text-chip {
            border: none !important;
            background-color: transparent !important;
            color: #5f6368 !important;
            border-radius: 6px !important;
            padding: 0.3rem 0.6rem !important;
            font-weight: 500;
            font-size: 0.78rem;
            transition: all 0.15s ease !important;
        }
        .material-text-chip:hover {
            background-color: rgba(32, 33, 36, 0.04) !important;
            color: #202124 !important;
        }
        
        /* Interactive Toggle Selections Maps */
        .btn-check:checked + .material-text-chip {
            font-weight: 600;
        }
        .btn-check:checked + .material-text-chip[for^="btn-my-chats"],
        .btn-check:checked + .material-text-chip[for^="btn-my-unread"] {
            color: #1a73e8 !important;
            background-color: #e8f0fe !important;
        }
        .btn-check:checked + .material-text-chip[for^="btn-my-locked"] {
            color: #b06000 !important;
            background-color: #fef7e0 !important;
        }
        .btn-check:checked + .material-text-chip[for^="btn-all-chats"],
        .btn-check:checked + .material-text-chip[for^="btn-single-order"] {
            color: #007b83 !important;
            background-color: #e4f7fb !important;
        }
        .btn-check:checked + .material-text-chip[for^="btn-unassigned-chats"],
        .btn-check:checked + .material-text-chip[for^="btn-archived-chats"] {
            color: #202124 !important;
            background-color: #f1f3f4 !important;
        }
        .btn-check:checked + .material-text-chip[for^="btn-call-logs"] {
            color: #d93025 !important;
            background-color: #fce8e6 !important;
        }
        .btn-check:checked + .material-text-chip[for^="btn-multi-order"] {
            color: #137333 !important;
            background-color: #e6f4ea !important;
        }

        #wa-conversation-list::-webkit-scrollbar {
            width: 5px;
        }
        #wa-conversation-list::-webkit-scrollbar-thumb {
            background: #dadce0;
            border-radius: 10px;
        }

/* ==========================================================================
   Momorita - native-feeling app shell (WhatsApp-inspired)
   Mobile: full-screen panes + bottom tab bar, push/pop navigation.
   Desktop: icon rail + list + detail, all three visible at once.
   ========================================================================== */

:root {
  --wa-green:#00a884; --wa-green-dk:#008069; --wa-teal:#128c7e;
  --bg:#ffffff; --bg-2:#f0f2f5; --bg-3:#e9edef; --bg-chat:#efeae2;
  --panel:#ffffff; --border:#e9edef; --border-2:#d1d7db;
  --text:#111b21; --text-2:#667781; --text-3:#8696a0;
  --bubble-in:#ffffff; --bubble-out:#d9fdd3; --accent:#00a884;
  --danger:#e5484d; --warn:#f0a30a; --ok:#00a884;
  --shadow-1:0 1px 2px rgba(11,20,26,.08); --shadow-2:0 4px 16px rgba(11,20,26,.12);
  --shadow-3:0 12px 40px rgba(11,20,26,.18);
  --rail:216px; --radius:12px; --radius-lg:18px;
  --tabbar:calc(58px + env(safe-area-inset-bottom));
  --navbar:calc(60px + env(safe-area-inset-bottom));
  --header:60px;
  --ease:cubic-bezier(.22,.61,.36,1);
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,"Helvetica Neue",sans-serif;
}
:root[data-theme="dark"], :root:not([data-theme="light"]) {
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#111b21; --bg-2:#202c33; --bg-3:#2a3942; --bg-chat:#0b141a;
    --panel:#111b21; --border:#222d34; --border-2:#2a3942;
    --text:#e9edef; --text-2:#8696a0; --text-3:#667781;
    --bubble-in:#202c33; --bubble-out:#005c4b;
    --shadow-1:0 1px 2px rgba(0,0,0,.3); --shadow-2:0 4px 16px rgba(0,0,0,.4);
    --shadow-3:0 12px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg:#111b21; --bg-2:#202c33; --bg-3:#2a3942; --bg-chat:#0b141a;
  --panel:#111b21; --border:#222d34; --border-2:#2a3942;
  --text:#e9edef; --text-2:#8696a0; --text-3:#667781;
  --bubble-in:#202c33; --bubble-out:#005c4b;
  --shadow-1:0 1px 2px rgba(0,0,0,.3); --shadow-2:0 4px 16px rgba(0,0,0,.4);
  --shadow-3:0 12px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* ---------- native app baseline ---------- */
*,*::before,*::after{box-sizing:border-box}
html,body{height:100%;overscroll-behavior:none}
body{
  margin:0;font-family:var(--font);background:var(--bg-2);color:var(--text);
  font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;text-rendering:optimizeLegibility;
}
/* Chrome (nav, headers, buttons) shouldn't feel like a web page. */
.app, .rail, .tabbar, .pane-header, .btn-ico, .conv-item, .tab-btn{
  -webkit-user-select:none;user-select:none;
}
/* but real content stays selectable */
.msg-text, .pane-body input, .pane-body textarea, table{-webkit-user-select:text;user-select:text}
input,textarea,select,button{font:inherit;color:inherit}
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-thumb{background:var(--border-2);border-radius:3px}
::-webkit-scrollbar-track{background:transparent}
.scroll{overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}

/* ---------- shell ---------- */
.app{
  position:fixed;inset:0;display:grid;background:var(--bg-2);
  grid-template-columns:var(--rail) 1fr;
  grid-template-areas:"rail panes";
}
.rail-btn .badge-dot{
  position:absolute;top:8px;right:8px;min-width:18px;height:18px;padding:0 5px;
  background:var(--wa-green);color:#fff;border-radius:9px;font-size:11px;font-weight:700;
  display:none;place-items:center;line-height:18px;
}
.rail-btn .badge-dot.show{display:grid}

/* the panes column; the chat pane splits itself internally */
.panes{grid-area:panes;position:relative;overflow:hidden;min-width:0}
.pane{
  position:absolute;inset:0;display:none;flex-direction:column;
  background:var(--bg);
}
.pane.active{display:flex}
/* the chat pane is the only one that uses both columns as a split view */
.pane[data-pane="chats"]{padding:0}
.pane[data-pane="chats"].active{display:flex}
.pane[data-pane="chats"] > #whatsapp-container{flex:1;min-height:0}

.pane-header{
  height:var(--header);flex:none;display:flex;align-items:center;gap:12px;
  padding:0 16px;background:var(--bg-2);border-bottom:1px solid var(--border);
  padding-top:env(safe-area-inset-top);height:calc(var(--header) + env(safe-area-inset-top));
}
.pane-title{font-size:19px;font-weight:600;margin:0;flex:1;letter-spacing:-.01em}
.pane-body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:16px}

.btn-ico{
  width:40px;height:40px;border:0;background:transparent;border-radius:50%;
  display:grid;place-items:center;color:var(--text-2);font-size:20px;cursor:pointer;
  transition:background .16s var(--ease);flex:none;
}
.btn-ico:hover{background:var(--bg-3)}
.btn-ico:active{transform:scale(.92)}
.back-btn{display:none}

/* ---------- cards / tables / forms ---------- */
.card2{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow-1);padding:16px;margin-bottom:12px}
.stat-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));margin-bottom:16px}
.stat{background:var(--panel);border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px}
.stat-label{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--text-2);font-weight:600}
.stat-value{font-size:26px;font-weight:700;margin-top:4px;letter-spacing:-.02em}
.tbl-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:var(--radius);
  border:1px solid var(--border);background:var(--panel)}
.tbl-wrap table{width:100%;border-collapse:collapse;min-width:520px;font-size:14px}
.tbl-wrap th{background:var(--bg-2);font-size:12px;text-transform:uppercase;letter-spacing:.04em;
  color:var(--text-2);font-weight:600;text-align:left;padding:10px 14px;position:sticky;top:0;z-index:1}
.tbl-wrap td{padding:12px 14px;border-top:1px solid var(--border)}
.tbl-wrap tr:active{background:var(--bg-2)}

.btn2{border:0;border-radius:22px;padding:10px 18px;font-weight:600;font-size:14px;cursor:pointer;
  background:var(--wa-green);color:#fff;transition:filter .16s var(--ease),transform .1s var(--ease)}
.btn2:hover{filter:brightness(1.06)} .btn2:active{transform:scale(.97)}
.btn2.ghost{background:var(--bg-3);color:var(--text)}
.btn2.danger{background:var(--danger)}
.field{width:100%;padding:11px 14px;border:1px solid var(--border-2);border-radius:10px;
  background:var(--bg);color:var(--text);outline:0;transition:border-color .16s var(--ease)}
.field:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(0,168,132,.15)}
.pill{display:inline-block;padding:3px 10px;border-radius:11px;font-size:12px;font-weight:600}
.pill.ok{background:rgba(0,168,132,.14);color:var(--ok)}
.pill.warn{background:rgba(240,163,10,.16);color:var(--warn)}
.pill.danger{background:rgba(229,72,77,.14);color:var(--danger)}
.pill.lock{background:rgba(240,163,10,.16);color:var(--warn)}


/* ==========================================================================
   Chat panel header - the list used to sit under ~330px of stacked toolbars
   (date range, metrics ribbon, agent clock, ticker, search, 3 dropdowns,
   chips). Heavy controls now collapse behind two toggles; collapsed the
   chrome is ~140px, so the conversation list gets the screen.
   ========================================================================== */
.wa-panel-head{
  display:flex;align-items:center;gap:6px;flex:none;
  padding:10px 12px;background:var(--bg);border-bottom:1px solid var(--border);
}
.wa-panel-title{
  flex:1;min-width:0;display:flex;align-items:center;gap:8px;
  font-size:18px;font-weight:650;letter-spacing:-.015em;color:var(--text);
}
.wa-count{
  font-size:12px;font-weight:600;color:var(--text-2);background:var(--bg-3);
  padding:1px 8px;border-radius:9px;
}
.wa-count:empty{display:none}
.wa-head-btn{
  position:relative;width:36px;height:36px;flex:none;border:0;border-radius:10px;
  background:transparent;color:var(--text-2);font-size:17px;cursor:pointer;
  display:grid;place-items:center;transition:background .16s var(--ease),color .16s var(--ease);
}
.wa-head-btn:hover{background:var(--bg-3);color:var(--text)}
.wa-head-btn:active{transform:scale(.94)}
.wa-head-btn.on{background:rgba(0,168,132,.14);color:var(--accent)}
.wa-dot{
  position:absolute;top:6px;right:6px;width:7px;height:7px;border-radius:50%;
  background:var(--wa-green);display:none;box-shadow:0 0 0 2px var(--bg);
}
.wa-dot.show{display:block}

/* collapsible sections */
.wa-collapse{display:none}
.wa-collapse.open{display:block}

/* the collapsed toolbars read as one calm surface */
#wa-insights-panel .stats-bar-minimal{border-bottom:0}
#wa-filters{border-bottom:1px solid var(--border)}

/* the list must own the remaining height */
#conversation-panel{min-height:0}
#wa-conversation-list{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}

/* chips: quieter, still scrollable */
.mobile-scroll-tabs .material-text-chip{
  border-radius:16px!important;font-size:12.5px;padding:5px 12px;font-weight:550;
  border:1px solid var(--border-2);background:var(--bg);color:var(--text-2);
}
.mobile-scroll-tabs .btn-check:checked + .material-text-chip{
  background:var(--accent);border-color:var(--accent);color:#fff;
}

@media (max-width:720px){
  .wa-panel-head{padding:8px 10px}
  .wa-panel-title{font-size:16.5px}
}




/* filter rail: keep the colour-coding legible on dark backgrounds */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) #wa-filter-rail .material-text-chip{color:var(--text-2)!important}
  :root:not([data-theme="light"]) #wa-filter-rail .material-text-chip:hover{background:var(--bg-3)!important;color:var(--text)!important}
  :root:not([data-theme="light"]) #wa-filter-rail .btn-check:checked + .material-text-chip{background:var(--bg-3)!important}
}
:root[data-theme="dark"] #wa-filter-rail .material-text-chip{color:var(--text-2)!important}
:root[data-theme="dark"] #wa-filter-rail .material-text-chip:hover{background:var(--bg-3)!important;color:var(--text)!important}
:root[data-theme="dark"] #wa-filter-rail .btn-check:checked + .material-text-chip{background:var(--bg-3)!important}


/* ==========================================================================
   ERP-grade chat surface. The legacy markup carries heavy inline styles, so
   these overrides are deliberately specific: tighter density, one type scale,
   restrained colour, hairline rules instead of chat-app flourishes.
   ========================================================================== */

/* ---- avatar: initials, stable colour, mood demoted to a corner dot ---- */
.wa-avatar{
  position:relative;width:42px;height:42px;border-radius:9px;margin-right:12px;
  display:grid;place-items:center;flex:none;
  background:color-mix(in srgb, var(--av) 12%, transparent);
  border:1px solid color-mix(in srgb, var(--av) 22%, transparent);
}
.wa-avatar-initials{
  font-size:14px;font-weight:650;letter-spacing:.02em;color:var(--av);
  font-variant-numeric:tabular-nums;
}
.wa-avatar-mood{
  position:absolute;right:-3px;bottom:-3px;font-size:11px;line-height:1;
  background:var(--bg);border-radius:50%;padding:1px;
  box-shadow:0 0 0 1px var(--border);
}

/* ---- conversation row ---- */
#wa-conversation-list .conversation-item{
  padding:11px 14px!important;gap:0;
  border-bottom:1px solid var(--border)!important;
  background:var(--bg);
}
#wa-conversation-list .conversation-item:hover{background:var(--bg-2)}
#wa-conversation-list .conversation-item.active{
  background:var(--bg-2);box-shadow:inset 3px 0 0 var(--accent);
}
#wa-conversation-list .conversation-item strong{
  font-size:14px!important;font-weight:600!important;color:var(--text)!important;
  letter-spacing:-.005em;
}
#wa-conversation-list .conversation-item .last-message{
  font-size:12.5px!important;color:var(--text-2)!important;
}
#wa-conversation-list .conversation-item small{color:var(--text-2)!important}
#wa-conversation-list .conversation-item .font-monospace{
  font-family:var(--font)!important;font-variant-numeric:tabular-nums;
  font-size:11.5px!important;letter-spacing:0;
}
/* metadata lines: one muted voice instead of four competing colours */
#wa-conversation-list .conversation-item-details > div:nth-child(n+4) small{
  font-size:11.5px!important;color:var(--text-2)!important;
}
#wa-conversation-list .conversation-item .bi-sticky-fill,
#wa-conversation-list .conversation-item .bi-sticky-fill + small{
  color:var(--text-2)!important;
}
#wa-conversation-list .conversation-item .badge{
  font-weight:600;letter-spacing:.01em;border-radius:5px;
}
.conversation-tags-container .badge{
  border-radius:5px!important;font-size:10.5px!important;
  padding:2px 6px!important;font-weight:600!important;
}

/* ---- chat header ---- */
#wa-chat-header{
  background:var(--bg-2)!important;border-bottom:1px solid var(--border)!important;
  /* height is set by the CHAT HEADER block below; a fixed !important height
     here overrode it and squashed the two-line name/number. */
}
#wa-chat-name{font-size:14.5px!important;font-weight:650!important;color:var(--text)!important}
#wa-chat-id{font-family:var(--font)!important;font-size:11.5px!important;color:var(--text-2)!important;font-variant-numeric:tabular-nums}

/* ---- message thread ---- */
#wa-chat-messages{background:var(--bg-chat)!important;padding:16px 5%!important}
.message-bubble{
  border-radius:10px!important;box-shadow:var(--shadow-1)!important;
  font-size:13.5px!important;line-height:1.5;padding:8px 11px!important;
  border:1px solid var(--border)!important;
}
.message-in{background:var(--bubble-in)!important}
.message-out{background:var(--bubble-out)!important;border-color:transparent!important}
.date-separator span{
  background:var(--bg-2)!important;color:var(--text-2)!important;
  font-size:11px!important;font-weight:600;letter-spacing:.03em;text-transform:uppercase;
  border-radius:6px!important;padding:4px 10px!important;box-shadow:var(--shadow-1);
}
.message-timestamp{font-size:10.5px!important;color:var(--text-2)!important;font-variant-numeric:tabular-nums}

/* ---- composer ---- */
#wa-message-form-footer{
  background:var(--bg-2)!important;border-top:1px solid var(--border)!important;
  padding:10px 12px!important;
}
#wa-message-input{
  border-radius:10px!important;background:var(--bg)!important;
  border:1px solid var(--border-2)!important;height:42px!important;font-size:13.5px;
}
#wa-message-input:focus{border-color:var(--accent)!important;box-shadow:0 0 0 3px rgba(0,168,132,.14)!important}
#wa-send-btn{
  background:var(--accent)!important;border-radius:10px!important;
  width:42px!important;height:42px!important;
}
#wa-attach-btn{border-radius:10px!important;width:42px!important;height:42px!important;background:var(--bg)!important;border:1px solid var(--border-2)!important}

/* ---- search + panel chrome ---- */
.google-search-wrap{
  background:var(--bg-2)!important;border:1px solid transparent!important;
  border-radius:9px!important;padding:2px 10px!important;
}
.google-search-wrap:focus-within{border-color:var(--accent)!important;background:var(--bg)!important}
#filter-search-query{background:transparent!important;font-size:13.5px!important;border:0!important;box-shadow:none!important}
.google-dropdown{
  border-radius:8px!important;border:1px solid var(--border-2)!important;
  font-size:12.5px!important;background:var(--bg)!important;color:var(--text)!important;
}
#conversation-panel{background:var(--bg)!important;border-right:1px solid var(--border)!important}
#wa-filters{background:var(--bg)!important}
.stats-bar-minimal{background:var(--bg)!important}


/* ==========================================================================
   ONE navigation. Chat views (My Chats, Tickets, Unread...) and business
   sections (Dashboard, Orders, Staff) are a single list, not two parallel
   navigations. Desktop: fixed sidebar. Phone: the same element slides up as
   the bottom-bar menu, so there is only ever one nav surface.
   ========================================================================== */
#app-nav{
  grid-area:rail;display:flex;flex-direction:column;min-height:0;
  width:100%;background:var(--bg-2);border-right:1px solid var(--border);
}
.nav-brand{
  display:flex;align-items:center;gap:10px;flex:none;
  padding:14px 14px 10px;
}
.nav-logo{
  width:30px;height:30px;border-radius:9px;background:var(--wa-green);color:#fff;
  display:grid;place-items:center;font-weight:700;font-size:14px;flex:none;
}
.nav-brand-text{font-weight:650;font-size:15px;letter-spacing:-.01em;color:var(--text)}
.nav-scroll{
  flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;padding:0 8px 8px;
}
.nav-group-label{
  font-size:10.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
  color:var(--text-3);padding:12px 8px 5px;
}
.nav-foot{flex:none;padding:6px 8px calc(8px + env(safe-area-inset-bottom));border-top:1px solid var(--border)}

/* one row style for BOTH chat views and business sections */
.nav-item,
#wa-filter-rail .material-text-chip{
  display:flex;align-items:center;gap:10px;width:100%;
  padding:8px 10px!important;margin:0;border:0;background:transparent!important;
  border-radius:8px!important;text-align:left;justify-content:flex-start;
  font-size:13.5px!important;font-weight:550!important;color:var(--text-2)!important;
  cursor:pointer;text-decoration:none;transition:background .14s var(--ease),color .14s var(--ease);
}
.nav-item i,
#wa-filter-rail .material-text-chip i{
  font-size:15px!important;width:18px;text-align:center;flex:none;opacity:.85;margin:0!important;
}
.nav-item:hover,
#wa-filter-rail .material-text-chip:hover{background:var(--bg-3)!important;color:var(--text)!important}
.nav-item.active{background:var(--bg-3)!important;color:var(--text)!important;font-weight:650!important}
.nav-item.active i{color:var(--accent)!important;opacity:1}
#wa-filter-rail .btn-check:checked + .material-text-chip{
  background:var(--bg-3)!important;color:var(--text)!important;font-weight:650!important;
  box-shadow:inset 3px 0 0 var(--accent);
}
/* neutralise the old horizontal-scroller wrappers */
#wa-filter-rail,#wa-filter-rail > div{
  width:auto!important;background:transparent!important;border:0!important;padding:0!important;
}
#wa-filter-rail .overflow-x-auto{overflow:visible!important;white-space:normal!important}
#wa-filter-rail .mobile-scroll-tabs{
  display:flex;flex-direction:column;align-items:stretch;min-width:0!important;gap:1px!important;
}

/* the chats pane no longer holds a nav column */
.pane[data-pane="chats"].active{display:flex;flex-direction:row}


/* ==========================================================================
   Insights panel (date range + KPI ribbon + staff ticker).
   Was: cramped monospace strips with hairline dividers and mixed colours.
   Now: a proper toolbar, three KPI tiles, and staff cards on one grid.
   ========================================================================== */
#wa-insights-panel .stats-bar-minimal{
  background:var(--bg)!important;padding:12px 14px!important;border-bottom:0!important;
}

/* --- toolbar: date range + sync --- */
#wa-insights-panel .top-proportional-row{
  display:flex!important;align-items:center;gap:8px;
}
#wa-insights-panel .compact-date-wrapper{display:flex;align-items:center;gap:6px;flex:1;min-width:0}
#wa-insights-panel #stat-from-date,
#wa-insights-panel #stat-to-date{
  height:34px!important;border-radius:8px!important;
  border:1px solid var(--border-2)!important;background:var(--bg)!important;
  color:var(--text)!important;font-family:var(--font)!important;
  font-size:12.5px!important;font-variant-numeric:tabular-nums;padding:0 8px!important;
}
#wa-insights-panel #stat-from-date:focus,
#wa-insights-panel #stat-to-date:focus{
  border-color:var(--accent)!important;box-shadow:0 0 0 3px rgba(0,168,132,.14)!important;
}
#wa-insights-panel .col-20-proportional{flex:none;width:auto}
#wa-insights-panel #btn-refresh-stats{
  height:34px!important;min-width:74px;border-radius:8px!important;
  background:var(--bg)!important;border:1px solid var(--border-2)!important;
  color:var(--text-2)!important;font-family:var(--font)!important;
  font-size:12px!important;font-weight:600!important;font-variant-numeric:tabular-nums;
}
#wa-insights-panel #btn-refresh-stats:hover{background:var(--bg-3)!important;color:var(--text)!important}

/* --- KPI tiles: replace the divider ribbon with real cards --- */
#wa-insights-panel .stats-bar-minimal > .container-fluid > .d-flex.bg-light{
  background:transparent!important;border:0!important;border-radius:0!important;
  display:grid!important;grid-template-columns:repeat(3,1fr);gap:8px;
  padding:0!important;margin-top:10px!important;font-family:var(--font)!important;
  font-size:inherit!important;
}
#wa-insights-panel .stats-bar-minimal > .container-fluid > .d-flex.bg-light > div{
  border:1px solid var(--border)!important;border-radius:10px;background:var(--bg-2);
  padding:8px 10px!important;text-align:left!important;color:var(--text-2)!important;
  display:flex;flex-direction:column;gap:2px;font-weight:500!important;
  font-size:10.5px!important;text-transform:uppercase;letter-spacing:.05em;
}
#wa-insights-panel .stats-bar-minimal > .container-fluid > .d-flex.bg-light > div strong{
  font-size:17px!important;font-weight:700!important;color:var(--text)!important;
  letter-spacing:-.02em;text-transform:none;font-variant-numeric:tabular-nums;
}
#wa-insights-panel .stats-bar-minimal > .container-fluid > .d-flex.bg-light > div i{
  display:none!important;
}
#wa-insights-panel .stats-bar-minimal > .container-fluid > .d-flex.bg-light > div span.text-muted{
  font-size:11px!important;color:var(--text-3)!important;letter-spacing:0;text-transform:none;
}

/* --- staff ticker: consistent cards on one rail --- */
#wa-insights-panel .line-two{border-top:1px solid var(--border)!important;margin-top:10px!important;padding-top:10px!important;background:transparent!important}
#staff-performance-ticker{gap:8px!important;padding-bottom:2px!important}
#staff-performance-ticker > div{
  height:auto!important;border-radius:10px!important;
  border:1px solid var(--border)!important;background:var(--bg-2)!important;
  padding:8px 10px!important;gap:8px!important;font-size:11.5px!important;
  box-shadow:none!important;align-items:center!important;
}
#staff-performance-ticker .fw-semibold{font-size:12.5px!important;font-weight:650!important;color:var(--text)!important}
#staff-performance-ticker .text-muted.opacity-50{display:none!important}
#staff-performance-ticker .bg-warning{
  background:transparent!important;border:0!important;padding:0!important;
  color:var(--text-2)!important;font-family:var(--font)!important;
  font-size:11.5px!important;font-weight:600!important;font-variant-numeric:tabular-nums;
}
#staff-performance-ticker .bg-warning i{color:var(--warn)!important}
#staff-performance-ticker .text-success,
#staff-performance-ticker .text-primary{
  font-size:11.5px!important;font-weight:600!important;font-variant-numeric:tabular-nums;
}
#staff-performance-ticker .text-success{color:var(--ok)!important}
#staff-performance-ticker .text-primary{color:var(--text-2)!important}

@media (max-width:720px){
  #wa-insights-panel .stats-bar-minimal > .container-fluid > .d-flex.bg-light{
    grid-template-columns:1fr 1fr;
  }
  #wa-insights-panel .stats-bar-minimal > .container-fluid > .d-flex.bg-light > div:first-child{
    grid-column:1 / -1;
  }
}


/* Contextual sub-filters, now above the conversation list */
#segment-team-filter-subbar,#ticket-filter-subbar{
  background:var(--bg-2)!important;border-top:1px solid var(--border)!important;
  border-bottom:1px solid var(--border)!important;padding:8px 12px!important;
}
#ticket-filter-subbar .btn-group{gap:4px}
#ticket-filter-subbar .btn{
  border-radius:8px!important;font-size:12px!important;font-weight:600!important;
  padding:6px 10px!important;
}


/* ==========================================================================
   CRM: follow-up badge, pipeline board
   ========================================================================== */
.nav-badge{
  display:none;margin-left:6px;min-width:18px;height:18px;padding:0 5px;
  border-radius:9px;background:var(--danger);color:#fff;
  font-size:10.5px;font-weight:700;line-height:18px;text-align:center;
}
.nav-badge.show{display:inline-block}

/* board: one column per stage, scrolls horizontally like a real kanban */
.pipeline-board{
  display:flex;gap:12px;align-items:flex-start;height:100%;
  overflow-x:auto;overflow-y:hidden;padding:14px;
  -webkit-overflow-scrolling:touch;
}
.pipe-col{
  flex:0 0 272px;display:flex;flex-direction:column;max-height:100%;
  background:var(--bg-2);border:1px solid var(--border);border-radius:12px;padding:10px;
}
.pipe-col-head{display:flex;align-items:center;gap:8px}
.pipe-dot{width:9px;height:9px;border-radius:50%;background:var(--st);flex:none}
.pipe-name{font-size:13px;font-weight:650;color:var(--text);flex:1;min-width:0;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pipe-count{font-size:11.5px;font-weight:700;color:var(--text-2);
  background:var(--bg-3);border-radius:9px;padding:1px 7px;font-variant-numeric:tabular-nums}
.pipe-edit{width:28px;height:28px;font-size:14px}
.pipe-desc{font-size:11.5px;color:var(--text-2);margin:6px 0 0;line-height:1.4}
.pipe-cards{
  margin-top:8px;display:flex;flex-direction:column;gap:8px;
  overflow-y:auto;min-height:60px;padding:2px;
}
.pipe-cards.over{outline:2px dashed var(--accent);outline-offset:2px;border-radius:8px}
.pipe-card{
  background:var(--bg);border:1px solid var(--border);border-radius:9px;padding:9px 10px;
  display:flex;flex-direction:column;gap:3px;cursor:pointer;
  box-shadow:var(--shadow-1);transition:border-color .14s var(--ease),transform .1s var(--ease);
}
.pipe-card:hover{border-color:var(--border-2)}
.pipe-card:active{transform:scale(.99)}
.pipe-card.dragging{opacity:.45}
.pipe-card strong{font-size:13px;font-weight:600;color:var(--text)}
.pipe-card-msg{font-size:11.5px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pipe-card-meta{display:flex;flex-wrap:wrap;gap:8px;font-size:10.5px;color:var(--text-3);margin-top:2px}
.pipe-empty{font-size:11.5px;color:var(--text-3);margin:6px 2px}

@media (max-width:720px){
  .pipeline-board{padding:10px;gap:10px}
  .pipe-col{flex:0 0 84vw}
}


/* ==========================================================================
   Inline CRM strip on every conversation row: follow-up, stage, note and the
   three actions, so an agent updates a chat without leaving the list.
   ========================================================================== */
.crm-strip{
  margin-top:8px;padding-top:8px;border-top:1px dashed var(--border);
  display:flex;flex-direction:column;gap:6px;cursor:default;
}
.crm-row{display:flex;align-items:center;gap:6px}
.crm-field{
  display:flex;align-items:center;gap:6px;flex:1;min-width:0;margin:0;
  background:var(--bg-2);border:1px solid var(--border);border-radius:8px;
  padding:0 8px;height:32px;
}
.crm-field:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px rgba(0,168,132,.12)}
.crm-field > i{font-size:12px;color:var(--text-3);flex:none}
.crm-field input,.crm-field select{
  flex:1;min-width:0;border:0;outline:0;background:transparent;color:var(--text);
  font-size:12px;font-family:var(--font);height:30px;padding:0;
}
.crm-field input[type="date"]{font-variant-numeric:tabular-nums;max-width:130px}
.crm-note-wrap{flex:1}
.crm-saved{
  font-size:10.5px;font-weight:600;color:var(--ok);min-width:38px;text-align:right;flex:none;
}
.crm-saved.bad{color:var(--danger)}

.crm-actions{display:flex;gap:6px}
.crm-btn{
  flex:1;display:inline-flex;align-items:center;justify-content:center;gap:5px;
  height:32px;border-radius:8px;border:1px solid var(--border-2);
  background:var(--bg);color:var(--text-2);
  font-size:11.5px;font-weight:600;cursor:pointer;text-decoration:none;
  transition:background .14s var(--ease),color .14s var(--ease),border-color .14s var(--ease);
}
.crm-btn i{font-size:13px}
.crm-btn:hover{background:var(--bg-3);color:var(--text)}
.crm-btn:active{transform:scale(.98)}
.crm-open:hover{border-color:var(--accent);color:var(--accent)}
.crm-tel:hover{border-color:#0b6bcb;color:#0b6bcb}
.crm-sys:hover{border-color:var(--warn);color:var(--warn)}

@media (max-width:720px){
  .crm-btn{font-size:11px;height:34px}
  .crm-field{height:34px}
  .crm-field input[type="date"]{max-width:none}
}


/* open-lead capacity indicator */
.lead-pill{
  font-size:11px;font-weight:650;color:var(--text-2);background:var(--bg-3);
  padding:2px 8px;border-radius:9px;white-space:nowrap;font-variant-numeric:tabular-nums;
}
.lead-pill:empty{display:none}
.lead-pill.full{background:rgba(229,72,77,.14);color:var(--danger)}



.crm-lock.on{border-color:var(--ok);color:var(--ok)}
.crm-lock:hover{border-color:var(--accent);color:var(--accent)}

/* chat-lock chip: who holds the lead and how long is left on it */
.lock-chip{
  display:inline-flex;align-items:center;gap:5px;
  font-size:10.5px;font-weight:600;padding:2px 8px;border-radius:5px;
  background:rgba(0,168,132,.12);color:var(--ok);
}
.lock-chip.soon{background:rgba(240,163,10,.16);color:var(--warn)}
.lock-chip.expired{background:var(--bg-3);color:var(--text-3)}
.lock-chip i{font-size:10px}

/* ---------- phone: the nav IS the bottom bar, scrolling left/right ----------
   No sheet, no overlay, no toggle: every destination is always on screen and
   reachable by swiping the bar. */
@media (max-width:900px){
  #app-nav{
    position:fixed;left:0;right:0;bottom:0;top:auto;z-index:68;
    width:auto;max-height:none;height:var(--navbar);
    flex-direction:row;align-items:stretch;
    border-right:0;border-top:1px solid var(--border);
    background:color-mix(in srgb,var(--bg-2) 92%,transparent);
    -webkit-backdrop-filter:saturate(180%) blur(18px);backdrop-filter:saturate(180%) blur(18px);
    border-radius:0;box-shadow:none;
    transform:none;visibility:visible;overflow:visible;
    padding:0 0 env(safe-area-inset-bottom);
  }
  .nav-brand{display:none}
  .nav-group-label{display:none}

  /* the bar itself is the scroller, so Theme/Sign out scroll with everything
     else instead of stealing width from the strip */
  #app-nav{
    overflow-x:auto;overflow-y:hidden;
    -webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;
    scrollbar-width:none;
  }
  #app-nav::-webkit-scrollbar{display:none}
  #app-nav .nav-scroll{
    flex:none;display:flex;flex-direction:row;align-items:stretch;
    overflow:visible;padding:0;min-width:0;
  }
  #app-nav .nav-foot{
    display:flex;flex-direction:row;align-items:stretch;flex:none;
    border-top:0;border-left:1px solid var(--border);padding:0;margin-left:2px;
  }
  #wa-filter-rail{display:flex;flex-direction:row;align-items:stretch}
  #wa-filter-rail .mobile-scroll-tabs{
    flex-direction:row!important;align-items:stretch;gap:0!important;min-width:max-content!important;
  }
  /* every destination renders as an icon + label tab */
  .nav-item,
  #wa-filter-rail .material-text-chip{
    flex-direction:column!important;justify-content:center!important;align-items:center!important;
    gap:3px!important;width:auto!important;min-width:66px;
    padding:7px 10px!important;border-radius:0!important;
    font-size:10.5px!important;font-weight:600!important;line-height:1.15;
    white-space:nowrap;box-shadow:none!important;
  }
  .nav-item i,
  #wa-filter-rail .material-text-chip i{font-size:19px!important;width:auto;opacity:.9}
  .nav-item.active,
  #wa-filter-rail .btn-check:checked + .material-text-chip{
    background:transparent!important;color:var(--accent)!important;
    box-shadow:inset 0 2px 0 var(--accent)!important;
  }
  .nav-item.active i{color:var(--accent)!important;opacity:1}

  /* panes clear the bar */
  .app{grid-template-columns:1fr;grid-template-areas:"panes"}
  .panes{padding-bottom:var(--navbar)}
  .pane{bottom:var(--navbar)}
  .tabbar{display:none}
}


/* ---------- bottom tab bar (mobile only) ---------- */
.tabbar{
  display:none;position:fixed;left:0;right:0;bottom:0;height:var(--tabbar);z-index:68;
  background:color-mix(in srgb,var(--bg-2) 88%,transparent);
  -webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);
  border-top:1px solid var(--border);
  padding-bottom:env(safe-area-inset-bottom);
}
.tabbar-inner{display:flex;height:58px}
.tab-btn{flex:1;border:0;background:transparent;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:2px;color:var(--text-2);font-size:10.5px;font-weight:500;cursor:pointer;
  position:relative;transition:color .16s var(--ease)}
.tab-btn i{font-size:21px}
.tab-btn.active{color:var(--accent)}
.tab-btn:active i{transform:scale(.88)}
/* ---------- app dialogs (replace native alert / confirm / prompt) ---------- */
/* Above Bootstrap modals (1055) so a dialog raised from inside a modal is
   reachable, and its own stacking context so nothing can paint over it. */
.mo-dlg-wrap{position:fixed;inset:0;z-index:20000;display:flex;align-items:center;
  justify-content:center;padding:20px;background:rgba(15,18,22,.46);
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
  opacity:0;transition:opacity .16s ease}
.mo-dlg-wrap.in{opacity:1}
.mo-dlg{width:100%;max-width:400px;background:var(--bg-2,#fff);color:var(--text,#111);
  border:1px solid var(--border,#e3e6ea);border-radius:16px;
  box-shadow:0 18px 48px rgba(0,0,0,.28);overflow:hidden;
  transform:translateY(8px) scale(.98);transition:transform .16s var(--ease,ease)}
.mo-dlg-wrap.in .mo-dlg{transform:none}
.mo-dlg-body{padding:20px 20px 4px}
.mo-dlg-title{font-size:15.5px;font-weight:650;margin:0 0 6px;letter-spacing:-.01em}
.mo-dlg-msg{font-size:13.5px;line-height:1.5;color:var(--text-2,#5a6270);margin:0;
  white-space:pre-wrap;word-break:break-word;max-height:46vh;overflow-y:auto}
.mo-dlg-input{width:100%;margin-top:14px;padding:9px 11px;font-size:13.5px;
  color:var(--text,#111);background:var(--bg,#fff);
  border:1px solid var(--border,#d7dbe0);border-radius:9px;outline:none}
.mo-dlg-input:focus{border-color:var(--accent,#0a84ff);box-shadow:0 0 0 3px rgba(10,132,255,.16)}
.mo-dlg-foot{display:flex;gap:8px;justify-content:flex-end;padding:16px 20px 18px}
.mo-dlg-btn{appearance:none;border:1px solid transparent;border-radius:9px;
  padding:8px 15px;font-size:13px;font-weight:600;cursor:pointer;
  transition:filter .14s ease,background .14s ease}
.mo-dlg-btn:active{transform:translateY(1px)}
.mo-dlg-btn.ghost{background:transparent;border-color:var(--border,#d7dbe0);color:var(--text-2,#5a6270)}
.mo-dlg-btn.ghost:hover{background:var(--bg,#f4f6f8)}
.mo-dlg-btn.primary{background:var(--accent,#0a84ff);color:#fff}
.mo-dlg-btn.primary:hover{filter:brightness(1.06)}
.mo-dlg-btn.danger{background:#dc3545;color:#fff}
.mo-dlg-btn.danger:hover{filter:brightness(1.06)}
.mo-dlg-icon{font-size:19px;line-height:1;margin-bottom:8px;display:block}
@media (max-width:420px){ .mo-dlg{max-width:100%} .mo-dlg-foot{padding-bottom:22px} }
@media (prefers-reduced-motion:reduce){
  .mo-dlg-wrap,.mo-dlg{transition:none}
}

.tab-more{position:fixed;inset:0;z-index:70;display:none;background:rgba(0,0,0,.4);
  -webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}
.tab-more.show{display:block}
.tab-more-sheet{position:absolute;left:0;right:0;bottom:0;background:var(--bg);
  border-radius:16px 16px 0 0;padding:8px 8px calc(8px + env(safe-area-inset-bottom));
  animation:sheet .24s var(--ease)}
@keyframes sheet{from{transform:translateY(100%)}to{transform:none}}
.tab-more-sheet .grab{width:36px;height:4px;border-radius:2px;background:var(--border-2);margin:6px auto 12px}
.sheet-item{display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:10px;
  cursor:pointer;font-weight:500}
.sheet-item:active{background:var(--bg-2)}
.sheet-item i{font-size:20px;color:var(--text-2);width:24px;text-align:center}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet: drop the rail, keep the chat split view */
@media (max-width:900px){
  .app{grid-template-columns:1fr;grid-template-areas:"panes"}
  .tabbar{display:block}
  /* .pane is absolutely positioned, so it ignores padding on .panes --
     inset its bottom instead or the chat composer hides behind the tab bar. */
  .pane{bottom:var(--tabbar)}
}

/* Phone: one full-screen pane at a time, push/pop between list and thread */
@media (max-width:720px){
  .back-btn{display:grid}
  .pane-body{padding:12px}
  .stat-grid{grid-template-columns:repeat(2,1fr);gap:10px}
  .stat-value{font-size:22px}
  .pane-title{font-size:17px}
  /* full-width sheet-style modals on phones */
  .modal-dialog{margin:0;max-width:100%;height:100%}
  .modal-content{border-radius:0;min-height:100%;border:0}
}
@media (max-width:400px){ .stat-grid{grid-template-columns:1fr} }

/* Landscape phones: reclaim vertical space */
@media (max-height:480px) and (orientation:landscape){
  :root{--header:48px;--tabbar:calc(46px + env(safe-area-inset-bottom))}
  .tabbar-inner{height:46px}
  .tab-btn{font-size:9.5px} .tab-btn i{font-size:18px}
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}
}

/* ==========================================================================
   CONVERSATION VIEW -- final pass.
   Loaded last so it settles the earlier layers rather than fighting them.
   ========================================================================== */

/* ---- 1. the timestamp overlap ----
   The original bubble reserved 24px of bottom padding for a timestamp pinned
   with position:absolute. A later override reset padding with !important and
   took that space away, so the time printed on top of the last line of text.
   The timestamp is already a normal sibling element, so putting it back in
   flow fixes it for every message length -- no reserved space to keep in sync. */
.message-bubble{
  position:relative;
  display:flex!important;flex-direction:column;
  max-width:min(78%,560px)!important;
  padding:7px 10px 5px!important;
  border:0!important;
  border-radius:13px!important;
  box-shadow:0 1px 1.5px rgba(11,20,26,.13)!important;
  font-size:14px!important;line-height:1.45!important;
}
.message-timestamp{
  position:static!important;
  align-self:flex-end;
  display:inline-flex;align-items:center;gap:3px;
  margin-top:2px;
  font-size:10.5px!important;line-height:1;
  opacity:.62;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
  pointer-events:none;
}
.message-out .message-timestamp{opacity:.7}
.message-content{font-size:inherit!important;line-height:inherit!important}
.message-content:empty{display:none}

/* ---- 2. tails and grouping ----
   Only the first bubble of a run gets a squared corner, so a burst of messages
   reads as one block instead of a row of identical lozenges. */
.message-wrapper{margin-bottom:2px!important;padding:0!important}
.message-wrapper + .message-wrapper{margin-top:0}
.message-in{border-top-left-radius:13px!important}
.message-out{border-top-right-radius:13px!important}
.message-wrapper.justify-content-start:first-of-type .message-in,
.message-wrapper.justify-content-end + .message-wrapper.justify-content-start .message-in{
  border-top-left-radius:4px!important;
}
.message-wrapper.justify-content-end:first-of-type .message-out,
.message-wrapper.justify-content-start + .message-wrapper.justify-content-end .message-out{
  border-top-right-radius:4px!important;
}
/* breathing room between speakers */
.message-wrapper.justify-content-start + .message-wrapper.justify-content-end,
.message-wrapper.justify-content-end + .message-wrapper.justify-content-start{
  margin-top:10px!important;
}

/* ---- 3. surface ---- */
#wa-chat-messages{
  padding:14px 4% 18px!important;
  scroll-behavior:smooth;
  overscroll-behavior:contain;
}
.date-separator{margin:14px 0 10px!important}

/* ---- 4. links and attachments inside bubbles ----
   A link on the green outbound bubble was near-unreadable in the default blue. */
.message-bubble a{word-break:break-word}
.message-out a,.message-out .link-primary{color:#036b5b!important;text-decoration-color:rgba(3,107,91,.4)}
:root[data-theme="dark"] .message-out a,
:root[data-theme="dark"] .message-out .link-primary{color:#7ee3cd!important}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]) .message-out a,
  :root:not([data-theme="light"]) .message-out .link-primary{color:#7ee3cd!important}
}
/* media / document links read as an attachment row, not a sentence */
.message-bubble > .message-content > a[target="_blank"]{
  display:inline-flex;align-items:center;gap:7px;
  padding:7px 10px;margin:1px 0 2px;
  border-radius:9px;
  background:rgba(11,20,26,.06);
  font-weight:600;font-size:13px;text-decoration:none!important;
}
.message-out > .message-content > a[target="_blank"]{background:rgba(0,0,0,.07)}
.message-bubble > .message-content > a[target="_blank"]:hover{background:rgba(11,20,26,.11)}

/* ---- 5. the hover menu must never sit on the text ---- */
.message-actions{top:1px!important;right:2px!important}
.message-bubble:hover .message-content{padding-right:14px}
/* On touch there is no hover, so the menu was hidden entirely and copy became
   unreachable on a phone. Show it faintly instead, and keep long-press as the
   quicker path. */
@media (hover:none){
  /* Fade the CARET, never the container: opacity on .message-actions cascades
     to the dropdown it owns, so the open menu rendered at 45% and the message
     text showed straight through it. */
  .message-actions{opacity:1!important;visibility:visible!important}
  .message-actions .dropdown-toggle{padding:2px 4px!important;opacity:.45}
  .message-actions.show .dropdown-toggle,
  .message-actions .dropdown-toggle:active{opacity:1}
  .message-content{padding-right:16px}
}
/* The menu is a floating surface -- always opaque, always above the thread. */
.message-actions .dropdown-menu{
  opacity:1!important;
  background:var(--bg-2)!important;
  border:1px solid var(--border)!important;
  box-shadow:var(--shadow-2)!important;
  z-index:1080;
  --bs-dropdown-bg:var(--bg-2);
  --bs-dropdown-link-color:var(--text);
  --bs-dropdown-link-hover-bg:var(--bg-3);
}
.message-actions .dropdown-item{color:var(--text)!important;font-size:13px}
.message-actions .dropdown-item:hover{background:var(--bg-3)!important}
.message-actions .dropdown-toggle::after{display:none}

/* ---- transient toast ---- */
#mo-toast-host{
  position:fixed;left:50%;bottom:calc(22px + env(safe-area-inset-bottom));
  transform:translateX(-50%);
  z-index:21000;display:flex;flex-direction:column;gap:8px;align-items:center;
  pointer-events:none;
}
.mo-toast{
  padding:9px 16px;border-radius:20px;
  background:rgba(17,27,33,.92);color:#fff;
  font-size:13px;font-weight:600;letter-spacing:.01em;
  box-shadow:0 6px 22px rgba(0,0,0,.28);
  opacity:0;transform:translateY(8px);
  transition:opacity .18s var(--ease),transform .18s var(--ease);
  max-width:80vw;text-align:center;
}
.mo-toast.in{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){ .mo-toast{transition:none} }

/* ---- 6. composer ---- */
#wa-message-form-footer{padding:8px 10px calc(8px + env(safe-area-inset-bottom))!important}
#wa-message-input{
  font-size:14.5px;padding:10px 16px!important;border-radius:22px!important;
  background:var(--bg)!important;border:1px solid var(--border)!important;
}
#wa-message-input:focus{
  border-color:var(--accent)!important;box-shadow:0 0 0 3px rgba(0,168,132,.16)!important;
}

/* ---- 7. phone: the chat gets the whole screen ----
   The bottom bar is a list-level control; while a conversation is open it only
   costs vertical space. body.chat-open is toggled where show-chat is toggled.
   Class on <body> because #app-nav is not a descendant of the chat panel. */
@media (max-width:900px){
  body.chat-open #app-nav{
    transform:translateY(105%);
    pointer-events:none;
    transition:transform .22s var(--ease,ease);
  }
  body.chat-open .panes{padding-bottom:0!important}
  body.chat-open .pane{bottom:0!important}
  #app-nav{transition:transform .22s var(--ease,ease)}
  .message-bubble{max-width:86%!important;font-size:14.5px!important}
  #wa-chat-messages{padding:12px 10px 14px!important}
}
@media (prefers-reduced-motion:reduce){
  #app-nav,body.chat-open #app-nav{transition:none}
}

/* ==========================================================================
   CHAT HEADER + COMPOSER
   The markup used to carry inline styles (fixed 64px height, #e0e0e0 borders,
   a #1a73e8 send button that clashed with the app's green accent). Those are
   gone from the HTML, so these rules are plain -- no !important needed.
   ========================================================================== */

/* ---- plain-English search ---- */
#ai-search-bar{
  padding:8px 10px;border-bottom:1px solid var(--border);
  background:color-mix(in srgb,var(--accent) 7%,var(--bg));
}
#ai-search-bar.d-none{display:none!important}
#ai-search-form{display:flex;align-items:center;gap:8px}
#ai-search-bar > form > i{color:var(--accent);font-size:15px;flex:none}
#ai-search-input{
  flex:1 1 auto;min-width:0;height:34px;border-radius:17px;
  border:1px solid var(--border-2);background:var(--bg);
  font-size:13.5px;padding:0 13px;color:var(--text);
}
#ai-search-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(0,168,132,.16);outline:none}
#ai-search-note{
  margin-top:6px;font-size:11.5px;line-height:1.45;color:var(--text-2);
}
#ai-search-note.err{color:var(--danger)}
#ai-search-note code{
  display:block;margin-top:4px;padding:6px 8px;border-radius:6px;
  background:var(--bg-3);color:var(--text-2);font-size:10.5px;
  white-space:pre-wrap;word-break:break-word;
}

/* ---- global-search notice ---- */
#wa-search-scope-note{
  display:flex;align-items:center;gap:7px;
  padding:7px 12px;
  font-size:11.5px;font-weight:600;letter-spacing:.01em;
  color:var(--accent);
  background:rgba(0,168,132,.09);
  border-bottom:1px solid var(--border);
}
#wa-search-scope-note.d-none{display:none!important}
#wa-search-scope-note i{font-size:12.5px}
#wa-search-scope-note span{flex:1 1 auto;min-width:0}
#wa-search-clear{
  flex:none;border:0;background:transparent;cursor:pointer;
  color:var(--accent);font:inherit;font-weight:700;
  padding:2px 6px;border-radius:6px;
}
#wa-search-clear:hover{background:rgba(0,168,132,.16)}

/* ---- header ---- */
#wa-chat-header{
  display:flex;align-items:center;gap:10px;
  min-height:62px;padding:9px 10px 9px 12px;
  background:color-mix(in srgb,var(--bg-2) 94%,transparent);
  -webkit-backdrop-filter:saturate(180%) blur(14px);backdrop-filter:saturate(180%) blur(14px);
  border-bottom:1px solid var(--border);
  flex:none;
  /* Message bubbles are position:relative, so they form a paint layer above
     any static sibling. Without this the header's dropdown ("Chat Details &
     Notes" / "Archive Chat") rendered UNDER the messages -- readable text with
     bubbles drawn straight over it. Giving the header its own layer fixes the
     menu and the sticky-blur edge together. */
  position:relative;
  z-index:30;
}
/* and lift the menu itself clear of anything inside the header */
#wa-action-buttons-container .dropdown-menu{z-index:1080}
#wa-chat-header .wa-back{display:none;margin-left:-4px}
@media (max-width:900px){ #wa-chat-header .wa-back{display:grid} }

#wa-chat-header .profile-pic{
  width:40px!important;height:40px!important;flex:none;
  font-size:15px!important;font-weight:650!important;
  background:linear-gradient(140deg,#4fb8e8,#2f8fd0)!important;
  border:0!important;box-shadow:0 1px 3px rgba(11,20,26,.16)!important;
  letter-spacing:.01em;
}

/* the name block is a button (it opens customer details) but must not look
   like one -- no chrome, just a pointer and a hover tint */
.wa-head-id{
  flex:1 1 auto;min-width:0;
  display:flex;flex-direction:column;align-items:flex-start;gap:1px;
  border:0;background:transparent;padding:3px 6px;margin-left:-2px;
  border-radius:9px;text-align:left;cursor:pointer;
  transition:background .16s var(--ease);
}
.wa-head-id:hover{background:var(--bg-3)}
.wa-head-id:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
#wa-chat-name{
  display:block;max-width:100%;
  font-size:15px;font-weight:650;line-height:1.2;color:var(--text);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
#wa-chat-id{
  display:block;max-width:100%;
  font-size:11.5px;line-height:1.2;color:var(--text-2);
  font-variant-numeric:tabular-nums;letter-spacing:.01em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

/* the action buttons are injected as Bootstrap btn-links; normalise them so
   they read as one row of equal icon buttons */
#wa-action-buttons-container{display:flex;align-items:center;gap:2px;flex:none;margin-left:auto}
#wa-action-buttons-container > .btn,
#wa-action-buttons-container .dropdown > .btn{
  width:36px;height:36px;padding:0!important;
  border:0!important;border-radius:10px;
  display:grid;place-items:center;
  color:var(--text-2)!important;background:transparent!important;
  transition:background .16s var(--ease),color .16s var(--ease);
}
#wa-action-buttons-container > .btn:hover,
#wa-action-buttons-container .dropdown > .btn:hover{
  background:var(--bg-3)!important;color:var(--text)!important;
}
#wa-action-buttons-container > .btn:active{transform:scale(.94)}
#wa-action-buttons-container .btn i{font-size:17px!important}
/* keep the meaningful colours, just calmer */
#wa-call-customer-btn{color:var(--ok)!important}
#wa-ai-call-customer-btn{color:var(--warn)!important}
#wa-action-buttons-container .dropdown-toggle::after{display:none}

/* ---- composer ---- */
#wa-message-form-footer{
  flex:none;
  background:color-mix(in srgb,var(--bg-2) 94%,transparent);
  -webkit-backdrop-filter:saturate(180%) blur(14px);backdrop-filter:saturate(180%) blur(14px);
  border-top:1px solid var(--border);
  padding:9px 10px calc(9px + env(safe-area-inset-bottom));
}
#wa-message-form{display:flex;align-items:flex-end;gap:8px}

.wa-compose-btn{
  width:40px;height:40px;flex:none;border:0;border-radius:50%;
  background:transparent;color:var(--text-2);font-size:19px;
  display:grid;place-items:center;cursor:pointer;
  transition:background .16s var(--ease),color .16s var(--ease);
}
.wa-compose-btn:hover:not(:disabled){background:var(--bg-3);color:var(--text)}
.wa-compose-btn:active:not(:disabled){transform:scale(.92)}

#wa-message-input{
  flex:1 1 auto;min-width:0;
  height:42px;padding:0 16px;
  font-size:14.5px;line-height:42px;color:var(--text);
  background:var(--bg);
  border:1px solid var(--border-2);
  border-radius:21px;
  outline:none;
  transition:border-color .16s var(--ease),box-shadow .16s var(--ease);
}
#wa-message-input::placeholder{color:var(--text-3)}
#wa-message-input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(0,168,132,.16);
}

.wa-compose-send{
  width:42px;height:42px;flex:none;border:0;border-radius:50%;
  background:var(--accent);color:#fff;font-size:16px;
  display:grid;place-items:center;cursor:pointer;
  box-shadow:0 1px 3px rgba(0,168,132,.4);
  transition:filter .16s var(--ease),transform .12s var(--ease);
}
.wa-compose-send i{margin-left:1px}
.wa-compose-send:hover:not(:disabled){filter:brightness(1.07)}
.wa-compose-send:active:not(:disabled){transform:scale(.92)}

/* disabled until a conversation is open -- muted, not merely faded */
#wa-message-form :disabled{cursor:not-allowed}
.wa-compose-btn:disabled{opacity:.4}
#wa-message-input:disabled{background:var(--bg-3);border-color:var(--border);color:var(--text-3)}
.wa-compose-send:disabled{background:var(--bg-3);color:var(--text-3);box-shadow:none}

@media (max-width:900px){
  #wa-chat-header{min-height:58px;padding:8px 8px 8px 4px}
  #wa-chat-header .profile-pic{width:36px!important;height:36px!important;font-size:14px!important}
  #wa-chat-name{font-size:14.5px}
  #wa-action-buttons-container > .btn,
  #wa-action-buttons-container .dropdown > .btn{width:34px;height:34px}
}

