/* Logged-in AloNet workspace: calm enterprise styling for the chat view. */
#viewChat {
    --nav-strip-width: 72px;
    --chats-sidebar-width: 340px;
    --info-drawer-width: 288px;
    --header-height: 72px;
    --brand-primary: #087bff;
    --brand-primary-light: #eaf3ff;
    --brand-accent: #13b8a6;
    --bg-body: #edf2f8;
    --bg-nav-strip: #091a34;
    --bg-sidebar: #fff;
    --bg-chat-area: #f2f5fa;
    --bg-composer: #fff;
    --border-color: #e4eaf2;
    --border-light: #eff3f8;
    --text-primary: #17253d;
    --text-secondary: #65748b;
    --text-muted: #8996aa;
    background: #edf2f8;
    color: #17253d;
    font-family: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

#viewChat .alonet-nav-strip {
    width: var(--nav-strip-width);
    padding: 18px 0 14px;
    border: 0;
    background: linear-gradient(180deg, #0a1b37, #102b4d);
    box-shadow: 4px 0 18px rgba(18, 38, 70, .08);
}

#viewChat .nav-strip-top,
#viewChat .nav-strip-bottom { gap: 10px; }
#viewChat .alonet-nav-brand { display: grid; width: 42px; height: 42px; margin: 0 0 7px; place-items: center; color: #3bd4f2; }
#viewChat .alonet-nav-brand svg { width: 36px; height: 36px; filter: drop-shadow(0 4px 8px rgba(26, 192, 234, .22)); }
#viewChat .user-my-avatar { width: 40px; height: 40px; margin-bottom: 10px; border: 2px solid rgba(255,255,255,.18); box-shadow: 0 5px 14px rgba(0,0,0,.18); }
#viewChat .user-status-dot.online { border-color: #102b4d; }
#viewChat .nav-icon-btn { width: 44px; height: 44px; border-radius: 14px; color: #a9bad1; font-size: 18px; }
#viewChat .nav-icon-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
#viewChat .nav-icon-btn.active { color: #56d9f0; background: rgba(51,196,231,.16); box-shadow: inset 0 0 0 1px rgba(84,216,241,.12); }
#viewChat .nav-icon-btn.logout-btn:hover { color: #ff8c96; }
#viewChat .nav-svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

