/* ============================================
   FR Collections — FR Family Workspace & Chat Stream Stylesheet
   Extracted from user/pages/fr_family.php
   Includes navy navbar, chat stream dock & mobile responsive rules
   ============================================ */

:root {
            --navy-dark: #070d19;
            --navy-mid: #0b172d;
            --navy-gradient: linear-gradient(135deg, #070d19 0%, #0b1e3d 50%, #004080 100%);
            --navy-card-gradient: linear-gradient(135deg, #004080 0%, #0284c7 100%);
            --primary-accent: #0284c7;
            --primary-light: #38bdf8;
            --border-color: rgba(255, 255, 255, 0.18);
            --text-white: #ffffff;
            --text-muted: #94a3b8;
            --vh: 1vh;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Plus Jakarta Sans', sans-serif; }
        body {
            background: var(--navy-mid);
            color: var(--text-white);
            height: 100vh;
            height: 100dvh;
            height: calc(var(--vh, 1vh) * 100);
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        /* ── DARK SHINY NAVY BLUE GRADIENT NAVBAR (FR Collections Legacy Theme) ── */
        .user-navbar {
            height: 60px;
            background: linear-gradient(135deg, #070d19 0%, #0b1e3d 50%, #004080 100%);
            padding: 0 16px;
            display: flex; align-items: center; justify-content: space-between;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
            border-bottom: 2px solid rgba(56, 189, 248, 0.3);
            position: relative;
            z-index: 100;
            flex-shrink: 0;
        }

        .user-navbar::after {
            content: '';
            position: absolute; bottom: 0; left: 0; right: 0; height: 2.5px;
            background: linear-gradient(90deg, 
                rgba(255, 255, 255, 0.2) 0%, 
                rgba(255, 255, 255, 0.9) 25%, 
                rgba(147, 197, 253, 1) 50%, 
                rgba(255, 255, 255, 0.9) 75%, 
                rgba(255, 255, 255, 0.2) 100%);
            background-size: 200% 100%;
            animation: borderShine 4s linear infinite;
            box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
            pointer-events: none;
        }

        @keyframes borderShine {
            0% { background-position: 0% 0%; }
            100% { background-position: 200% 0%; }
        }

        .nav-left { display: flex; align-items: center; gap: 12px; }

        /* Squircle Left Arrow Button (Glassmorphic Dark Navy Style) */
        .nav-arrow-squircle {
            width: 38px; height: 38px; border-radius: 12px;
            background: rgba(255, 255, 255, 0.16); color: #ffffff;
            border: 1.5px solid rgba(255, 255, 255, 0.35);
            backdrop-filter: blur(8px);
            display: flex; align-items: center; justify-content: center;
            font-size: 1rem; cursor: pointer; text-decoration: none;
            transition: all 0.22s ease; flex-shrink: 0;
            box-shadow: 0 3px 10px rgba(0,0,0,0.2);
        }
        .nav-arrow-squircle i {
            color: #ffffff;
            background: none;
            -webkit-background-clip: unset;
            -webkit-text-fill-color: #ffffff;
        }
        .nav-arrow-squircle:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.6);
            transform: scale(1.05);
            box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
        }

        /* Brand Title */
        .nav-brand-title {
            font-family: 'Outfit', sans-serif;
            font-size: 1.18rem; font-weight: 900; color: #ffffff;
            letter-spacing: -0.2px; text-transform: uppercase;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }

        /* Right Nav elements */
        .nav-right { display: flex; align-items: center; gap: 10px; }

        /* Icon Button */
        .nav-icon-btn {
            width: 36px; height: 36px; border-radius: 10px;
            background: rgba(255, 255, 255, 0.14); color: #ffffff;
            border: 1.5px solid rgba(255, 255, 255, 0.3);
            backdrop-filter: blur(6px);
            display: flex; align-items: center; justify-content: center;
            font-size: 0.95rem; cursor: pointer; text-decoration: none;
            transition: all 0.2s ease; flex-shrink: 0;
        }
        .nav-icon-btn i {
            color: #ffffff;
            background: none;
            -webkit-background-clip: unset;
            -webkit-text-fill-color: #ffffff;
        }
        .nav-icon-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            border-color: rgba(255, 255, 255, 0.6);
            transform: translateY(-1px);
        }

        /* Profile Avatar */
        .nav-avatar {
            width: 36px; height: 36px; border-radius: 10px;
            background: #ffffff; color: #004080;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.92rem; font-weight: 900; text-decoration: none;
            flex-shrink: 0;
            border: 2px solid rgba(255, 255, 255, 0.95);
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
            transition: all 0.25s ease;
            overflow: hidden;
            cursor: pointer;
        }
        .nav-avatar:hover {
            transform: translateY(-2px) scale(1.06);
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
        }

        /* Store Home Button */
        .nav-home-btn {
            background: rgba(255, 255, 255, 0.16);
            border: 1.5px solid rgba(255, 255, 255, 0.38);
            color: #ffffff;
            padding: 6px 14px;
            border-radius: 50px;
            font-size: 0.78rem;
            font-weight: 800;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            transition: all 0.22s ease;
            white-space: nowrap;
            box-shadow: 0 3px 10px rgba(0,0,0,0.15);
        }
        .nav-home-btn span, .nav-home-btn i {
            color: #ffffff;
            background: none;
            -webkit-background-clip: unset;
            -webkit-text-fill-color: #ffffff;
        }
        .nav-home-btn:hover {
            background: #ffffff;
            border-color: #ffffff;
            color: #004080;
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
            transform: translateY(-1px);
        }
        .nav-home-btn:hover span, .nav-home-btn:hover i {
            color: #004080;
            background: none;
            -webkit-background-clip: unset;
            -webkit-text-fill-color: #004080;
        }

        /* ── Hide Duplicate Bottom-Center Arrow ── */
        #backTop, .back-top {
            display: none !important;
            opacity: 0 !important;
            visibility: hidden !important;
            pointer-events: none !important;
        }

        /* ── Quick Nav Dropdown Drawer ── */
        .ud-menu-overlay {
            position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65);
            backdrop-filter: blur(4px); z-index: 9998; display: none;
            opacity: 0; transition: opacity 0.3s ease;
        }
        .ud-menu-overlay.active { display: block; opacity: 1; }

        .ud-menu-dropdown {
            position: fixed; top: 50px; right: 16px; width: 290px;
            max-width: calc(100vw - 32px);
            background: linear-gradient(165deg, rgba(15, 23, 42, 0.98), rgba(10, 25, 47, 0.95));
            border: 1.5px solid rgba(59, 130, 246, 0.45);
            border-radius: 20px; padding: 16px;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.75), 0 0 25px rgba(59, 130, 246, 0.25);
            backdrop-filter: blur(18px); z-index: 9999; display: none;
            transform: translateY(-10px) scale(0.95); opacity: 0;
            transition: transform 0.3s cubic-bezier(0.22, 0.98, 0.36, 1), opacity 0.3s ease;
        }
        .ud-menu-dropdown.active { display: block; transform: translateY(0) scale(1); opacity: 1; }

        .ud-menu-header {
            display: flex; align-items: center; justify-content: space-between;
            padding-bottom: 10px; margin-bottom: 10px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.12);
            font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.88rem; color: #ffffff;
        }
        .ud-menu-close {
            background: none; border: none; color: rgba(255, 255, 255, 0.6);
            font-size: 1.05rem; cursor: pointer; padding: 4px; transition: color 0.2s;
        }
        .ud-menu-close:hover { color: #ffffff; }

        .ud-menu-items { display: flex; flex-direction: column; gap: 8px; }
        .ud-menu-item {
            display: flex; align-items: center; gap: 12px; padding: 10px 12px;
            border-radius: 12px; background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08); color: #ffffff;
            text-decoration: none; transition: all 0.2s ease;
        }
        .ud-menu-item:hover {
            background: rgba(59, 130, 246, 0.18); border-color: rgba(59, 130, 246, 0.4);
            transform: translateX(3px);
        }
        .ud-menu-item i { font-size: 1.1rem; width: 24px; text-align: center; }
        .ud-menu-item strong { display: block; font-size: 0.82rem; font-weight: 700; color: #ffffff; line-height: 1.2; }
        .ud-menu-item small { display: block; font-size: 0.7rem; color: rgba(255, 255, 255, 0.65); }

        /* ── Workspace Main Layout ── */
        .workspace-wrap {
            flex: 1; display: flex; overflow: hidden; background: #f8fafc; position: relative;
        }

        /* ── LEFT SIDEBAR PANE ── */
        .sidebar-pane {
            width: 340px; background: #ffffff; border-right: 1.5px solid #e2e8f0;
            display: flex; flex-direction: column; flex-shrink: 0; transition: transform 0.3s ease;
            z-index: 10;
        }

        /* Search Box */
        .sidebar-search { padding: 10px 12px; border-bottom: 1.5px solid #e2e8f0; background: #ffffff; }
        .search-box {
            background: #f1f5f9; border: 1.5px solid #cbd5e1; border-radius: 12px; padding: 7px 12px;
            display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: #64748b;
        }
        .search-box input { border: none; outline: none; background: transparent; width: 100%; font-size: 0.82rem; color: #0f172a; }

        /* Channels List */
        .channels-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
        
        .channel-card {
            display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px;
            cursor: pointer; background: #ffffff; border: 1.5px solid #cbd5e1; transition: all 0.22s ease;
            box-shadow: 0 2px 8px rgba(0,0,0,0.03); color: #0f172a; text-decoration: none;
        }
        .channel-card:hover {
            border-color: #0284c7; transform: translateY(-1px); background: #f0f9ff;
        }
        .channel-card.active {
            background: linear-gradient(135deg, #004080 0%, #0284c7 100%);
            color: #ffffff !important; border-color: transparent;
            box-shadow: 0 6px 20px rgba(0, 64, 128, 0.35);
        }

        .channel-badge {
            width: 44px; height: 44px; border-radius: 12px;
            background: linear-gradient(135deg, #070d19 0%, #004080 50%, #0284c7 100%);
            color: #ffffff;
            display: flex; align-items: center; justify-content: center;
            font-size: 1.1rem; flex-shrink: 0;
            border: 2px solid #ffffff;
            box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
            overflow: hidden; flex-shrink: 0;
        }
        .channel-card.active .channel-badge {
            background: linear-gradient(135deg, #070d19 0%, #004080 50%, #0284c7 100%);
            color: #ffffff;
            border: 2px solid #ffffff;
            box-shadow: 0 4px 14px rgba(255, 255, 255, 0.5);
        }

        .channel-meta { flex: 1; min-width: 0; }
        .channel-name {
            font-weight: 800; font-size: 0.88rem; color: #004080;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }
        .channel-card.active .channel-name {
            color: #ffffff !important;
        }
        .channel-last-msg {
            font-size: 0.74rem; color: #64748b;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
        }
        .channel-card.active .channel-last-msg {
            color: rgba(255, 255, 255, 0.9) !important;
        }

        /* ── RIGHT MAIN PANEL ── */
        .main-pane {
            flex: 1; display: flex; flex-direction: column; background: #ffffff; position: relative; overflow: hidden;
        }

        /* ── WHITE SHINY GRADIENT CHAT BANNER HEADER ── */
        .chat-banner-header {
            background: linear-gradient(180deg, #ffffff 0%, #f8fafc 40%, #f1f5f9 70%, #e2e8f0 100%);
            border-bottom: 2px solid #cbd5e1;
            padding: 12px 18px;
            display: flex; align-items: center; justify-content: space-between;
            flex-shrink: 0;
            position: relative;
            overflow: hidden;
            color: #0f172a;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), inset 0 1px 0 #ffffff;
        }

        .chat-banner-header::after {
            content: '';
            position: absolute; bottom: 0; left: 0; right: 0; height: 2.5px;
            background: linear-gradient(90deg, 
                rgba(0, 64, 128, 0.2) 0%, 
                rgba(2, 132, 199, 0.9) 25%, 
                rgba(56, 189, 248, 1) 50%, 
                rgba(2, 132, 199, 0.9) 75%, 
                rgba(0, 64, 128, 0.2) 100%);
            background-size: 200% 100%;
            animation: borderShine 3.5s linear infinite;
            box-shadow: 0 0 10px rgba(2, 132, 199, 0.5);
            pointer-events: none;
        }

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

        .header-avatar {
            width: 42px; height: 42px; border-radius: 12px;
            background: linear-gradient(135deg, #070d19 0%, #004080 50%, #0284c7 100%);
            color: #ffffff; display: flex; align-items: center; justify-content: center;
            font-size: 1.1rem; box-shadow: 0 3px 12px rgba(2, 132, 199, 0.35);
            border: 2px solid #ffffff; flex-shrink: 0;
        }

        .header-title-text {
            font-family: 'Outfit', sans-serif;
            font-weight: 900; font-size: 1.08rem;
            background: linear-gradient(135deg, #070d19 0%, #004080 45%, #0284c7 85%, #38bdf8 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
        }

        .header-sub { font-size: 0.76rem; color: #047857; font-weight: 800; display: flex; align-items: center; gap: 5px; margin-top: 1px; }

        .chat-refresh-icon-btn {
            width: 36px; height: 36px; border-radius: 10px;
            background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
            color: #004080;
            border: 1.5px solid #cbd5e1;
            display: flex; align-items: center; justify-content: center;
            font-size: 0.9rem; cursor: pointer; transition: all 0.2s ease;
            flex-shrink: 0;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04), inset 0 1px 0 #ffffff;
        }
        .chat-refresh-icon-btn i {
            background: linear-gradient(135deg, #070d19 0%, #004080 50%, #0284c7 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            display: inline-block;
            transition: all 0.2s ease;
        }
        .chat-refresh-icon-btn:hover {
            background: linear-gradient(135deg, #070d19 0%, #004080 50%, #0284c7 100%);
            border-color: #004080;
            transform: scale(1.06);
            box-shadow: 0 3px 12px rgba(2, 132, 199, 0.4);
        }
        .chat-refresh-icon-btn:hover i {
            background: none;
            -webkit-background-clip: unset;
            -webkit-text-fill-color: #ffffff;
            color: #ffffff;
        }

        /* FR Collections Premium Download & Action Pill Buttons */
        .btn-download {
            background: linear-gradient(135deg, #070d19 0%, #004080 50%, #0284c7 100%);
            color: #ffffff !important;
            border: 1.5px solid rgba(255, 255, 255, 0.4);
            border-radius: 50px;
            padding: 8px 18px;
            font-family: 'Plus Jakarta Sans', sans-serif;
            font-size: 0.8rem;
            font-weight: 800;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            box-shadow: 0 4px 14px rgba(0, 64, 128, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            text-decoration: none;
            flex-shrink: 0;
        }
        .btn-download i {
            font-size: 0.88rem;
            transition: transform 0.2s ease;
        }
        .btn-download:hover {
            background: linear-gradient(135deg, #004080 0%, #0284c7 50%, #38bdf8 100%);
            transform: translateY(-2px);
            box-shadow: 0 6px 18px rgba(2, 132, 199, 0.45), inset 0 1px 0 #ffffff;
            border-color: #ffffff;
        }
        .btn-download:hover i {
            transform: translateY(1px);
        }
        .btn-download:active {
            transform: translateY(0);
            box-shadow: 0 2px 8px rgba(0, 64, 128, 0.4);
        }

        .btn-task-attachment {
            background: #f0f9ff !important;
            color: #0284c7 !important;
            border: 1.5px solid #7dd3fc !important;
            padding: 6px 14px;
            font-size: 0.78rem;
            border-radius: 10px;
            font-weight: 800;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            text-decoration: none;
            box-shadow: 0 2px 6px rgba(2, 132, 199, 0.12);
            transition: all 0.2s ease;
        }
        .btn-task-attachment:hover {
            background: #e0f2fe !important;
            color: #0369a1 !important;
            border-color: #38bdf8 !important;
            transform: translateY(-1px);
        }
        .btn-sample-file {
            background: #fffbeb !important;
            color: #d97706 !important;
            border: 1.5px solid #fcd34d !important;
            padding: 6px 14px;
            font-size: 0.78rem;
            border-radius: 10px;
            font-weight: 800;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            text-decoration: none;
            box-shadow: 0 2px 6px rgba(217, 119, 6, 0.12);
            transition: all 0.2s ease;
        }
        .btn-sample-file:hover {
            background: #fef3c7 !important;
            color: #b45309 !important;
            border-color: #f59e0b !important;
            transform: translateY(-1px);
        }

        .sec-banner { text-align: center; margin: 10px 0 2px; }
        .sec-pill {
            background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), rgba(0, 64, 128, 0.12));
            color: #004080; border: 1.5px solid rgba(2, 132, 199, 0.35); font-size: 0.74rem; font-weight: 800;
            padding: 6px 18px; border-radius: 50px; display: inline-flex; align-items: center; gap: 6px;
            box-shadow: 0 3px 10px rgba(2, 132, 199, 0.1);
        }

        .chat-stream {
            flex: 1; padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; background: #ffffff;
        }
        .msg-row { display: flex; gap: 10px; max-width: 82%; }
        .msg-row.me { align-self: flex-end; flex-direction: row-reverse; }
        .msg-avatar {
            width: 34px;
            height: 34px;
            border-radius: 10px;
            background: linear-gradient(135deg, #070d19 0%, #004080 50%, #0284c7 100%);
            color: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
            font-weight: 800;
            flex-shrink: 0;
            border: 1.5px solid #ffffff;
            box-shadow: 0 3px 10px rgba(0, 64, 128, 0.25);
            overflow: hidden;
            margin-top: 2px;
        }
        .msg-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .msg-bubble {
            padding: 12px 16px; border-radius: 18px; font-size: 0.9rem; line-height: 1.5; word-break: break-word;
        }
        .msg-row.me .msg-bubble {
            background: linear-gradient(135deg, #070d19 0%, #004080 50%, #0284c7 100%);
            color: #ffffff;
            border: 1px solid rgba(56, 189, 248, 0.35);
            border-bottom-right-radius: 4px;
            box-shadow: 0 6px 20px rgba(0, 64, 128, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
        }
        .msg-row.others .msg-bubble {
            background: #ffffff; border: 1.5px solid #e2e8f0; color: #0f172a; border-bottom-left-radius: 4px;
            box-shadow: 0 3px 10px rgba(0,0,0,0.03);
        }
        .msg-meta {
            font-size: 0.72rem;
            font-weight: 800;
            opacity: 0.96;
            margin-top: 5px;
            text-align: right;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 5px;
        }
        .msg-row.me .msg-meta {
            color: rgba(255, 255, 255, 0.95);
        }
        .msg-row.others .msg-meta {
            color: #475569;
            font-weight: 800;
        }
        
        .read-receipt {
            background: #ffffff;
            color: #0284c7;
            -webkit-text-stroke: 0.8px #0284c7;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 0.68rem;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
            border: 1px solid rgba(255, 255, 255, 0.9);
            margin-left: 4px;
            vertical-align: middle;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .read-receipt.read {
            background: #ffffff;
            color: #000000;
            -webkit-text-stroke: 0.8px #000000;
            transform: scale(1.05);
        }

        .chat-dock { padding: 12px 18px 16px; border-top: 1.5px solid #e2e8f0; background: #ffffff; flex-shrink: 0; }
        .input-bar {
            background: #f8fafc; border: 1.5px solid #cbd5e1; border-radius: 22px; padding: 5px 8px 5px 14px;
            display: flex; align-items: center; gap: 10px; transition: border-color 0.2s;
        }
        .input-bar:focus-within { border-color: #004080; background: #ffffff; box-shadow: 0 0 0 3px rgba(0, 64, 128, 0.12); }
        .attach-btn {
            width: 36px; height: 36px; border-radius: 12px; border: 1px solid #cbd5e1; background: #ffffff; color: #64748b;
            display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
            transition: all 0.2s ease;
        }
        .attach-btn:hover { background: #004080; color: #ffffff; border-color: #004080; }
        .input-field { flex: 1; border: none; outline: none; background: transparent; font-size: 0.9rem; color: #0f172a; }
        .send-btn {
            width: 38px; height: 38px; border-radius: 12px; border: none; background: linear-gradient(135deg, #004080, #0284c7);
            color: #ffffff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
            box-shadow: 0 3px 12px rgba(2, 132, 199, 0.35);
        }

        /* ── WHITE SHINY GRADIENT TAB BANNER CARD ── */
        .tab-banner-card {
            background: linear-gradient(180deg, #ffffff 0%, #f8fafc 40%, #f1f5f9 70%, #e2e8f0 100%);
            border: 1.5px solid #cbd5e1;
            border-radius: 20px;
            padding: 16px 20px;
            margin-bottom: 20px;
            color: #0f172a;
            position: relative;
            overflow: hidden;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05), inset 0 1px 0 #ffffff;
        }
        .tab-banner-card::after {
            content: '';
            position: absolute;
            bottom: 0; left: 0; right: 0;
            height: 3px;
            background: linear-gradient(90deg, 
                rgba(0, 64, 128, 0.2) 0%, 
                rgba(2, 132, 199, 0.9) 25%, 
                rgba(56, 189, 248, 1) 50%, 
                rgba(2, 132, 199, 0.9) 75%, 
                rgba(0, 64, 128, 0.2) 100%);
            background-size: 200% 100%;
            animation: borderShine 3.5s linear infinite;
            box-shadow: 0 0 10px rgba(2, 132, 199, 0.5);
            pointer-events: none;
        }

        .tab-banner-card h2, .tab-banner-card .banner-title {
            font-family: 'Outfit', sans-serif;
            font-weight: 900;
            font-size: 1.15rem;
            background: linear-gradient(135deg, #070d19 0%, #004080 45%, #0284c7 85%, #38bdf8 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin: 0;
            flex: 1;
            min-width: 0;
        }

        .banner-icon-box {
            width: 42px; height: 42px; border-radius: 14px;
            background: linear-gradient(135deg, #070d19 0%, #004080 50%, #0284c7 100%);
            color: #ffffff; display: flex; align-items: center; justify-content: center;
            font-size: 1.2rem; flex-shrink: 0; border: 1.5px solid #ffffff;
            box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
        }

        .panel-content { display: none; flex: 1; min-height: 0; height: 100%; padding: 22px; overflow-y: auto; background: #f8fafc; -webkit-overflow-scrolling: touch; }
        .panel-content.active { display: block; }
        .card-box {
            background: #ffffff; border: 1.5px solid #e2e8f0; border-radius: 20px; padding: 20px;
            margin-bottom: 16px; box-shadow: 0 4px 14px rgba(0,0,0,0.03); flex-wrap: wrap;
        }

        /* Workspace Bottom Nav Bar (Shiny Dark Navy Blue Gradient Style) */
        .mobile-bottom-nav {
            display: none;
            position: relative;
            width: 100%;
            height: calc(62px + env(safe-area-inset-bottom, 0px));
            padding-bottom: env(safe-area-inset-bottom, 0px);
            background: linear-gradient(135deg, #070d19 0%, #0b1e3d 50%, #004080 100%);
            border-top: 1.5px solid rgba(255, 255, 255, 0.25);
            align-items: center; justify-content: space-around; padding-left: 8px; padding-right: 8px; z-index: 9999; flex-shrink: 0;
            box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.4);
            overflow: hidden;
            box-sizing: border-box;
        }

        .mobile-bottom-nav::before {
            content: '';
            position: absolute; top: 0; left: 0; right: 0; height: 2px;
            background: linear-gradient(90deg, 
                rgba(255, 255, 255, 0.1) 0%, 
                rgba(255, 255, 255, 0.9) 25%, 
                rgba(56, 189, 248, 1) 50%, 
                rgba(255, 255, 255, 0.9) 75%, 
                rgba(255, 255, 255, 0.1) 100%);
            background-size: 200% 100%;
            animation: borderShine 3.5s linear infinite;
            pointer-events: none;
        }

        .bottom-nav-item {
            flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
            color: rgba(255, 255, 255, 0.65); text-decoration: none; border: none; background: transparent; font-size: 0.68rem;
            font-weight: 700; cursor: pointer; transition: all 0.2s ease; padding: 6px 0; border-radius: 12px;
        }
        .bottom-nav-item i { font-size: 1.18rem; transition: transform 0.2s ease; }
        .bottom-nav-item:hover { color: #ffffff; }
        .bottom-nav-item.active {
            background: linear-gradient(180deg, #ffffff 0%, #f8fafc 40%, #f1f5f9 70%, #e2e8f0 100%);
            border: 1.5px solid #ffffff;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 #ffffff;
            transform: translateY(-1px);
        }
        .bottom-nav-item.active i,
        .bottom-nav-item.active span {
            background: linear-gradient(135deg, #070d19 0%, #004080 50%, #0284c7 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            color: #004080;
            font-weight: 900;
            display: inline-block;
        }
        .bottom-nav-item.active i { transform: scale(1.1); }

        /* ── WHATSAPP-STYLE RICH FILE PREVIEW CHIP ── */
        .file-attachment-preview {
            display: none;
            align-items: center;
            gap: 12px;
            padding: 8px 14px;
            background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
            border: 1.5px solid #cbd5e1;
            border-radius: 16px;
            margin-bottom: 10px;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
            animation: slideUpChip 0.25s ease-out;
        }
        @keyframes slideUpChip {
            from { opacity: 0; transform: translateY(6px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .file-thumb-wrap {
            width: 42px;
            height: 42px;
            border-radius: 10px;
            background: #e0f2fe;
            border: 1px solid #cbd5e1;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            flex-shrink: 0;
        }
        .file-thumb-wrap img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .file-thumb-wrap i {
            font-size: 1.2rem;
            color: #0284c7;
        }
        .file-info-wrap {
            flex: 1;
            min-width: 0;
        }
        .file-name-text {
            display: block;
            font-size: 0.84rem;
            font-weight: 800;
            color: #0f172a;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .file-size-text {
            font-size: 0.72rem;
            color: #64748b;
            font-weight: 600;
        }
        .file-actions-wrap {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 0;
        }
        .file-action-btn {
            padding: 5px 12px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 800;
            border: none;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            transition: all 0.2s ease;
        }
        .file-action-btn.edit-btn {
            background: #e0f2fe;
            color: #0284c7;
            border: 1px solid #bae6fd;
        }
        .file-action-btn.edit-btn:hover {
            background: #0284c7;
            color: #ffffff;
        }
        .file-action-btn.remove-btn {
            background: #fef2f2;
            color: #ef4444;
            border: 1px solid #fca5a5;
        }
        .file-action-btn.remove-btn:hover {
            background: #ef4444;
            color: #ffffff;
        }

        /* ── WHATSAPP WEB ATTACHMENT EDITOR & PREVIEW MODAL ── */
        .wa-attach-modal-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 9999999 !important;
            background: rgba(7, 13, 25, 0.92);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            align-items: center;
            justify-content: center;
            padding: 16px;
        }
        .wa-attach-modal-backdrop.active {
            display: flex !important;
        }
        .wa-attach-modal-box {
            background: #0b172d;
            border: 1.5px solid rgba(56, 189, 248, 0.3);
            border-radius: 24px;
            width: 100%;
            max-width: 640px;
            max-height: 90vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
            color: #ffffff;
            animation: popWaModal 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        @keyframes popWaModal {
            from { opacity: 0; transform: scale(0.92); }
            to { opacity: 1; transform: scale(1); }
        }
        .wa-modal-header {
            padding: 10px 14px;
            background: linear-gradient(135deg, #070d19 0%, #0b1e3d 100%);
            border-bottom: 1px solid rgba(255, 255, 255, 0.12);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }
        .wa-modal-title {
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 800;
            color: #ffffff;
            display: flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .wa-title-desktop { display: inline; }
        .wa-title-mobile { display: none; }

        .wa-tools-wrap {
            display: flex;
            align-items: center;
            gap: 5px;
            overflow-x: auto;
            scrollbar-width: none;
            padding-bottom: 2px;
        }
        .wa-tools-wrap::-webkit-scrollbar { display: none; }

        .wa-tool-btn {
            width: 30px;
            height: 30px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 0.8rem;
            flex-shrink: 0;
            transition: all 0.2s ease;
        }
        .wa-tool-btn:hover {
            background: #0284c7;
            border-color: #38bdf8;
            transform: scale(1.05);
        }
        .wa-tool-btn.active {
            background: #0284c7 !important;
            border-color: #38bdf8 !important;
            box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
        }
        .wa-tool-btn.close-btn {
            background: rgba(239, 68, 68, 0.2);
            border-color: rgba(239, 68, 68, 0.4);
            color: #f87171;
        }
        .wa-tool-btn.close-btn:hover {
            background: #ef4444;
            color: #ffffff;
        }

        /* Subtool Settings Drawer */
        .wa-subtool-drawer {
            background: #070d19;
            border-bottom: 1px solid rgba(255, 255, 255, 0.12);
            padding: 8px 12px;
            animation: slideDownSubpanel 0.2s ease-out;
        }
        @keyframes slideDownSubpanel {
            from { opacity: 0; transform: translateY(-8px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .wa-subtool-panel {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .wa-subpanel-title {
            font-size: 0.75rem;
            font-weight: 800;
            color: #38bdf8;
            display: flex;
            align-items: center;
            gap: 4px;
            white-space: nowrap;
        }
        .wa-mini-pill {
            padding: 4px 10px;
            font-size: 0.72rem;
            font-weight: 700;
            border-radius: 16px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            color: #ffffff;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .wa-mini-pill:hover,
        .wa-mini-pill.active {
            background: #0284c7;
            border-color: #38bdf8;
        }
        .wa-mini-pill.apply-btn {
            background: linear-gradient(135deg, #16a34a, #15803d);
            border: none;
        }
        .wa-color-swatches {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .wa-color-dot {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            border: 2px solid transparent;
            cursor: pointer;
            transition: transform 0.15s ease;
        }
        .wa-color-dot:hover,
        .wa-color-dot.active {
            transform: scale(1.25);
            border-color: #ffffff;
            box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
        }
        .wa-mini-select,
        .wa-mini-text-input {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 12px;
            padding: 4px 8px;
            color: #ffffff;
            font-size: 0.75rem;
            outline: none;
        }
        .wa-mini-select option {
            background: #0b172d;
            color: #ffffff;
        }

        /* Crop Overlay Box */
        .wa-crop-box {
            position: absolute;
            border: 2px dashed #38bdf8;
            box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
            pointer-events: auto;
            cursor: move;
            z-index: 10;
            touch-action: none;
            user-select: none;
            -webkit-user-select: none;
        }
        .crop-handle {
            position: absolute;
            width: 14px;
            height: 14px;
            background: #38bdf8;
            border: 2px solid #ffffff;
            border-radius: 3px;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
            z-index: 12;
            touch-action: none;
        }
        .handle-tl { top: -7px; left: -7px; cursor: nwse-resize; }
        .handle-tr { top: -7px; right: -7px; cursor: nesw-resize; }
        .handle-bl { bottom: -7px; left: -7px; cursor: nesw-resize; }
        .handle-br { bottom: -7px; right: -7px; cursor: nwse-resize; }

        .wa-preview-stage {
            flex: 1;
            min-height: 260px;
            max-height: 52vh;
            background: #070d19;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            position: relative;
            overflow: hidden;
            user-select: none;
        }
        .wa-preview-stage canvas,
        .wa-preview-stage img {
            max-width: 100%;
            max-height: 48vh;
            object-fit: contain;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        }
        .wa-preview-stage video {
            max-width: 100%;
            max-height: 48vh;
            border-radius: 12px;
        }
        .wa-doc-preview-card {
            background: rgba(255, 255, 255, 0.08);
            border: 1.5px solid rgba(255, 255, 255, 0.2);
            border-radius: 18px;
            padding: 24px;
            text-align: center;
            max-width: 320px;
            width: 100%;
        }
        .wa-doc-preview-card i {
            font-size: 3rem;
            color: #38bdf8;
            margin-bottom: 12px;
            display: block;
        }
        .wa-modal-footer {
            padding: 10px 14px;
            background: #070d19;
            border-top: 1px solid rgba(255, 255, 255, 0.12);
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .wa-caption-input {
            flex: 1;
            background: rgba(255, 255, 255, 0.1);
            border: 1.5px solid rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            padding: 8px 14px;
            color: #ffffff;
            font-size: 0.85rem;
            outline: none;
            transition: all 0.2s ease;
        }
        .wa-caption-input:focus {
            border-color: #38bdf8;
            background: rgba(255, 255, 255, 0.16);
            box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
        }
        .wa-send-btn {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, #004080 0%, #0284c7 100%);
            color: #ffffff;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            cursor: pointer;
            flex-shrink: 0;
            box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
            transition: all 0.2s ease;
        }
        .wa-send-btn:hover {
            transform: scale(1.08);
            box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
        }

        @media (max-width: 600px) {
            .wa-modal-title { display: none !important; }
            .wa-modal-header { padding: 8px; justify-content: center; }
            .wa-tools-wrap {
                width: 100%;
                justify-content: space-around;
                gap: 2px;
                overflow: hidden !important;
                scrollbar-width: none !important;
                padding-bottom: 0;
            }
            .wa-tools-wrap::-webkit-scrollbar { display: none !important; }
            .wa-tool-btn {
                width: 32px;
                height: 32px;
                font-size: 0.85rem;
                border-radius: 8px;
                margin: 0;
            }
            .wa-attach-modal-box { max-height: 96vh; border-radius: 16px; }
            .wa-preview-stage { min-height: 200px; max-height: 44vh; padding: 8px; }
            .wa-caption-input { padding: 6px 10px; font-size: 0.8rem; }
            .wa-send-btn { width: 36px; height: 36px; font-size: 0.9rem; }
            .wa-subpanel-title { font-size: 0.7rem; }
            .wa-mini-pill { padding: 3px 8px; font-size: 0.68rem; }
        }

        /* ── Modal Backdrop & Dialog Box ── */
        .user-modal-backdrop {
            display: none;
            position: fixed;
            inset: 0;
            z-index: 9999;
            background: rgba(7, 13, 25, 0.75);
            backdrop-filter: blur(6px);
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .user-modal-backdrop.active {
            display: flex;
        }
        .user-modal-box {
            background: #ffffff;
            border-radius: 24px;
            padding: 24px;
            width: 100%;
            max-width: 480px;
            color: #0f172a;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
        }

        /* Auth Card */
        .portal-auth-card {
            max-width: 440px; margin: 40px auto; padding: 32px 28px; background: #ffffff;
            border-radius: 26px; border: 1.5px solid #cbd5e1; text-align: center; color: #0f172a;
            box-shadow: 0 15px 45px rgba(0,0,0,0.1);
        }

        @media (max-width: 768px) {
            .nav-home-btn span { display: none; }
            .nav-home-btn {
                width: 36px; height: 36px; border-radius: 10px; padding: 0;
                display: flex; align-items: center; justify-content: center;
            }

            .header-title-text {
                font-size: 0.88rem !important;
                max-width: 220px;
            }

            .workspace-wrap { position: relative; flex: 1; min-height: 0; overflow: hidden; }

            .sidebar-pane {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
                width: 100% !important;
                z-index: 20;
                transform: translateX(0); transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
            }
            .sidebar-pane.mobile-hidden {
                transform: translateX(-100%); pointer-events: none;
            }

            .main-pane {
                position: absolute !important;
                top: 0 !important;
                left: 0 !important;
                right: 0 !important;
                bottom: calc(62px + 70px + env(safe-area-inset-bottom, 0px)) !important;
                width: 100% !important;
                z-index: 10 !important;
                display: flex !important;
                flex-direction: column !important;
            }

            #view-chat {
                display: flex !important;
                flex-direction: column !important;
                height: 100% !important;
                min-height: 0 !important;
                position: relative !important;
            }

            .chat-banner-header {
                flex-shrink: 0 !important;
            }

            .chat-dock {
                display: block !important;
                position: fixed !important;
                bottom: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
                left: 0 !important;
                right: 0 !important;
                min-height: 58px !important;
                z-index: 9998 !important;
                background: #ffffff !important;
                padding: 10px 12px !important;
                border-top: 1.5px solid #cbd5e1 !important;
                box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08) !important;
            }

            .chat-stream {
                flex: 1 !important;
                min-height: 0 !important;
                overflow-y: auto !important;
                padding: 14px 14px 50px !important;
                -webkit-overflow-scrolling: touch !important;
            }

            .mobile-bottom-nav {
                display: flex !important;
                position: fixed !important;
                bottom: 0 !important;
                left: 0 !important;
                right: 0 !important;
                width: 100% !important;
                flex-shrink: 0 !important;
                z-index: 9999 !important;
                height: calc(62px + env(safe-area-inset-bottom, 0px)) !important;
                padding-bottom: env(safe-area-inset-bottom, 0px) !important;
                box-sizing: border-box !important;
            }

            .panel-content {
                position: absolute !important;
                top: 0 !important;
                left: 0 !important;
                right: 0 !important;
                bottom: -70px !important;
                overflow-y: auto !important;
                padding: 14px 14px 20px !important;
            }

            .chat-stream-scroll-btn {
                position: fixed !important;
                right: 14px !important;
                bottom: calc(62px + 70px + 12px + env(safe-area-inset-bottom, 0px)) !important;
                z-index: 9999 !important;
                width: 36px !important;
                height: 36px !important;
                font-size: 0.9rem !important;
            }
            .in-chat-search-bar {
                padding: 6px 10px !important;
                gap: 6px !important;
            }
            .in-chat-search-input-wrap {
                padding: 4px 10px !important;
            }
            .search-counter-badge {
                padding: 3px 7px !important;
                font-size: 0.7rem !important;
            }
            .search-nav-btn, .search-close-btn {
                width: 28px !important;
                height: 28px !important;
                font-size: 0.75rem !important;
            }

            .vault-upload-btn span {
                display: none !important;
            }
            .vault-upload-btn {
                width: 36px !important;
                height: 36px !important;
                padding: 0 !important;
                border-radius: 50% !important;
                justify-content: center !important;
                align-items: center !important;
                flex-shrink: 0 !important;
            }
            .vault-upload-btn i {
                font-size: 0.95rem !important;
                margin: 0 !important;
            }
        }

        /* ── MINI ICONS & COMPACT NAVBAR FOR MOBILE DEVICES (<= 500px) ── */
        @media (max-width: 500px) {
            .user-navbar {
                height: 50px !important;
                padding: 0 8px !important;
            }
            .nav-left {
                gap: 6px !important;
            }
            .nav-arrow-squircle {
                width: 30px !important;
                height: 30px !important;
                border-radius: 8px !important;
                font-size: 0.78rem !important;
            }
            .nav-brand-title {
                font-size: 0.85rem !important;
                letter-spacing: -0.3px !important;
            }
            .nav-right {
                gap: 4px !important;
            }
            .nav-icon-btn {
                width: 30px !important;
                height: 30px !important;
                border-radius: 8px !important;
                font-size: 0.78rem !important;
            }
            .nav-avatar {
                width: 30px !important;
                height: 30px !important;
                border-radius: 8px !important;
                font-size: 0.78rem !important;
            }
            .nav-home-btn {
                width: 30px !important;
                height: 30px !important;
                border-radius: 8px !important;
                font-size: 0.78rem !important;
                padding: 0 !important;
            }
            .nav-home-btn i {
                font-size: 0.78rem !important;
            }

            /* Banner Header Mini Icons */
            .chat-banner-header {
                height: 44px !important;
                padding: 6px 10px !important;
            }
            .header-avatar {
                width: 30px !important;
                height: 30px !important;
                border-radius: 8px !important;
                font-size: 0.82rem !important;
            }
            .header-title-text {
                font-size: 0.8rem !important;
                max-width: 150px !important;
            }
            .header-sub {
                font-size: 0.7rem !important;
            }
            .chat-refresh-icon-btn {
                width: 30px !important;
                height: 30px !important;
                border-radius: 8px !important;
                font-size: 0.78rem !important;
            }

            .sidebar-pane {
                bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
            }

            .main-pane {
                position: absolute !important;
                top: 0 !important;
                left: 0 !important;
                right: 0 !important;
                bottom: calc(54px + 64px + env(safe-area-inset-bottom, 0px)) !important;
                width: 100% !important;
            }

            .chat-dock {
                position: fixed !important;
                bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
                left: 0 !important;
                right: 0 !important;
                min-height: 52px !important;
                padding: 5px 8px !important;
            }

            .chat-stream {
                padding: 10px 8px 45px !important;
                gap: 8px !important;
            }

            .mobile-bottom-nav {
                height: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
                padding: 2px 4px !important;
                padding-bottom: env(safe-area-inset-bottom, 0px) !important;
            }
            .bottom-nav-item {
                font-size: 0.62rem !important;
                padding: 4px 0 !important;
            }
            .bottom-nav-item i {
                font-size: 0.98rem !important;
            }

            .panel-content {
                bottom: -64px !important;
            }

            .input-bar { padding: 3px 6px 3px 10px !important; gap: 6px !important; border-radius: 18px !important; }
            .attach-btn { width: 32px !important; height: 32px !important; border-radius: 10px !important; font-size: 0.85rem !important; }
            .send-btn { width: 34px !important; height: 34px !important; border-radius: 10px !important; font-size: 0.85rem !important; }
            .input-field { font-size: 0.85rem !important; }
            .msg-row { max-width: 92% !important; gap: 6px !important; }
            .sec-pill { font-size: 0.68rem !important; padding: 4px 10px !important; }

            /* Stream Scroll Mini Button */
            .chat-stream-scroll-btn {
                position: fixed !important;
                right: 10px !important;
                bottom: calc(54px + 64px + 10px + env(safe-area-inset-bottom, 0px)) !important;
                z-index: 9999 !important;
                width: 32px !important;
                height: 32px !important;
                font-size: 0.8rem !important;
            }
            .vault-upload-btn {
                width: 30px !important;
                height: 30px !important;
            }
            .vault-upload-btn i {
                font-size: 0.8rem !important;
            }
        }

        /* ── IN-CHAT SEARCH BAR & HIGHLIGHTS ── */
        .in-chat-search-bar {
            background: #ffffff;
            border-bottom: 1.5px solid #cbd5e1;
            padding: 8px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            z-index: 15;
            animation: slideDownSearch 0.25s ease-out;
        }
        @keyframes slideDownSearch {
            from { opacity: 0; transform: translateY(-8px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .in-chat-search-input-wrap {
            flex: 1;
            display: flex;
            align-items: center;
            gap: 8px;
            background: #f1f5f9;
            border: 1.5px solid #cbd5e1;
            border-radius: 20px;
            padding: 6px 12px;
            transition: all 0.2s ease;
        }
        .in-chat-search-input-wrap:focus-within {
            border-color: #004080;
            background: #ffffff;
            box-shadow: 0 0 0 3px rgba(0, 64, 128, 0.12);
        }
        .in-chat-search-input-wrap .search-icon {
            color: #64748b;
            font-size: 0.85rem;
        }
        .in-chat-search-input-wrap input {
            border: none;
            outline: none;
            background: transparent;
            width: 100%;
            font-size: 0.85rem;
            color: #0f172a;
            font-weight: 600;
        }
        .clear-search-btn {
            background: none;
            border: none;
            color: #94a3b8;
            cursor: pointer;
            font-size: 0.85rem;
            padding: 2px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .clear-search-btn:hover {
            color: #ef4444;
        }
        .in-chat-search-nav {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-shrink: 0;
        }
        .search-counter-badge {
            font-size: 0.76rem;
            font-weight: 800;
            color: #004080;
            background: #e0f2fe;
            border: 1px solid rgba(2, 132, 199, 0.3);
            padding: 4px 10px;
            border-radius: 50px;
            white-space: nowrap;
        }
        .search-nav-btn, .search-close-btn {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: 1px solid #cbd5e1;
            background: #ffffff;
            color: #004080;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 0.82rem;
            transition: all 0.2s ease;
        }
        .search-nav-btn:hover {
            background: #004080;
            color: #ffffff;
            border-color: #004080;
        }
        .search-close-btn {
            color: #ef4444;
            border-color: #fca5a5;
            background: #fef2f2;
        }
        .search-close-btn:hover {
            background: #ef4444;
            color: #ffffff;
            border-color: #ef4444;
        }

        /* Highlight mark styling */
        mark.chat-search-highlight {
            background: #fef08a;
            color: #854d0e;
            padding: 1px 3px;
            border-radius: 3px;
            font-weight: 800;
            box-shadow: 0 0 0 1px #eab308;
        }
        mark.chat-search-highlight.active-match {
            background: #f97316;
            color: #ffffff;
            box-shadow: 0 0 0 2px #c2410c;
        }

        /* ── FLOATING SMART CHAT STREAM SCROLL BUTTON ── */
        .chat-stream-scroll-btn {
            position: absolute;
            right: 22px;
            bottom: 75px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, #070d19 0%, #004080 50%, #0284c7 100%);
            color: #ffffff;
            border: 2px solid #ffffff;
            box-shadow: 0 4px 15px rgba(0, 64, 128, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            cursor: pointer;
            z-index: 25;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            backdrop-filter: blur(4px);
        }
        .chat-stream-scroll-btn:hover {
            transform: scale(1.12);
            box-shadow: 0 6px 20px rgba(2, 132, 199, 0.6), inset 0 1px 0 #ffffff;
        }
        .chat-stream-scroll-btn:active {
            transform: scale(0.95);
        }

        /* ── FORCE WHITE BACKGROUND BEHIND PORTAL PHOTOS ── */
        .channel-badge.has-photo,
        .header-avatar.has-photo,
        .channel-badge:has(img),
        .header-avatar:has(img),
        .dash-avatar:has(img) {
            background: #ffffff !important;
            border: 1.5px solid #cbd5e1 !important;
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08) !important;
        }

        .channel-badge.has-photo img,
        .header-avatar.has-photo img,
        .channel-badge img,
        .header-avatar img {
            background: #ffffff !important;
        }

        .channel-card.active .channel-badge.has-photo,
        .channel-card.active .channel-badge:has(img) {
            background: #ffffff !important;
            border: 2px solid #ffffff !important;
            box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15) !important;
        }

        .header-avatar i,
        .header-avatar .fas,
        .header-avatar .far,
        .header-avatar .fab {
            color: #ffffff !important;
        }


