/* ═══════════════════════════════════════════════════════════
   AETHERCHAT — "Aurora" theme
   A premium, distinctly non-WhatsApp visual language.
   - Deep cosmic-blue backdrop
   - Electric violet → magenta primary gradient
   - Soft frosted-glass surfaces
   - Bubble-shape avatars w/ aurora rings
   - Floating cards instead of full-bleed lists
═══════════════════════════════════════════════════════════ */

:root {
    /* Backdrop */
    --bg:           #0B0A1F;
    --bg-2:         #110E2B;
    --surface:      #1A1740;
    --surface-2:    #221E4D;
    --surface-3:    #2E2962;
    --surface-glass:     rgba(26,23,64, 0.62);
    --surface-glass-strong: rgba(26,23,64, 0.85);

    /* Brand gradient — electric violet to magenta */
    --primary:      #7C5CFF;
    --primary-2:    #C465FF;
    --accent:       #FF6FB5;
    --accent-2:     #5BD3FF;

    --grad-primary: linear-gradient(135deg, #7C5CFF 0%, #C465FF 50%, #FF6FB5 100%);
    --grad-aurora:  linear-gradient(135deg, #5BD3FF 0%, #7C5CFF 35%, #C465FF 70%, #FF6FB5 100%);
    --grad-mute:    linear-gradient(135deg, rgba(124,92,255,0.18) 0%, rgba(196,101,255,0.12) 100%);

    /* Bubbles */
    --bubble-out:        linear-gradient(135deg, #7C5CFF 0%, #C465FF 100%);
    --bubble-in:         rgba(255,255,255,0.06);
    --bubble-in-border:  rgba(255,255,255,0.10);

    /* Type */
    --text:         #F1EFFA;
    --text-2:       #B7B3D8;
    --text-3:       #6E6A95;

    --tick:         #5BD3FF;
    --red:          #FF5C7C;
    --warn:         #FFC960;
    --green:        #56DEA1;     /* used only for tiny "online" dot */

    /* Motion */
    --m-fast:    140ms;
    --m-base:    220ms;
    --m-slow:    320ms;
    --ease-out:  cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.46, 0.64, 1);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.30);
    --shadow-md: 0 12px 28px rgba(0,0,0,0.40);
    --shadow-lg: 0 24px 60px rgba(0,0,0,0.55);
    --glow-primary: 0 8px 30px rgba(124,92,255,0.45);
    --glow-accent:  0 8px 30px rgba(255,111,181,0.40);

    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-pill: 999px;
}

/* Resetting base */
html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: "ss01" on, "cv11" on;
    letter-spacing: -0.005em;
}

/* Aurora background — radial blobs that breathe slowly */
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(ellipse 720px 480px at 12% 6%,  rgba(124,92,255,0.25) 0%, transparent 60%),
        radial-gradient(ellipse 600px 400px at 88% 20%, rgba(255,111,181,0.18) 0%, transparent 60%),
        radial-gradient(ellipse 700px 500px at 50% 110%, rgba(91,211,255,0.15)  0%, transparent 65%);
    animation: aurora-shift 18s ease-in-out infinite;
    pointer-events: none;
}
@keyframes aurora-shift {
    0%, 100% { transform: translate3d(0,0,0); }
    50%      { transform: translate3d(2%, -1.5%, 0); }
}

* { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
input, textarea { color: var(--text); caret-color: var(--primary-2); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
::selection { background: rgba(124,92,255,0.45); color: #fff; }

/* ═══ APP SHELL ═══ */
.app-shell {
    background: transparent;
}

.screen {
    background: transparent;
    bottom: 76px;          /* nav is taller */
}

.hidden { display: none !important; }

/* ═══ ONBOARDING ═══ */
.ob-screen {
    background:
        radial-gradient(ellipse 600px 400px at 50% 0%, rgba(124,92,255,0.30) 0%, transparent 65%),
        var(--bg);
}
.ob-logo {
    background: var(--grad-primary);
    box-shadow: var(--glow-primary), inset 0 1px 0 rgba(255,255,255,0.20);
    border-radius: 26px;
}
.ob-logo i { color: #fff; }
.ob-logo.green-soft { background: var(--grad-aurora); }
.ob-hero h1 {
    font-weight: 800;
    background: var(--grad-aurora);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    font-size: 32px;
}
.ob-hero p { color: var(--text-2); }
.ob-link { color: var(--primary-2); }

.ob-field-group label { color: var(--primary-2); }
.ob-field-group input { border-bottom: 1.5px solid rgba(124,92,255,0.45); }
.ob-field-group input:focus { border-bottom-color: var(--accent); }

.ob-next-btn {
    background: var(--grad-primary) !important;
    border-radius: var(--r-pill);
    box-shadow: var(--glow-primary);
    font-weight: 700;
    letter-spacing: 0.02em;
}
.ob-next-btn:disabled {
    background: var(--surface-2) !important;
    box-shadow: none;
    color: var(--text-3);
}

.ob-txt-btn { color: var(--primary-2); }

.handle-row { border-bottom: 1.5px solid rgba(124,92,255,0.45); }
.handle-at  { color: var(--primary-2); font-weight: 600; }
.handle-status.ok  { background: rgba(86,222,161,0.18); color: var(--green); }
.handle-status.bad { background: rgba(255,92,124,0.18); color: var(--red); }
.handle-status.wait{ color: var(--primary-2); }

.native-g-btn {
    background: linear-gradient(135deg, #1d1a3f 0%, #15132e 100%);
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: var(--shadow-sm);
}

/* ═══ HEADER ═══ */
.wa-header {
    background: linear-gradient(180deg, rgba(26,23,64,0.85) 0%, rgba(11,10,31,0.5) 100%);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 0 8px 0 20px;
    height: 64px;
}
.wa-header-title {
    font-weight: 800;
    font-size: 22px;
    background: var(--grad-aurora);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.01em;
}

.hdr-btn, .hdr-back-btn {
    width: 42px; height: 42px; border-radius: 12px;
    color: var(--text-2);
    transition: all var(--m-fast);
}
.hdr-btn:hover, .hdr-back-btn:hover {
    background: rgba(124,92,255,0.12);
    color: var(--primary-2);
}

/* ═══ FILTER CHIPS ═══ */
.filter-chips { padding: 6px 16px 12px; gap: 6px; background: transparent; }
.chip {
    background: rgba(255,255,255,0.05);
    color: var(--text-2);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--r-pill);
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(8px);
    transition: all var(--m-fast) var(--ease-out);
}
.chip:hover { background: rgba(255,255,255,0.10); color: var(--text); }
.chip.active {
    background: var(--grad-primary);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(124,92,255,0.45);
}

/* ═══ CHATS LIST ═══ */
.chats-list { padding: 4px 12px 100px; }
.chats-list::-webkit-scrollbar { width: 0; }

.chat-item {
    display: flex; align-items: center;
    padding: 12px 14px;
    margin: 4px 0;
    border-radius: var(--r-md);
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.04);
    backdrop-filter: blur(8px);
    transition: all var(--m-base) var(--ease-out);
    cursor: pointer;
    gap: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.chat-item:hover {
    background: rgba(124,92,255,0.08);
    border-color: rgba(124,92,255,0.20);
    transform: translateX(2px);
}
.chat-item.active-item {
    background: linear-gradient(90deg, rgba(124,92,255,0.16) 0%, rgba(196,101,255,0.06) 100%);
    border-color: rgba(124,92,255,0.30);
    border-left: none;
    padding-left: 14px;
}

.ci-av {
    width: 52px; height: 52px;
    border-radius: 18px;
    background: var(--grad-primary);
    color: #fff;
    font-size: 21px; font-weight: 700;
    box-shadow: 0 4px 12px rgba(124,92,255,0.30);
    border: 2px solid transparent;
    background-clip: padding-box;
    overflow: hidden;
    position: relative;
}
.ci-av img { border-radius: 16px; width: 100%; height: 100%; object-fit: cover; }
.ci-av.global-av { background: var(--grad-aurora); }
.ci-av-online-dot {
    width: 13px; height: 13px;
    background: var(--green);
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 0 rgba(86,222,161,0.6);
    animation: dot-pulse 2.4s ease-in-out infinite;
}
@keyframes dot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(86,222,161,0.7); }
    50%      { box-shadow: 0 0 0 8px rgba(86,222,161,0); }
}

.ci-name { color: var(--text); font-weight: 600; font-size: 15.5px; }
.ci-time { color: var(--text-3); font-size: 11.5px; font-weight: 500; }
.ci-time.unread { color: var(--primary-2); font-weight: 700; }
.ci-preview { color: var(--text-2); font-size: 13.5px; }
.ci-badge {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(124,92,255,0.45);
    font-size: 11px; font-weight: 700;
}
.ci-badge.muted { background: var(--surface-3); }
.ci-pin, .ci-muted-icon { color: var(--text-3); }

/* ═══ FAB ═══ */
.fab {
    width: 60px; height: 60px;
    border-radius: 22px;
    background: var(--grad-primary);
    color: #fff;
    box-shadow: var(--glow-primary), 0 12px 28px rgba(124,92,255,0.30);
    bottom: 90px; right: 20px;
}
.fab:hover { box-shadow: 0 16px 40px rgba(124,92,255,0.55); }

/* ═══ EMPTY STATE ═══ */
.empty-state { padding: 64px 28px; }
.empty-state i {
    font-size: 56px; margin-bottom: 18px;
    background: var(--grad-aurora);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.85;
}
.empty-state p { color: var(--text-2); }

/* ═══ BOTTOM NAV — pill-style floating ═══ */
.bot-nav {
    bottom: 16px;
    left: 16px; right: 16px;
    height: 60px;
    background: rgba(26,23,64,0.78);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 22px;
    box-shadow: var(--shadow-md);
    padding: 0 8px;
}
.bnav {
    color: var(--text-3);
    font-size: 11px; font-weight: 600;
    border-radius: 16px;
    margin: 6px 4px;
    transition: all var(--m-base) var(--ease-out);
    gap: 4px;
    position: relative;
}
.bnav.active {
    color: #fff;
    background: var(--grad-primary);
    box-shadow: 0 4px 14px rgba(124,92,255,0.45);
}
.bnav.active::after { display: none; }       /* no underline; bg is the indicator */
.bnav-icon-w { font-size: 19px; }
.bnav.active .bnav-icon-w { transform: scale(1); }
.bnav-badge {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 0 2px rgba(26,23,64,0.78);
}

/* ═══ MAIN MENU DROPDOWN ═══ */
.ctx-menu {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(28px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    top: 60px; right: 12px;
    overflow: hidden;
    min-width: 220px;
}
.ctx-item {
    color: var(--text);
    font-weight: 500;
    padding: 12px 18px;
}
.ctx-item:hover { background: rgba(124,92,255,0.16); padding-left: 22px; }
.ctx-item:hover i { color: var(--primary-2); }
.ctx-item i { color: var(--text-3); width: 18px; }

/* ═══ CHAT VIEW ═══ */
.chat-view { background: transparent; }
.cv-header {
    background: linear-gradient(180deg, rgba(26,23,64,0.85) 0%, rgba(11,10,31,0.45) 100%);
    backdrop-filter: blur(22px) saturate(140%);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    height: 64px;
}
.cv-back, .cv-act {
    width: 42px; height: 42px; border-radius: 12px;
    color: var(--text-2);
}
.cv-back:hover, .cv-act:hover { background: rgba(124,92,255,0.12); color: var(--primary-2); }
.cv-av {
    width: 44px; height: 44px;
    border-radius: 16px;
    background: var(--grad-primary);
    color: #fff; font-weight: 700; font-size: 19px;
    box-shadow: 0 4px 12px rgba(124,92,255,0.30);
}
.cv-av img { border-radius: 14px; }
.cv-online-dot { background: var(--green); border-color: var(--surface); }
.cv-name { font-weight: 700; font-size: 16px; }
.cv-status { color: var(--text-2); font-size: 12.5px; }
.cv-status.online { color: var(--green); font-weight: 600; }

/* messages canvas - use the aurora bg */
.cv-messages {
    background-image: none;
    padding: 14px 12px 6px;
}

.encrypt-notice {
    background: rgba(124,92,255,0.10);
    border: 1px solid rgba(124,92,255,0.20);
    color: var(--primary-2);
    font-size: 12px;
    border-radius: 14px;
    padding: 10px 16px;
    backdrop-filter: blur(10px);
}

.chat-date-sep span {
    background: rgba(26,23,64,0.78);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-2);
    font-weight: 500;
    backdrop-filter: blur(10px);
    border-radius: 12px;
}

/* ═══ MESSAGE BUBBLES ═══ */
.msg-row { margin: 3px 0; padding: 0 4px; }

.msg-bubble {
    max-width: 78%;
    position: relative;
}
.msg-row.out .msg-bubble::after,
.msg-row.in  .msg-bubble::after { display: none; }      /* ditch the WhatsApp tail */

.msg-bubble-inner {
    padding: 9px 14px 22px;
    border-radius: 20px;
    position: relative;
}

/* Outgoing: brand gradient with stronger shape */
.msg-row.out .msg-bubble-inner {
    background: var(--bubble-out);
    color: #fff;
    border-top-right-radius: 6px;
    box-shadow: 0 8px 20px rgba(124,92,255,0.30);
}
/* Incoming: frosted glass */
.msg-row.in .msg-bubble-inner {
    background: var(--bubble-in);
    border: 1px solid var(--bubble-in-border);
    color: var(--text);
    border-top-left-radius: 6px;
    backdrop-filter: blur(14px);
}

.msg-text { font-size: 14.5px; line-height: 1.5; }
.msg-row.out .msg-text { color: #fff; }
.msg-row.in  .msg-text { color: var(--text); }

.msg-meta { right: 10px; bottom: 5px; gap: 4px; }
.msg-time { font-size: 10.5px; font-weight: 500; }
.msg-row.out .msg-time { color: rgba(255,255,255,0.65); }
.msg-row.in  .msg-time { color: var(--text-3); }

.msg-ticks { font-size: 11px; }
.msg-ticks.sent      { color: rgba(255,255,255,0.55); }
.msg-ticks.delivered { color: rgba(255,255,255,0.65); }
.msg-ticks.read      { color: var(--tick); }

.msg-sender { color: var(--accent); font-weight: 600; font-size: 12px; }

.msg-reply-quote {
    background: rgba(0,0,0,0.18);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 4px;
}
.msg-reply-quote .rq-sender { color: var(--accent); font-weight: 600; }
.msg-reply-quote .rq-text   { color: rgba(255,255,255,0.75); }
.msg-row.in .msg-reply-quote .rq-text { color: var(--text-2); }

.msg-image {
    max-width: 280px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
}
.msg-doc {
    background: rgba(0,0,0,0.18);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.05);
}
.msg-doc-icon { color: var(--accent-2); }
.msg-location {
    border-radius: 14px;
}
.msg-location-map { background: linear-gradient(135deg, #2E2962 0%, #1A1740 100%); }
.msg-location-label { background: rgba(0,0,0,0.30); color: var(--text-2); }

.msg-reactions { gap: 4px; }
.react-chip {
    background: var(--surface-glass-strong);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 3px 8px;
}

/* ═══ REPLY BAR ═══ */
.reply-bar {
    background: linear-gradient(90deg, rgba(124,92,255,0.12) 0%, rgba(26,23,64,0.85) 100%);
    border-top: 1px solid rgba(124,92,255,0.20);
    backdrop-filter: blur(16px);
}
.reply-stripe { background: var(--accent); box-shadow: 0 0 8px rgba(255,111,181,0.6); }
.reply-sender { color: var(--accent); }
.reply-text { color: var(--text-2); }

/* ═══ INPUT BAR ═══ */
.cv-input-bar {
    background: linear-gradient(180deg, rgba(26,23,64,0.5) 0%, var(--bg) 100%);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.04);
    padding: 10px 12px 12px;
    gap: 10px;
}
.cv-input-pill {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all var(--m-base);
}
.cv-input-pill:focus-within {
    border-color: var(--primary);
    background: rgba(124,92,255,0.10);
    box-shadow: 0 0 0 4px rgba(124,92,255,0.10);
}
.cv-pill-btn { color: var(--text-3); }
.cv-pill-btn:hover { color: var(--primary-2); }
.cv-input-wrap input { font-size: 14.5px; color: var(--text); }

.cv-mic-send {
    width: 52px; height: 52px;
    background: var(--grad-primary);
    border-radius: 18px;
    box-shadow: var(--glow-primary);
}
.cv-mic-send.recording {
    background: linear-gradient(135deg, #FF5C7C, #FF6FB5);
    animation: rec-pulse 1.4s ease-in-out infinite;
}
@keyframes rec-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,111,181,0.6), 0 4px 16px rgba(255,111,181,0.4); }
    50%      { box-shadow: 0 0 0 14px rgba(255,111,181,0), 0 4px 16px rgba(255,111,181,0.4); }
}

.recording-row { color: var(--text-2); }
.rec-dot { background: var(--red); box-shadow: 0 0 8px rgba(255,92,124,0.6); }

/* ═══ ATTACH TRAY ═══ */
.attach-tray {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(24px) saturate(150%);
    border-top: 1px solid rgba(255,255,255,0.06);
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.30);
}
.tray-icon {
    width: 60px; height: 60px;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}