#viewChat .alonet-chats-sidebar { width: var(--chats-sidebar-width); flex: 0 0 var(--chats-sidebar-width); background: #fff; border-right: 1px solid #e5ebf3; box-shadow: 5px 0 22px rgba(20,42,75,.035); }
#viewChat .chats-sidebar-header { padding: 16px 16px 8px; border-bottom: 1px solid #e9eef5; }
#viewChat .sidebar-community-stats { margin-bottom: 17px; padding: 7px 10px; border: 1px solid #dfebf8; border-radius: 10px; background: #f5f9ff; color: #55708f; font-size: 10.5px; line-height: 1.4; }
#viewChat .header-title-row { margin-bottom: 13px; }
#viewChat .header-title-row h2 { color: #182844; font-size: 21px; letter-spacing: -.45px; }
#viewChat .header-actions { gap: 6px; }
#viewChat .btn-invite-zalo-pill { border-radius: 10px; padding: 7px 9px; background: #f2f7ff; color: #1761b7; box-shadow: none; font-size: 10px; }
#viewChat .btn-invite-zalo-pill:hover { background: #e8f2ff; box-shadow: none; filter: none; }
#viewChat .icon-circle-btn { width: 32px; height: 32px; border: 1px solid #e5ebf3; background: #fff; color: #5d6d85; font-size: 17px; }
#viewChat .icon-circle-btn:hover { border-color: #bed8fa; background: #f2f7ff; color: #087bff; }
#viewChat .alonet-account-actions { gap: 8px; margin: 0 0 13px; }
#viewChat .alonet-account-action { min-height: 38px; border-radius: 10px; font-size: 11px; }
#viewChat .alonet-account-action .action-svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#viewChat .alonet-account-action-secure { border-color: #c7defb; background: #f0f6ff; color: #1762bd; }
#viewChat .chats-search-bar { min-height: 39px; margin-bottom: 10px; padding: 6px 11px; border: 1px solid #e7edf5; border-radius: 10px; background: #f7f9fc; }
#viewChat .chats-search-bar:focus-within { border-color: #9cc8fa; background: #fff; box-shadow: 0 0 0 3px rgba(8,123,255,.08); }
#viewChat .chats-search-bar input { color: #253751; font-size: 12px; }
#viewChat .chats-search-bar input::placeholder { color: #96a2b3; }
#viewChat .chat-filter-tabs { gap: 4px; }
#viewChat .filter-tab { padding: 6px 10px; border-radius: 8px; color: #6e7d92; font-size: 11px; }
#viewChat .filter-tab.active { background: #eaf3ff; color: #176bd1; }
#viewChat .conversations-scroll-list { padding: 9px 10px; gap: 4px; }
#viewChat .conversation-item { gap: 11px; min-height: 72px; padding: 11px 10px; border: 1px solid transparent; border-radius: 12px; }
#viewChat .conversation-item:hover { background: #f7f9fc; }
#viewChat .conversation-item.active { border: 1px solid #d8e9ff; background: #eff6ff; }
#viewChat .conv-avatar { width: 46px; height: 46px; border: 1px solid rgba(21,47,85,.08); background: linear-gradient(145deg, #e7f4ff, #dbe9ff); font-size: 20px; }
#viewChat .conv-name { color: #20324d; font-size: 12.5px; font-weight: 720; }
#viewChat .conv-time { color: #97a3b4; font-size: 10px; }
#viewChat .conv-last-msg { max-width: 210px; color: #738197; font-size: 11px; }
#viewChat .chats-sidebar-footer { padding: 11px 14px; border-top: 1px solid #e9eef5; background: #fff; color: #728198; }
#viewChat .status-indicator-dot { box-shadow: 0 0 0 3px rgba(19,184,166,.12); }
#viewChat .pob-shared-text { color: #6e7d92; font-size: 10px; }

#viewChat .alonet-chat-viewport { min-width: 0; background: #f2f5fa; }
#viewChat .chat-viewport-header { min-height: var(--header-height); height: var(--header-height); padding: 0 22px; border-bottom: 1px solid #e5ebf3; background: rgba(255,255,255,.96); }
#viewChat .chat-target-avatar { width: 43px; height: 43px; border: 2px solid #fff; background: linear-gradient(145deg, #10b9d5, #276be4); box-shadow: 0 2px 7px rgba(20,62,119,.18); }
#viewChat .target-name-row h3 { color: #1b2b46; font-size: 14px; letter-spacing: -.12px; }
#viewChat .target-sub-row { gap: 8px; color: #75839a; font-size: 10px; }
#viewChat .e2ee-tag { display: inline-flex; align-items: center; gap: 4px; color: #437b75; font-weight: 650; }
#viewChat .e2ee-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #20b596; }
#viewChat .status-text { color: #8491a4; }
#viewChat .header-right-actions { gap: 7px; }
#viewChat .header-btn { min-height: 36px; padding: 6px 10px; border: 1px solid #e3eaf3; border-radius: 10px; background: #fff; color: #51627a; font-size: 11px; }
#viewChat .header-btn:hover { border-color: #bfd9fb; background: #f4f8ff; color: #1768cb; }
#viewChat .header-btn.icon-only { width: 36px; justify-content: center; padding: 6px; }

#viewChat .chat-message-stream { gap: 13px; padding: 23px clamp(18px, 4vw, 54px); background: radial-gradient(ellipse at 50% 0%, rgba(228,239,255,.62), transparent 62%), #f2f5fa; }
#viewChat .e2ee-encryption-banner { width: min(100%, 720px); margin-bottom: 7px; padding: 11px 14px; border: 1px solid #dce9f8; border-radius: 11px; background: #f8fbff; }
#viewChat .e2ee-encryption-banner .banner-icon { color: #2470c9; }
#viewChat .e2ee-encryption-banner .banner-body strong { color: #3d6c9e; font-size: 11px; }
#viewChat .e2ee-encryption-banner .banner-body p { color: #718198; font-size: 10.5px; line-height: 1.5; }
#viewChat .message-bubble-row { max-width: min(76%, 660px); }
#viewChat .msg-sender-name { color: #65758d; font-size: 10.5px; }
#viewChat .msg-bubble { padding: 10px 13px; border-radius: 15px; font-size: 12.5px; box-shadow: 0 3px 12px rgba(22,43,76,.045); }
#viewChat .incoming .msg-bubble { border: 1px solid #e7edf5; border-bottom-left-radius: 5px; background: #fff; color: #263750; }
#viewChat .outgoing .msg-bubble { border: 1px solid #1675e8; border-bottom-right-radius: 5px; background: linear-gradient(135deg, #168bea, #1767df); color: #fff; }
#viewChat .incoming .msg-meta-row { color: #9ba7b7; }
#viewChat .outgoing .msg-meta-row { color: rgba(255,255,255,.78); }
#viewChat .msg-quick-actions { border: 1px solid #e7edf5; border-radius: 10px; background: #fff; box-shadow: 0 6px 18px rgba(22,43,76,.08); }
#viewChat .chat-composer-section { padding: 10px 20px 14px; border-top: 1px solid #e5ebf3; background: #fff; }
#viewChat .composer-toolbar { gap: 5px; margin-bottom: 7px; overflow-x: auto; scrollbar-width: none; }
#viewChat .composer-toolbar::-webkit-scrollbar { display: none; }
#viewChat .toolbar-btn { min-width: 34px; min-height: 32px; color: #71819a; font-size: 16px; }
#viewChat .toolbar-btn:hover { background: #edf4ff; color: #176bd1; }
#viewChat .input-container { padding: 9px 14px; border: 1px solid #e2e9f2; border-radius: 14px; background: #f7f9fc; }
#viewChat .input-container:focus-within { border-color: #9bc7fa; background: #fff; box-shadow: 0 0 0 3px rgba(8,123,255,.07); }
#viewChat .input-container textarea { color: #253751; font-size: 13px; }
#viewChat .input-container textarea::placeholder { color: #9aa6b6; }
#viewChat .voice-record-btn { width: 38px; height: 38px; border: 1px solid #e4eaf2; background: #fff; color: #687a93; }
#viewChat .send-message-btn { min-height: 38px; padding: 8px 15px; border-radius: 11px; background: #087bff; box-shadow: 0 5px 14px rgba(8,123,255,.2); font-size: 12px; }

#viewChat .alonet-info-drawer { width: var(--info-drawer-width); flex: 0 0 var(--info-drawer-width); border-left: 1px solid #e5ebf3; background: #fff; }
#viewChat .info-drawer-header { padding: 0 17px; border-bottom-color: #e9eef5; }
#viewChat .info-drawer-header h4 { color: #22334d; font-size: 13px; }
#viewChat .info-drawer-content { gap: 17px; padding: 20px 16px; }
#viewChat .profile-big-avatar { width: 62px; height: 62px; margin-bottom: 10px; border: 3px solid #fff; background: linear-gradient(145deg, #10b9d5, #276be4); box-shadow: 0 3px 12px rgba(20,62,119,.18); font-size: 24px; }
#viewChat .target-profile-card h3 { color: #20324d; font-size: 14px; }
#viewChat .profile-meta-tag { color: #64809e; font-size: 10px; }
#viewChat .profile-desc { color: #8290a3; font-size: 10px; }
#viewChat .drawer-action-grid { gap: 7px; }
#viewChat .drawer-action-item { min-height: 66px; border: 1px solid #e8eef6; background: #f8fafe; color: #58708d; }
#viewChat .drawer-action-item:hover { border-color: #c8def9; background: #eff6ff; color: #1768cb; }
#viewChat .drawer-action-item span:last-child { color: inherit; font-size: 9px; }
#viewChat .drawer-section { padding-top: 2px; }
#viewChat .section-title { color: #344762; font-size: 11px; font-weight: 750; }
#viewChat .drawer-empty-note { margin-top: 9px; padding: 12px; border: 1px dashed #dce5f0; border-radius: 10px; background: #fafbfd; color: #8794a6; font-size: 10px; line-height: 1.55; }
#viewChat .r2-subtext { color: #7c8ba0; font-size: 10px; line-height: 1.55; }
#viewChat .safety-fingerprint { border: 1px solid #e5ebf3; border-radius: 10px; background: #f8fafe; }