.tray-item:nth-child(1) .tray-icon { background: linear-gradient(135deg, #C465FF, #FF6FB5) !important; }
.tray-item:nth-child(2) .tray-icon { background: linear-gradient(135deg, #5BD3FF, #7C5CFF) !important; }
.tray-item:nth-child(3) .tray-icon { background: linear-gradient(135deg, #7C5CFF, #5BD3FF) !important; }
.tray-item:nth-child(4) .tray-icon { background: linear-gradient(135deg, #FF5C7C, #FFC960) !important; }

.tray-item span { color: var(--text-2); font-weight: 500; }

/* ═══ MSG CTX MENU + REACT PANEL ═══ */
.msg-ctx-menu {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(28px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}
.react-panel {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(28px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 28px;
    padding: 8px 12px;
}

/* ═══ MODALS ═══ */
.modal {
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(10px);
}
.modal-card {
    background: var(--surface);
    border-left: 1px solid rgba(255,255,255,0.05);
    border-right: 1px solid rgba(255,255,255,0.05);
}
.modal-hdr {
    background: rgba(26,23,64,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    height: 64px;
}
.modal-title {
    font-weight: 700;
    font-size: 17px;
    background: var(--grad-aurora);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.green-text { color: var(--primary-2) !important; }

/* In-app alert/confirm modals */
#ac-modal-root .ac-modal-card {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
}
.ac-modal-title {
    font-weight: 700;
    background: var(--grad-aurora);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.ac-modal-btn { color: var(--primary-2); font-weight: 600; }
.ac-modal-btn.primary { background: rgba(124,92,255,0.12); }
.ac-modal-btn.danger { color: var(--red); }

/* ═══ SEARCH MODAL ═══ */
.search-input-wrap input {
    background: rgba(255,255,255,0.05);
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    font-size: 15px;
}
.search-input-wrap input:focus {
    border-color: var(--primary);
    background: rgba(124,92,255,0.08);
}
.search-result {
    padding: 12px 16px;
    margin: 4px 12px;
    border-radius: 14px;
    transition: all var(--m-fast);
}
.search-result:hover { background: rgba(124,92,255,0.12); }
.sr-av { width: 48px; height: 48px; border-radius: 16px; box-shadow: 0 4px 10px rgba(0,0,0,0.25); }
.sr-av span { background: var(--grad-primary) !important; border-radius: 16px; }
.sr-name { font-weight: 600; }
.sr-handle { color: var(--primary-2); font-weight: 500; }
.sr-btn {
    background: var(--grad-primary) !important;
    color: #fff !important;
    width: 40px; height: 40px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(124,92,255,0.40);
}
.sr-btn.sel { background: var(--accent) !important; }

/* ═══ GROUP COMPOSER ═══ */
.group-form input {
    background: rgba(255,255,255,0.04);
    padding: 12px 14px;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    font-size: 15px;
}
.group-chip {
    background: rgba(124,92,255,0.18);
    border: 1px solid rgba(124,92,255,0.30);
    color: var(--primary-2);
    border-radius: 12px;
}

/* ═══ STATUS / UPDATES ═══ */
.section-header { color: var(--primary-2); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 11px; padding: 18px 20px 8px; }
.my-status-row {
    margin: 8px 16px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: all var(--m-fast);
}
.my-status-row:hover { background: rgba(124,92,255,0.10); border-color: rgba(124,92,255,0.25); }
.my-status-av {
    background: var(--grad-primary) !important;
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(124,92,255,0.30);
}
.status-add-btn {
    background: var(--accent);
    border: 3px solid var(--surface);
    box-shadow: 0 2px 8px rgba(255,111,181,0.45);
}
.status-item {
    margin: 4px 16px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    border: 1px solid transparent;
}
.status-item:hover { background: rgba(124,92,255,0.10); border-color: rgba(124,92,255,0.20); }
.status-item .my-status-av {
    border: 2.5px solid var(--accent);
    padding: 1px;
}

/* ═══ STATUS COMPOSER ═══ */
.status-canvas { background: var(--grad-primary) !important; }
.status-bg-row {
    background: rgba(26,23,64,0.85);
    backdrop-filter: blur(16px);
}

/* ═══ SETTINGS ═══ */
.settings-hdr { background: linear-gradient(135deg, var(--surface) 0%, rgba(124,92,255,0.10) 100%); }
.settings-profile-hero {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(124,92,255,0.15) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 32px 18px 30px;
}
.settings-av {
    background: var(--grad-primary);
    border-radius: 26px;
    box-shadow: var(--glow-primary);
}
.settings-profile-text h2 { font-weight: 700; }
#settings-handle { color: var(--primary-2); font-weight: 600; }
.settings-bio-text { color: var(--text-2); font-style: italic; }
.settings-edit-btn { color: var(--primary-2); }

.settings-list { padding: 8px 0; }
.settings-item {
    margin: 4px 12px;
    padding: 12px 14px;
    border-radius: 14px;
    transition: all var(--m-fast);
}
.settings-item:hover { background: rgba(124,92,255,0.08); }
.sitem-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--grad-mute);
    color: var(--primary-2);
}
.sitem-icon.green { background: var(--grad-primary); color: #fff; }
.sitem-icon.grey  { background: rgba(255,255,255,0.05); color: var(--text-3); }
.sitem-info span { font-weight: 500; }
.sitem-info small { color: var(--text-3); }

.settings-sheet { background: var(--bg); }
.set-row {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.set-row:hover { background: rgba(124,92,255,0.06); }
.set-row strong { font-weight: 600; }
.set-row small { color: var(--text-3); }

/* Switch */
.switch .slider { background: rgba(255,255,255,0.08); }
.switch input:checked + .slider { background: var(--grad-primary); }
.switch .slider:before { background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }

/* ═══ TOAST ═══ */
.toast {
    background: var(--surface-glass-strong);
    backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    color: var(--text);
    padding: 12px 20px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
}

/* ═══ CALL OVERLAY ═══ */
.calling-overlay {
    background: radial-gradient(ellipse at center, rgba(11,10,31,0.95) 0%, rgba(0,0,0,0.98) 100%);
}
.calling-bg {
    background: radial-gradient(ellipse at center,
        rgba(124,92,255,0.45) 0%,
        rgba(196,101,255,0.20) 30%,
        transparent 70%);
}
.calling-av {
    background: var(--grad-primary);
    box-shadow: 0 16px 50px rgba(124,92,255,0.50), inset 0 1px 0 rgba(255,255,255,0.15);
    border-radius: 36%;
    animation: av-breathe 3.4s ease-in-out infinite;
}
@keyframes av-breathe {
    0%, 100% { transform: scale(1); border-radius: 36%; }
    50%      { transform: scale(1.04); border-radius: 42%; }
}
.calling-inner h2 {
    font-weight: 700;
    background: var(--grad-aurora);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}

.call-btn { width: 64px; height: 64px; border-radius: 22px; }
.call-btn.accept { background: var(--grad-primary); }
.call-btn.end    { background: linear-gradient(135deg, #FF5C7C, #C465FF); }
.call-btn.mute, .call-btn.flip { background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.10); }

#local-video { border-radius: 18px; box-shadow: var(--shadow-md); border: 2px solid rgba(255,255,255,0.10); }

/* ═══ HOOKED BACKGROUNDS — sweet aurora bg for the chat thread ═══ */
.cv-messages {
    background: transparent;
}

/* ═══ SCROLLBARS (desktop) ═══ */
*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-thumb { background: rgba(124,92,255,0.30); border-radius: 4px; }

/* ═══ ANIMATIONS for new theme ═══ */
.chat-item {
    animation: ci-stagger 0.45s var(--ease-out) both;
}
.chat-item:nth-child(1) { animation-delay: 0.02s; }
.chat-item:nth-child(2) { animation-delay: 0.06s; }
.chat-item:nth-child(3) { animation-delay: 0.10s; }
.chat-item:nth-child(4) { animation-delay: 0.14s; }
.chat-item:nth-child(n+5) { animation-delay: 0.18s; }
@keyframes ci-stagger {
    from { opacity: 0; transform: translateY(6px) translateX(-4px); }
    to   { opacity: 1; transform: translateY(0) translateX(0); }
}

.msg-row.out { animation: msg-slide-out 0.30s var(--ease-spring); }
.msg-row.in  { animation: msg-slide-in 0.30s var(--ease-spring); }
@keyframes msg-slide-out {
    from { opacity: 0; transform: translateY(8px) translateX(8px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
}
@keyframes msg-slide-in {
    from { opacity: 0; transform: translateY(8px) translateX(-8px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) translateX(0) scale(1); }
}

/* Toast */
.toast { animation: toast-rise 0.32s var(--ease-spring); }
@keyframes toast-rise {
    from { opacity: 0; transform: translateY(20px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    body::before { animation: none; }
}

/* ═══ Keep status bar safe area ═══ */
.app-shell { padding-top: env(safe-area-inset-top, 0); }


/* In-call overlay polish */
.calling-overlay.connected .calling-bg { display: none; }
.calling-overlay #remote-video,
.calling-overlay #local-video { background: #000; }

/* Conn bar takes brand colors */
.conn-bar { background: linear-gradient(135deg, #C465FF, #FF6FB5) !important; }

/* The reaction tray sits ABOVE bubbles */
.react-panel { z-index: 200; }

/* Send button keeps its pill, but a touch sleeker */
.cv-mic-send i { color: #fff; }

/* Replace WhatsApp-like wallpaper SVG (was a green pattern) with subtle aurora dust */
.cv-messages {
    background-image: radial-gradient(circle at 20% 10%, rgba(124,92,255,0.06) 0%, transparent 30%),
                      radial-gradient(circle at 80% 80%, rgba(255,111,181,0.04) 0%, transparent 30%);
}

/* "Updates" tab tweaks */
.muted-hdr { color: var(--text-3) !important; }
.no-status-msg { color: var(--text-3); }
.channels-hdr-row { padding: 0 16px; }
.find-channels-btn {
    background: rgba(124,92,255,0.10);
    color: var(--primary-2);
    border: 1px solid rgba(124,92,255,0.25);
    padding: 6px 14px;
    border-radius: var(--r-pill);
    font-size: 12.5px; font-weight: 600;
}
.channel-item {
    margin: 6px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex; gap: 12px; align-items: center;
}
.ch-av {
    width: 48px; height: 48px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
    background: var(--grad-aurora) !important;
    box-shadow: 0 4px 12px rgba(124,92,255,0.30);
}
.ch-name { font-weight: 600; color: var(--text); }
.ch-time { color: var(--accent) !important; font-size: 11.5px; font-weight: 600; }
.ch-preview { color: var(--text-3); font-size: 13px; }

/* Calls tab */
.call-link-row {
    margin: 8px 16px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
}
.call-link-av {
    background: var(--grad-primary) !important;
    border-radius: 16px;
    box-shadow: var(--glow-primary);
}
.calls-empty { color: var(--text-3); }

/* Updates fab */
.updates-fab { background: var(--grad-aurora); }

/* Edge fade at top of chat list to soften header transition */
.chats-list::before {
    content: ""; position: sticky; top: 0; left: 0; right: 0;
    height: 12px; pointer-events: none;
    background: linear-gradient(180deg, var(--bg) 0%, transparent 100%);
    margin-bottom: -12px;
    display: block;
}

/* Small visual signature on the empty state */
.empty-state {
    position: relative;
}


/* Lift the FAB a bit since nav is floating */
.fab { right: 22px; bottom: 96px; }
.updates-fab { right: 22px; bottom: 96px; }

/* Make sure the chat list isn't covered by the floating nav */
.chats-list { padding-bottom: 110px; }
.calls-list { padding-bottom: 110px; }
.updates-body { padding-bottom: 110px; }
.settings-list { padding-bottom: 110px; }

/* Search FAB style for the search-users-btn in header to be more noticeable */
#search-users-btn { background: rgba(124,92,255,0.08); }
#search-users-btn:hover { background: rgba(124,92,255,0.18); }

/* Make new-chat icon a sparkle */
#compose-fab i { font-size: 24px; }


/* Anchor the kebab dropdown to the right of the screen, never off-canvas */
#main-menu, #cv-ctx-menu {
    top: 64px;
    right: 12px;
    left: auto !important;
    transform-origin: top right;
    z-index: 200;
}

/* Just in case ctx-menu is being styled by old style.css with hardcoded left */
.ctx-menu { left: auto !important; }


/* Force FAB to the right (override any earlier left positioning) */
.fab, .updates-fab {
    left: auto !important;
    right: 22px !important;
    bottom: 96px !important;
}


/* ═══ FIX: Settings screen must fully cover chats ═══ */
#settings-screen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 80 !important;
    background: var(--bg) !important;
    bottom: 0 !important;
}
/* Hide the bottom nav while settings is open */
#settings-screen:not(.hidden) ~ .bot-nav,
.bot-nav.hidden { display: none !important; }

/* ═══ FIX: FAB must be on the RIGHT ═══
   Multiple style sources can fight over .fab; we win with !important on every axis. */
.fab {
    position: absolute !important;
    left: auto !important;
    right: 22px !important;
    bottom: 96px !important;
    top: auto !important;
}
.fab.updates-fab {
    position: absolute !important;
    left: auto !important;
    right: 22px !important;
    bottom: 96px !important;
}

/* And in case the parent .screen is rtl somehow */
.screen { direction: ltr !important; }


/* ═══ FIX: Chat view must fully cover everything underneath ═══ */
.chat-view {
    position: fixed !important;
    inset: 0 !important;
    bottom: 0 !important;
    z-index: 90 !important;       /* above bot-nav (40) and screens (5) */
    background: var(--bg) !important;
}
.chat-view.open { transform: translateX(0); }

/* Hide the floating bottom nav while a chat is open */
.chat-view:not(.hidden) ~ .bot-nav { display: none !important; }

/* And while the search modal / group composer / status modal / settings sheet is open */
.modal:not(.hidden) ~ .bot-nav,
#ac-settings-sheet:not(.hidden) ~ .bot-nav {
    display: none !important;
}


/* Disable the persistent "active" highlight on chat items.
   Highlight only when explicitly selected (e.g. long-press). */
.chat-item.active-item {
    background: rgba(255,255,255,0.025) !important;
    border-color: rgba(255,255,255,0.04) !important;
    border-left: none !important;
    padding-left: 14px !important;
}

/* Reserved for long-press multi-select mode */
.chat-item.selected {
    background: linear-gradient(90deg, rgba(124,92,255,0.22) 0%, rgba(196,101,255,0.10) 100%) !important;
    border-color: rgba(124,92,255,0.45) !important;
    box-shadow: 0 4px 14px rgba(124,92,255,0.20);
}


/* ═══ PIN BANNER ═══ */
.pin-banner {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(90deg, rgba(124,92,255,0.18) 0%, rgba(196,101,255,0.12) 100%);
    border-bottom: 1px solid rgba(124,92,255,0.30);
    padding: 10px 14px;
    backdrop-filter: blur(14px);
    cursor: pointer;
    z-index: 9;
    animation: rise-fade 0.32s var(--ease-out);
}
.pin-banner > i { color: var(--primary-2); font-size: 14px; flex-shrink: 0; }
.pin-content { flex: 1; min-width: 0; }
.pin-label { font-size: 11px; color: var(--primary-2); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.pin-text { color: var(--text); font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.pin-close {
    width: 30px; height: 30px; border-radius: 10px;
    color: var(--text-3); flex-shrink: 0;
}
.pin-close:hover { background: rgba(255,255,255,0.05); color: var(--text); }

/* ═══ MENTION PICKER ═══ */
.mention-picker {
    position: absolute;
    bottom: 80px; left: 12px; right: 12px;
    max-height: 220px; overflow-y: auto;
    background: var(--surface-glass-strong);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    padding: 6px;
    animation: rise-fade 0.16s var(--ease-out);
}
.mention-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 12px;
    cursor: pointer; transition: background var(--m-fast);
}
.mention-item:hover, .mention-item.active { background: rgba(124,92,255,0.18); }
.mention-av {
    width: 32px; height: 32px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 14px; font-weight: 700;
    flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.mention-name { font-weight: 600; font-size: 14px; color: var(--text); }
.mention-handle { color: var(--primary-2); font-size: 12px; }

/* Mention chip in message text */
.msg-text .mention {
    color: var(--accent);
    font-weight: 600;
    background: rgba(255,111,181,0.10);
    padding: 1px 6px; border-radius: 8px;
}

/* QR code modal */
.qr-modal {
    background: var(--surface-glass-strong);
    border-radius: 22px;
    padding: 24px;
    border: 1px solid rgba(255,255,255,0.08);
    text-align: center;
    backdrop-filter: blur(20px);
}
.qr-modal img {
    width: 240px; height: 240px;
    border-radius: 16px;
    background: #fff; padding: 8px;
}
.qr-modal h3 {
    margin-top: 16px; font-weight: 700;
    background: var(--grad-aurora);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.qr-modal p { color: var(--text-2); font-size: 13px; margin-top: 6px; }
.qr-modal .invite-url {
    margin-top: 12px;
    background: rgba(255,255,255,0.04);
    padding: 10px 14px; border-radius: 12px;
    color: var(--primary-2); font-size: 12.5px;
    word-break: break-all;
    border: 1px solid rgba(124,92,255,0.20);
    font-family: monospace;
}


/* Network indicator on call overlay */
#call-net-indicator {
    position: absolute;
    top: 24px; right: 24px;
    width: 36px; height: 36px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.10);
    backdrop-filter: blur(10px);
    color: var(--green);
    font-size: 14px; z-index: 1010;
}
#call-net-indicator[data-level="fair"] { color: var(--warn); }
#call-net-indicator[data-level="bad"]  { color: var(--red); animation: net-blink 1.4s ease-in-out infinite; }
@keyframes net-blink { 50% { opacity: 0.4; } }


/* Calls tab rows */
.call-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px;
    margin: 4px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
}
.call-av {
    width: 46px; height: 46px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: 18px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.call-info { flex: 1; min-width: 0; }
.call-name { font-weight: 600; color: var(--text); font-size: 15px; }
.call-meta { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.call-meta i { font-size: 10px; }
.call-action {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(124,92,255,0.12);
    color: var(--primary-2);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--m-fast);
}
.call-action:hover { background: var(--grad-primary); color: #fff; }