#viewChat .chat-empty-state { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 34px 24px; text-align: center; }
#viewChat .chat-empty-mark { display: grid; width: 76px; height: 76px; margin-bottom: 21px; place-items: center; border: 1px solid #d8e8fb; border-radius: 24px; background: linear-gradient(145deg, #f5fbff, #e9f3ff); color: #118fc6; box-shadow: 0 12px 28px rgba(50,105,174,.08); }
#viewChat .chat-empty-mark svg { width: 44px; height: 44px; }
#viewChat .chat-empty-eyebrow { color: #5080b4; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
#viewChat .chat-empty-state h2 { max-width: 440px; margin: 10px 0 8px; color: #1b2e4c; font-size: clamp(21px, 2vw, 28px); letter-spacing: -.7px; line-height: 1.2; }
#viewChat .chat-empty-state > p { max-width: 430px; color: #718198; font-size: 12px; line-height: 1.65; }
#viewChat .chat-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 20px; }
#viewChat .chat-empty-actions button { min-height: 40px; padding: 0 15px; border: 1px solid #087bff; border-radius: 10px; background: #087bff; color: #fff; font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; box-shadow: 0 7px 18px rgba(8,123,255,.16); }
#viewChat .chat-empty-actions button + button { border-color: #d4e1f0; background: #fff; color: #3a5d83; box-shadow: none; }
#viewChat .chat-empty-actions button:hover { filter: brightness(1.04); transform: translateY(-1px); }
#viewChat button:focus-visible { outline: 3px solid rgba(8,123,255,.35); outline-offset: 2px; }
#viewChat .chat-empty-state > small { margin-top: 18px; color: #94a0b0; font-size: 9px; }
#viewChat.is-empty .chat-empty-state { display: flex; }
#viewChat.is-empty .chat-message-stream,
#viewChat.is-empty .chat-composer-section,
#viewChat.is-empty .header-right-actions { display: none; }

@media (max-width: 1180px) {
    #viewChat { --info-drawer-width: 255px; --chats-sidebar-width: 315px; }
    #viewChat .chat-viewport-header { padding-inline: 15px; }
    #viewChat .header-btn { padding-inline: 8px; }
}

@media (max-width: 920px) {
    #viewChat .alonet-info-drawer { display: none; }
    #viewChat { --chats-sidebar-width: 320px; }
}

@media (max-width: 680px) {
    #viewChat .alonet-chats-sidebar { width: calc(100vw - var(--nav-strip-width)); flex-basis: calc(100vw - var(--nav-strip-width)); }
    #viewChat .chats-sidebar-header { padding: 13px 12px 7px; }
    #viewChat .sidebar-community-stats { margin-bottom: 12px; }
    #viewChat .header-title-row h2 { font-size: 19px; }
    #viewChat .chat-viewport-header { padding-inline: 10px; }
    #viewChat .header-right-actions { gap: 4px; }
    #viewChat .header-right-actions .header-btn { width: 34px; min-width: 34px; padding: 5px; justify-content: center; }
    #viewChat .header-right-actions .btn-label { display: none; }
    #viewChat .target-sub-row .status-text { display: none; }
    #viewChat .chat-message-stream { padding: 15px 12px; }
    #viewChat .message-bubble-row { max-width: 88%; }
    #viewChat .chat-composer-section { padding: 8px 9px 11px; }
    #viewChat .composer-toolbar { max-width: calc(100vw - 92px); }
    #viewChat .chat-empty-state { padding: 26px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    #viewChat *, #viewChat *::before, #viewChat *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
