* {
    box-sizing: border-box;
}

:root {
    --bg: #070b14;
    --bg-soft: #0a1020;
    --sidebar: rgba(10, 16, 29, 0.96);
    --panel: #0f1727;
    --panel-2: #151f33;
    --panel-3: #1a2740;
    --border: rgba(255, 255, 255, 0.075);
    --border-strong: rgba(255, 255, 255, 0.12);
    --text: #f5f7fb;
    --muted: #8190a8;
    --muted-2: #5f6d84;
    --blue: #4f7cff;
    --purple: #765cf6;
    --green: #2ed17b;
    --danger: #fb7185;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

body {
    background:
        radial-gradient(circle at 8% 0%, rgba(79, 124, 255, 0.14), transparent 30%),
        radial-gradient(circle at 94% 100%, rgba(118, 92, 246, 0.08), transparent 30%),
        var(--bg);
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}

::selection {
    background: rgba(79, 124, 255, 0.35);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.11);
    border-radius: 20px;
}

/* AUTH */

.auth {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 22% 18%, rgba(79, 124, 255, 0.24), transparent 32%),
        radial-gradient(circle at 80% 82%, rgba(118, 92, 246, 0.18), transparent 32%),
        #070b14;
}

.auth-card {
    width: min(430px, 94vw);
    padding: 38px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: rgba(15, 23, 39, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.logo {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    box-shadow: 0 14px 38px rgba(79, 124, 255, 0.28);
    font-size: 28px;
    font-weight: 900;
}

.auth h1 {
    margin: 0 0 7px;
    font-size: 31px;
    letter-spacing: -1px;
}

.auth p {
    margin: 0 0 26px;
    color: var(--muted);
    line-height: 1.5;
}

.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
}

.tabs button {
    flex: 1;
    padding: 10px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    transition: 0.18s ease;
}

.tabs button.active {
    background: rgba(255, 255, 255, 0.09);
    color: white;
}

.field {
    margin: 13px 0;
}

.field input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    outline: none;
    background: rgba(255, 255, 255, 0.04);
    color: white;
    transition: 0.18s ease;
}

.field input:focus {
    border-color: rgba(79, 124, 255, 0.68);
    box-shadow: 0 0 0 3px rgba(79, 124, 255, 0.11);
}

.primary {
    width: 100%;
    margin-top: 5px;
    padding: 14px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    font-weight: 800;
    box-shadow: 0 10px 28px rgba(79, 124, 255, 0.2);
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.primary:hover {
    transform: translateY(-1px);
}

.error {
    min-height: 18px;
    margin-top: 12px;
    color: var(--danger);
    text-align: center;
    font-size: 13px;
}

/* APP */

.app {
    display: flex;
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 350px;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--sidebar);
    backdrop-filter: blur(22px);
}

.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--border);
}

.mini-logo {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    box-shadow: 0 8px 22px rgba(79, 124, 255, 0.2);
    font-size: 18px;
    font-weight: 900;
}

.menu,
.iconbtn {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #aab6c7;
    font-size: 19px;
    transition: 0.16s ease;
}

.menu {
    background: rgba(79, 124, 255, 0.12);
    color: #9bb1ff;
}

.menu:hover,
.iconbtn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: white;
}

.search {
    min-width: 0;
    flex: 1;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 12px;
    outline: none;
    background: rgba(255, 255, 255, 0.045);
    color: white;
    transition: 0.18s ease;
}

.search:focus {
    border-color: rgba(79, 124, 255, 0.42);
    background: rgba(255, 255, 255, 0.06);
}

.search::placeholder,
textarea::placeholder,
input::placeholder {
    color: #637189;
}

.profilebar {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px 16px;
    border-bottom: 1px solid var(--border);
}

.avatar {
    width: 46px;
    height: 46px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(135deg, #3b5fbb, #7256e7);
    color: white;
    font-weight: 850;
    box-shadow: 0 8px 22px rgba(44, 67, 132, 0.2);
}

.grow {
    flex: 1;
    min-width: 0;
}

.name {
    overflow: hidden;
    color: #f0f4fb;
    font-weight: 780;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.muted {
    color: var(--muted);
    font-size: 12px;
}

.chatlist {
    flex: 1;
    overflow: auto;
    padding: 8px 9px 14px;
}

.chatitem {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 3px;
    padding: 11px;
    border: 1px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: 0.16s ease;
}

.chatitem:hover {
    background: rgba(255, 255, 255, 0.04);
}

.chatitem.active {
    border-color: rgba(79, 124, 255, 0.12);
    background: linear-gradient(90deg, rgba(79, 124, 255, 0.13), rgba(118, 92, 246, 0.06));
}

.chatmeta {
    flex: 1;
    min-width: 0;
}

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

.preview {
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.badge {
    min-width: 21px;
    height: 21px;
    display: grid;
    place-items: center;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    font-size: 10px;
    font-weight: 800;
}

.online-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 12px;
    height: 12px;
    border: 3px solid #0a101d;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px rgba(46, 209, 123, 0.5);
}

.avatar-wrap {
    position: relative;
}

.empty {
    padding: 28px 18px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
    line-height: 1.55;
}

/* MAIN */

.main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at 50% 0%, rgba(79, 124, 255, 0.06), transparent 29%),
        radial-gradient(circle at 100% 100%, rgba(118, 92, 246, 0.04), transparent 25%),
        #080d17;
}

.chatheader {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 13, 23, 0.88);
    backdrop-filter: blur(18px);
}

.chatheader .avatar {
    width: 44px;
    height: 44px;
}

.header-actions {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.messages {
    flex: 1;
    overflow: auto;
    padding: 26px max(20px, 7vw);
    scroll-behavior: smooth;
}

.welcome {
    height: 100%;
    display: grid;
    place-items: center;
}

.welcome-card {
    max-width: 430px;
    padding: 26px 30px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(15, 23, 39, 0.78);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.16);
    text-align: center;
    backdrop-filter: blur(16px);
}

.welcome-card h2,
.welcome-card h3 {
    margin: 0 0 8px;
}

.message-row {
    display: flex;
    margin: 8px 0;
}

.message-row.mine {
    justify-content: flex-end;
}

.bubble {
    position: relative;
    max-width: min(650px, 76%);
    padding: 10px 13px 8px;
    border: 1px solid var(--border);
    border-radius: 17px;
    border-bottom-left-radius: 6px;
    background: #141f32;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.12);
}

.mine .bubble {
    border-color: rgba(79, 124, 255, 0.12);
    border-bottom-right-radius: 6px;
    border-bottom-left-radius: 17px;
    background: linear-gradient(135deg, #4b74e8, #6657df);
    box-shadow: 0 7px 24px rgba(79, 124, 255, 0.14);
}

.sender {
    margin-bottom: 4px;
    color: #85a2ff;
    font-size: 12px;
    font-weight: 750;
}

.text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.47;
}

.time {
    margin-top: 5px;
    color: rgba(224, 231, 243, 0.62);
    font-size: 9px;
    text-align: right;
}

.reply {
    margin-bottom: 7px;
    padding: 6px 9px;
    border-left: 3px solid #a8bbff;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.16);
    color: #e0e7f3;
    font-size: 11px;
}

.attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.16);
    color: white;
    text-decoration: none;
}

.deleted {
    color: rgba(231, 237, 247, 0.6);
    font-style: italic;
}

.reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.reaction {
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.14);
    color: white;
    font-size: 11px;
}

.msg-actions {
    position: absolute;
    top: -34px;
    right: 3px;
    display: none;
    padding: 3px;
    border: 1px solid var(--border-strong);
    border-radius: 11px;
    background: #111a2a;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.bubble:hover .msg-actions {
    display: flex;
}

.msg-actions button {
    padding: 5px 7px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #b9c5d6;
}

.msg-actions button:hover {
    background: rgba(255, 255, 255, 0.07);
    color: white;
}

.typing {
    min-height: 24px;
    padding: 1px max(20px, 7vw) 4px;
    color: #8ea5ff;
    font-size: 12px;
}

.replybar {
    display: flex;
    gap: 8px;
    margin: 0 max(14px, 5vw);
    padding: 9px 13px;
    border-left: 3px solid var(--blue);
    border-radius: 11px 11px 0 0;
    background: #111a2a;
}

.replybar .grow {
    overflow: hidden;
    font-size: 12px;
}

#replyText {
    overflow: hidden;
    color: var(--muted);
    white-space: nowrap;
    text-overflow: ellipsis;
}

.composer-wrap {
    padding: 9px max(14px, 5vw) 17px;
}

.composer {
    max-width: 980px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 0 auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(20, 31, 50, 0.96);
    box-shadow: 0 13px 35px rgba(0, 0, 0, 0.18);
    transition: 0.18s ease;
}

.composer:focus-within {
    border-color: rgba(79, 124, 255, 0.35);
}

.composer textarea {
    min-height: 40px;
    max-height: 140px;
    flex: 1;
    padding: 10px 4px;
    border: 0;
    outline: 0;
    resize: none;
    background: transparent;
    color: white;
}

.send {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--blue), var(--purple));
    color: white;
    font-size: 18px;
    box-shadow: 0 8px 22px rgba(79, 124, 255, 0.2);
}

.clip {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: #9ca9bd;
    font-size: 19px;
}

.clip:hover {
    background: rgba(255, 255, 255, 0.055);
    color: white;
}

.disabled {
    opacity: 0.42;
    pointer-events: none;
}

/* MODALS */

.modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 14, 0.72);
    backdrop-filter: blur(8px);
}

.modal-card {
    width: min(540px, 96vw);
    max-height: min(720px, 86vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    background: #111a2a;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.46);
}

.modal h3 {
    margin: 0 0 15px;
    font-size: 19px;
}

.modal-card > input,
.modal-card > textarea,
.modal-card > .field input {
    width: 100%;
    flex: 0 0 auto;
    margin-bottom: 10px;
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    outline: none;
    background: #0b1220;
    color: white;
}

.modal-card > input:focus,
.modal-card > textarea:focus {
    border-color: rgba(79, 124, 255, 0.55);
}

.mode-tabs {
    display: flex;
    gap: 7px;
    margin-bottom: 11px;
    padding: 4px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
}

.mode-tabs .secondary {
    flex: 1;
}

#userPicker {
    min-height: 72px;
    max-height: 330px;
    overflow-x: hidden;
    overflow-y: auto;
    margin-top: 2px;
    padding-right: 2px;
}

.userpick {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 3px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 13px;
    cursor: pointer;
    overflow: hidden;
    transition: 0.15s ease;
}

.userpick:hover {
    background: rgba(255, 255, 255, 0.045);
}

.userpick:has(input:checked) {
    border-color: rgba(79, 124, 255, 0.16);
    background: rgba(79, 124, 255, 0.1);
}

.userpick input[type="radio"],
.userpick input[type="checkbox"] {
    width: 18px !important;
    height: 18px;
    min-width: 18px;
    flex: 0 0 18px;
    margin: 0;
    accent-color: var(--blue);
}

.userpick .avatar {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px;
    border-radius: 12px;
}

.userpick .grow {
    min-width: 0;
}

.userpick .name,
.userpick .muted {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.modal-actions {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.secondary,
.small-primary {
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    color: white;
    transition: 0.15s ease;
}

.secondary {
    background: rgba(255, 255, 255, 0.07);
    color: #c7d1df;
}

.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.secondary.mode-active {
    background: linear-gradient(135deg, rgba(79, 124, 255, 0.94), rgba(118, 92, 246, 0.94));
    color: white;
}

.small-primary {
    background: linear-gradient(135deg, var(--blue), var(--purple));
    box-shadow: 0 8px 20px rgba(79, 124, 255, 0.16);
}

.context {
    position: fixed;
    z-index: 40;
    padding: 5px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #111a2a;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.42);
}

.context button {
    width: 100%;
    display: block;
    padding: 8px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: white;
    text-align: left;
}

.context button:hover {
    background: rgba(255, 255, 255, 0.07);
}

@media (max-width: 900px) {
    .sidebar {
        width: 310px;
        min-width: 310px;
    }
}

@media (max-width: 760px) {
    .sidebar {
        width: 92px;
        min-width: 92px;
    }

    .mini-logo,
    .topbar .search,
    .profilebar .grow,
    .profilebar .iconbtn,
    .chatmeta {
        display: none;
    }

    .topbar,
    .profilebar {
        justify-content: center;
    }

    .chatitem {
        justify-content: center;
        padding: 10px 5px;
    }

    .messages {
        padding: 17px 11px;
    }

    .bubble {
        max-width: 88%;
    }
}

@media (max-width: 520px) {
    .sidebar {
        display: none;
    }

    .messages {
        padding: 14px 8px;
    }

    .composer-wrap {
        padding: 7px 8px 10px;
    }

    .replybar {
        margin: 0 8px;
    }

    .modal {
        padding: 10px;
    }

    .modal-card {
        width: 100%;
        max-height: 92vh;
        padding: 16px;
        border-radius: 18px;
    }
}


/* NOVA 2.0 */

.avatar.has-image {
    overflow: hidden;
    padding: 0;
    background: #172238;
}

.avatar.has-image img,
.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.readmark {
    margin-left: 4px;
    color: rgba(255,255,255,.72);
    font-weight: 800;
    letter-spacing: -2px;
}

.readmark.read {
    color: #b8f2ff;
}

.forwarded {
    margin-bottom: 6px;
    color: #a7b9ff;
    font-size: 11px;
    font-weight: 750;
}

.pinned-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(17, 26, 42, 0.92);
    cursor: pointer;
}

.pinned-bar:hover {
    background: rgba(22, 33, 54, 0.96);
}

.pinned-accent {
    width: 3px;
    align-self: stretch;
    border-radius: 4px;
    background: linear-gradient(var(--blue), var(--purple));
}

.pinned-text {
    min-width: 0;
    flex: 1;
}

.pinned-text b {
    display: block;
    color: #9fb3ff;
    font-size: 11px;
}

.pinned-preview {
    overflow: hidden;
    color: #cbd5e1;
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.chat-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 18, 32, 0.95);
}

.chat-search-bar input {
    min-width: 0;
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: 0;
    background: rgba(255,255,255,.04);
    color: white;
}

.search-count {
    min-width: 58px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.search-hit {
    animation: novaPulse 1.2s ease;
}

@keyframes novaPulse {
    0%, 100% { filter: none; }
    35% { filter: drop-shadow(0 0 12px rgba(118,92,246,.9)); }
}

.profile-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.profile-avatar-preview {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(135deg, #3b5fbb, #7256e7);
    font-size: 26px;
    font-weight: 850;
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.members-list {
    max-height: 260px;
    overflow-y: auto;
    margin-top: 8px;
}

.member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px;
    border-radius: 12px;
}

.member-row:hover {
    background: rgba(255,255,255,.035);
}

.role-pill {
    margin-left: auto;
    padding: 3px 7px;
    border-radius: 8px;
    background: rgba(79,124,255,.1);
    color: #98adff;
    font-size: 9px;
    text-transform: uppercase;
}

.forward-list {
    max-height: 340px;
    overflow-y: auto;
}

.forward-chat {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    margin-bottom: 4px;
    padding: 10px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: white;
    text-align: left;
}

.forward-chat:hover {
    background: rgba(255,255,255,.05);
}


/* NOVA 2.1: управление группами и каналами */
.member-actions {
    display: flex;
    gap: 5px;
    margin-left: auto;
}
.member-actions button {
    padding: 5px 8px;
    border: 0;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    color: #cbd5e1;
    font-size: 10px;
}
.member-actions button:hover {
    background: rgba(255,255,255,.1);
    color: white;
}
.member-actions .danger-btn,
.danger-btn {
    color: #ff9bac;
}
.danger-btn {
    padding: 10px 13px;
    border: 1px solid rgba(251,113,133,.16);
    border-radius: 10px;
    background: rgba(251,113,133,.08);
}
.danger-btn:hover {
    background: rgba(251,113,133,.14);
}
.chat-management {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.add-members-list {
    max-height: 340px;
    overflow-y: auto;
}
.add-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px;
    border-radius: 12px;
    cursor: pointer;
}
.add-member-row:hover {
    background: rgba(255,255,255,.045);
}


/* NOVA 2.2: медиа, голосовые, emoji, drag&drop, уведомления */

.main {
    position: relative;
}

.media-image {
    display: block;
    max-width: min(420px, 100%);
    max-height: 420px;
    margin-top: 8px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 10px 28px rgba(0,0,0,.18);
}

.media-video {
    display: block;
    width: min(460px, 100%);
    max-height: 420px;
    margin-top: 8px;
    border-radius: 14px;
    background: #05080e;
}

.media-audio {
    width: min(340px, 100%);
    margin-top: 8px;
}

.file-card {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
    padding: 9px 11px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: rgba(0,0,0,.15);
    color: white;
    text-decoration: none;
}

.file-card:hover {
    background: rgba(255,255,255,.06);
}

.emoji-btn,
.record-btn {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: #a6b2c5;
    font-size: 19px;
}

.emoji-btn:hover,
.record-btn:hover {
    background: rgba(255,255,255,.055);
    color: white;
}

.record-btn.recording {
    color: #ff8ca0;
    background: rgba(251,113,133,.09);
    animation: novaRecordPulse 1.15s ease-in-out infinite;
}

@keyframes novaRecordPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(251,113,133,.08); }
    50% { box-shadow: 0 0 0 7px rgba(251,113,133,.05); }
}

.recording-label {
    display: none;
    align-items: center;
    gap: 7px;
    padding: 0 4px;
    color: #ff9aac;
    font-size: 12px;
    white-space: nowrap;
}

.recording-label.visible {
    display: flex;
}

.recording-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fb7185;
    animation: novaBlink .9s ease-in-out infinite;
}

@keyframes novaBlink {
    50% { opacity: .25; }
}

.emoji-panel {
    position: absolute;
    right: 76px;
    bottom: 72px;
    z-index: 15;
    width: min(340px, calc(100vw - 28px));
    padding: 10px;
    border: 1px solid var(--border-strong);
    border-radius: 17px;
    background: #111a2a;
    box-shadow: 0 20px 55px rgba(0,0,0,.4);
    backdrop-filter: blur(18px);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.emoji-grid button {
    aspect-ratio: 1;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: 20px;
}

.emoji-grid button:hover {
    background: rgba(255,255,255,.07);
    transform: scale(1.08);
}

.drop-overlay {
    position: absolute;
    inset: 82px 22px 92px;
    z-index: 12;
    display: none;
    place-items: center;
    border: 2px dashed rgba(110,139,255,.45);
    border-radius: 22px;
    background: rgba(9,15,27,.9);
    color: #c7d4ff;
    backdrop-filter: blur(7px);
    pointer-events: none;
}

.drop-overlay.visible {
    display: grid;
}

.drop-overlay-card {
    padding: 22px 28px;
    border-radius: 18px;
    background: rgba(79,124,255,.08);
    text-align: center;
}

.drop-overlay-card b {
    display: block;
    margin-bottom: 6px;
    font-size: 17px;
}

.uploading-indicator {
    position: absolute;
    right: 18px;
    bottom: 76px;
    z-index: 11;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #111a2a;
    color: #cbd5e1;
    font-size: 11px;
    box-shadow: 0 10px 25px rgba(0,0,0,.25);
}

.notify-enabled {
    color: #a9bbff !important;
    background: rgba(79,124,255,.1) !important;
}

@media (max-width: 760px) {
    .emoji-panel {
        right: 12px;
        bottom: 72px;
    }

    .emoji-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .recording-label {
        max-width: 76px;
        overflow: hidden;
    }
}


/* NOVA 2.2.1: красивое голосовое */

.voice-player {
    min-width: 280px;
    max-width: min(360px, 78vw);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 7px;
    padding: 8px 9px 8px 8px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 15px;
    background: rgba(5,10,20,.14);
}

.voice-play {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    color: white;
    font-size: 14px;
    transition: transform .15s ease, background .15s ease;
}

.voice-play:hover {
    transform: scale(1.04);
    background: rgba(255,255,255,.22);
}

.other .voice-play {
    background: linear-gradient(135deg, #4f7cff, #765cf6);
}

.voice-main {
    min-width: 0;
    flex: 1;
}

.voice-wave {
    height: 27px;
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    user-select: none;
}

.voice-bar {
    width: 3px;
    flex: 0 0 3px;
    border-radius: 5px;
    background: rgba(255,255,255,.27);
    transition: background .12s ease, transform .12s ease;
}

.other .voice-bar {
    background: rgba(159,178,220,.32);
}

.voice-bar.played {
    background: rgba(255,255,255,.9);
}

.other .voice-bar.played {
    background: #718fff;
}

.voice-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    color: rgba(229,235,244,.65);
    font-size: 9px;
}

.other .voice-meta {
    color: #718096;
}

.voice-label {
    margin-left: auto;
    opacity: .75;
}

.voice-audio {
    display: none;
}

.recording-label {
    height: 40px;
    min-width: 116px;
    padding: 0 10px;
    border-radius: 13px;
    background: rgba(251,113,133,.08);
}

.recording-label.visible {
    display: flex;
}

.recording-label .recording-dot {
    box-shadow: 0 0 0 5px rgba(251,113,133,.08);
}

.record-cancel-hint {
    color: #8f9caf;
    font-size: 10px;
}

@media (max-width: 560px) {
    .voice-player {
        min-width: 230px;
        max-width: 76vw;
    }

    .voice-wave {
        gap: 1.5px;
    }

    .voice-bar {
        width: 2.5px;
        flex-basis: 2.5px;
    }
}


/* NOVA 2.3: аудио и видеозвонки */

.call-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 18px;
    background:
        radial-gradient(circle at 50% 15%, rgba(79,124,255,.16), transparent 32%),
        rgba(3,7,14,.88);
    backdrop-filter: blur(15px);
}

.call-card {
    width: min(760px, 96vw);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: 26px;
    background: #0e1727;
    box-shadow: 0 32px 100px rgba(0,0,0,.5);
}

.call-stage {
    position: relative;
    min-height: 360px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 30%, rgba(79,124,255,.10), transparent 38%),
        #080d17;
}

.call-stage video {
    width: 100%;
    height: 100%;
    max-height: 68vh;
    object-fit: cover;
    background: #05080e;
}

.call-stage.audio-mode video {
    display: none;
}

.call-avatar {
    width: 108px;
    height: 108px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 34px;
    background: linear-gradient(135deg,#3b5fbb,#7256e7);
    font-size: 38px;
    font-weight: 850;
    box-shadow: 0 18px 50px rgba(79,124,255,.2);
}

.call-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.local-video {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 160px !important;
    height: 110px !important;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 12px 35px rgba(0,0,0,.35);
}

.call-info {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    text-align: center;
    pointer-events: none;
}

.call-name {
    font-size: 20px;
    font-weight: 850;
}

.call-status {
    margin-top: 5px;
    color: #98a7bd;
    font-size: 12px;
}

.call-controls {
    display: flex;
    justify-content: center;
    gap: 11px;
    padding: 17px;
    border-top: 1px solid var(--border);
    background: #111a2a;
}

.call-control {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 16px;
    background: rgba(255,255,255,.07);
    color: white;
    font-size: 19px;
}

.call-control:hover {
    background: rgba(255,255,255,.11);
}

.call-control.active {
    color: #93aaff;
    background: rgba(79,124,255,.13);
}

.call-control.end {
    background: #d94b61;
}

.call-control.accept {
    background: #21b86a;
}

.call-control.decline {
    background: #d94b61;
}

.incoming-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.call-header-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #aeb9ca;
    font-size: 17px;
}

.call-header-btn:hover {
    background: rgba(255,255,255,.06);
    color: white;
}

@media (max-width: 620px) {
    .call-stage {
        min-height: 480px;
    }

    .local-video {
        width: 112px !important;
        height: 84px !important;
    }
}


.call-header-btn svg,.call-control svg{width:20px;height:20px;display:block;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.call-header-btn,.call-control{transition:transform .16s ease,background .16s ease,color .16s ease}
.call-header-btn:hover,.call-control:hover{transform:translateY(-1px)}
.call-header-btn:hover{background:rgba(79,124,255,.10);color:#aabaff}
.call-control.end,.call-control.decline{box-shadow:0 8px 24px rgba(217,75,97,.22)}
.call-control.accept{box-shadow:0 8px 24px rgba(33,184,106,.20)}


/* NOVA 2.4: красивые профили и toast-уведомления */

.clickable-avatar {
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease;
}

.clickable-avatar:hover {
    transform: translateY(-1px) scale(1.025);
    box-shadow: 0 10px 26px rgba(79,124,255,.18);
}

.user-profile-card {
    position: relative;
    width: min(520px, 96vw);
    overflow: hidden;
    padding: 0;
}

.user-profile-cover {
    height: 132px;
    background:
        radial-gradient(circle at 18% 20%, rgba(255,255,255,.15), transparent 22%),
        linear-gradient(135deg, rgba(79,124,255,.95), rgba(118,92,246,.92));
}

.user-profile-body {
    position: relative;
    padding: 0 24px 23px;
}

.user-profile-avatar-wrap {
    position: relative;
    width: 104px;
    height: 104px;
    margin-top: -52px;
}

.user-profile-avatar {
    width: 104px;
    height: 104px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 5px solid #111a2a;
    border-radius: 31px;
    background: linear-gradient(135deg,#3d5fb9,#7658e8);
    font-size: 37px;
    font-weight: 900;
    box-shadow: 0 16px 38px rgba(0,0,0,.25);
}

.user-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile-online {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 18px;
    height: 18px;
    border: 4px solid #111a2a;
    border-radius: 50%;
    background: #475569;
}

.user-profile-online.online {
    background: var(--green);
    box-shadow: 0 0 12px rgba(46,209,123,.55);
}

.user-profile-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.user-profile-name {
    margin-top: 12px;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -.4px;
}

.user-profile-handle {
    margin-top: 3px;
    color: #91a2ba;
    font-size: 12px;
}

.user-profile-bio {
    min-height: 52px;
    margin-top: 18px;
    padding: 14px 15px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
    color: #d7dfeb;
    line-height: 1.55;
    white-space: pre-wrap;
}

.user-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.user-profile-chip {
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(255,255,255,.03);
    color: #8e9db2;
    font-size: 10px;
}

.user-profile-actions {
    display: flex;
    gap: 8px;
    margin-top: 17px;
}

.user-profile-actions button {
    flex: 1;
}

.profile-close-floating {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    background: rgba(7,11,20,.34);
    color: white;
    backdrop-filter: blur(9px);
}

.profile-close-floating:hover {
    background: rgba(7,11,20,.58);
}

.toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 90;
    width: min(360px, calc(100vw - 30px));
    display: flex;
    flex-direction: column;
    gap: 9px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.095);
    border-radius: 15px;
    background: rgba(17,26,42,.94);
    box-shadow: 0 18px 45px rgba(0,0,0,.34);
    backdrop-filter: blur(18px);
    pointer-events: auto;
    transform: translateX(22px);
    opacity: 0;
    animation: toastIn .24s ease forwards;
}

.toast.leaving {
    animation: toastOut .2s ease forwards;
}

@keyframes toastIn {
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    to { transform: translateX(24px); opacity: 0; }
}

.toast-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 13px;
    background: linear-gradient(135deg,#3b5fbb,#7256e7);
    font-weight: 850;
}

.toast-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.toast-title {
    overflow: hidden;
    color: white;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.toast-text {
    margin-top: 3px;
    overflow: hidden;
    color: #9aa8bc;
    font-size: 11px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.toast-close {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #7f8da2;
}

.toast-close:hover {
    background: rgba(255,255,255,.06);
    color: white;
}

.toast.call-toast {
    border-color: rgba(79,124,255,.18);
    background: linear-gradient(135deg, rgba(18,30,52,.97), rgba(27,24,54,.97));
}

@media (max-width: 620px) {
    .toast-stack {
        top: 10px;
        right: 10px;
        width: calc(100vw - 20px);
    }

    .user-profile-card {
        width: 100%;
    }
}


/* NOVA 2.5: компактные профили, глобальный поиск, last seen */

.forwarded-profile {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
    padding: 3px 6px;
    border-radius: 8px;
    color: #a7b9ff;
    font-size: 11px;
    font-weight: 750;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.forwarded-profile:hover {
    background: rgba(255,255,255,.055);
    color: #c3d0ff;
}

.profile-compact-actions {
    display: flex;
    gap: 7px;
    margin-top: 16px;
}

.profile-mini-action {
    min-width: 44px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255,255,255,.045);
    color: #d9e1ec;
    font-size: 12px;
    font-weight: 700;
    transition: .16s ease;
}

.profile-mini-action:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,.075);
    color: white;
}

.profile-mini-action.primary-action {
    border-color: rgba(79,124,255,.18);
    background: rgba(79,124,255,.12);
    color: #afbeff;
}

.profile-mini-action svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-section-label {
    margin-top: 17px;
    margin-bottom: 7px;
    color: #69778d;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .9px;
    text-transform: uppercase;
}

.mutual-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mutual-chip {
    max-width: 180px;
    padding: 6px 9px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(255,255,255,.03);
    color: #a9b5c7;
    font-size: 10px;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}

.mutual-chip:hover {
    background: rgba(255,255,255,.06);
    color: white;
}

.people-results {
    position: absolute;
    top: 63px;
    left: 54px;
    right: 100px;
    z-index: 19;
    max-height: 330px;
    overflow-y: auto;
    padding: 7px;
    border: 1px solid var(--border-strong);
    border-radius: 15px;
    background: rgba(17,26,42,.98);
    box-shadow: 0 18px 55px rgba(0,0,0,.34);
    backdrop-filter: blur(18px);
}

.people-result {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: white;
    text-align: left;
}

.people-result:hover {
    background: rgba(255,255,255,.055);
}

.people-result .avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 12px;
}

.people-results-title {
    padding: 6px 8px 8px;
    color: #69778d;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.people-empty {
    padding: 14px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

@media (max-width: 760px) {
    .people-results {
        left: 8px;
        right: 8px;
    }

    .profile-mini-action span {
        display: none;
    }

    .profile-mini-action {
        flex: 1;
        padding: 0;
    }
}


/* NOVA 2.6 · Chat Experience */
.chat-item.pinned-chat .name::before{content:"";display:inline-block;width:6px;height:6px;margin-right:6px;border-radius:50%;background:#718fff;vertical-align:2px}
.chat-item.archived-chat{opacity:.62}
.chat-state-icons{display:flex;gap:4px;margin-left:auto;color:#738198;font-size:10px}
.date-separator{display:flex;align-items:center;justify-content:center;margin:15px 0 10px;position:relative}
.date-separator span{position:relative;z-index:1;padding:5px 10px;border:1px solid var(--border);border-radius:999px;background:rgba(17,26,42,.88);color:#8290a4;font-size:9px;font-weight:800;backdrop-filter:blur(10px)}
.unread-separator{display:flex;align-items:center;gap:10px;margin:12px 0;color:#8298ff;font-size:9px;font-weight:850;text-transform:uppercase;letter-spacing:.6px}
.unread-separator::before,.unread-separator::after{content:"";height:1px;flex:1;background:rgba(113,143,255,.25)}
.jump-unread{position:absolute;right:18px;bottom:92px;z-index:10;padding:8px 11px;border:1px solid rgba(113,143,255,.2);border-radius:12px;background:rgba(20,30,49,.94);color:#aabaff;font-size:10px;font-weight:800;box-shadow:0 10px 30px rgba(0,0,0,.25)}
.draft-tag{color:#ff8798;font-weight:800}
.context{min-width:190px;padding:6px;border:1px solid var(--border-strong);border-radius:14px;background:rgba(17,26,42,.98);box-shadow:0 18px 55px rgba(0,0,0,.4);backdrop-filter:blur(18px)}
.context button{width:100%;display:flex;align-items:center;gap:9px;padding:9px 10px;border:0;border-radius:9px;background:transparent;color:#d8e0eb;text-align:left;font-size:11px}
.context button:hover{background:rgba(255,255,255,.06)}
.context button.danger{color:#ff8798}
.media-tabs{display:flex;gap:6px;margin-top:14px}
.media-tab{padding:6px 9px;border:1px solid var(--border);border-radius:9px;background:rgba(255,255,255,.03);color:#8997aa;font-size:10px}
.media-tab.active{background:rgba(79,124,255,.12);color:#b3c0ff;border-color:rgba(79,124,255,.18)}
.shared-media-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-top:9px}
.shared-media-item{aspect-ratio:1;overflow:hidden;border-radius:10px;background:rgba(255,255,255,.035);display:grid;place-items:center;color:#8492a6;font-size:10px}
.shared-media-item img,.shared-media-item video{width:100%;height:100%;object-fit:cover}
.shared-link{display:block;margin-top:6px;padding:8px 9px;border:1px solid var(--border);border-radius:9px;color:#aabaff;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-info-state{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}
.chat-info-state button{padding:7px 9px;border-radius:9px}


/* NOVA 2.7 · Navigation & Saved */
.chat-filters{display:flex;gap:5px;padding:8px 10px 7px;overflow-x:auto;border-bottom:1px solid var(--border)}
.chat-filter{flex:0 0 auto;padding:6px 9px;border:1px solid transparent;border-radius:10px;background:transparent;color:#718096;font-size:9px;font-weight:800}
.chat-filter:hover{background:rgba(255,255,255,.04);color:#a8b4c5}
.chat-filter.active{background:rgba(79,124,255,.11);border-color:rgba(79,124,255,.14);color:#a8b8ff}
.chat-filter-count{margin-left:4px;opacity:.65}
.saved-panel-list{max-height:520px;overflow-y:auto}
.saved-message{display:flex;gap:10px;padding:11px;border-radius:12px;cursor:pointer;border:1px solid transparent}
.saved-message:hover{background:rgba(255,255,255,.04);border-color:var(--border)}
.saved-message-icon{width:34px;height:34px;display:grid;place-items:center;flex:0 0 34px;border-radius:10px;background:rgba(79,124,255,.1);color:#a8b8ff}
.saved-message-body{min-width:0;flex:1}.saved-message-chat{font-size:10px;font-weight:800;color:#a9b6c8}.saved-message-text{margin-top:3px;overflow:hidden;color:#d8e0eb;font-size:11px;white-space:nowrap;text-overflow:ellipsis}.saved-message-time{margin-top:4px;color:#647287;font-size:9px}.bookmark-mark{color:#ffd86b;margin-left:5px}

/* NOVA 2.8 · Power User Update */
.selection-bar{
  min-height:58px;display:flex;align-items:center;gap:10px;padding:8px 15px;
  border-bottom:1px solid var(--border);background:rgba(12,19,32,.96);backdrop-filter:blur(16px)
}
.selection-count{font-size:12px;font-weight:850;color:#dce4ef}
.selection-actions{display:flex;gap:6px;margin-left:auto}
.selection-actions button{
  min-width:38px;height:38px;padding:0 10px;border:1px solid var(--border);border-radius:11px;
  background:rgba(255,255,255,.04);color:#aab7c8;font-size:11px
}
.selection-actions button:hover{background:rgba(255,255,255,.07);color:white}
.selection-actions .danger{color:#ff8798;border-color:rgba(251,113,133,.13)}
.message-row.select-mode{cursor:pointer}
.message-row.selected .bubble{outline:2px solid rgba(113,143,255,.5);outline-offset:2px}
.message-check{
  width:22px;height:22px;display:none;place-items:center;flex:0 0 22px;margin:10px 7px 0;
  border:1px solid rgba(255,255,255,.15);border-radius:50%;background:rgba(17,26,42,.9);color:white;font-size:10px
}
.message-row.select-mode .message-check{display:grid}
.message-row.selected .message-check{background:#587bf0;border-color:#587bf0}
.global-search-section{padding:6px 8px 4px;color:#69778d;font-size:9px;font-weight:850;letter-spacing:.8px;text-transform:uppercase}
.global-message-result{
  display:flex;gap:9px;width:100%;padding:9px;border:0;border-radius:11px;background:transparent;color:white;text-align:left
}
.global-message-result:hover{background:rgba(255,255,255,.05)}
.global-message-result .msg-icon{
  width:34px;height:34px;display:grid;place-items:center;flex:0 0 34px;border-radius:10px;
  background:rgba(79,124,255,.09);color:#aab8ff
}
.global-message-result .msg-title{font-size:10px;font-weight:800;color:#abb7c7}
.global-message-result .msg-text{margin-top:3px;overflow:hidden;color:#e0e6ef;font-size:11px;white-space:nowrap;text-overflow:ellipsis}
.shortcut-hint{margin-left:auto;color:#637188;font-size:9px}


/* NOVA 2.9 · Media Update */
.media-image{cursor:zoom-in}
.media-viewer{position:fixed;inset:0;z-index:120;display:flex;align-items:center;justify-content:center;background:rgba(4,8,15,.94);backdrop-filter:blur(18px)}
.media-viewer.hidden{display:none}.media-viewer-stage{position:relative;width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:72px 90px}
.media-viewer-stage img,.media-viewer-stage video{max-width:92vw;max-height:82vh;border-radius:14px;box-shadow:0 24px 90px rgba(0,0,0,.55);object-fit:contain}
.media-viewer-top{position:absolute;left:0;right:0;top:0;height:62px;display:flex;align-items:center;gap:10px;padding:0 18px;background:linear-gradient(rgba(0,0,0,.38),transparent);z-index:3}
.media-viewer-name{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#dfe6ef;font-size:11px;font-weight:750}
.viewer-btn{width:38px;height:38px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.12);border-radius:11px;background:rgba(17,26,42,.7);color:#e8edf5;font-size:16px;text-decoration:none}
.viewer-nav{position:absolute;top:50%;transform:translateY(-50%);z-index:3;width:44px;height:58px;border:1px solid rgba(255,255,255,.1);border-radius:13px;background:rgba(17,26,42,.68);color:white;font-size:24px}
.viewer-prev{left:20px}.viewer-next{right:20px}.viewer-counter{color:#8190a5;font-size:10px}
.upload-queue{position:fixed;right:18px;bottom:18px;z-index:70;width:min(340px,calc(100vw - 36px));display:flex;flex-direction:column;gap:7px}
.upload-card{padding:10px 11px;border:1px solid var(--border-strong);border-radius:13px;background:rgba(17,26,42,.97);box-shadow:0 14px 40px rgba(0,0,0,.32)}
.upload-card-head{display:flex;align-items:center;gap:8px}.upload-card-name{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#dbe3ed;font-size:10px;font-weight:750}.upload-card-pct{color:#8292aa;font-size:9px}
.upload-track{height:4px;margin-top:8px;overflow:hidden;border-radius:999px;background:rgba(255,255,255,.07)}.upload-progress{height:100%;width:0;background:currentColor;color:#718fff;border-radius:999px;transition:width .12s linear}
.file-card{display:flex!important;align-items:center;gap:10px;padding:10px!important}.file-icon{width:34px;height:34px;display:grid;place-items:center;flex:0 0 34px;border-radius:9px;background:rgba(79,124,255,.1);color:#aebcff;font-size:15px}.file-info{min-width:0}.file-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#dfe6ef;font-size:10px;font-weight:750}.file-sub{display:block;margin-top:2px;color:#6f7d92;font-size:9px}
@media(max-width:760px){.media-viewer-stage{padding:65px 12px}.viewer-prev{left:8px}.viewer-next{right:8px}.viewer-nav{width:36px;height:48px}}

/* NOVA 3.0 · Groups & Channels */
.chat-create-extra{display:grid;gap:8px;margin-top:8px}.chat-create-extra textarea{min-height:72px;resize:vertical}
.toggle-row{display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid var(--border);border-radius:11px;background:rgba(255,255,255,.025);color:#aab5c5;font-size:10px}.toggle-row input{accent-color:#718fff}
.chat-description{margin:10px 0;padding:10px 11px;border:1px solid var(--border);border-radius:11px;background:rgba(255,255,255,.025);color:#9eabbd;font-size:10px;line-height:1.5}
.invite-box{display:flex;gap:6px;margin-top:8px}.invite-box input{min-width:0;flex:1;font-size:9px}.invite-box button{white-space:nowrap}
.management-section{margin-top:12px;padding-top:11px;border-top:1px solid var(--border)}.management-title{margin-bottom:7px;color:#718096;font-size:9px;font-weight:850;text-transform:uppercase;letter-spacing:.7px}
.member-actions .owner-btn{color:#ffd878}
.channel-readonly{padding:10px 14px;text-align:center;border-top:1px solid var(--border);background:rgba(255,255,255,.02);color:#75849a;font-size:10px}

/* NOVA 3.0.1 · Chat Info redesign */
#chatInfoModal{
  align-items:center;
  padding:18px;
}
#chatInfoModal .modal-card{
  position:relative;
  width:min(660px, 96vw);
  max-height:min(88vh, 860px);
  overflow-y:auto;
  padding:0;
  border-radius:24px;
  background:#111a2a;
  scrollbar-width:thin;
}
#chatInfoModal .modal-card::-webkit-scrollbar{width:8px}
#chatInfoModal .modal-card::-webkit-scrollbar-thumb{background:rgba(255,255,255,.1);border-radius:8px}

.chat-info-top{
  position:sticky;
  top:0;
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 20px 12px;
  background:linear-gradient(180deg,rgba(17,26,42,.99),rgba(17,26,42,.94));
  backdrop-filter:blur(18px);
}
.chat-info-top h3{margin:0}
.chat-info-close{
  width:36px;height:36px;display:grid;place-items:center;border:0;border-radius:11px;
  background:rgba(255,255,255,.05);color:#9cabc0;font-size:19px
}
.chat-info-close:hover{background:rgba(255,255,255,.09);color:#fff}
.chat-info-content{padding:4px 20px 22px}

.chat-info-hero{
  display:flex;align-items:center;gap:14px;padding:10px 0 16px
}
.chat-info-hero .profile-avatar-preview{
  width:76px;height:76px;flex-basis:76px;border-radius:23px
}
.chat-info-titleline{font-size:18px;font-weight:850;color:#f3f6fb}
.chat-info-subline{margin-top:3px;color:#78879c;font-size:11px}

.chat-info-primary-actions{
  display:flex;gap:7px;flex-wrap:wrap;margin-top:10px
}
.chat-info-primary-actions button{
  height:36px;padding:0 11px;border-radius:10px;font-size:10px
}

.chat-info-section{
  margin-top:12px;padding:13px;
  border:1px solid var(--border);
  border-radius:15px;
  background:rgba(255,255,255,.022)
}
.chat-info-section-title{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:10px;color:#74839a;font-size:9px;font-weight:850;letter-spacing:.75px;text-transform:uppercase
}
.chat-info-section textarea,
.chat-info-section input[type="text"],
.chat-info-section input:not([type]){
  width:100%;box-sizing:border-box;
  padding:10px 11px;border:1px solid var(--border);
  border-radius:11px;outline:none;background:#0d1523;color:#e4e9f1;
  font:inherit;font-size:11px
}
.chat-info-section textarea{min-height:72px;resize:vertical}
.chat-info-section textarea:focus,
.chat-info-section input:focus{border-color:rgba(113,143,255,.35)}

.chat-info-description{
  padding:10px 11px;border-radius:11px;
  background:#0d1523;color:#aeb9c9;font-size:11px;line-height:1.5
}

.chat-state-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:7px
}
.chat-state-grid button{
  min-height:38px;padding:7px;border:1px solid var(--border);border-radius:10px;
  background:rgba(255,255,255,.035);color:#aeb9c9;font-size:10px
}
.chat-state-grid button:hover{background:rgba(255,255,255,.065);color:white}

.invite-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:6px;
}
.invite-box input{
  min-width:0;background:#0d1523!important;color:#9fb0c7!important
}

.members-list{
  max-height:none;
  margin:0;
}
.member-row{
  min-height:50px;
  padding:8px 6px;
  border-bottom:1px solid rgba(255,255,255,.035);
}
.member-row:last-child{border-bottom:0}
.member-info{min-width:0;flex:1}
.member-role-select{
  height:32px;padding:0 8px;border:1px solid var(--border);border-radius:9px;
  background:#0d1523;color:#c9d2df;font-size:10px;outline:none
}
.member-role-select:focus{border-color:rgba(113,143,255,.35)}
.member-actions{margin-left:4px}
.member-actions button{
  height:32px;padding:0 8px;border-radius:9px
}
.role-pill.owner{color:#ffd678;background:rgba(255,205,94,.09)}
.role-pill.admin{color:#aebcff;background:rgba(79,124,255,.11)}
.role-pill.member{color:#8795a9;background:rgba(255,255,255,.045)}

.chat-info-danger-zone{
  display:flex;gap:7px;flex-wrap:wrap
}
.chat-info-danger-zone .danger-btn{padding:8px 10px;font-size:10px}

.chat-info-save-row{
  display:flex;justify-content:flex-end;gap:7px;margin-top:10px
}

#chatInfoModal .media-tabs{margin-top:0}
#chatInfoModal #sharedMedia{margin-top:8px}

@media(max-width:620px){
  #chatInfoModal{padding:0}
  #chatInfoModal .modal-card{width:100vw;max-height:100vh;height:100vh;border-radius:0}
  .chat-info-content{padding:4px 12px 18px}
  .chat-state-grid{grid-template-columns:1fr}
  .invite-box{grid-template-columns:1fr 1fr}
  .invite-box input{grid-column:1/-1}
  .member-row{align-items:flex-start;flex-wrap:wrap}
  .member-actions{width:100%;margin-left:48px}
}


/* NOVA 3.1 · Profiles & Social */
.user-profile-cover{
  position:relative;
  height:154px;
  background:
    radial-gradient(circle at 18% 20%,rgba(255,255,255,.13),transparent 22%),
    linear-gradient(135deg,rgba(79,124,255,.94),rgba(118,92,246,.9));
  background-size:cover;
  background-position:center;
}
.user-profile-cover::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(180deg,transparent 45%,rgba(17,26,42,.48))
}
.user-profile-name{margin-top:12px}
.user-profile-handle{display:flex;align-items:center;gap:7px}
.copy-handle{
  width:27px;height:27px;display:grid;place-items:center;border:0;border-radius:8px;
  background:rgba(255,255,255,.045);color:#7f8da2;font-size:11px
}
.copy-handle:hover{background:rgba(255,255,255,.08);color:white}
.profile-social-tabs{display:flex;gap:6px;margin-top:17px;border-bottom:1px solid var(--border);padding-bottom:8px}
.profile-social-tab{
  padding:6px 9px;border:0;border-radius:9px;background:transparent;color:#718096;font-size:10px;font-weight:800
}
.profile-social-tab.active{background:rgba(79,124,255,.11);color:#aebcff}
.profile-social-pane{margin-top:10px}
.wall-compose{
  display:flex;gap:8px;padding:10px;border:1px solid var(--border);border-radius:13px;background:rgba(255,255,255,.025)
}
.wall-compose textarea{
  flex:1;min-height:58px;resize:vertical;padding:9px 10px;border:1px solid var(--border);border-radius:10px;
  background:#0d1523;color:#e5eaf1;font:inherit;font-size:11px;outline:none
}
.wall-compose textarea:focus{border-color:rgba(113,143,255,.34)}
.wall-compose button{align-self:flex-end}
.wall-list{display:flex;flex-direction:column;gap:8px;margin-top:9px}
.wall-post{padding:11px;border:1px solid var(--border);border-radius:13px;background:rgba(255,255,255,.025)}
.wall-post-head{display:flex;align-items:center;gap:9px}
.wall-post-author{min-width:0;flex:1}
.wall-post-name{font-size:10px;font-weight:850;color:#dce4ee;cursor:pointer}
.wall-post-name:hover{color:#b7c4ff}
.wall-post-time{margin-top:2px;color:#65748a;font-size:9px}
.wall-post-text{margin-top:9px;color:#cbd4df;font-size:11px;line-height:1.55;white-space:pre-wrap;word-break:break-word}
.wall-post-delete{
  width:28px;height:28px;border:0;border-radius:8px;background:transparent;color:#738198
}
.wall-post-delete:hover{background:rgba(251,113,133,.08);color:#ff8798}
.profile-media-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.profile-media-item{
  aspect-ratio:1;overflow:hidden;border:0;border-radius:10px;background:rgba(255,255,255,.035);padding:0;cursor:pointer
}
.profile-media-item img,.profile-media-item video{width:100%;height:100%;object-fit:cover}
.profile-media-file{display:grid;place-items:center;color:#8fa1b8;font-size:18px}
.profile-empty{padding:18px 10px;color:#6d7b90;font-size:10px;text-align:center}
.profile-edit-grid{display:grid;gap:8px}
.profile-cover-preview{
  height:100px;border-radius:14px;background:linear-gradient(135deg,#3b5fbb,#7256e7);
  background-size:cover;background-position:center;border:1px solid var(--border);overflow:hidden
}
.profile-edit-actions{display:flex;gap:7px;flex-wrap:wrap}
@media(max-width:560px){.profile-media-grid{grid-template-columns:repeat(3,1fr)}}


/* NOVA 3.2 · Visual Refresh */
:root{--bg:#080d17;--panel:#0d1422;--panel2:#111a2a;--line:rgba(255,255,255,.075);--text:#eef3fb;--muted:#7e8da4;--violet:#7d5cff;--blue:#42b7ff;--cyan:#14d7df;--pink:#db45c7}
html,body{background:radial-gradient(circle at 20% 0%,rgba(101,67,255,.10),transparent 28%),radial-gradient(circle at 90% 20%,rgba(0,191,255,.06),transparent 24%),var(--bg)}
body{color:var(--text)}button,input,textarea,select{font-family:Inter,Segoe UI,Arial,sans-serif}button{transition:transform .16s ease,background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease}button:hover{transform:translateY(-1px)}
.app{background:transparent!important}.sidebar{width:300px;border-right:1px solid var(--line);background:linear-gradient(180deg,rgba(12,18,31,.98),rgba(10,16,27,.98));box-shadow:20px 0 70px rgba(0,0,0,.16)}.main{background:radial-gradient(circle at 65% 30%,rgba(91,68,255,.055),transparent 32%),#090f19}
.topbar{min-height:68px;padding:12px 14px;gap:10px;border-bottom:1px solid var(--line);background:rgba(10,16,27,.88);backdrop-filter:blur(18px)}
.brand-lockup{display:flex;align-items:center;gap:10px;min-width:122px}.brand-mark{width:35px;height:35px;flex:0 0 35px;display:grid;place-items:center;border-radius:10px;background:linear-gradient(145deg,rgba(125,92,255,.15),rgba(20,215,223,.08));box-shadow:inset 0 0 0 1px rgba(255,255,255,.06),0 10px 25px rgba(95,72,255,.12)}.brand-mark svg{width:27px;height:27px;display:block}.brand-word{color:#f4f7fb;font-size:16px;font-weight:800;letter-spacing:.18em}.brand-word span{background:linear-gradient(90deg,var(--violet),var(--blue));-webkit-background-clip:text;background-clip:text;color:transparent}
.search{height:42px;border:1px solid var(--line);border-radius:14px;background:#0b1320;color:#dfe6ef;padding:0 13px}.search:focus{border-color:rgba(125,92,255,.34);box-shadow:0 0 0 3px rgba(125,92,255,.06)}
.profilebar{margin:10px 12px 4px;padding:10px;border:1px solid var(--line);border-radius:14px;background:rgba(255,255,255,.025)}.chat-filters{margin:8px 10px 4px;padding:6px;border:1px solid var(--line);border-radius:13px;background:#0b1320;gap:5px}.chat-filter{min-height:32px;padding:0 10px;border-radius:9px;border:1px solid transparent;background:transparent;color:var(--muted)}.chat-filter.active{background:linear-gradient(135deg,rgba(125,92,255,.20),rgba(66,183,255,.12));border-color:rgba(125,92,255,.20);color:#d9e1ff;box-shadow:0 8px 22px rgba(88,73,255,.08)}
.chatlist{padding:6px 8px 12px}.chatitem{position:relative;min-height:68px;margin:4px 0;padding:9px 10px;border:1px solid transparent;border-radius:14px;background:transparent}.chatitem:hover{background:rgba(255,255,255,.035)}.chatitem.active{background:linear-gradient(135deg,rgba(125,92,255,.15),rgba(37,99,235,.08));border-color:rgba(125,92,255,.18);box-shadow:0 10px 28px rgba(53,39,143,.10)}.chatitem.active::before{content:"";position:absolute;left:-1px;top:14px;bottom:14px;width:2px;border-radius:999px;background:linear-gradient(var(--cyan),var(--violet),var(--pink))}.chatitem .avatar{border-radius:13px!important;box-shadow:0 8px 20px rgba(0,0,0,.16)}.chatitem .name{font-weight:800;color:#e9eef6}.chatitem .preview{margin-top:3px;color:#6f7d91}.badge{min-width:21px;height:21px;display:grid;place-items:center;padding:0 6px;border-radius:999px;background:linear-gradient(135deg,var(--violet),var(--pink));color:white;font-size:9px;font-weight:850;box-shadow:0 6px 18px rgba(123,77,255,.18)}
.chat-header{min-height:72px;padding:10px 16px;border-bottom:1px solid var(--line);background:rgba(9,15,25,.88);backdrop-filter:blur(18px)}.header-title .name{font-size:14px;font-weight:850}.header-title .muted{margin-top:2px;color:#5dcf9b}.call-header-btn,.iconbtn,.menu{width:40px;height:40px;border:1px solid var(--line);border-radius:12px;background:rgba(255,255,255,.025);color:#97a5b8}.call-header-btn:hover,.iconbtn:hover,.menu:hover{background:rgba(125,92,255,.10);color:#d8e0ff;border-color:rgba(125,92,255,.16)}
.messages{padding:22px 20px 16px;background:radial-gradient(circle at 55% 30%,rgba(88,66,255,.08),transparent 28%),radial-gradient(circle at 35% 70%,rgba(18,215,223,.035),transparent 24%),transparent}.message-row{margin:7px 0}.bubble{border:1px solid var(--line);border-radius:16px;background:#121a28;color:#e3e9f1;box-shadow:0 8px 24px rgba(0,0,0,.12)}.message-row.mine .bubble{position:relative;border-color:rgba(112,87,255,.28);background:linear-gradient(135deg,#5f3ee6 0%,#5b56f0 45%,#287ef0 100%);box-shadow:0 12px 30px rgba(76,62,220,.20)}.message-row.mine .bubble::after{content:"";position:absolute;right:-8px;bottom:5px;width:12px;height:12px;background:#2f76ec;clip-path:polygon(0 0,100% 100%,0 100%)}
.composer-wrap{padding:10px 14px 14px;background:linear-gradient(180deg,transparent,rgba(8,13,23,.72) 35%,rgba(8,13,23,.94))}.composer{min-height:54px;padding:6px;border:1px solid var(--line);border-radius:17px;background:#0d1522;box-shadow:0 14px 36px rgba(0,0,0,.18)}.composer:focus-within{border-color:rgba(125,92,255,.26);box-shadow:0 0 0 3px rgba(125,92,255,.05),0 14px 36px rgba(0,0,0,.18)}.send{width:42px;height:42px;border-radius:13px;border:0;background:linear-gradient(135deg,var(--violet),var(--blue));color:white;box-shadow:0 10px 22px rgba(79,107,255,.18)}
.modal{background:rgba(3,7,13,.78);backdrop-filter:blur(18px)}.modal-card{border:1px solid var(--line);border-radius:22px;background:linear-gradient(180deg,rgba(18,27,43,.98),rgba(13,20,33,.98));box-shadow:0 30px 90px rgba(0,0,0,.48)}.secondary{border:1px solid var(--line);background:rgba(255,255,255,.035);color:#b8c3d2}.small-primary{border:0;background:linear-gradient(135deg,var(--violet),var(--blue));color:white;box-shadow:0 10px 24px rgba(80,89,235,.15)}input,textarea,select{border-color:var(--line)!important;background:#0c1421!important;color:#e7edf4!important}
.user-profile-card{overflow:hidden;border-radius:24px}.user-profile-cover{height:165px;background:radial-gradient(circle at 22% 18%,rgba(255,255,255,.14),transparent 20%),linear-gradient(135deg,#3525a8,#6d3be5 48%,#145fd4)}.user-profile-avatar{border-radius:28px;border-color:#101827}.profile-mini-action{border-color:var(--line);background:rgba(255,255,255,.035)}.profile-mini-action.primary-action{background:linear-gradient(135deg,rgba(125,92,255,.16),rgba(66,183,255,.12));border-color:rgba(125,92,255,.18)}.toast{border-color:var(--line);background:rgba(13,20,33,.96);box-shadow:0 16px 45px rgba(0,0,0,.34)}
.auth-card{border:1px solid var(--line);border-radius:24px;background:radial-gradient(circle at 50% 0%,rgba(125,92,255,.08),transparent 32%),linear-gradient(180deg,rgba(18,27,43,.98),rgba(11,18,30,.98));box-shadow:0 28px 90px rgba(0,0,0,.45)}.auth-brand{display:flex;justify-content:center;align-items:center;gap:12px;margin-bottom:18px}.auth-logo-mark{width:46px;height:46px;display:grid;place-items:center;border-radius:13px;background:linear-gradient(145deg,rgba(125,92,255,.16),rgba(20,215,223,.08));box-shadow:inset 0 0 0 1px rgba(255,255,255,.06),0 12px 28px rgba(95,72,255,.14)}.auth-logo-mark svg{width:35px;height:35px}.auth-word{font-size:20px;font-weight:850;letter-spacing:.18em}
@media(max-width:900px){.sidebar{width:260px}.brand-word{display:none}}@media(max-width:720px){.sidebar{width:84px}.profilebar .grow,.profilebar #logoutBtn,.chatmeta,.chat-filters{display:none}.topbar{padding:10px}.brand-lockup{min-width:auto}.messages{padding-left:10px;padding-right:10px}}


/* NOVA 3.3 · Search, Notification Center & Message Polish */
#notifyBtn{position:relative}
.notify-count{
  position:absolute;right:-4px;top:-5px;min-width:17px;height:17px;padding:0 4px;
  display:grid;place-items:center;border:2px solid #0c1421;border-radius:999px;
  background:linear-gradient(135deg,#8b5cf6,#ec4899);color:white;font-size:8px;font-weight:900
}
.notification-panel{
  position:fixed;z-index:1500;top:72px;left:304px;width:min(380px,calc(100vw - 24px));
  max-height:min(600px,calc(100vh - 90px));overflow:auto;padding:10px;
  border:1px solid var(--line);border-radius:18px;background:rgba(13,20,33,.97);
  box-shadow:0 28px 80px rgba(0,0,0,.48);backdrop-filter:blur(22px)
}
.notification-head{display:flex;align-items:center;gap:8px;padding:4px 5px 10px}
.notification-head strong{flex:1;font-size:12px}.notification-head button{padding:6px 8px;border:0;border-radius:8px;background:transparent;color:#7f8ca0;font-size:9px}
.notification-head button:hover{background:rgba(255,255,255,.05);color:#dfe6ef}
.notification-list{display:flex;flex-direction:column;gap:5px}
.notification-item{width:100%;display:flex;gap:10px;padding:10px;border:1px solid transparent;border-radius:13px;background:transparent;text-align:left;color:inherit}
.notification-item:hover{background:rgba(255,255,255,.035);border-color:var(--line)}
.notification-item.unread{background:linear-gradient(135deg,rgba(125,92,255,.09),rgba(66,183,255,.04));border-color:rgba(125,92,255,.11)}
.notification-icon{width:38px;height:38px;flex:0 0 38px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(135deg,rgba(125,92,255,.18),rgba(66,183,255,.10));font-size:15px}
.notification-copy{min-width:0;flex:1}.notification-title{font-size:10px;font-weight:850;color:#dfe6ef}.notification-text{margin-top:3px;color:#8795a9;font-size:10px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.notification-time{margin-top:5px;color:#59687e;font-size:8px}
.notification-empty{padding:34px 16px;text-align:center;color:#68768b;font-size:10px}
.search-chat-result{width:100%;display:flex;align-items:center;gap:9px;padding:8px;border:0;border-radius:10px;background:transparent;color:inherit;text-align:left}.search-chat-result:hover{background:rgba(255,255,255,.05)}
.msg-actions{gap:3px!important;padding:4px!important;border:1px solid var(--line)!important;border-radius:10px!important;background:rgba(9,15,25,.94)!important;box-shadow:0 12px 30px rgba(0,0,0,.25)!important}
.msg-actions button{width:28px!important;height:28px!important;display:grid!important;place-items:center!important;border-radius:7px!important;color:#8d9bb0!important;font-size:0!important}
.msg-actions button:hover{background:rgba(125,92,255,.12)!important;color:#d9e1ff!important}
.msg-actions button::before{font-size:13px}
.msg-actions button[data-a="reply"]::before{content:"↩"}
.msg-actions button[data-a="edit"]::before{content:"✎"}
.msg-actions button[data-a="forward"]::before{content:"➜"}
.msg-actions button[data-a="details"]::before{content:"i";font-family:serif;font-weight:900}
.msg-actions button[data-a="pin"]::before{content:"⌁"}
.msg-actions button[data-a="react"]::before{content:"♡"}
.msg-actions button[data-a="delete"]::before{content:"×";font-size:17px}
.message-row.selected .bubble{outline:2px solid rgba(125,92,255,.38);outline-offset:2px}
.search-hit .bubble{animation:novaSearchHit 1.2s ease}
@keyframes novaSearchHit{0%,100%{box-shadow:0 8px 24px rgba(0,0,0,.12)}40%{box-shadow:0 0 0 4px rgba(125,92,255,.16),0 12px 35px rgba(91,70,230,.24)}}
@media(max-width:720px){.notification-panel{left:92px;top:66px;width:calc(100vw - 104px)}}


/* ==========================================================
   NOVA 3.3.1 · Fix & Layout Update
   ========================================================== */

.sidebar{
  width:360px!important;
  min-width:360px!important;
}

.topbar{
  display:block!important;
  min-height:auto!important;
  padding:12px 12px 10px!important;
}

.sidebar-brand-row{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:42px;
}

.sidebar-brand-row .brand-lockup{
  flex:1;
  min-width:0;
}

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

.sidebar-tool{
  position:relative;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid var(--line);
  border-radius:11px;
  background:rgba(255,255,255,.025);
  color:#8595ac;
}

.sidebar-tool:hover{
  border-color:rgba(125,92,255,.18);
  background:rgba(125,92,255,.10);
  color:#d8e1ff;
}

.sidebar-tool svg,
.modern-icon svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.sidebar-search-row{
  position:relative;
  display:flex;
  align-items:center;
  margin-top:10px;
}

.sidebar-search-row .search{
  width:100%!important;
  min-width:0!important;
  height:42px!important;
  padding:0 48px 0 38px!important;
}

.sidebar-search-icon{
  position:absolute;
  z-index:2;
  left:13px;
  width:16px;
  height:16px;
  fill:none;
  stroke:#64748a;
  stroke-width:1.8;
  stroke-linecap:round;
  pointer-events:none;
}

.search-shortcut{
  position:absolute;
  right:11px;
  padding:3px 5px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:6px;
  background:rgba(255,255,255,.025);
  color:#59677c;
  font-size:8px;
  pointer-events:none;
}

.people-results{
  top:112px!important;
  left:12px!important;
  right:12px!important;
  width:auto!important;
  max-height:420px!important;
  border-radius:14px!important;
  box-shadow:0 22px 65px rgba(0,0,0,.42)!important;
}

.profilebar{
  margin-top:8px!important;
}

.chat-filters{
  display:flex!important;
  overflow-x:auto!important;
  scrollbar-width:none;
  white-space:nowrap;
}
.chat-filters::-webkit-scrollbar{display:none}

.chat-filter{
  flex:0 0 auto!important;
}

/* Main header actual class is .chatheader in this project */
.chatheader{
  min-height:70px;
  padding:10px 16px;
  border-bottom:1px solid var(--line);
  background:rgba(9,15,25,.90);
  backdrop-filter:blur(18px);
}

.header-actions{
  gap:5px!important;
}

.modern-icon{
  display:grid!important;
  place-items:center!important;
}

/* Notification drawer */
.notification-panel{
  position:fixed!important;
  z-index:2500!important;
  top:12px!important;
  right:12px!important;
  bottom:12px!important;
  left:auto!important;
  width:min(410px,calc(100vw - 24px))!important;
  max-height:none!important;
  display:flex;
  flex-direction:column;
  padding:0!important;
  overflow:hidden!important;
  border:1px solid rgba(255,255,255,.08)!important;
  border-radius:20px!important;
  background:
    radial-gradient(circle at 80% 0%,rgba(125,92,255,.10),transparent 25%),
    rgba(12,19,32,.985)!important;
  box-shadow:-24px 0 80px rgba(0,0,0,.42)!important;
  backdrop-filter:blur(24px)!important;
}

.notification-panel.hidden{
  display:none!important;
}

.notification-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:17px 17px 13px!important;
  border-bottom:1px solid var(--line);
}

.notification-head > div:first-child{
  flex:1;
  min-width:0;
}

.notification-head strong{
  display:block;
  font-size:13px!important;
  color:#eef3fb;
}

.notification-subtitle{
  margin-top:3px;
  color:#65758b;
  font-size:9px;
}

.notification-close{
  width:34px!important;
  height:34px!important;
  display:grid!important;
  place-items:center!important;
  padding:0!important;
  border:1px solid var(--line)!important;
  border-radius:10px!important;
  background:rgba(255,255,255,.025)!important;
  color:#8796ab!important;
  font-size:18px!important;
}

.notification-tabs{
  display:flex;
  gap:5px;
  padding:10px 12px;
  border-bottom:1px solid var(--line);
}

.notification-tab{
  min-height:32px;
  padding:0 10px;
  border:1px solid transparent;
  border-radius:9px;
  background:transparent;
  color:#718096;
  font-size:9px;
  font-weight:800;
}

.notification-tab.active{
  border-color:rgba(125,92,255,.15);
  background:linear-gradient(135deg,rgba(125,92,255,.16),rgba(66,183,255,.08));
  color:#cbd5ff;
}

.notification-list{
  flex:1;
  min-height:0;
  overflow-y:auto;
  padding:8px 10px!important;
}

.notification-footer{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  padding:10px;
  border-top:1px solid var(--line);
  background:rgba(255,255,255,.015);
}

.notification-footer button{
  min-height:34px;
  padding:0 8px;
  border:1px solid var(--line);
  border-radius:9px;
  background:rgba(255,255,255,.025);
  color:#8290a5;
  font-size:9px;
}

.notification-footer button:hover{
  background:rgba(125,92,255,.08);
  color:#cbd5ff;
}

#clearNotifications{
  color:#b77785;
}

.notification-trigger .notify-count{
  right:-5px!important;
  top:-5px!important;
  z-index:5;
}

.notification-item{
  min-height:66px;
}

.notification-item.unread::after{
  content:"";
  width:7px;
  height:7px;
  flex:0 0 7px;
  align-self:center;
  border-radius:50%;
  background:linear-gradient(135deg,#7d5cff,#42b7ff);
  box-shadow:0 0 10px rgba(87,104,255,.45);
}

/* Make top buttons readable and not look like empty circles */
.call-header-btn,
.header-actions .iconbtn{
  width:38px!important;
  height:38px!important;
  border-radius:11px!important;
}

/* Desktop fit */
@media(max-width:1100px){
  .sidebar{width:330px!important;min-width:330px!important}
  .brand-word{display:none!important}
}

@media(max-width:760px){
  .sidebar{
    width:92px!important;
    min-width:92px!important;
  }
  .sidebar-brand-row{
    justify-content:center;
  }
  .sidebar-brand-row .brand-lockup{
    flex:0 0 auto;
  }
  .sidebar-actions{
    display:none;
  }
  .sidebar-search-row{
    display:none;
  }
  .people-results{
    left:96px!important;
    right:8px!important;
    top:10px!important;
  }
  .notification-panel{
    top:8px!important;
    right:8px!important;
    bottom:8px!important;
    width:calc(100vw - 16px)!important;
  }
}


/* NOVA 3.4 · Calls 2.0 */
.call-history-card{
  width:min(620px,94vw);
  max-height:min(82vh,760px);
  padding:0;
  overflow:hidden;
}
.call-history-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:18px 18px 14px;
  border-bottom:1px solid var(--line);
}
.call-history-head > div:first-child{flex:1}
.call-history-head h3{margin:0 0 3px}
.call-history-list{
  max-height:calc(82vh - 82px);
  overflow-y:auto;
  padding:8px 10px 12px;
}
.call-history-item{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
  padding:10px;
  border:1px solid transparent;
  border-radius:13px;
  background:transparent;
  color:inherit;
  text-align:left;
}
.call-history-item:hover{
  border-color:var(--line);
  background:rgba(255,255,255,.035);
}
.call-history-avatar{
  width:42px;height:42px;flex:0 0 42px;
  display:grid;place-items:center;overflow:hidden;
  border-radius:13px;
  background:linear-gradient(135deg,#5f4ee9,#326fe7);
  font-weight:850;
}
.call-history-avatar img{width:100%;height:100%;object-fit:cover}
.call-history-copy{min-width:0;flex:1}
.call-history-name{font-size:11px;font-weight:850;color:#e1e8f1}
.call-history-meta{display:flex;align-items:center;gap:6px;margin-top:4px;color:#748399;font-size:9px}
.call-history-meta.missed{color:#ff7f92}
.call-history-time{margin-left:auto;color:#56657a;font-size:9px}
.call-history-action{
  width:34px;height:34px;display:grid;place-items:center;
  border:1px solid var(--line);border-radius:10px;
  background:rgba(255,255,255,.025);color:#8392a7
}
.call-history-action:hover{background:rgba(125,92,255,.1);color:#d8e1ff}
.call-history-action svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.call-card{
  width:min(860px,96vw)!important;
  border-radius:28px!important;
  overflow:hidden;
}
.call-stage{
  min-height:480px!important;
  background:
    radial-gradient(circle at 50% 28%,rgba(125,92,255,.14),transparent 34%),
    radial-gradient(circle at 70% 70%,rgba(66,183,255,.07),transparent 28%),
    #080e18!important;
}
.call-stage.audio-mode{
  background:
    radial-gradient(circle at 50% 35%,rgba(125,92,255,.18),transparent 28%),
    radial-gradient(circle at 50% 65%,rgba(66,183,255,.05),transparent 28%),
    #080e18!important;
}
.call-avatar{
  width:120px!important;height:120px!important;
  border-radius:34px!important;
  box-shadow:0 24px 65px rgba(72,52,195,.28)!important;
}
.call-info{
  top:24px!important;
}
.call-name{
  font-size:22px!important;
  letter-spacing:-.3px;
}
.call-status{
  margin-top:6px!important;
  font-size:11px!important;
}
.call-controls{
  min-height:82px;
  gap:9px!important;
  padding:15px!important;
  background:#0d1522!important;
}
.call-control{
  width:50px!important;height:50px!important;
  border:1px solid rgba(255,255,255,.07)!important;
  border-radius:15px!important;
  background:rgba(255,255,255,.045)!important;
}
.call-control.active{
  border-color:rgba(125,92,255,.18)!important;
  background:rgba(125,92,255,.14)!important;
  color:#c7d2ff!important;
}
.call-control.end{
  border-color:rgba(255,107,131,.14)!important;
  background:#dc4962!important;
}
.local-video{
  width:190px!important;
  height:132px!important;
  border-radius:18px!important;
}
.screen-sharing-badge{
  position:absolute;
  left:18px;
  bottom:18px;
  z-index:4;
  display:flex;
  align-items:center;
  gap:7px;
  padding:7px 9px;
  border:1px solid rgba(125,92,255,.18);
  border-radius:10px;
  background:rgba(13,20,33,.88);
  color:#bfcaff;
  font-size:9px;
  backdrop-filter:blur(12px);
}
.screen-sharing-badge::before{
  content:"";
  width:7px;height:7px;border-radius:50%;
  background:#7d5cff;
  box-shadow:0 0 10px rgba(125,92,255,.6);
}
@media(max-width:620px){
  .call-stage{min-height:520px!important}
  .local-video{width:118px!important;height:88px!important}
}


/* NOVA 3.5 · Settings & Privacy */
.settings-card{
  width:min(650px,95vw);
  max-height:min(86vh,820px);
  padding:0;
  overflow:hidden;
}
.settings-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:18px 18px 14px;
  border-bottom:1px solid var(--line);
}
.settings-head > div:first-child{flex:1}
.settings-head h3{margin:0 0 3px}
.settings-body{
  max-height:calc(86vh - 76px);
  overflow-y:auto;
  padding:12px;
}
.settings-section{
  margin-bottom:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:15px;
  background:rgba(255,255,255,.022);
}
.settings-section-title{
  margin-bottom:7px;
  color:#708097;
  font-size:9px;
  font-weight:850;
  letter-spacing:.75px;
  text-transform:uppercase;
}
.settings-row{
  display:flex;
  align-items:center;
  gap:14px;
  min-height:58px;
  padding:8px 4px;
  border-bottom:1px solid rgba(255,255,255,.04);
  cursor:pointer;
}
.settings-row:last-child{border-bottom:0}
.settings-row > div:first-child{min-width:0;flex:1}
.settings-row-title{font-size:11px;font-weight:800;color:#dbe3ed}
.settings-row-note{margin-top:3px;color:#68778d;font-size:9px;line-height:1.4}
.settings-row input[type="checkbox"]{
  width:38px!important;
  height:21px!important;
  flex:0 0 38px;
  appearance:none;
  position:relative;
  border:1px solid var(--line)!important;
  border-radius:999px!important;
  background:#0b1320!important;
  cursor:pointer;
}
.settings-row input[type="checkbox"]::after{
  content:"";
  position:absolute;
  top:2px;left:2px;
  width:15px;height:15px;
  border-radius:50%;
  background:#67758a;
  transition:.16s ease;
}
.settings-row input[type="checkbox"]:checked{
  border-color:rgba(125,92,255,.22)!important;
  background:linear-gradient(135deg,rgba(125,92,255,.58),rgba(66,183,255,.42))!important;
}
.settings-row input[type="checkbox"]:checked::after{
  left:19px;
  background:white;
}
.sessions-list{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:9px;
}
.session-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#0c1421;
}
.session-icon{
  width:35px;height:35px;flex:0 0 35px;
  display:grid;place-items:center;
  border-radius:10px;
  background:rgba(125,92,255,.10);
  color:#aab8ff;
}
.session-copy{min-width:0;flex:1}
.session-name{font-size:10px;font-weight:800;color:#d9e1ea}
.session-meta{margin-top:3px;color:#637188;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.session-current{
  padding:4px 6px;
  border-radius:7px;
  background:rgba(50,213,131,.09);
  color:#70dba7;
  font-size:8px;
  font-weight:800;
}
.danger-soft{
  color:#e17d8d!important;
  border-color:rgba(255,107,131,.12)!important;
}
body.nova-compact .chatitem{
  min-height:56px!important;
  padding-top:6px!important;
  padding-bottom:6px!important;
  margin-top:2px!important;
  margin-bottom:2px!important;
}
body.nova-no-animations *,
body.nova-no-animations *::before,
body.nova-no-animations *::after{
  animation:none!important;
  transition:none!important;
  scroll-behavior:auto!important;
}


/* NOVA 3.6 · UX Polish */
.sidebar-section-label{display:flex;align-items:center;justify-content:space-between;padding:7px 12px 4px;color:#59687d;font-size:8px;font-weight:850;letter-spacing:.8px;text-transform:uppercase}
.chatitem{overflow:hidden}.chatitem .row{gap:7px}.chatitem .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chatitem .preview{margin-top:3px;line-height:1.35}.chatitem-time{flex:0 0 auto;color:#56647a;font-size:8px;font-weight:700}.chatitem.active .chatitem-time{color:#8390bf}
.bubble{max-width:min(72%,720px)}.message-row.other .bubble{background:linear-gradient(180deg,rgba(20,29,44,.98),rgba(17,25,38,.98))}.message-row.mine .bubble{background:linear-gradient(135deg,#5b43db 0%,#5d58eb 48%,#2f75dd 100%)}.message-text{line-height:1.52}.message-meta{display:flex;align-items:center;justify-content:flex-end;gap:4px}.edited-label{opacity:.72}
.message-jump-flash .bubble{animation:novaMessageJump 1.1s ease}@keyframes novaMessageJump{0%{box-shadow:0 0 0 0 rgba(125,92,255,0)}38%{box-shadow:0 0 0 4px rgba(125,92,255,.19),0 14px 34px rgba(69,56,190,.22)}100%{box-shadow:0 8px 24px rgba(0,0,0,.12)}}
.composer-toolbar{max-width:980px;display:flex;align-items:center;gap:8px;margin:0 auto 6px;padding:0 4px}.composer-hint{color:#56657b;font-size:8px}.composer-hint strong{color:#7889a0}.char-counter{margin-left:auto;color:#56657b;font-size:8px}.char-counter.warning{color:#d8a15e}.char-counter.danger{color:#f17b8e}
.user-profile-card{width:min(560px,96vw)!important}.profile-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin-top:12px}.profile-stat{padding:9px;border:1px solid var(--line);border-radius:11px;background:rgba(255,255,255,.022);text-align:center}.profile-stat-value{color:#dce4ee;font-size:12px;font-weight:850}.profile-stat-label{margin-top:3px;color:#64738a;font-size:8px;text-transform:uppercase;letter-spacing:.55px}
.profile-social-tabs{position:sticky;top:0;z-index:4;margin-left:-24px;margin-right:-24px;padding:9px 24px 8px!important;background:rgba(17,26,42,.97);backdrop-filter:blur(16px)}.wall-post{border-radius:12px!important}.profile-media-item{border:1px solid var(--line)!important;transition:transform .15s ease,border-color .15s ease}.profile-media-item:hover{transform:translateY(-1px);border-color:rgba(125,92,255,.18)!important}
@media(max-width:620px){.bubble{max-width:86%}.profile-social-tabs{margin-left:-18px;margin-right:-18px;padding-left:18px!important;padding-right:18px!important}}


/* NOVA 3.7 · Header Fix + Messages 2.0 */
.sidebar-brand-row{
  display:grid!important;
  grid-template-columns:minmax(120px,1fr) auto!important;
  align-items:center!important;
  column-gap:12px!important;
}
.sidebar-brand-row .brand-lockup{min-width:120px!important;overflow:hidden!important}
.sidebar-actions{justify-self:end!important;display:flex!important;flex-wrap:nowrap!important;gap:5px!important}
.sidebar-tool{flex:0 0 34px!important;width:34px!important;height:34px!important}
@media(max-width:1180px){
  .sidebar{width:350px!important;min-width:350px!important}
  .sidebar-brand-row{grid-template-columns:minmax(52px,1fr) auto!important}
  .sidebar-brand-row .brand-word{display:none!important}
}
@media(max-width:760px){
  .sidebar{width:92px!important;min-width:92px!important}
  .sidebar-brand-row{display:flex!important;justify-content:center!important}
}

.composer-formatbar{max-width:980px;display:flex;align-items:center;gap:4px;margin:0 auto 5px;padding:0 4px}
.format-btn{min-width:29px;height:27px;display:grid;place-items:center;padding:0 7px;border:1px solid transparent;border-radius:7px;background:transparent;color:#68788f;font-size:9px;font-weight:800}
.format-btn:hover{border-color:var(--line);background:rgba(255,255,255,.035);color:#b9c6d8}
.format-separator{width:1px;height:16px;margin:0 2px;background:var(--line)}
.composer-format-note{margin-left:auto;color:#526178;font-size:8px}


/* NOVA 3.8 · Rich Messages */
.message-row .text a{
  color:#9fc7ff;
  text-decoration:none;
  border-bottom:1px solid rgba(159,199,255,.28)
}
.message-row.mine .text a{
  color:#eef4ff;
  border-bottom-color:rgba(255,255,255,.32)
}
.message-row .text a:hover{border-bottom-color:currentColor}
.message-row .text strong{font-weight:900}
.message-row .text em{font-style:italic}
.message-row .text s{opacity:.72}
.message-code{
  display:inline-block;
  padding:1px 5px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:5px;
  background:rgba(0,0,0,.19);
  font-family:Consolas,"Courier New",monospace;
  font-size:.93em;
}
.message-mention{
  display:inline;
  padding:1px 4px;
  border-radius:5px;
  background:rgba(125,92,255,.13);
  color:#b7c4ff;
  font-weight:850;
  cursor:pointer;
}
.message-row.mine .message-mention{
  background:rgba(255,255,255,.13);
  color:#fff;
}
.sender.clickable-sender{cursor:pointer}
.sender.clickable-sender:hover{text-decoration:underline}
.reply.clickable-reply{
  cursor:pointer;
  border-radius:8px;
  transition:background .15s ease
}
.reply.clickable-reply:hover{background:rgba(255,255,255,.05)}

.mention-popup{
  position:absolute;
  z-index:80;
  left:58px;
  bottom:76px;
  width:min(320px,calc(100% - 90px));
  max-height:230px;
  overflow-y:auto;
  padding:6px;
  border:1px solid var(--line);
  border-radius:13px;
  background:rgba(12,19,32,.98);
  box-shadow:0 18px 50px rgba(0,0,0,.38);
  backdrop-filter:blur(18px)
}
.mention-popup.hidden{display:none}
.mention-option{
  width:100%;
  display:flex;
  align-items:center;
  gap:9px;
  padding:8px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:inherit;
  text-align:left
}
.mention-option:hover,.mention-option.active{
  background:rgba(125,92,255,.09)
}
.mention-option .avatar{
  width:32px;height:32px;flex:0 0 32px;border-radius:10px
}
.mention-option-name{
  font-size:10px;font-weight:800;color:#dce4ee
}
.mention-option-handle{
  margin-top:2px;color:#68788f;font-size:8px
}


/* ==========================================================
   NOVA 4.0 FINAL
   ========================================================== */

/* Final sidebar/header geometry */
.sidebar-brand-row{
  min-height:48px!important;
  padding-right:2px!important;
}
.sidebar-actions{
  max-width:calc(100% - 124px);
  overflow-x:auto;
  scrollbar-width:none;
}
.sidebar-actions::-webkit-scrollbar{display:none}
.sidebar-tool{
  position:relative;
  flex:0 0 34px!important;
}
.sidebar-tool:focus-visible,
.format-btn:focus-visible,
button:focus-visible{
  outline:2px solid rgba(125,92,255,.65);
  outline-offset:2px;
}

/* Cleaner search */
.search-wrap{
  min-width:0!important;
}
.search-wrap input{
  min-width:0!important;
  width:100%!important;
}

/* Unread marker */
.unread-separator{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  margin:12px 0;
  color:#7f8fa6;
  font-size:8px;
  font-weight:800;
  letter-spacing:.5px;
  text-transform:uppercase;
}
.unread-separator::before,
.unread-separator::after{
  content:"";
  height:1px;
  flex:1;
  background:linear-gradient(90deg,transparent,rgba(125,92,255,.22));
}
.unread-separator::after{
  background:linear-gradient(90deg,rgba(125,92,255,.22),transparent);
}

/* Date separators */
.nova-date-separator{
  position:sticky;
  top:8px;
  z-index:3;
  width:max-content;
  margin:10px auto;
  padding:5px 9px;
  border:1px solid rgba(255,255,255,.055);
  border-radius:999px;
  background:rgba(10,17,29,.82);
  color:#697990;
  font-size:8px;
  font-weight:800;
  backdrop-filter:blur(12px);
  pointer-events:none;
}

/* Message action polish */
.msg-actions{
  opacity:0;
  transform:translateY(2px);
  transition:opacity .13s ease,transform .13s ease;
}
.message-row:hover .msg-actions,
.message-row:focus-within .msg-actions{
  opacity:1;
  transform:none;
}
@media(hover:none){
  .msg-actions{opacity:1;transform:none}
}

/* Better selection */
.message-row.selected .bubble{
  box-shadow:0 0 0 2px rgba(125,92,255,.32),0 12px 30px rgba(0,0,0,.16)!important;
}

/* Link safety visual */
.message-row .text a::after{
  content:" ↗";
  font-size:.75em;
  opacity:.6;
}

/* Composer final pass */
.composer-formatbar{
  min-height:29px;
}
.composer-formatbar:empty{display:none}
.composer-hint{
  user-select:none;
}
#messageInput{
  scrollbar-width:thin;
}

/* Jump to bottom */
.nova-jump-bottom{
  position:absolute;
  right:18px;
  bottom:92px;
  z-index:15;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(14,22,36,.94);
  color:#8d9cb2;
  box-shadow:0 10px 28px rgba(0,0,0,.28);
  backdrop-filter:blur(14px);
  transition:.16s ease;
}
.nova-jump-bottom:hover{
  transform:translateY(-1px);
  color:#d8e0ec;
  border-color:rgba(125,92,255,.2);
}
.nova-jump-bottom.hidden{display:none}
.nova-jump-bottom svg{
  width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
}

/* Empty chat finishing */
.nova-empty-chat{
  max-width:360px;
  margin:auto;
  padding:28px;
  text-align:center;
  color:#68778d;
}
.nova-empty-chat-icon{
  width:62px;height:62px;
  display:grid;place-items:center;
  margin:0 auto 13px;
  border:1px solid rgba(125,92,255,.13);
  border-radius:20px;
  background:radial-gradient(circle at 35% 25%,rgba(125,92,255,.16),rgba(255,255,255,.025));
  color:#a5b1ff;
  font-size:24px;
}
.nova-empty-chat-title{
  color:#cbd5e1;
  font-size:13px;
  font-weight:850;
}
.nova-empty-chat-note{
  margin-top:6px;
  font-size:9px;
  line-height:1.5;
}

/* Mobile final pass */
@media(max-width:760px){
  .sidebar-actions{
    max-width:none;
    width:100%;
    justify-content:center!important;
  }
  .sidebar-brand-row .brand-lockup{display:none!important}
  .sidebar-brand-row{padding:0 6px!important}
  .nova-jump-bottom{right:12px;bottom:88px}
}


/* NOVA 4.0.1 · Calls & Settings visibility hotfix */
.sidebar-brand-row{
  display:flex!important;
  align-items:center!important;
  min-height:42px!important;
}
.sidebar-brand-row .brand-lockup{
  flex:1 1 auto!important;
  min-width:0!important;
}
.sidebar-brand-row .sidebar-actions{
  display:none!important;
}

.sidebar-quick-actions{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:5px;
  margin-top:9px;
  width:100%;
}

.sidebar-quick-actions .sidebar-tool{
  width:100%!important;
  min-width:0!important;
  height:36px!important;
  flex:none!important;
}

.sidebar-quick-actions .sidebar-tool::after{
  content:attr(data-short-label);
  position:absolute;
  left:50%;
  top:100%;
  transform:translate(-50%,4px);
  z-index:100;
  display:none;
  padding:4px 6px;
  border:1px solid var(--line);
  border-radius:7px;
  background:#101827;
  color:#aeb9c8;
  font-size:8px;
  white-space:nowrap;
  box-shadow:0 8px 24px rgba(0,0,0,.28);
}

.sidebar-quick-actions .sidebar-tool:hover::after{
  display:block;
}

#callsBtn,#settingsBtn{
  border-color:rgba(125,92,255,.12)!important;
}

#callsBtn:hover,#settingsBtn:hover{
  border-color:rgba(125,92,255,.28)!important;
  background:rgba(125,92,255,.12)!important;
}

@media(max-width:1180px){
  .sidebar{width:350px!important;min-width:350px!important}
  .sidebar-brand-row .brand-word{display:block!important}
}

@media(max-width:760px){
  .sidebar-brand-row .brand-lockup{display:flex!important}
  .sidebar-quick-actions{
    grid-template-columns:repeat(2,34px);
    justify-content:center;
  }
  .sidebar-quick-actions .sidebar-tool:nth-child(-n+4){
    display:none;
  }
  .sidebar-quick-actions .sidebar-tool{
    width:34px!important;
  }
}


/* ==========================================================
   NOVA 4.1 · Mobile Edition
   ========================================================== */

.mobile-back-btn{
  display:none;
  width:38px;
  height:38px;
  flex:0 0 38px;
  place-items:center;
  padding:0;
  border:1px solid var(--line);
  border-radius:11px;
  background:rgba(255,255,255,.025);
  color:#8d9cb2;
}
.mobile-back-btn svg{
  width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
}

@media(max-width:760px){
  html,body{
    width:100%;
    height:100%;
    overflow:hidden;
    overscroll-behavior:none;
  }

  body{
    min-height:100dvh;
    background:#080d17;
  }

  .app{
    position:relative!important;
    width:100%!important;
    height:100dvh!important;
    min-height:100dvh!important;
    overflow:hidden!important;
  }

  /* Mobile starts as a real chat list screen */
  .sidebar{
    position:absolute!important;
    inset:0!important;
    z-index:40!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    min-width:0!important;
    height:100dvh!important;
    border-right:0!important;
    background:#0a111d!important;
    padding-bottom:calc(70px + env(safe-area-inset-bottom))!important;
    transition:transform .2s ease,opacity .2s ease!important;
  }

  .main{
    position:absolute!important;
    inset:0!important;
    z-index:50!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    min-width:0!important;
    height:100dvh!important;
    transform:translateX(100%)!important;
    visibility:hidden!important;
    opacity:0!important;
    transition:transform .2s ease,opacity .2s ease,visibility .2s ease!important;
    background:#090f19!important;
  }

  body.mobile-chat-open .sidebar{
    transform:translateX(-18%)!important;
    opacity:0!important;
    pointer-events:none!important;
  }

  body.mobile-chat-open .main{
    transform:translateX(0)!important;
    visibility:visible!important;
    opacity:1!important;
  }

  /* Brand + search */
  .topbar{
    flex:0 0 auto!important;
    padding:calc(10px + env(safe-area-inset-top)) 12px 10px!important;
    background:rgba(10,17,29,.98)!important;
  }

  .sidebar-brand-row{
    min-height:44px!important;
  }

  .sidebar-brand-row .brand-lockup{
    display:flex!important;
  }

  .sidebar-brand-row .brand-word{
    display:block!important;
  }

  .sidebar-brand-row .sidebar-actions{
    display:none!important;
  }

  .sidebar-search-row{
    display:flex!important;
    margin-top:8px!important;
  }

  .sidebar-search-row .search{
    height:44px!important;
    font-size:16px!important; /* prevents iOS zoom */
  }

  .search-shortcut{
    display:none!important;
  }

  .people-results{
    position:fixed!important;
    top:calc(104px + env(safe-area-inset-top))!important;
    left:10px!important;
    right:10px!important;
    width:auto!important;
    max-height:calc(100dvh - 190px)!important;
    z-index:100!important;
  }

  .profilebar{
    flex:0 0 auto!important;
    margin:8px 10px 3px!important;
  }

  .profilebar .grow{
    display:block!important;
  }

  .sidebar-section-label{
    flex:0 0 auto!important;
    padding-left:14px!important;
    padding-right:14px!important;
  }

  .chat-filters{
    flex:0 0 auto!important;
    margin:6px 10px!important;
    padding:5px!important;
    overflow-x:auto!important;
    scroll-snap-type:x proximity;
  }

  .chat-filter{
    min-height:34px!important;
    scroll-snap-align:start;
  }

  .chatlist{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
    padding:4px 8px 12px!important;
  }

  .chatitem{
    min-height:68px!important;
    margin:3px 0!important;
    padding:9px 10px!important;
    border-radius:15px!important;
  }

  .chatitem .avatar{
    width:46px!important;
    height:46px!important;
    flex:0 0 46px!important;
  }

  /* Bottom navigation uses the existing 6 working buttons */
  .sidebar-quick-actions{
    position:fixed!important;
    z-index:70!important;
    left:8px!important;
    right:8px!important;
    bottom:calc(8px + env(safe-area-inset-bottom))!important;
    display:grid!important;
    grid-template-columns:repeat(6,1fr)!important;
    gap:5px!important;
    width:auto!important;
    margin:0!important;
    padding:7px!important;
    border:1px solid rgba(255,255,255,.07)!important;
    border-radius:18px!important;
    background:rgba(12,19,32,.96)!important;
    box-shadow:0 14px 45px rgba(0,0,0,.34)!important;
    backdrop-filter:blur(22px)!important;
  }

  .sidebar-quick-actions .sidebar-tool,
  .sidebar-quick-actions .sidebar-tool:nth-child(-n+4){
    display:grid!important;
    width:100%!important;
    height:44px!important;
    min-width:0!important;
    border-radius:13px!important;
  }

  .sidebar-quick-actions .sidebar-tool::after{
    display:none!important;
  }

  .sidebar-quick-actions .sidebar-tool svg{
    width:19px!important;
    height:19px!important;
  }

  /* Chat screen */
  .chatheader{
    flex:0 0 auto!important;
    min-height:calc(62px + env(safe-area-inset-top))!important;
    padding:calc(8px + env(safe-area-inset-top)) 9px 8px!important;
    gap:7px!important;
  }

  .mobile-back-btn{
    display:grid!important;
  }

  .chatheader .avatar{
    width:38px!important;
    height:38px!important;
    flex:0 0 38px!important;
  }

  .chatheader .grow{
    min-width:0!important;
  }

  .chatheader .name{
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:12px!important;
  }

  .chatheader .muted{
    max-width:100%!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    font-size:8px!important;
  }

  .header-actions{
    flex:0 0 auto!important;
    gap:3px!important;
  }

  .header-actions .call-header-btn,
  .header-actions .iconbtn{
    width:34px!important;
    height:34px!important;
  }

  #refreshBtn{
    display:none!important;
  }

  .messages{
    flex:1 1 auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
    padding:14px 9px 10px!important;
    -webkit-overflow-scrolling:touch;
  }

  .message-row{
    margin:5px 0!important;
  }

  .bubble{
    max-width:88%!important;
    border-radius:16px!important;
    font-size:14px!important;
  }

  .message-row.mine .bubble{
    border-bottom-right-radius:6px!important;
  }

  .message-row.other .bubble{
    border-bottom-left-radius:6px!important;
  }

  .msg-actions{
    opacity:1!important;
    transform:none!important;
  }

  .msg-actions button{
    width:31px!important;
    height:31px!important;
  }

  .nova-date-separator{
    top:6px!important;
  }

  .typing{
    flex:0 0 auto!important;
  }

  .replybar{
    flex:0 0 auto!important;
    margin:0 8px 5px!important;
  }

  .composer-wrap{
    position:relative!important;
    flex:0 0 auto!important;
    padding:5px 8px calc(7px + env(safe-area-inset-bottom))!important;
    background:linear-gradient(180deg,rgba(8,13,23,.82),#080d17)!important;
  }

  .composer-formatbar{
    overflow-x:auto!important;
    scrollbar-width:none;
    white-space:nowrap;
    margin-bottom:3px!important;
  }
  .composer-formatbar::-webkit-scrollbar{display:none}

  .composer-format-note,
  .composer-hint{
    display:none!important;
  }

  .composer-toolbar{
    min-height:16px!important;
    margin-bottom:2px!important;
  }

  .char-counter{
    margin-left:auto!important;
  }

  .composer{
    min-height:50px!important;
    border-radius:16px!important;
    padding:5px!important;
  }

  #messageInput{
    min-width:0!important;
    font-size:16px!important; /* prevents iOS zoom */
    max-height:110px!important;
  }

  .composer .clip,
  .composer .emoji-btn,
  .composer .record-btn,
  .composer .send{
    width:38px!important;
    height:38px!important;
    flex:0 0 38px!important;
    border-radius:12px!important;
  }

  .mention-popup{
    position:fixed!important;
    left:8px!important;
    right:8px!important;
    bottom:calc(72px + env(safe-area-inset-bottom))!important;
    width:auto!important;
    max-height:42dvh!important;
    z-index:120!important;
  }

  .emoji-panel{
    left:8px!important;
    right:8px!important;
    bottom:calc(70px + env(safe-area-inset-bottom))!important;
    width:auto!important;
    max-width:none!important;
  }

  .nova-jump-bottom{
    right:10px!important;
    bottom:calc(78px + env(safe-area-inset-bottom))!important;
  }

  .jump-unread{
    right:10px!important;
    bottom:calc(124px + env(safe-area-inset-bottom))!important;
  }

  /* Search / selection bars */
  .selection-bar,
  .chat-search-bar{
    flex:0 0 auto!important;
    overflow-x:auto!important;
    padding-left:8px!important;
    padding-right:8px!important;
  }

  .selection-actions{
    flex-wrap:nowrap!important;
  }

  .chat-search-bar input{
    min-width:120px!important;
    font-size:16px!important;
  }

  /* Full-screen sheets instead of desktop modals */
  .modal{
    align-items:flex-end!important;
    padding:0!important;
  }

  .modal-card,
  .settings-card,
  .call-history-card,
  .user-profile-card{
    width:100%!important;
    max-width:none!important;
    height:min(92dvh,920px)!important;
    max-height:92dvh!important;
    margin:0!important;
    border-radius:22px 22px 0 0!important;
    border-left:0!important;
    border-right:0!important;
    border-bottom:0!important;
    padding-bottom:env(safe-area-inset-bottom)!important;
  }

  .settings-body,
  .call-history-list{
    max-height:none!important;
    flex:1!important;
  }

  .notification-panel{
    top:0!important;
    right:0!important;
    bottom:0!important;
    left:0!important;
    width:100%!important;
    max-width:none!important;
    border:0!important;
    border-radius:0!important;
    padding-top:env(safe-area-inset-top)!important;
    padding-bottom:env(safe-area-inset-bottom)!important;
  }

  /* Call screen */
  .call-modal{
    padding:0!important;
  }

  .call-card{
    width:100%!important;
    height:100dvh!important;
    max-width:none!important;
    max-height:none!important;
    border-radius:0!important;
  }

  .call-stage{
    min-height:0!important;
    flex:1!important;
  }

  .call-controls{
    padding-bottom:calc(15px + env(safe-area-inset-bottom))!important;
  }

  .local-video{
    width:112px!important;
    height:86px!important;
    right:10px!important;
    bottom:10px!important;
  }

  /* Media viewer */
  .media-viewer{
    padding-top:env(safe-area-inset-top)!important;
    padding-bottom:env(safe-area-inset-bottom)!important;
  }

  .viewer-nav{
    width:42px!important;
    height:54px!important;
  }

  /* Toasts */
  .toast-stack{
    top:calc(8px + env(safe-area-inset-top))!important;
    left:8px!important;
    right:8px!important;
    width:auto!important;
  }

  /* Upload queue */
  .upload-queue{
    left:8px!important;
    right:8px!important;
    bottom:calc(76px + env(safe-area-inset-bottom))!important;
    width:auto!important;
  }
}

@media(max-width:390px){
  .sidebar-quick-actions{
    gap:3px!important;
    padding:6px!important;
  }
  .sidebar-quick-actions .sidebar-tool{
    height:41px!important;
  }
  .header-actions #chatSearchBtn{
    display:none!important;
  }
  .bubble{
    max-width:91%!important;
  }
  .profile-stats{
    gap:4px!important;
  }
}


/* ==========================================================
   NOVA 4.1.1 · Mobile Redesign
   ========================================================== */

.mobile-home-actions,
.mobile-bottom-nav,
.mobile-format-toggle{
  display:none;
}

@media(max-width:760px){
  /* Clear mobile hierarchy */
  .sidebar{
    padding-bottom:calc(86px + env(safe-area-inset-bottom))!important;
  }

  .topbar{
    padding:calc(12px + env(safe-area-inset-top)) 12px 10px!important;
  }

  .sidebar-brand-row{
    min-height:46px!important;
    margin-bottom:8px!important;
  }

  .sidebar-brand-row .brand-lockup{
    display:flex!important;
    align-items:center!important;
  }

  .sidebar-brand-row .brand-mark{
    width:36px!important;
    height:36px!important;
    flex:0 0 36px!important;
  }

  .sidebar-brand-row .brand-word{
    display:block!important;
    font-size:15px!important;
  }

  .mobile-home-actions{
    display:flex!important;
    gap:7px;
    margin-bottom:8px;
  }

  .mobile-home-action{
    flex:1;
    height:38px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    border:1px solid var(--line);
    border-radius:11px;
    background:rgba(255,255,255,.025);
    color:#8290a5;
    font-size:9px;
    font-weight:800;
  }

  .mobile-home-action svg{
    width:16px;height:16px;
    fill:none;stroke:currentColor;stroke-width:1.8;
    stroke-linecap:round;stroke-linejoin:round;
  }

  .mobile-home-action:active{
    background:rgba(125,92,255,.12);
    color:#d6def8;
  }

  .sidebar-search-row{
    margin-top:0!important;
  }

  .sidebar-search-row .search{
    height:46px!important;
    border-radius:14px!important;
    background:#0c1522!important;
  }

  .profilebar{
    display:none!important;
  }

  .sidebar-section-label{
    padding-top:9px!important;
    padding-bottom:4px!important;
  }

  .sidebar-section-label:first-of-type{
    display:none!important;
  }

  .chat-filters{
    margin:7px 10px 5px!important;
    padding:4px!important;
    border-radius:12px!important;
    background:#0c1420!important;
  }

  .chat-filter{
    min-height:34px!important;
    padding:0 12px!important;
    font-size:9px!important;
  }

  .chatlist{
    padding:3px 8px 14px!important;
  }

  .chatitem{
    min-height:72px!important;
    padding:10px!important;
    border-radius:16px!important;
    background:transparent!important;
  }

  .chatitem.active{
    background:linear-gradient(135deg,rgba(125,92,255,.12),rgba(66,183,255,.05))!important;
  }

  .chatitem .avatar{
    width:48px!important;
    height:48px!important;
    flex:0 0 48px!important;
    border-radius:14px!important;
  }

  .chatitem .name{
    font-size:11px!important;
  }

  .chatitem .preview{
    font-size:9px!important;
    color:#718096!important;
  }

  .chatitem-time{
    font-size:8px!important;
  }

  /* Hide old 6-icon strip completely on phone */
  .sidebar-quick-actions{
    display:none!important;
  }

  /* Proper labeled bottom navigation */
  .mobile-bottom-nav{
    position:fixed;
    z-index:90;
    left:8px;
    right:8px;
    bottom:calc(7px + env(safe-area-inset-bottom));
    height:66px;
    display:grid;
    grid-template-columns:1fr 1fr 64px 1fr 1fr;
    align-items:center;
    gap:3px;
    padding:6px 7px;
    border:1px solid rgba(255,255,255,.075);
    border-radius:20px;
    background:rgba(12,19,32,.97);
    box-shadow:0 18px 50px rgba(0,0,0,.36);
    backdrop-filter:blur(22px);
  }

  body.mobile-chat-open .mobile-bottom-nav{
    display:none!important;
  }

  .mobile-nav-item{
    min-width:0;
    height:50px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    padding:0 2px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:#66768d;
    font-size:7px;
    font-weight:800;
  }

  .mobile-nav-item svg{
    width:19px;height:19px;
    fill:none;stroke:currentColor;stroke-width:1.75;
    stroke-linecap:round;stroke-linejoin:round;
  }

  .mobile-nav-item.active{
    color:#bfc8ff;
    background:rgba(125,92,255,.08);
  }

  .mobile-nav-fab{
    width:54px;
    height:54px;
    justify-self:center;
    display:grid;
    place-items:center;
    border:0;
    border-radius:18px;
    background:linear-gradient(135deg,#7d5cff,#3f91ff);
    color:white;
    box-shadow:0 12px 28px rgba(78,87,220,.28);
  }

  .mobile-nav-fab svg{
    width:23px;height:23px;
    fill:none;stroke:currentColor;stroke-width:2;
    stroke-linecap:round;stroke-linejoin:round;
  }

  /* Chat screen: less noisy, familiar NOVA identity */
  .chatheader{
    min-height:calc(62px + env(safe-area-inset-top))!important;
    padding:calc(8px + env(safe-area-inset-top)) 8px 8px!important;
  }

  .mobile-back-btn{
    width:36px!important;
    height:36px!important;
    flex:0 0 36px!important;
    border-radius:11px!important;
  }

  .chatheader .avatar{
    width:38px!important;
    height:38px!important;
    flex:0 0 38px!important;
    border-radius:12px!important;
  }

  .header-actions{
    gap:2px!important;
  }

  .header-actions .call-header-btn,
  .header-actions .iconbtn{
    width:34px!important;
    height:34px!important;
    border-radius:10px!important;
  }

  #chatSearchBtn,
  #refreshBtn{
    display:none!important;
  }

  .messages{
    padding:12px 9px 8px!important;
  }

  .bubble{
    max-width:86%!important;
    padding:9px 11px!important;
    font-size:14px!important;
    line-height:1.42!important;
  }

  .sender{
    font-size:9px!important;
  }

  .time{
    font-size:8px!important;
  }

  /* Hide desktop hover action bar on phone, use context menu via long press/right-click */
  .msg-actions{
    display:none!important;
  }

  .reply,
  .forwarded-profile{
    font-size:9px!important;
  }

  /* Composer: one clean row by default */
  .composer-wrap{
    padding:4px 7px calc(7px + env(safe-area-inset-bottom))!important;
  }

  .composer-toolbar{
    display:none!important;
  }

  .mobile-format-toggle{
    display:grid!important;
    position:absolute;
    left:12px;
    top:-32px;
    width:31px;
    height:27px;
    place-items:center;
    border:1px solid var(--line);
    border-radius:8px;
    background:rgba(12,20,33,.96);
    color:#7c8ba0;
    font-size:9px;
    font-weight:850;
  }

  .composer-formatbar{
    display:none!important;
    margin:0 0 5px!important;
    padding:4px!important;
    border:1px solid var(--line);
    border-radius:10px;
    background:#0c1421;
  }

  body.mobile-format-open .composer-formatbar{
    display:flex!important;
  }

  .format-btn{
    min-width:32px!important;
    height:30px!important;
  }

  .composer{
    min-height:52px!important;
    padding:5px!important;
    gap:3px!important;
  }

  #messageInput{
    min-height:38px!important;
    padding:9px 6px!important;
  }

  .composer .clip,
  .composer .emoji-btn,
  .composer .record-btn,
  .composer .send{
    width:39px!important;
    height:39px!important;
    flex:0 0 39px!important;
  }

  /* On very narrow phones, keep only essentials visible */
  @media(max-width:390px){
    .composer .emoji-btn{
      display:none!important;
    }
    .bubble{
      max-width:89%!important;
    }
    .mobile-nav-item span{
      font-size:6.5px!important;
    }
  }

  /* Sheets stay in NOVA visual language */
  .modal{
    background:rgba(3,7,13,.74)!important;
    backdrop-filter:blur(14px)!important;
  }

  .modal-card,
  .settings-card,
  .call-history-card,
  .user-profile-card{
    height:min(90dvh,900px)!important;
    max-height:90dvh!important;
    border-radius:24px 24px 0 0!important;
    background:linear-gradient(180deg,#111a2a,#0d1422)!important;
  }

  .settings-head,
  .call-history-head{
    position:sticky;
    top:0;
    z-index:5;
    background:rgba(17,26,42,.97);
    backdrop-filter:blur(16px);
  }

  .notification-panel{
    background:linear-gradient(180deg,#111a2a,#0d1422)!important;
  }

  .call-card{
    background:#080e18!important;
  }
}


/* NOVA 4.2 · Read Receipts */
.read-receipt{
  display:inline-flex;
  align-items:center;
  gap:3px;
  margin-left:4px;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  font:inherit;
  opacity:.9;
  cursor:pointer;
}

.read-receipt:hover{
  opacity:1;
  text-decoration:underline;
}

.read-receipt .readmark{
  margin-left:0;
}

.read-view-time{
  color:inherit;
  opacity:.78;
  font-size:8px;
}

.read-count{
  min-width:12px;
  text-align:center;
  font-size:8px;
  font-weight:850;
}

.readers-card{
  width:min(520px,94vw);
  max-height:min(76vh,700px);
  padding:0;
  overflow:hidden;
}

.readers-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:17px 17px 13px;
  border-bottom:1px solid var(--line);
}

.readers-head > div:first-child{flex:1}
.readers-head h3{margin:0 0 3px}

.readers-list{
  max-height:calc(76vh - 72px);
  overflow-y:auto;
  padding:8px 10px 12px;
}

.reader-item{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:56px;
  padding:8px;
  border-radius:12px;
}

.reader-item:hover{
  background:rgba(255,255,255,.03);
}

.reader-avatar{
  width:40px;
  height:40px;
  flex:0 0 40px;
  overflow:hidden;
  border-radius:12px;
  background:linear-gradient(135deg,#6550e7,#2f78dc);
  display:grid;
  place-items:center;
  font-weight:850;
}

.reader-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.reader-copy{
  min-width:0;
  flex:1;
}

.reader-name{
  color:#dde5ef;
  font-size:10px;
  font-weight:850;
}

.reader-handle{
  margin-top:2px;
  color:#66768d;
  font-size:8px;
}

.reader-time{
  color:#8392a8;
  font-size:9px;
  text-align:right;
}

.reader-time-date{
  display:block;
  margin-top:2px;
  color:#55647a;
  font-size:8px;
}

.reader-empty{
  padding:30px 15px;
  color:#68778d;
  text-align:center;
  font-size:10px;
}

@media(max-width:760px){
  .read-view-time{
    font-size:7.5px;
  }

  .readers-card{
    width:100%!important;
    max-width:none!important;
    height:min(72dvh,680px)!important;
    max-height:72dvh!important;
    border-radius:24px 24px 0 0!important;
  }

  .readers-list{
    max-height:none!important;
    flex:1;
  }
}


/* ==========================================================
   NOVA 4.3 · Presence 2.0
   ========================================================== */

.typing{
  min-height:22px;
  display:flex;
  align-items:center;
  padding:0 max(20px,7vw);
  color:#8392a8;
  font-size:10px;
  transition:.15s ease;
}

.activity-pill{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:22px;
  padding:3px 8px;
  border:1px solid rgba(125,92,255,.10);
  border-radius:999px;
  background:rgba(125,92,255,.055);
  color:#95a4ba;
}

.activity-dots{
  display:inline-flex;
  align-items:center;
  gap:2px;
}

.activity-dots i{
  width:3px;
  height:3px;
  border-radius:50%;
  background:#8d9bff;
  animation:novaPresenceDot 1.05s ease-in-out infinite;
}

.activity-dots i:nth-child(2){animation-delay:.14s}
.activity-dots i:nth-child(3){animation-delay:.28s}

@keyframes novaPresenceDot{
  0%,70%,100%{transform:translateY(0);opacity:.45}
  35%{transform:translateY(-3px);opacity:1}
}

.activity-text{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.chat-live-status{
  color:#8f9dff!important;
  font-weight:750;
}

.chat-live-status.recording{
  color:#ff91a4!important;
}

.chat-live-status.uploading{
  color:#70b8ff!important;
}

.header-live-status{
  color:#9aa8ff!important;
}

.header-live-status.recording{
  color:#ff91a4!important;
}

.header-live-status.uploading{
  color:#70b8ff!important;
}

.online-dot{
  transition:transform .16s ease,box-shadow .16s ease;
}

.chatitem:hover .online-dot{
  transform:scale(1.12);
}

@media(max-width:760px){
  .typing{
    min-height:20px;
    padding:0 10px!important;
    font-size:9px;
  }

  .activity-pill{
    max-width:calc(100vw - 20px);
    min-height:20px;
    padding:2px 7px;
  }
}


/* ==========================================================
   NOVA 4.4 · Message Details
   ========================================================== */

.message-details-card{
  width:min(620px,94vw);
  max-height:min(84vh,820px);
  padding:0;
  overflow:hidden;
}

.message-details-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:17px;
  border-bottom:1px solid var(--line);
  background:rgba(14,22,36,.97);
}

.message-details-head>div:first-child{flex:1}
.message-details-head h3{margin:0 0 3px}

.message-details-body{
  max-height:calc(84vh - 74px);
  overflow-y:auto;
  padding:12px;
}

.details-message-preview{
  padding:13px;
  margin-bottom:10px;
  border:1px solid rgba(125,92,255,.12);
  border-radius:15px;
  background:linear-gradient(135deg,rgba(125,92,255,.07),rgba(66,183,255,.025));
}

.details-preview-author{
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:9px;
}

.details-mini-avatar{
  width:34px;
  height:34px;
  flex:0 0 34px;
  overflow:hidden;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:linear-gradient(135deg,#6550e7,#2f78dc);
  font-size:10px;
  font-weight:850;
}

.details-mini-avatar img{
  width:100%;height:100%;object-fit:cover;
}

.details-author-name{
  color:#dce5f1;
  font-size:10px;
  font-weight:850;
}

.details-author-handle{
  margin-top:2px;
  color:#66768d;
  font-size:8px;
}

.details-preview-text{
  color:#c6d0dd;
  font-size:11px;
  line-height:1.5;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.details-preview-attachment{
  margin-top:8px;
  padding:8px 9px;
  border-radius:9px;
  background:rgba(255,255,255,.035);
  color:#8796aa;
  font-size:9px;
}

.details-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
  margin-bottom:10px;
}

.details-stat{
  min-width:0;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.018);
}

.details-stat-label{
  margin-bottom:4px;
  color:#5f6e83;
  font-size:8px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.35px;
}

.details-stat-value{
  color:#bdc8d8;
  font-size:10px;
  line-height:1.4;
  overflow-wrap:anywhere;
}

.details-section{
  margin-top:9px;
  border:1px solid var(--line);
  border-radius:13px;
  overflow:hidden;
  background:rgba(255,255,255,.014);
}

.details-section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px 11px;
  border-bottom:1px solid var(--line);
  color:#aab6c7;
  font-size:9px;
  font-weight:850;
}

.details-count{
  min-width:20px;
  padding:2px 6px;
  border-radius:999px;
  background:rgba(125,92,255,.10);
  color:#aab4ff;
  text-align:center;
  font-size:8px;
}

.details-person{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:50px;
  padding:7px 10px;
  border-bottom:1px solid rgba(255,255,255,.035);
  cursor:pointer;
}

.details-person:last-child{border-bottom:0}
.details-person:hover{background:rgba(255,255,255,.025)}

.details-person-copy{
  min-width:0;
  flex:1;
}

.details-person-name{
  color:#cbd5e1;
  font-size:9px;
  font-weight:800;
}

.details-person-meta{
  margin-top:2px;
  color:#617086;
  font-size:8px;
}

.details-person-side{
  color:#8392a8;
  font-size:8px;
  text-align:right;
}

.details-reaction-emoji{
  min-width:30px;
  font-size:17px;
  text-align:center;
}

.details-link-row{
  display:flex;
  align-items:center;
  gap:9px;
  padding:10px;
  cursor:pointer;
}

.details-link-row:hover{background:rgba(255,255,255,.025)}

.details-link-icon{
  width:32px;
  height:32px;
  flex:0 0 32px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:rgba(125,92,255,.09);
  color:#9ca8ff;
}

.details-tech{
  margin-top:10px;
}

.details-tech summary{
  cursor:pointer;
  padding:9px 10px;
  color:#65748a;
  font-size:8px;
  font-weight:800;
  user-select:none;
}

.details-tech-box{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:6px 12px;
  padding:0 10px 10px;
  color:#5f6e83;
  font-size:8px;
}

.details-tech-box strong{
  color:#8795a8;
  font-weight:750;
}

.details-empty{
  padding:18px;
  color:#65748a;
  text-align:center;
  font-size:9px;
}

@media(max-width:760px){
  .message-details-card{
    width:100%!important;
    max-width:none!important;
    height:min(88dvh,820px)!important;
    max-height:88dvh!important;
    border-radius:24px 24px 0 0!important;
  }

  .message-details-body{
    max-height:none!important;
    flex:1;
    padding-bottom:calc(16px + env(safe-area-inset-bottom));
  }

  .details-grid{
    grid-template-columns:1fr 1fr;
  }
}

@media(max-width:390px){
  .details-grid{
    grid-template-columns:1fr;
  }
}


/* NOVA 4.4.1 · Auth + Voice polish */
.auth-card > .logo{
  display:none!important;
}

.auth-brand{
  margin-bottom:16px!important;
}

.auth-logo-mark{
  width:52px!important;
  height:52px!important;
  border-radius:16px!important;
  background:
    radial-gradient(circle at 30% 20%,rgba(255,255,255,.08),transparent 30%),
    linear-gradient(145deg,rgba(125,92,255,.18),rgba(20,215,223,.08))!important;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.07),
    0 14px 34px rgba(75,59,180,.16)!important;
}

.auth-logo-mark svg{
  width:39px!important;
  height:39px!important;
}

.auth-word{
  font-size:22px!important;
  letter-spacing:.2em!important;
}

.record-btn{
  position:relative;
  overflow:hidden;
  border:1px solid transparent!important;
  color:#91a0b5!important;
  background:transparent!important;
}

.record-btn svg{
  width:19px;
  height:19px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
  pointer-events:none;
}

.record-btn:hover{
  color:#d5deea!important;
  border-color:rgba(255,255,255,.055)!important;
  background:rgba(255,255,255,.04)!important;
}

.record-icon-stop{
  display:none;
}

.record-btn.recording{
  color:#ff8298!important;
  border-color:rgba(251,113,133,.14)!important;
  background:rgba(251,113,133,.09)!important;
  animation:novaRecordPulse 1.15s ease-in-out infinite;
}

.record-btn.recording .record-icon-mic{
  display:none;
}

.record-btn.recording .record-icon-stop{
  display:block;
}

.record-btn.recording::after{
  content:"";
  position:absolute;
  inset:5px;
  border:1px solid rgba(255,130,152,.15);
  border-radius:9px;
  pointer-events:none;
}

@media(max-width:760px){
  .auth-card{
    padding-top:24px!important;
  }

  .auth-logo-mark{
    width:48px!important;
    height:48px!important;
  }

  .auth-logo-mark svg{
    width:36px!important;
    height:36px!important;
  }

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


/* ==========================================================
   NOVA 4.4.2 · MOBILE TOUCH HOTFIX
   ========================================================== */

@media(max-width:760px){
  /* Explicit interaction layers. This is important on real mobile
     browsers where transformed fixed elements may still win hit-testing. */
  .sidebar{
    pointer-events:auto!important;
    visibility:visible!important;
  }

  .main{
    pointer-events:none!important;
  }

  body.mobile-chat-open .sidebar{
    pointer-events:none!important;
  }

  body.mobile-chat-open .main{
    pointer-events:auto!important;
    visibility:visible!important;
  }

  /* The mobile navigation must always sit above the inactive chat layer. */
  .mobile-bottom-nav{
    z-index:500!important;
    pointer-events:auto!important;
    isolation:isolate;
  }

  body.mobile-chat-open .mobile-bottom-nav{
    pointer-events:none!important;
  }

  /* Real touch targets */
  .mobile-bottom-nav button,
  .mobile-home-actions button,
  .mobile-back-btn,
  .chatitem,
  .chat-filter,
  .composer button,
  .chatheader button,
  .modal button,
  .notification-panel button,
  .reader-item,
  .details-person,
  .details-link-row{
    pointer-events:auto!important;
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
  }

  .mobile-bottom-nav button,
  .mobile-home-actions button{
    position:relative;
    z-index:2;
  }

  /* Invisible UI must never create a transparent tap shield. */
  .modal.hidden,
  .notification-panel.hidden,
  .emoji-panel.hidden,
  .people-results.hidden,
  .mention-popup.hidden,
  .media-viewer.hidden,
  .call-modal.hidden,
  .context.hidden,
  .reaction-menu.hidden{
    display:none!important;
    pointer-events:none!important;
    visibility:hidden!important;
  }

  .modal:not(.hidden),
  .notification-panel:not(.hidden),
  .media-viewer:not(.hidden),
  .call-modal:not(.hidden){
    pointer-events:auto!important;
    visibility:visible!important;
  }

  /* Old mobile desktop rules used to hide chat metadata at <=720px.
     Restore the actual mobile chat list explicitly. */
  .chatmeta{
    display:block!important;
    min-width:0!important;
    flex:1!important;
  }

  .chat-filters{
    display:flex!important;
  }

  .sidebar-search-row{
    display:flex!important;
  }

  /* Avoid selection/drag gestures swallowing ordinary taps. */
  button,
  .chatitem,
  .chat-filter{
    user-select:none;
    -webkit-user-select:none;
  }

  /* Inputs remain normally interactive. */
  input,
  textarea{
    pointer-events:auto!important;
    touch-action:auto;
    user-select:text;
    -webkit-user-select:text;
  }
}


/* ==========================================================
   NOVA 4.4.3 · MOBILE INTERACTION REBUILD
   ========================================================== */
@media(max-width:760px){

  /* Force the mobile home hierarchy to be visible and tappable. */
  .sidebar{
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }

  .topbar{
    display:block!important;
    flex:0 0 auto!important;
    position:relative!important;
    z-index:120!important;
    overflow:visible!important;
  }

  .sidebar-brand-row{
    display:flex!important;
    width:100%!important;
  }

  .sidebar-brand-row .brand-lockup{
    display:flex!important;
    flex:1 1 auto!important;
    min-width:0!important;
  }

  /* Search had several old media rules fighting each other.
     This final rule wins explicitly. */
  .sidebar-search-row{
    display:flex!important;
    position:relative!important;
    width:100%!important;
    height:46px!important;
    margin:0!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }

  .sidebar-search-row .search,
  #searchInput{
    display:block!important;
    width:100%!important;
    height:46px!important;
    min-width:0!important;
    padding:0 14px 0 39px!important;
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
    color:#dbe4ef!important;
    background:#0c1522!important;
    border:1px solid rgba(255,255,255,.07)!important;
    border-radius:14px!important;
  }

  .sidebar-search-icon{
    display:block!important;
    z-index:3!important;
  }

  .mobile-home-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    position:relative!important;
    z-index:121!important;
    pointer-events:auto!important;
  }

  .mobile-home-action{
    pointer-events:auto!important;
    cursor:pointer!important;
  }

  /* Mobile bottom navigation is the authoritative phone nav. */
  .mobile-bottom-nav{
    display:grid!important;
    z-index:10000!important;
    pointer-events:auto!important;
    transform:translateZ(0);
    -webkit-transform:translateZ(0);
  }

  body.mobile-chat-open .mobile-bottom-nav{
    display:none!important;
  }

  .mobile-nav-item,
  .mobile-nav-fab{
    pointer-events:auto!important;
    cursor:pointer!important;
    touch-action:manipulation!important;
  }

  /* Chat rows and profile entry points. */
  .chatlist{
    position:relative!important;
    z-index:10!important;
    pointer-events:auto!important;
  }

  .chatitem,
  .chatitem .avatar,
  .clickable-avatar,
  .clickable-sender,
  .forwarded-profile,
  .message-mention,
  .details-person,
  .reader-item{
    pointer-events:auto!important;
    touch-action:manipulation!important;
  }

  .chatitem .avatar.clickable-avatar,
  .clickable-sender,
  .forwarded-profile,
  .message-mention{
    cursor:pointer!important;
  }

  /* Search results must appear above everything on mobile. */
  .people-results{
    display:block;
    position:fixed!important;
    z-index:20000!important;
    top:calc(126px + env(safe-area-inset-top))!important;
    left:10px!important;
    right:10px!important;
    width:auto!important;
    max-height:calc(100dvh - 150px - env(safe-area-inset-top))!important;
    overflow-y:auto!important;
    pointer-events:auto!important;
  }

  .people-results.hidden{
    display:none!important;
    pointer-events:none!important;
  }

  .people-result,
  .search-chat-result,
  .global-message-result{
    pointer-events:auto!important;
    touch-action:manipulation!important;
  }

  /* Modals/sheets must be above nav and never behind transparent layers. */
  .modal:not(.hidden){
    z-index:30000!important;
    pointer-events:auto!important;
  }

  .notification-panel:not(.hidden){
    z-index:30000!important;
    pointer-events:auto!important;
  }

  /* More comfortable mobile profile sheets. */
  .user-profile-card,
  #profileModal .modal-card,
  .settings-card,
  .call-history-card,
  #savedModal .modal-card{
    display:flex!important;
    flex-direction:column!important;
    overflow:hidden!important;
  }

  .user-profile-body,
  .settings-body,
  .call-history-list,
  #savedList{
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch;
  }
}


/* ==========================================================
   NOVA 4.5 · Media & Files
   ========================================================== */
.media-hub-open{
  height:28px!important;
  padding:0 9px!important;
  border:1px solid rgba(125,92,255,.13)!important;
  border-radius:9px!important;
  background:rgba(125,92,255,.07)!important;
  color:#a9b2ff!important;
  font-size:8px!important;
  text-transform:none!important;
  letter-spacing:0!important;
}

.media-tabs{
  display:flex;
  gap:5px;
  overflow-x:auto;
  scrollbar-width:none;
}
.media-tabs::-webkit-scrollbar{display:none}

.media-tab{
  flex:0 0 auto;
}

.shared-media-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:5px;
  margin-top:9px;
}

.shared-media-item{
  aspect-ratio:1;
  overflow:hidden;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:10px;
  background:#0b1320;
  color:#718096;
  text-decoration:none;
  cursor:pointer;
}

.shared-media-item img,
.shared-media-item video{
  width:100%;
  height:100%;
  object-fit:cover;
}

.shared-list{
  display:flex;
  flex-direction:column;
  gap:5px;
  margin-top:9px;
}

.shared-list-item{
  display:flex;
  align-items:center;
  gap:9px;
  width:100%;
  min-width:0;
  padding:8px;
  border:1px solid var(--line);
  border-radius:10px;
  background:rgba(255,255,255,.018);
  color:#b9c4d3;
  text-align:left;
  cursor:pointer;
}

.shared-list-item:hover{background:rgba(255,255,255,.035)}

.shared-list-icon{
  width:34px;height:34px;flex:0 0 34px;
  display:grid;place-items:center;
  border-radius:9px;
  background:rgba(125,92,255,.08);
  color:#9da8ff;
}

.shared-list-copy{min-width:0;flex:1}
.shared-list-name{
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  font-size:9px;font-weight:800;
}
.shared-list-meta{
  margin-top:2px;color:#617086;font-size:8px;
}
.shared-link{
  display:block;
  overflow:hidden;
  padding:9px;
  border-bottom:1px solid var(--line);
  color:#8ea8ff;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.media-hub-card{
  width:min(820px,95vw);
  height:min(82vh,820px);
  max-height:82vh;
  padding:0!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
}

.media-hub-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:17px;
  border-bottom:1px solid var(--line);
}
.media-hub-head>div:first-child{flex:1}
.media-hub-head h3{margin:0 0 3px}

.media-hub-controls{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid var(--line);
}

.media-hub-tabs{flex:1}

.media-hub-search{
  width:220px;
  height:36px;
  padding:0 11px;
  border:1px solid var(--line);
  border-radius:10px;
  outline:none;
  background:#0c1522;
  color:#dbe4ef;
  font:inherit;
  font-size:9px;
}

.media-hub-body{
  flex:1;
  overflow-y:auto;
  padding:12px;
}

.media-hub-grid{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:7px;
}

.media-hub-tile{
  position:relative;
  aspect-ratio:1;
  overflow:hidden;
  border:0;
  border-radius:12px;
  padding:0;
  background:#0a111c;
  cursor:pointer;
}

.media-hub-tile img,
.media-hub-tile video{
  width:100%;height:100%;object-fit:cover;
}

.media-hub-tile-overlay{
  position:absolute;
  left:0;right:0;bottom:0;
  padding:18px 7px 6px;
  background:linear-gradient(transparent,rgba(0,0,0,.68));
  color:#e7edf5;
  font-size:7px;
  text-align:left;
}

.media-hub-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.media-hub-row{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:58px;
  padding:8px 9px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.015);
  cursor:pointer;
}

.media-hub-row:hover{background:rgba(255,255,255,.03)}

.media-hub-row-icon{
  width:40px;height:40px;flex:0 0 40px;
  display:grid;place-items:center;
  border-radius:11px;
  background:rgba(125,92,255,.08);
  color:#9ba7ff;
  font-size:15px;
}

.media-hub-row-copy{min-width:0;flex:1}
.media-hub-row-title{
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  color:#c9d3df;font-size:10px;font-weight:800;
}
.media-hub-row-meta{
  margin-top:3px;color:#617086;font-size:8px;
}
.media-hub-row-action{
  color:#66768b;font-size:8px;
}

.media-hub-empty{
  padding:42px 15px;
  color:#65748a;
  text-align:center;
  font-size:10px;
}

.media-hub-voice{
  width:100%;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
}

@media(max-width:760px){
  .shared-media-grid{grid-template-columns:repeat(3,1fr)}

  .media-hub-card{
    width:100%!important;
    max-width:none!important;
    height:92dvh!important;
    max-height:92dvh!important;
    border-radius:24px 24px 0 0!important;
  }

  .media-hub-controls{
    display:block;
  }

  .media-hub-search{
    width:100%;
    margin-top:8px;
  }

  .media-hub-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .media-hub-body{
    padding-bottom:calc(18px + env(safe-area-inset-bottom));
  }
}


/* ==========================================================
   NOVA 4.6 · Groups 2.0
   ========================================================== */
.group2-owner-settings{margin-top:8px}
.group2-settings-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
}
.group2-settings-grid>label,
.invite-advanced>label{
  display:flex;
  flex-direction:column;
  gap:5px;
  padding:9px;
  border:1px solid var(--line);
  border-radius:11px;
  background:#0c1421;
  color:#718096;
  font-size:8px;
}
.group2-settings-grid select,
.invite-advanced select,
.invite-advanced input{
  height:34px;
  padding:0 9px;
  border:1px solid var(--line);
  border-radius:9px;
  background:#0a121e;
  color:#c5cedb;
  outline:none;
}
.group2-check{
  flex-direction:row!important;
  align-items:center!important;
}
.group2-check input{width:18px!important;height:18px!important;flex:0 0 18px}
.group2-check span{display:flex;flex-direction:column;gap:3px}
.group2-check b{color:#bdc8d6;font-size:9px}
.group2-check small{color:#5e6d82;font-size:8px}

.invite-advanced{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
  margin-top:7px;
}
.invite-usage{
  grid-column:1/-1;
  padding:6px 2px 0;
  color:#5f6e83;
  font-size:8px;
}

.group2-moderation-actions{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}
.group2-moderation-actions button{flex:1;min-width:140px}
#joinRequestsBadge:not(:empty){
  margin-left:4px;
  padding:2px 5px;
  border-radius:999px;
  background:rgba(255,157,92,.12);
  color:#f0a777;
}

.group2-card{
  width:min(620px,94vw);
  max-height:min(82vh,760px);
  padding:0!important;
  overflow:hidden!important;
}
.group2-head{
  display:flex;
  align-items:center;
  gap:12px;
  padding:17px;
  border-bottom:1px solid var(--line);
}
.group2-head>div:first-child{flex:1}
.group2-head h3{margin:0 0 3px}
.group2-list{
  max-height:calc(82vh - 72px);
  overflow-y:auto;
  padding:8px 10px 12px;
}

.join-request-row,
.admin-log-row{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:58px;
  padding:8px;
  border-bottom:1px solid rgba(255,255,255,.035);
}
.join-request-row:last-child,.admin-log-row:last-child{border-bottom:0}
.group2-row-copy{min-width:0;flex:1}
.group2-row-title{color:#cdd6e2;font-size:10px;font-weight:800}
.group2-row-meta{margin-top:3px;color:#637188;font-size:8px}
.join-request-actions{display:flex;gap:5px}
.join-request-actions button{height:32px;padding:0 8px}
.join-approve{color:#74dca9!important}
.join-decline{color:#e18191!important}

.admin-log-icon{
  width:34px;height:34px;flex:0 0 34px;
  display:grid;place-items:center;
  border-radius:9px;
  background:rgba(125,92,255,.08);
  color:#9ba7ff;
  font-size:12px;
}

.admin-permissions-card{
  width:min(520px,94vw);
  padding:0!important;
  overflow:hidden!important;
}
.admin-permissions-body{padding:10px 14px 14px}
.admin-permission-btn{
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:9px;
  background:#0d1523;
  color:#8594aa;
}
.admin-permission-btn:hover{color:#c8d2ff;background:rgba(125,92,255,.08)}

.slow-mode-badge{
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin-left:5px;
  color:#8d9ab0;
  font-size:8px;
}

@media(max-width:760px){
  .group2-settings-grid,
  .invite-advanced{grid-template-columns:1fr}
  .invite-usage{grid-column:auto}
  .group2-card,
  .admin-permissions-card{
    width:100%!important;
    max-width:none!important;
    height:min(86dvh,780px)!important;
    max-height:86dvh!important;
    border-radius:24px 24px 0 0!important;
  }
  .group2-list{max-height:none!important;flex:1}
}


/* NOVA 4.6.1 · Invite persistence */
.invite-settings-note{
  grid-column:1/-1;
  padding:2px 2px 0;
  color:#536278;
  font-size:8px;
  line-height:1.45;
}
@media(max-width:760px){
  .invite-settings-note{grid-column:auto}
}

/* NOVA 4.7 · Messaging 2.0 */
.pin-nav{display:flex;align-items:center;gap:2px;margin-left:auto}.pin-nav .iconbtn{width:30px;height:30px}
.pinned-bar.multi-pin .pinned-accent{background:linear-gradient(180deg,#7d5cff,#14d7df,#db45c7)}
.edit-history-item{padding:10px 11px;border-bottom:1px solid rgba(255,255,255,.035)}.edit-history-item:last-child{border-bottom:0}
.edit-history-text{color:#b9c5d5;font-size:9px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}.edit-history-meta{margin-top:5px;color:#607087;font-size:8px}
.reaction{transition:transform .12s ease,background .12s ease,border-color .12s ease}.reaction:hover{transform:translateY(-1px)}
.reaction[data-my-reaction="1"]{border-color:rgba(125,92,255,.35)!important;background:rgba(125,92,255,.13)!important}
@media(max-width:760px){.selection-actions{overflow-x:auto;scrollbar-width:none}.selection-actions::-webkit-scrollbar{display:none}.selection-actions button{flex:0 0 auto}.pin-nav .iconbtn{width:34px;height:34px}}

/* NOVA 4.7.1 · Forwarding Fix */
.forward-card{width:min(520px,94vw);max-height:min(78vh,720px);padding:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
.forward-head{display:flex;align-items:center;gap:12px;padding:16px 16px 12px;border-bottom:1px solid var(--line)}
.forward-head>div:first-child{flex:1}.forward-head h3{margin:0 0 3px}
.forward-preview{margin:10px 12px 0;padding:10px 11px;border:1px solid rgba(125,92,255,.12);border-radius:12px;background:linear-gradient(135deg,rgba(125,92,255,.07),rgba(66,183,255,.025))}
.forward-preview-count{color:#9da8ff;font-size:8px;font-weight:850;text-transform:uppercase;letter-spacing:.35px}
.forward-preview-text{margin-top:5px;color:#aebaca;font-size:9px;line-height:1.45;max-height:43px;overflow:hidden}
.forward-search-wrap{padding:9px 12px 5px}.forward-search{width:100%;height:38px;padding:0 11px;border:1px solid var(--line);border-radius:11px;outline:none;background:#0c1522;color:#dbe4ef;font:inherit;font-size:10px}
.forward-list{flex:1;min-height:0;max-height:none!important;overflow-y:auto;padding:4px 8px 10px}
.forward-chat{position:relative;min-height:57px;margin:2px 0!important;padding:8px 9px!important}.forward-chat:disabled{opacity:.48;cursor:not-allowed}
.forward-chat-sending{pointer-events:none;opacity:.55}.forward-chat-status{flex:0 0 auto;color:#64738a;font-size:8px}
.forward-empty{padding:28px 12px;color:#68778d;text-align:center;font-size:9px}
@media(max-width:760px){.forward-card{width:100%!important;max-width:none!important;height:min(78dvh,700px)!important;max-height:78dvh!important;border-radius:24px 24px 0 0!important}.forward-search{font-size:16px}.forward-list{padding-bottom:calc(14px + env(safe-area-inset-bottom))}.forward-chat{min-height:62px}}


/* ==========================================================
   NOVA 4.8 · iPhone Test / PWA
   ========================================================== */

html{
  background:#080d17;
  -webkit-text-size-adjust:100%;
}

body{
  min-height:100dvh;
  min-height:-webkit-fill-available;
}

button,
a,
input,
textarea,
select{
  -webkit-tap-highlight-color:transparent;
}

.ios-install-banner{
  position:fixed;
  z-index:50000;
  top:calc(10px + env(safe-area-inset-top));
  left:10px;
  right:10px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:16px;
  background:rgba(14,22,36,.97);
  box-shadow:0 18px 60px rgba(0,0,0,.42);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
}

.ios-install-icon{
  width:42px;
  height:42px;
  flex:0 0 42px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:linear-gradient(145deg,rgba(125,92,255,.16),rgba(20,215,223,.08));
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.06);
}

.ios-install-icon svg{width:32px;height:32px}
.ios-install-copy{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}
.ios-install-copy b{font-size:10px;color:#e5ebf4}
.ios-install-copy span{font-size:8px;line-height:1.4;color:#738198}
.ios-install-banner>button{
  width:34px;height:34px;flex:0 0 34px;
  border:0;border-radius:10px;
  background:rgba(255,255,255,.035);
  color:#8b99ad;
}

/* PWA standalone gets its own stable viewport. */
@media(display-mode:standalone){
  html,body{
    width:100%;
    height:100%;
    overflow:hidden;
  }

  body{
    min-height:100dvh;
    padding:0;
  }
}

/* iPhone-focused layer */
@media(max-width:760px){
  html,body{
    height:100dvh!important;
    min-height:100dvh!important;
  }

  .app{
    height:100dvh!important;
    min-height:100dvh!important;
    padding-top:0!important;
  }

  /* Keep content away from Dynamic Island / Home indicator */
  .topbar{
    padding-top:calc(12px + env(safe-area-inset-top))!important;
  }

  .chatheader{
    padding-top:calc(8px + env(safe-area-inset-top))!important;
    min-height:calc(62px + env(safe-area-inset-top))!important;
  }

  .sidebar{
    height:100dvh!important;
    padding-bottom:calc(86px + env(safe-area-inset-bottom))!important;
  }

  .main{
    height:100dvh!important;
  }

  .mobile-bottom-nav{
    bottom:calc(7px + env(safe-area-inset-bottom))!important;
  }

  .composer-wrap{
    padding-bottom:calc(8px + env(safe-area-inset-bottom))!important;
  }

  /* iOS keyboard / zoom protection */
  input,
  textarea,
  select{
    font-size:16px!important;
  }

  #messageInput{
    max-height:min(118px,28dvh)!important;
  }

  /* Long press should belong to NOVA, not Safari text selection. */
  .message-row,
  .bubble,
  .chatitem,
  .mobile-nav-item,
  .mobile-nav-fab,
  .sidebar-tool{
    -webkit-user-select:none;
    user-select:none;
    -webkit-touch-callout:none;
  }

  .bubble .text,
  .message-text,
  input,
  textarea{
    -webkit-user-select:text;
    user-select:text;
    -webkit-touch-callout:default;
  }

  /* iPhone sheets leave room for home indicator */
  .modal-card,
  .settings-card,
  .call-history-card,
  .user-profile-card,
  .forward-card,
  .media-hub-card,
  .group2-card,
  .admin-permissions-card{
    padding-bottom:max(env(safe-area-inset-bottom),8px)!important;
  }

  /* Prevent body rubber-band exposing white page edges. */
  body{
    overscroll-behavior:none;
  }

  .chatlist,
  .messages,
  .notification-panel,
  .modal-card{
    -webkit-overflow-scrolling:touch;
  }
}

/* Compact iPhone widths */
@media(max-width:430px){
  .sidebar-brand-row .brand-word{
    display:block!important;
  }

  .mobile-bottom-nav{
    left:7px!important;
    right:7px!important;
  }

  .chatheader .name{
    max-width:34vw!important;
  }

  .bubble{
    max-width:90%!important;
  }
}


/* ==========================================================
   NOVA 4.8.1 · iPhone Visual Refresh
   Design-only layer. Functionality stays unchanged.
   ========================================================== */

@media(max-width:760px){
  :root{
    --ios-surface:rgba(13,20,34,.92);
    --ios-surface-2:rgba(18,27,45,.94);
    --ios-line:rgba(255,255,255,.065);
    --ios-glow:rgba(125,92,255,.14);
  }

  body{
    background:
      radial-gradient(circle at 15% -5%,rgba(125,92,255,.15),transparent 27%),
      radial-gradient(circle at 105% 22%,rgba(20,215,223,.07),transparent 25%),
      #070c15!important;
  }

  .sidebar{
    width:100%!important;
    min-width:100%!important;
    background:transparent!important;
    border:0!important;
    box-shadow:none!important;
  }

  .topbar{
    padding-left:16px!important;
    padding-right:16px!important;
    padding-bottom:8px!important;
    background:linear-gradient(180deg,rgba(7,12,21,.98),rgba(7,12,21,.84))!important;
    border-bottom:0!important;
    backdrop-filter:blur(24px)!important;
    -webkit-backdrop-filter:blur(24px)!important;
  }

  .sidebar-brand-row{
    min-height:48px!important;
    gap:8px!important;
  }

  .brand-lockup{
    min-width:0!important;
  }

  .brand-mark{
    width:38px!important;height:38px!important;flex-basis:38px!important;
    border-radius:13px!important;
    background:linear-gradient(145deg,rgba(125,92,255,.19),rgba(20,215,223,.07))!important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.07),0 10px 30px rgba(82,62,220,.12)!important;
  }

  .brand-word{
    display:block!important;
    font-size:15px!important;
    letter-spacing:.16em!important;
  }

  .sidebar-actions{gap:5px!important}
  .sidebar-tool{
    width:38px!important;height:38px!important;
    border:0!important;
    border-radius:12px!important;
    background:rgba(255,255,255,.035)!important;
  }

  .sidebar-search-row{
    margin-top:8px!important;
  }

  .sidebar-search-row .search{
    height:44px!important;
    border:1px solid var(--ios-line)!important;
    border-radius:15px!important;
    background:rgba(255,255,255,.045)!important;
    box-shadow:inset 0 1px rgba(255,255,255,.018)!important;
  }

  .search-shortcut{display:none!important}

  .profilebar{
    margin:8px 16px 2px!important;
    padding:9px 10px!important;
    border:1px solid var(--ios-line)!important;
    border-radius:16px!important;
    background:linear-gradient(135deg,rgba(255,255,255,.04),rgba(255,255,255,.018))!important;
  }

  .profilebar .avatar{
    border-radius:13px!important;
  }

  .chat-filters{
    margin:9px 12px 5px!important;
    padding:0 4px!important;
    border:0!important;
    background:transparent!important;
    gap:6px!important;
  }

  .chat-filter{
    min-height:34px!important;
    padding:0 12px!important;
    border:1px solid rgba(255,255,255,.05)!important;
    border-radius:999px!important;
    background:rgba(255,255,255,.028)!important;
  }

  .chat-filter.active{
    color:#eeeaff!important;
    background:rgba(125,92,255,.14)!important;
    border-color:rgba(125,92,255,.17)!important;
    box-shadow:none!important;
  }

  .chatlist{
    padding:4px 10px calc(96px + env(safe-area-inset-bottom))!important;
  }

  .chatitem{
    min-height:72px!important;
    margin:2px 0!important;
    padding:10px 9px!important;
    border:0!important;
    border-radius:17px!important;
  }

  .chatitem:hover{transform:none!important}
  .chatitem.active{
    background:linear-gradient(135deg,rgba(125,92,255,.11),rgba(50,130,255,.045))!important;
    border:0!important;
    box-shadow:inset 0 0 0 1px rgba(125,92,255,.08)!important;
  }
  .chatitem.active::before{display:none!important}

  .chatitem .avatar{
    width:48px!important;height:48px!important;flex-basis:48px!important;
    border-radius:16px!important;
    box-shadow:none!important;
  }

  .chatitem .name{
    font-size:11px!important;
    letter-spacing:-.05px;
  }

  .chatitem .preview{
    margin-top:4px!important;
    font-size:9px!important;
    color:#68778c!important;
  }

  .badge{
    min-width:20px!important;height:20px!important;
    box-shadow:none!important;
  }

  /* Conversation becomes a clean edge-to-edge iPhone screen. */
  .main{
    background:
      radial-gradient(circle at 82% 2%,rgba(125,92,255,.065),transparent 27%),
      #080e18!important;
  }

  .chatheader{
    padding-left:12px!important;
    padding-right:10px!important;
    padding-bottom:8px!important;
    border-bottom:1px solid rgba(255,255,255,.045)!important;
    background:rgba(8,14,24,.91)!important;
    backdrop-filter:blur(26px)!important;
    -webkit-backdrop-filter:blur(26px)!important;
  }

  .chatheader .avatar{
    width:40px!important;height:40px!important;flex-basis:40px!important;
    border-radius:14px!important;
  }

  .header-title .name,.chatheader .name{
    font-size:12px!important;
    font-weight:800!important;
  }

  .header-title .muted,.chatheader .muted{
    font-size:8px!important;
  }

  .header-actions{
    gap:1px!important;
  }

  .header-actions .iconbtn,
  .call-header-btn{
    width:37px!important;height:37px!important;flex-basis:37px!important;
    border-radius:12px!important;
    background:transparent!important;
  }

  .messages{
    padding:14px 10px 12px!important;
  }

  .message-row{
    margin:3px 0!important;
  }

  .bubble{
    border-radius:18px!important;
    padding:9px 11px 7px!important;
    box-shadow:0 5px 18px rgba(0,0,0,.08)!important;
  }

  .message-row.mine .bubble{
    background:linear-gradient(145deg,rgba(82,67,184,.34),rgba(37,74,145,.27))!important;
    border-color:rgba(135,119,255,.10)!important;
  }

  .message-row:not(.mine) .bubble{
    background:rgba(19,29,45,.88)!important;
    border-color:rgba(255,255,255,.045)!important;
  }

  .sender{
    font-size:8px!important;
    margin-bottom:4px!important;
  }

  .message-text,.bubble .text{
    font-size:11px!important;
    line-height:1.45!important;
  }

  .msgmeta{
    margin-top:4px!important;
    font-size:7px!important;
    opacity:.68;
  }

  .reply-preview,
  .forwarded-profile{
    border-radius:10px!important;
  }

  .reactions{
    gap:4px!important;
    margin-top:5px!important;
  }

  .reaction{
    min-height:25px!important;
    border-radius:999px!important;
    padding:3px 8px!important;
    background:rgba(255,255,255,.04)!important;
  }

  .pinned-bar{
    margin:7px 9px 0!important;
    border:1px solid rgba(255,255,255,.055)!important;
    border-radius:14px!important;
    background:rgba(15,24,39,.9)!important;
    box-shadow:none!important;
  }

  .composer-wrap{
    padding-left:8px!important;
    padding-right:8px!important;
    background:linear-gradient(180deg,rgba(8,14,24,.12),rgba(8,14,24,.98) 24%)!important;
    border-top:0!important;
  }

  .composer{
    min-height:52px!important;
    padding:5px 6px 5px 7px!important;
    border:1px solid rgba(255,255,255,.065)!important;
    border-radius:19px!important;
    background:rgba(17,26,42,.96)!important;
    box-shadow:0 12px 36px rgba(0,0,0,.16)!important;
  }

  .composer textarea{
    min-height:38px!important;
    padding:9px 6px!important;
    background:transparent!important;
    border:0!important;
  }

  .composer .iconbtn{
    width:38px!important;height:38px!important;flex-basis:38px!important;
    border-radius:13px!important;
  }

  #sendBtn{
    width:40px!important;height:40px!important;flex-basis:40px!important;
    border-radius:14px!important;
    box-shadow:0 8px 20px rgba(89,71,220,.18)!important;
  }

  /* Bottom navigation: floating dock, visually distinct from Telegram. */
  .mobile-bottom-nav{
    left:10px!important;
    right:10px!important;
    min-height:62px!important;
    padding:5px 6px!important;
    border:1px solid rgba(255,255,255,.07)!important;
    border-radius:21px!important;
    background:rgba(13,21,35,.91)!important;
    box-shadow:0 16px 45px rgba(0,0,0,.36)!important;
    backdrop-filter:blur(26px)!important;
    -webkit-backdrop-filter:blur(26px)!important;
  }

  .mobile-nav-item{
    border-radius:15px!important;
    color:#69788e!important;
  }

  .mobile-nav-item.active{
    background:rgba(125,92,255,.11)!important;
    color:#b8adff!important;
  }

  .mobile-nav-item span{
    font-size:7px!important;
  }

  .mobile-nav-fab{
    width:46px!important;height:46px!important;
    border-radius:16px!important;
    box-shadow:0 10px 26px rgba(83,63,220,.25)!important;
  }

  /* All sheets share one iPhone visual language. */
  .modal{
    align-items:flex-end!important;
    background:rgba(0,0,0,.48)!important;
    backdrop-filter:blur(7px)!important;
    -webkit-backdrop-filter:blur(7px)!important;
  }

  .modal-card,
  .settings-card,
  .call-history-card,
  .user-profile-card,
  .media-hub-card,
  .group2-card,
  .admin-permissions-card,
  .forward-card{
    width:100%!important;
    max-width:none!important;
    max-height:88dvh!important;
    border:1px solid rgba(255,255,255,.075)!important;
    border-bottom:0!important;
    border-radius:24px 24px 0 0!important;
    background:linear-gradient(180deg,#111a2a,#0b121e)!important;
    box-shadow:0 -22px 70px rgba(0,0,0,.42)!important;
  }

  .modal-card::before,
  .settings-card::before,
  .call-history-card::before,
  .media-hub-card::before,
  .group2-card::before,
  .admin-permissions-card::before,
  .forward-card::before{
    content:"";
    display:block;
    width:38px;
    height:4px;
    margin:8px auto 4px;
    border-radius:999px;
    background:rgba(255,255,255,.13);
  }

  .notification-panel{
    top:calc(8px + env(safe-area-inset-top))!important;
    right:8px!important;
    bottom:calc(8px + env(safe-area-inset-bottom))!important;
    left:8px!important;
    width:auto!important;
    border-radius:22px!important;
    background:rgba(12,19,31,.97)!important;
  }

  .toast-stack{
    top:calc(10px + env(safe-area-inset-top))!important;
    left:10px!important;
    right:10px!important;
  }

  .toast{
    width:100%!important;
    border-radius:16px!important;
    background:rgba(16,25,40,.96)!important;
    backdrop-filter:blur(20px)!important;
    -webkit-backdrop-filter:blur(20px)!important;
  }

  .selection-bar{
    border-radius:18px!important;
    background:rgba(15,23,38,.96)!important;
    backdrop-filter:blur(22px)!important;
    -webkit-backdrop-filter:blur(22px)!important;
  }
}

@media(max-width:390px){
  .brand-word{font-size:14px!important}
  .sidebar-actions{gap:2px!important}
  .sidebar-tool{width:36px!important;height:36px!important}
  .chatitem{min-height:68px!important}
  .chatitem .avatar{width:45px!important;height:45px!important;flex-basis:45px!important}
  .header-actions .iconbtn,.call-header-btn{width:34px!important;height:34px!important;flex-basis:34px!important}
}


/* ==========================================================
   NOVA 4.9 · GLASS iPHONE
   Radical visual redesign, mobile only
   ========================================================== */

@media(max-width:760px){
  :root{
    --glass-bg:rgba(15,22,36,.58);
    --glass-bg-strong:rgba(17,25,42,.74);
    --glass-bg-soft:rgba(255,255,255,.045);
    --glass-line:rgba(255,255,255,.10);
    --glass-line-soft:rgba(255,255,255,.055);
    --glass-text:#f2f5fb;
    --glass-muted:#8190a8;
    --glass-violet:#8b78ff;
    --glass-blue:#64b7ff;
    --glass-cyan:#50e4e0;
  }

  html,body{
    background:#060a12!important;
  }

  body::before,
  body::after{
    content:"";
    position:fixed;
    z-index:-1;
    width:54vw;
    height:54vw;
    border-radius:50%;
    filter:blur(70px);
    opacity:.28;
    pointer-events:none;
  }

  body::before{
    top:-18vw;
    right:-18vw;
    background:#6f4cff;
  }

  body::after{
    left:-22vw;
    bottom:8vh;
    background:#0fa8c7;
    opacity:.16;
  }

  /* ===== Home / chat list ===== */
  .sidebar{
    background:
      linear-gradient(180deg,rgba(6,10,18,.46),rgba(6,10,18,.70))!important;
  }

  .topbar{
    padding:
      calc(10px + env(safe-area-inset-top))
      14px
      10px!important;
    background:transparent!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }

  .sidebar-brand-row{
    min-height:50px!important;
    padding:2px 2px 0!important;
  }

  .brand-mark{
    width:40px!important;
    height:40px!important;
    flex:0 0 40px!important;
    border-radius:15px!important;
    background:rgba(255,255,255,.055)!important;
    border:1px solid rgba(255,255,255,.09)!important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.06),
      0 12px 32px rgba(0,0,0,.16)!important;
    backdrop-filter:blur(20px)!important;
    -webkit-backdrop-filter:blur(20px)!important;
  }

  .brand-mark svg{
    width:30px!important;
    height:30px!important;
  }

  .brand-word{
    color:#f4f6fb!important;
    font-size:15px!important;
    font-weight:850!important;
    letter-spacing:.20em!important;
  }

  .sidebar-actions{
    gap:6px!important;
  }

  .sidebar-tool,
  .mobile-top-compose{
    width:40px;
    height:40px;
    display:grid;
    place-items:center;
    border:1px solid rgba(255,255,255,.075)!important;
    border-radius:14px!important;
    background:rgba(255,255,255,.045)!important;
    color:#8493aa!important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.035),
      0 10px 28px rgba(0,0,0,.10)!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
  }

  .mobile-top-compose{
    color:#e9e6ff!important;
    background:
      linear-gradient(135deg,rgba(139,120,255,.30),rgba(68,154,255,.20))!important;
    border-color:rgba(161,145,255,.23)!important;
  }

  .mobile-top-compose svg,
  .sidebar-tool svg{
    width:18px;
    height:18px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.75;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .sidebar-search-row{
    margin-top:11px!important;
  }

  .sidebar-search-row .search{
    height:48px!important;
    padding-left:40px!important;
    border:1px solid rgba(255,255,255,.075)!important;
    border-radius:17px!important;
    background:rgba(255,255,255,.045)!important;
    color:#eef2f8!important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.025),
      0 12px 34px rgba(0,0,0,.09)!important;
    backdrop-filter:blur(22px)!important;
    -webkit-backdrop-filter:blur(22px)!important;
  }

  .sidebar-search-row .search::placeholder{
    color:#65748a!important;
  }

  .mobile-home-actions{
    margin:10px 0 4px!important;
    gap:7px!important;
  }

  .mobile-home-action{
    height:42px!important;
    border:1px solid rgba(255,255,255,.065)!important;
    border-radius:15px!important;
    background:rgba(255,255,255,.035)!important;
    color:#8391a7!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
  }

  .chat-filters{
    margin:9px 12px 6px!important;
    padding:4px!important;
    border:1px solid rgba(255,255,255,.055)!important;
    border-radius:16px!important;
    background:rgba(255,255,255,.025)!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
  }

  .chat-filter{
    min-height:34px!important;
    border:0!important;
    border-radius:12px!important;
    background:transparent!important;
    color:#66758b!important;
  }

  .chat-filter.active{
    background:rgba(255,255,255,.065)!important;
    color:#e4e9f2!important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.045)!important;
  }

  .chatlist{
    padding:4px 10px calc(92px + env(safe-area-inset-bottom))!important;
  }

  .chatitem{
    min-height:76px!important;
    margin:4px 0!important;
    padding:10px 11px!important;
    border:1px solid transparent!important;
    border-radius:20px!important;
    background:transparent!important;
  }

  .chatitem.active{
    border-color:rgba(255,255,255,.065)!important;
    background:
      linear-gradient(135deg,rgba(139,120,255,.095),rgba(70,169,255,.035)),
      rgba(255,255,255,.025)!important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.025),
      0 14px 38px rgba(0,0,0,.08)!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
  }

  .chatitem .avatar{
    width:50px!important;
    height:50px!important;
    flex:0 0 50px!important;
    border-radius:18px!important;
    border:1px solid rgba(255,255,255,.07)!important;
    box-shadow:0 10px 28px rgba(0,0,0,.14)!important;
  }

  .chatitem .name{
    color:#edf1f7!important;
    font-size:11px!important;
    font-weight:800!important;
  }

  .chatitem .preview{
    margin-top:4px!important;
    color:#65748a!important;
    font-size:9px!important;
  }

  .online-dot{
    width:13px!important;
    height:13px!important;
    border:3px solid #0b111c!important;
    box-shadow:0 0 14px rgba(46,209,123,.46)!important;
  }

  /* ===== Four-item glass dock ===== */
  .mobile-bottom-nav{
    left:12px!important;
    right:12px!important;
    bottom:calc(9px + env(safe-area-inset-bottom))!important;
    height:64px!important;
    grid-template-columns:repeat(4,1fr)!important;
    gap:3px!important;
    padding:6px!important;
    border:1px solid rgba(255,255,255,.085)!important;
    border-radius:23px!important;
    background:rgba(16,23,38,.57)!important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.055),
      0 22px 60px rgba(0,0,0,.34)!important;
    backdrop-filter:blur(32px) saturate(140%)!important;
    -webkit-backdrop-filter:blur(32px) saturate(140%)!important;
  }

  .mobile-nav-item{
    height:50px!important;
    border-radius:17px!important;
    color:#66758b!important;
  }

  .mobile-nav-item.active{
    color:#eeeaff!important;
    background:
      linear-gradient(135deg,rgba(139,120,255,.16),rgba(87,166,255,.08))!important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.045)!important;
  }

  .mobile-nav-item svg{
    width:19px!important;
    height:19px!important;
  }

  .mobile-nav-item span{
    margin-top:1px;
    font-size:7px!important;
    letter-spacing:.02em;
  }

  /* old center FAB no longer exists */
  .mobile-nav-fab{display:none!important}

  /* ===== Chat screen ===== */
  .main{
    background:
      radial-gradient(circle at 86% 0%,rgba(121,89,255,.11),transparent 28%),
      radial-gradient(circle at 0% 85%,rgba(25,180,190,.055),transparent 28%),
      #070d16!important;
  }

  .chatheader{
    min-height:calc(66px + env(safe-area-inset-top))!important;
    padding:
      calc(8px + env(safe-area-inset-top))
      10px
      8px!important;
    border-bottom:0!important;
    background:rgba(9,15,25,.52)!important;
    box-shadow:0 12px 34px rgba(0,0,0,.08)!important;
    backdrop-filter:blur(30px) saturate(135%)!important;
    -webkit-backdrop-filter:blur(30px) saturate(135%)!important;
  }

  .mobile-back-btn{
    width:38px!important;
    height:38px!important;
    border:1px solid rgba(255,255,255,.055)!important;
    border-radius:14px!important;
    background:rgba(255,255,255,.035)!important;
  }

  .chatheader .avatar{
    width:42px!important;
    height:42px!important;
    flex:0 0 42px!important;
    border-radius:15px!important;
    border:1px solid rgba(255,255,255,.07)!important;
  }

  .chatheader .name{
    font-size:12px!important;
    color:#eef2f8!important;
  }

  .chatheader .muted{
    color:#718096!important;
  }

  .header-actions .iconbtn,
  .call-header-btn{
    width:37px!important;
    height:37px!important;
    flex:0 0 37px!important;
    border-radius:13px!important;
    background:rgba(255,255,255,.025)!important;
  }

  .messages{
    padding:15px 9px 12px!important;
  }

  .bubble{
    max-width:88%!important;
    padding:10px 12px 8px!important;
    border-radius:19px!important;
    border:1px solid rgba(255,255,255,.055)!important;
    background:rgba(19,28,45,.60)!important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.02),
      0 8px 26px rgba(0,0,0,.08)!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
  }

  .message-row.mine .bubble{
    border-color:rgba(152,135,255,.11)!important;
    background:
      linear-gradient(135deg,rgba(127,91,255,.27),rgba(43,118,204,.20)),
      rgba(20,27,43,.52)!important;
  }

  .sender{
    color:#9f91ff!important;
  }

  .msgmeta{
    opacity:.62!important;
  }

  .reaction{
    border:1px solid rgba(255,255,255,.06)!important;
    background:rgba(255,255,255,.035)!important;
    backdrop-filter:blur(12px)!important;
    -webkit-backdrop-filter:blur(12px)!important;
  }

  .pinned-bar{
    margin:7px 9px 0!important;
    border:1px solid rgba(255,255,255,.065)!important;
    border-radius:16px!important;
    background:rgba(17,25,40,.58)!important;
    box-shadow:0 10px 28px rgba(0,0,0,.08)!important;
    backdrop-filter:blur(22px)!important;
    -webkit-backdrop-filter:blur(22px)!important;
  }

  .composer-wrap{
    padding:8px 8px calc(8px + env(safe-area-inset-bottom))!important;
    background:linear-gradient(180deg,transparent,rgba(6,10,18,.88) 28%)!important;
  }

  .composer{
    min-height:54px!important;
    border:1px solid rgba(255,255,255,.085)!important;
    border-radius:21px!important;
    background:rgba(18,27,44,.58)!important;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.045),
      0 16px 46px rgba(0,0,0,.20)!important;
    backdrop-filter:blur(30px) saturate(135%)!important;
    -webkit-backdrop-filter:blur(30px) saturate(135%)!important;
  }

  .composer textarea{
    color:#f0f3f8!important;
  }

  #sendBtn{
    border-radius:16px!important;
    background:linear-gradient(135deg,#8a72ff,#579fff)!important;
    box-shadow:0 10px 28px rgba(101,84,230,.25)!important;
  }

  /* ===== User profile: major redesign ===== */
  #userProfileModal{
    align-items:flex-end!important;
  }

  .glass-profile-card{
    height:min(90dvh,820px)!important;
    max-height:90dvh!important;
    overflow:hidden!important;
    border:1px solid rgba(255,255,255,.09)!important;
    border-bottom:0!important;
    border-radius:30px 30px 0 0!important;
    background:
      radial-gradient(circle at 80% 0%,rgba(126,91,255,.12),transparent 28%),
      linear-gradient(180deg,rgba(20,29,47,.88),rgba(10,16,27,.96))!important;
    box-shadow:0 -30px 90px rgba(0,0,0,.48)!important;
    backdrop-filter:blur(34px) saturate(135%)!important;
    -webkit-backdrop-filter:blur(34px) saturate(135%)!important;
  }

  .glass-profile-card .user-profile-cover{
    height:180px!important;
    border-bottom:1px solid rgba(255,255,255,.05)!important;
    background:
      radial-gradient(circle at 20% 20%,rgba(255,255,255,.14),transparent 18%),
      radial-gradient(circle at 82% 10%,rgba(97,214,255,.22),transparent 24%),
      linear-gradient(145deg,#35257f,#613bb0 52%,#195f96)!important;
    filter:saturate(.9);
  }

  .glass-profile-card .user-profile-body{
    padding:0 17px calc(24px + env(safe-area-inset-bottom))!important;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch;
  }

  .glass-profile-card .user-profile-head{
    justify-content:center!important;
    text-align:center;
  }

  .glass-profile-card .user-profile-head>div{
    width:100%;
  }

  .glass-profile-card .user-profile-avatar-wrap{
    width:116px!important;
    height:116px!important;
    margin:-58px auto 0!important;
  }

  .glass-profile-card .user-profile-avatar{
    width:116px!important;
    height:116px!important;
    border:5px solid rgba(14,21,35,.92)!important;
    border-radius:35px!important;
    box-shadow:
      0 18px 44px rgba(0,0,0,.35),
      0 0 0 1px rgba(255,255,255,.08)!important;
  }

  .glass-profile-card .user-profile-online{
    right:5px!important;
    bottom:5px!important;
    width:20px!important;
    height:20px!important;
    border:4px solid #0f1726!important;
  }

  .glass-profile-card .user-profile-name{
    margin-top:14px!important;
    color:#f3f5fa!important;
    font-size:24px!important;
    font-weight:900!important;
    letter-spacing:-.5px!important;
  }

  .glass-profile-card .user-profile-handle{
    justify-content:center;
    display:flex;
    align-items:center;
    gap:5px;
    color:#8190a7!important;
  }

  .glass-profile-card .copy-handle{
    width:28px!important;
    height:28px!important;
    border-radius:9px!important;
    background:rgba(255,255,255,.035)!important;
  }

  .glass-profile-card .user-profile-bio{
    min-height:auto!important;
    margin-top:16px!important;
    padding:13px 14px!important;
    border:1px solid rgba(255,255,255,.065)!important;
    border-radius:16px!important;
    background:rgba(255,255,255,.035)!important;
    color:#bec8d6!important;
    text-align:center;
    line-height:1.5!important;
  }

  .glass-profile-card .profile-stats{
    display:grid!important;
    grid-template-columns:repeat(3,1fr)!important;
    gap:7px!important;
    margin-top:12px!important;
  }

  .glass-profile-card .profile-stat{
    padding:12px 6px!important;
    border:1px solid rgba(255,255,255,.055)!important;
    border-radius:16px!important;
    background:rgba(255,255,255,.025)!important;
  }

  .glass-profile-card .profile-stat-value{
    color:#eef2f8!important;
    font-size:15px!important;
    font-weight:850!important;
  }

  .glass-profile-card .profile-stat-label{
    margin-top:2px!important;
    color:#66758b!important;
    font-size:7px!important;
  }

  .glass-profile-card .user-profile-meta{
    justify-content:center!important;
    gap:6px!important;
  }

  .glass-profile-card .user-profile-chip{
    border:1px solid rgba(255,255,255,.055)!important;
    border-radius:999px!important;
    background:rgba(255,255,255,.03)!important;
    color:#7d8da3!important;
  }

  .glass-profile-card .profile-compact-actions{
    display:grid!important;
    grid-template-columns:1.35fr 1fr 1fr!important;
    gap:7px!important;
    margin-top:14px!important;
  }

  .glass-profile-card .profile-mini-action{
    min-width:0!important;
    height:46px!important;
    border:1px solid rgba(255,255,255,.065)!important;
    border-radius:15px!important;
    background:rgba(255,255,255,.035)!important;
    color:#a8b4c5!important;
  }

  .glass-profile-card .profile-mini-action.primary-action{
    color:#efecff!important;
    border-color:rgba(151,133,255,.17)!important;
    background:linear-gradient(135deg,rgba(135,108,255,.19),rgba(74,151,255,.12))!important;
  }

  .glass-profile-card .profile-mini-action span{
    display:inline!important;
    font-size:8px!important;
  }

  .glass-profile-card .profile-social-tabs{
    margin-top:16px!important;
    padding:4px!important;
    border:1px solid rgba(255,255,255,.055)!important;
    border-radius:15px!important;
    background:rgba(255,255,255,.025)!important;
  }

  .glass-profile-card .profile-social-tab{
    min-height:36px!important;
    border-radius:11px!important;
  }

  .glass-profile-card .profile-social-tab.active{
    background:rgba(255,255,255,.065)!important;
    color:#e9edf4!important;
  }

  .glass-profile-card .wall-compose,
  .glass-profile-card .wall-item,
  .glass-profile-card .mutual-chip{
    border-color:rgba(255,255,255,.055)!important;
    background:rgba(255,255,255,.025)!important;
  }

  .glass-profile-card .profile-close-floating{
    top:calc(12px + env(safe-area-inset-top))!important;
    right:12px!important;
    width:38px!important;
    height:38px!important;
    border:1px solid rgba(255,255,255,.10)!important;
    border-radius:14px!important;
    background:rgba(5,9,16,.28)!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
  }

  /* ===== Own profile editor ===== */
  .glass-profile-edit{
    max-height:88dvh!important;
    overflow-y:auto!important;
    padding:16px!important;
    background:
      radial-gradient(circle at 85% 0%,rgba(128,91,255,.12),transparent 28%),
      rgba(13,20,33,.94)!important;
    backdrop-filter:blur(34px)!important;
    -webkit-backdrop-filter:blur(34px)!important;
  }

  .glass-profile-edit>h3{
    margin:5px 0 14px!important;
    text-align:center;
  }

  .glass-profile-edit .profile-cover-preview{
    height:132px!important;
    border-radius:20px!important;
    border:1px solid rgba(255,255,255,.065)!important;
    overflow:hidden;
  }

  .glass-profile-edit .profile-head{
    margin-top:-26px!important;
    padding:0 8px!important;
    align-items:flex-end!important;
  }

  .glass-profile-edit .profile-avatar-preview{
    width:82px!important;
    height:82px!important;
    flex:0 0 82px!important;
    border:4px solid #111a2b!important;
    border-radius:25px!important;
    box-shadow:0 14px 34px rgba(0,0,0,.28)!important;
  }

  .glass-profile-edit input,
  .glass-profile-edit textarea{
    border:1px solid rgba(255,255,255,.065)!important;
    border-radius:14px!important;
    background:rgba(255,255,255,.035)!important;
  }

  /* ===== Glass sheets everywhere ===== */
  .modal{
    background:rgba(2,5,10,.48)!important;
    backdrop-filter:blur(8px)!important;
    -webkit-backdrop-filter:blur(8px)!important;
  }

  .modal-card:not(.glass-profile-card):not(.glass-profile-edit),
  .settings-card,
  .call-history-card,
  .media-hub-card,
  .group2-card,
  .admin-permissions-card,
  .forward-card{
    border-color:rgba(255,255,255,.075)!important;
    background:
      radial-gradient(circle at 80% 0%,rgba(120,86,255,.085),transparent 26%),
      rgba(14,21,35,.91)!important;
    box-shadow:0 -28px 80px rgba(0,0,0,.46)!important;
    backdrop-filter:blur(34px) saturate(130%)!important;
    -webkit-backdrop-filter:blur(34px) saturate(130%)!important;
  }

  .toast{
    border:1px solid rgba(255,255,255,.08)!important;
    background:rgba(17,25,40,.70)!important;
    box-shadow:0 18px 50px rgba(0,0,0,.28)!important;
    backdrop-filter:blur(28px) saturate(135%)!important;
    -webkit-backdrop-filter:blur(28px) saturate(135%)!important;
  }
}

@media(max-width:390px){
  .brand-word{font-size:14px!important}
  .sidebar-actions{gap:4px!important}
  .sidebar-tool,.mobile-top-compose{width:38px!important;height:38px!important}
  .glass-profile-card .profile-mini-action span{display:none!important}
  .glass-profile-card .profile-compact-actions{grid-template-columns:repeat(3,1fr)!important}
}


/* ==========================================================
   NOVA 5.0 · iPhone Chat Experience
   ========================================================== */

@media(max-width:760px){
  .message-row{
    position:relative;
    touch-action:pan-y;
    transition:transform .16s cubic-bezier(.2,.7,.2,1);
  }

  .message-row.mobile-swiping{
    transition:none!important;
  }

  .message-row::before{
    content:"↩";
    position:absolute;
    top:50%;
    left:5px;
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    transform:translate(-46px,-50%) scale(.8);
    opacity:0;
    border:1px solid rgba(255,255,255,.08);
    border-radius:12px;
    background:rgba(130,107,255,.16);
    color:#d9d2ff;
    font-size:15px;
    transition:.12s ease;
    pointer-events:none;
  }

  .message-row.mobile-swipe-ready::before{
    transform:translate(0,-50%) scale(1);
    opacity:1;
  }

  .message-row.mobile-swipe-ready .bubble{
    box-shadow:
      0 10px 30px rgba(0,0,0,.10),
      0 0 0 1px rgba(139,120,255,.08)!important;
  }

  .mobile-message-sheet,
  .mobile-attach-sheet{
    position:fixed;
    z-index:60000;
    inset:0;
    display:flex;
    align-items:flex-end;
  }

  .mobile-message-sheet.hidden,
  .mobile-attach-sheet.hidden{
    display:none!important;
  }

  .mobile-sheet-backdrop{
    position:absolute;
    inset:0;
    background:rgba(2,5,10,.50);
    backdrop-filter:blur(7px);
    -webkit-backdrop-filter:blur(7px);
  }

  .mobile-sheet-card{
    position:relative;
    z-index:1;
    width:100%;
    padding:8px 10px calc(12px + env(safe-area-inset-bottom));
    border:1px solid rgba(255,255,255,.09);
    border-bottom:0;
    border-radius:28px 28px 0 0;
    background:
      radial-gradient(circle at 80% 0%,rgba(121,88,255,.12),transparent 27%),
      rgba(14,21,35,.94);
    box-shadow:0 -28px 80px rgba(0,0,0,.46);
    backdrop-filter:blur(34px) saturate(135%);
    -webkit-backdrop-filter:blur(34px) saturate(135%);
    animation:novaSheetIn .20s cubic-bezier(.2,.75,.2,1);
  }

  @keyframes novaSheetIn{
    from{transform:translateY(24px);opacity:.55}
    to{transform:none;opacity:1}
  }

  .mobile-sheet-handle{
    width:38px;
    height:4px;
    margin:0 auto 9px;
    border-radius:999px;
    background:rgba(255,255,255,.14);
  }

  .mobile-message-sheet-preview{
    margin:0 3px 8px;
    padding:10px 11px;
    overflow:hidden;
    border:1px solid rgba(255,255,255,.055);
    border-radius:15px;
    background:rgba(255,255,255,.025);
  }

  .mobile-message-sheet-preview b{
    display:block;
    margin-bottom:4px;
    color:#a99cff;
    font-size:8px;
    font-weight:850;
  }

  .mobile-message-sheet-preview span{
    display:block;
    overflow:hidden;
    color:#aab6c7;
    font-size:9px;
    white-space:nowrap;
    text-overflow:ellipsis;
  }

  .mobile-message-actions{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:7px;
  }

  .mobile-message-actions button{
    min-height:70px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:7px;
    border:1px solid rgba(255,255,255,.055);
    border-radius:17px;
    background:rgba(255,255,255,.028);
    color:#9aa9bd;
    font-size:8px;
    font-weight:750;
  }

  .mobile-message-actions button strong{
    width:31px;
    height:31px;
    display:grid;
    place-items:center;
    border-radius:11px;
    background:rgba(255,255,255,.045);
    color:#d8e0eb;
    font-size:14px;
    font-weight:700;
  }

  .mobile-message-actions button.mobile-danger{
    color:#d98b98;
  }

  .mobile-message-actions button.mobile-danger strong{
    color:#ff9bad;
    background:rgba(251,113,133,.08);
  }

  .mobile-sheet-title{
    padding:2px 4px 11px;
    color:#e8edf4;
    font-size:12px;
    font-weight:850;
    text-align:center;
  }

  .mobile-attach-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:7px;
  }

  .mobile-attach-grid button{
    min-width:0;
    height:82px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:1px solid rgba(255,255,255,.055);
    border-radius:18px;
    background:rgba(255,255,255,.03);
    color:#9aa8ba;
    font-size:8px;
    font-weight:800;
  }

  .mobile-attach-icon{
    width:37px;
    height:37px;
    display:grid;
    place-items:center;
    border-radius:13px;
    background:
      linear-gradient(135deg,rgba(139,120,255,.15),rgba(73,160,255,.08));
    color:#d8d2ff;
    font-size:18px;
  }

  .mobile-sheet-cancel{
    width:100%;
    height:46px;
    margin-top:8px;
    border:1px solid rgba(255,255,255,.055);
    border-radius:15px;
    background:rgba(255,255,255,.025);
    color:#8392a6;
  }

  /* Mobile recording experience */
  .mobile-record-overlay{
    position:fixed;
    z-index:62000;
    left:8px;
    right:8px;
    bottom:calc(8px + env(safe-area-inset-bottom));
    display:block;
    pointer-events:auto;
  }

  .mobile-record-overlay.hidden{
    display:none!important;
  }

  .mobile-record-glow{
    position:absolute;
    left:14%;
    right:14%;
    bottom:0;
    height:70px;
    border-radius:50%;
    background:rgba(251,113,133,.13);
    filter:blur(30px);
    pointer-events:none;
  }

  .mobile-record-card{
    position:relative;
    padding:11px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:22px;
    background:rgba(18,26,42,.88);
    box-shadow:0 18px 55px rgba(0,0,0,.34);
    backdrop-filter:blur(30px);
    -webkit-backdrop-filter:blur(30px);
  }

  .mobile-record-top{
    display:flex;
    align-items:center;
    gap:8px;
    color:#dce4ef;
    font-size:9px;
  }

  .mobile-record-top b{
    flex:1;
  }

  .mobile-record-top>span:last-child{
    color:#ff92a4;
    font-variant-numeric:tabular-nums;
  }

  .mobile-record-dot{
    width:7px;
    height:7px;
    border-radius:50%;
    background:#ff7188;
    box-shadow:0 0 14px rgba(255,113,136,.45);
    animation:novaRecordDot 1s ease infinite;
  }

  @keyframes novaRecordDot{
    50%{opacity:.35}
  }

  .mobile-record-wave{
    height:42px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:3px;
    margin:5px 0 2px;
  }

  .mobile-record-wave i{
    width:3px;
    height:12px;
    border-radius:999px;
    background:linear-gradient(#ff8da0,#8674ff);
    animation:novaVoiceBar .85s ease-in-out infinite alternate;
    opacity:.82;
  }

  .mobile-record-wave i:nth-child(2n){height:22px;animation-delay:.08s}
  .mobile-record-wave i:nth-child(3n){height:30px;animation-delay:.18s}
  .mobile-record-wave i:nth-child(4n){height:17px;animation-delay:.28s}
  .mobile-record-wave i:nth-child(5n){height:35px;animation-delay:.12s}

  @keyframes novaVoiceBar{
    to{transform:scaleY(.5);opacity:.42}
  }

  .mobile-record-hint{
    margin-bottom:8px;
    color:#64748a;
    font-size:8px;
    text-align:center;
  }

  .mobile-record-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:7px;
  }

  .mobile-record-actions button{
    height:42px;
    border-radius:14px;
    font-weight:800;
  }

  .mobile-record-cancel{
    border:1px solid rgba(255,255,255,.055);
    background:rgba(255,255,255,.025);
    color:#8b98aa;
  }

  .mobile-record-send{
    border:1px solid rgba(132,111,255,.16);
    background:linear-gradient(135deg,rgba(132,105,255,.22),rgba(72,151,255,.14));
    color:#e9e5ff;
  }

  /* Hide desktop-formatting chrome on iPhone unless explicitly opened */
  .composer-formatbar,
  .composer-toolbar{
    display:none!important;
  }

  /* Context menu never floats awkwardly over iPhone messages anymore. */
  #contextMenu{
    display:none!important;
  }

  .replybar{
    margin:0 8px 5px!important;
    padding:8px 10px!important;
    border:1px solid rgba(255,255,255,.06)!important;
    border-radius:15px!important;
    background:rgba(17,25,40,.64)!important;
    backdrop-filter:blur(20px)!important;
    -webkit-backdrop-filter:blur(20px)!important;
  }

  .jump-unread,
  #novaJumpBottom{
    border:1px solid rgba(255,255,255,.07)!important;
    border-radius:15px!important;
    background:rgba(17,25,40,.72)!important;
    box-shadow:0 12px 34px rgba(0,0,0,.20)!important;
    backdrop-filter:blur(22px)!important;
    -webkit-backdrop-filter:blur(22px)!important;
  }

  .media-viewer{
    background:rgba(3,6,11,.94)!important;
  }

  .media-viewer-top{
    padding-top:calc(10px + env(safe-area-inset-top))!important;
    background:linear-gradient(180deg,rgba(4,7,12,.76),transparent)!important;
    backdrop-filter:blur(16px)!important;
    -webkit-backdrop-filter:blur(16px)!important;
  }

  .viewer-btn{
    border:1px solid rgba(255,255,255,.07)!important;
    background:rgba(255,255,255,.045)!important;
    backdrop-filter:blur(18px)!important;
    -webkit-backdrop-filter:blur(18px)!important;
  }
}

@media(max-width:390px){
  .mobile-message-actions{
    grid-template-columns:repeat(2,1fr);
  }
  .mobile-attach-grid{
    grid-template-columns:repeat(2,1fr);
  }
}


@media(max-width:760px){
  .mobile-record-overlay.cancel-ready .mobile-record-card{
    border-color:rgba(251,113,133,.18);
    background:rgba(49,21,30,.88);
  }
  .mobile-record-overlay.cancel-ready .mobile-record-hint{
    color:#ff9aad;
  }
}

/* ==========================================================
   NOVA 5.1 · Video Circles
   ========================================================== */

.video-note{
  position:relative;
  width:220px;
  height:220px;
  max-width:72vw;
  max-height:72vw;
  margin-top:7px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.09);
  border-radius:50%;
  background:#05080e;
  box-shadow:
    0 16px 44px rgba(0,0,0,.26),
    inset 0 0 0 1px rgba(255,255,255,.03);
}

.video-note video{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  background:#05080e;
}


/* NOVA 6.0.3 · чистый видеосообщение в чате, без квадратного пузыря */
.message-row.video-note-message .bubble{
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  overflow:visible!important;
}
.message-row.video-note-message.mine .bubble::after{
  display:none!important;
}
.message-row.video-note-message .text:empty{
  display:none!important;
}
.message-row.video-note-message .video-note{
  margin-top:0;
}
.message-row.video-note-message .reactions:empty{
  display:none;
}

.video-note-toggle{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  border:0;
  border-radius:50%;
  background:transparent;
  color:white;
}

.video-note-toggle::before{
  content:"▶";
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  padding-left:3px;
  border:1px solid rgba(255,255,255,.13);
  border-radius:50%;
  background:rgba(5,9,16,.42);
  box-shadow:0 10px 30px rgba(0,0,0,.22);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  transition:.16s ease;
}

.video-note.playing .video-note-toggle::before{
  content:"";
  width:11px;
  height:16px;
  padding:0;
  border:0;
  border-radius:2px;
  background:
    linear-gradient(90deg,currentColor 0 36%,transparent 36% 64%,currentColor 64% 100%);
  box-shadow:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  opacity:.0;
}

.video-note:hover .video-note-toggle::before,
.video-note:focus-within .video-note-toggle::before{
  opacity:1!important;
}

.video-note-progress{
  position:absolute;
  left:12%;
  right:12%;
  bottom:14px;
  height:3px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(255,255,255,.18);
  pointer-events:none;
}

.video-note-progress>i{
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,#9a7fff,#5cc8ff);
}

.video-note-time{
  position:absolute;
  right:24px;
  bottom:23px;
  padding:3px 6px;
  border-radius:999px;
  background:rgba(5,9,16,.44);
  color:#f2f5f9;
  font-size:7px;
  font-weight:800;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  pointer-events:none;
}

.video-note-recorder{
  position:fixed;
  z-index:65000;
  inset:0;
  display:flex;
  align-items:flex-end;
}

.video-note-recorder.hidden{
  display:none!important;
}

.video-note-recorder-backdrop{
  position:absolute;
  inset:0;
  background:rgba(2,5,10,.62);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.video-note-recorder-card{
  position:relative;
  z-index:1;
  width:100%;
  padding:
    12px
    14px
    calc(16px + env(safe-area-inset-bottom));
  border:1px solid rgba(255,255,255,.09);
  border-bottom:0;
  border-radius:30px 30px 0 0;
  background:
    radial-gradient(circle at 70% 0%,rgba(125,92,255,.13),transparent 30%),
    rgba(12,18,30,.96);
  box-shadow:0 -30px 90px rgba(0,0,0,.52);
  backdrop-filter:blur(34px) saturate(135%);
  -webkit-backdrop-filter:blur(34px) saturate(135%);
}

.video-note-recorder-head{
  display:grid;
  grid-template-columns:42px 1fr 52px;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}

.video-note-recorder-head>button{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.07);
  border-radius:13px;
  background:rgba(255,255,255,.035);
  color:#8d9bae;
  font-size:18px;
}

.video-note-recorder-head>div:nth-child(2){
  display:flex;
  flex-direction:column;
  gap:2px;
  text-align:center;
}

.video-note-recorder-head b{
  color:#eef2f8;
  font-size:11px;
}

.video-note-recorder-head span{
  color:#66758a;
  font-size:8px;
}

.video-note-record-time{
  color:#ff91a4;
  font-size:9px;
  font-weight:850;
  text-align:right;
  font-variant-numeric:tabular-nums;
}

.video-note-live-wrap{
  position:relative;
  width:min(76vw,310px);
  aspect-ratio:1;
  margin:2px auto 14px;
  overflow:hidden;
  border-radius:50%;
  background:
    radial-gradient(circle at 30% 20%,rgba(125,92,255,.13),transparent 32%),
    #05080e;
  box-shadow:
    0 24px 70px rgba(0,0,0,.40),
    0 0 0 1px rgba(255,255,255,.08);
}

.video-note-live-wrap video{
  width:100%;
  height:100%;
  object-fit:cover;
  transform:scaleX(-1);
  background:#05080e;
}

.video-note-recorder.rear-camera .video-note-live-wrap video{
  transform:none;
}

.video-note-live-ring{
  position:absolute;
  inset:5px;
  border:2px solid rgba(255,255,255,.08);
  border-radius:50%;
  pointer-events:none;
}

.video-note-recorder.recording .video-note-live-ring{
  border-color:rgba(255,104,130,.50);
  box-shadow:
    inset 0 0 22px rgba(255,90,120,.09),
    0 0 24px rgba(255,90,120,.13);
  animation:videoNoteRing 1.2s ease-in-out infinite;
}

@keyframes videoNoteRing{
  50%{opacity:.5}
}

.video-note-live-state{
  position:absolute;
  left:50%;
  bottom:20px;
  transform:translateX(-50%);
  padding:5px 9px;
  border-radius:999px;
  background:rgba(5,9,16,.44);
  color:#c4cfdd;
  font-size:8px;
  font-weight:800;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}

.video-note-recorder-actions{
  display:grid;
  grid-template-columns:1fr 82px 1fr;
  align-items:center;
  gap:10px;
}

.video-note-recorder-actions>button{
  border:0;
  background:transparent;
  color:#7d8ca1;
}

.video-note-flip,
.video-note-cancel{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  font-size:7px;
}

.video-note-flip span,
.video-note-cancel span{
  width:39px;
  height:39px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.065);
  border-radius:14px;
  background:rgba(255,255,255,.035);
  color:#a8b5c6;
  font-size:17px;
}

.video-note-record-main{
  width:76px;
  height:76px;
  justify-self:center;
  display:grid;
  place-items:center;
  border:2px solid rgba(255,255,255,.22)!important;
  border-radius:50%;
  background:rgba(255,255,255,.06)!important;
  box-shadow:0 12px 34px rgba(0,0,0,.18);
}

.video-note-record-main>span{
  width:58px;
  height:58px;
  display:block;
  border-radius:50%;
  background:linear-gradient(145deg,#ff778f,#ea526f);
  transition:.16s ease;
}

.video-note-recorder.recording .video-note-record-main>span{
  width:30px;
  height:30px;
  border-radius:9px;
}

.video-note-recorder-hint{
  margin-top:10px;
  color:#64748a;
  font-size:8px;
  text-align:center;
}

.video-note-attach .mobile-attach-icon{
  background:
    linear-gradient(135deg,rgba(255,104,130,.13),rgba(125,92,255,.14))!important;
  color:#ffabb8!important;
}

@media(max-width:760px){
  .video-note{
    width:min(220px,64vw);
    height:min(220px,64vw);
  }

  .video-note-recorder{
    align-items:flex-end;
  }
}

@media(min-width:761px){
  .video-note-recorder{
    align-items:center;
    justify-content:center;
  }

  .video-note-recorder-card{
    width:min(420px,94vw);
    border-radius:28px;
    border-bottom:1px solid rgba(255,255,255,.09);
  }
}


/* ==========================================================
   NOVA 5.2 · Composer Gesture Mode
   ========================================================== */

.record-icon-video-note{
  display:none;
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
}

.record-btn.video-note-mode .record-icon-mic{
  display:none!important;
}

.record-btn.video-note-mode .record-icon-video-note{
  display:block!important;
}

.record-btn:not(.recording) .record-icon-stop{
  display:none!important;
}

@media(max-width:760px){
  .composer .send,
  .composer .record-btn{
    transition:
      transform .15s ease,
      opacity .15s ease,
      background .15s ease,
      color .15s ease;
  }

  .composer-action-hidden{
    display:none!important;
  }

  .record-btn{
    position:relative;
    color:#98a7bb!important;
    touch-action:none!important;
  }

  .record-btn.video-note-mode{
    color:#ff9faf!important;
    background:
      linear-gradient(135deg,rgba(255,100,130,.08),rgba(125,92,255,.08))!important;
  }

  .record-btn.video-note-mode::after{
    content:"";
    position:absolute;
    right:5px;
    top:5px;
    width:5px;
    height:5px;
    border-radius:50%;
    background:#ff758d;
    box-shadow:0 0 10px rgba(255,117,141,.55);
  }

  .record-btn.composer-swipe-armed{
    transform:translateY(-10px) scale(1.06);
    color:#e8e4ff!important;
    background:rgba(125,92,255,.16)!important;
    box-shadow:
      0 10px 24px rgba(86,67,220,.16),
      0 0 0 1px rgba(155,139,255,.10);
  }

  .composer-record-gesture-hint{
    position:fixed;
    z-index:61000;
    right:12px;
    bottom:calc(74px + env(safe-area-inset-bottom));
    display:flex;
    align-items:center;
    gap:7px;
    padding:8px 10px;
    border:1px solid rgba(255,255,255,.07);
    border-radius:13px;
    background:rgba(17,25,40,.76);
    color:#7f8fa5;
    font-size:8px;
    font-weight:800;
    box-shadow:0 12px 34px rgba(0,0,0,.20);
    backdrop-filter:blur(22px);
    -webkit-backdrop-filter:blur(22px);
    pointer-events:none;
    opacity:0;
    transform:translateY(8px);
    transition:.14s ease;
  }

  .composer-record-gesture-hint.visible{
    opacity:1;
    transform:none;
  }

  .composer-record-gesture-hint.ready{
    color:#ded8ff;
    border-color:rgba(139,120,255,.15);
    background:rgba(72,58,128,.72);
  }

  .composer-record-gesture-hint strong{
    color:#a99cff;
    font-size:13px;
  }

  /* A cleaner send state when there is text */
  #sendBtn:not(.composer-action-hidden){
    animation:novaSendAppear .16s ease;
  }

  @keyframes novaSendAppear{
    from{opacity:.2;transform:scale(.78)}
    to{opacity:1;transform:scale(1)}
  }
}


/* ==========================================================
   NOVA 5.3.1 · iOS Stability Hotfix
   ========================================================== */
.profile-edit-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.profile-edit-head h3{margin:0}

@media(max-width:760px){
  html,body{
    overscroll-behavior:none;
  }

  button,a,input,textarea{
    -webkit-tap-highlight-color:transparent;
  }

  button{
    touch-action:manipulation;
  }

  #recordBtn{
    touch-action:none!important;
  }

  #profileModal .modal-card{
    position:relative;
    width:calc(100% - 16px)!important;
    max-height:calc(100dvh - 16px)!important;
    margin:8px!important;
    padding-top:12px!important;
  }

  #profileModal .profile-edit-head{
    position:sticky;
    top:0;
    z-index:8;
    flex:0 0 auto;
    padding:2px 0 10px;
    background:linear-gradient(180deg,rgba(16,24,39,.98) 72%,rgba(16,24,39,0));
  }

  #profileModal .profile-edit-grid{
    min-height:0;
    overflow-y:auto!important;
    -webkit-overflow-scrolling:touch;
  }

  #profileModal .modal-actions{
    position:sticky;
    bottom:0;
    z-index:8;
    flex:0 0 auto;
    padding-top:10px;
    background:linear-gradient(0deg,rgba(16,24,39,.98) 72%,rgba(16,24,39,0));
  }

  #closeProfileTop{
    display:grid!important;
    flex:0 0 38px;
  }

  .modal.hidden,
  .mobile-message-sheet.hidden,
  .mobile-attach-sheet.hidden,
  .mobile-record-overlay.hidden,
  .video-note-recorder.hidden{
    pointer-events:none!important;
  }

  body.nova-touch-reset *,
  body.nova-touch-reset *::before,
  body.nova-touch-reset *::after{
    transition-duration:.01ms!important;
  }
}


/* NOVA 5.3.2 · private chat open hotfix */
@media(max-width:760px){
  .profile-mini-action:disabled{
    opacity:.42!important;
    pointer-events:none!important;
  }
}


/* ==========================================================
   NOVA 5.6 · Hold / Slide / Lock recorder
   ========================================================== */
@media(max-width:760px){
  #recordBtn{
    position:relative!important;
    touch-action:none!important;
    -webkit-user-select:none!important;
    user-select:none!important;
    -webkit-touch-callout:none!important;
  }

  #recordBtn.nova-record-holding{
    transform:scale(1.08)!important;
    background:rgba(125,92,255,.16)!important;
    color:#eeeaff!important;
    box-shadow:0 0 0 7px rgba(125,92,255,.07),0 12px 34px rgba(0,0,0,.2)!important;
  }

  #recordBtn.nova-record-cancel{
    transform:translateX(-10px) scale(.96)!important;
    color:#ff8fa3!important;
    background:rgba(251,113,133,.12)!important;
  }

  #recordBtn.nova-record-lock{
    transform:translateY(-10px) scale(1.05)!important;
    color:#c9bdff!important;
    background:rgba(125,92,255,.16)!important;
  }

  .mobile-record-overlay{
    pointer-events:none!important;
  }

  .mobile-record-overlay .mobile-record-card{
    pointer-events:none!important;
  }

  .mobile-record-overlay.locked{
    pointer-events:auto!important;
  }

  .mobile-record-overlay.locked .mobile-record-card,
  .mobile-record-overlay.locked .mobile-record-actions,
  .mobile-record-overlay.locked button{
    pointer-events:auto!important;
  }

  .mobile-record-overlay:not(.locked) .mobile-record-actions{
    display:none!important;
  }

  .mobile-record-overlay.locked .mobile-record-hint::before{
    content:"⌁ ";
    color:#a99cff;
  }

  .mobile-record-actions{
    grid-template-columns:1fr 1fr 1.15fr!important;
  }

  .mobile-record-pause{
    border:1px solid rgba(255,255,255,.055);
    background:rgba(255,255,255,.035);
    color:#c7d0dc;
  }

  .mobile-record-overlay.paused .mobile-record-dot{
    animation:none!important;
    opacity:.4;
  }

  .mobile-record-overlay.cancel-ready .mobile-record-hint{
    color:#ff9aad!important;
  }

  .mobile-record-overlay.lock-ready .mobile-record-hint{
    color:#b8aaff!important;
  }

  .video-note-recorder.gesture-recording .video-note-recorder-actions{
    opacity:.18;
    pointer-events:none;
  }

  .video-note-recorder.gesture-recording.locked .video-note-recorder-actions{
    opacity:1;
    pointer-events:auto;
  }

  .video-note-recorder.gesture-recording:not(.locked) #videoNoteClose,
  .video-note-recorder.gesture-recording:not(.locked) #videoNoteFlip,
  .video-note-recorder.gesture-recording:not(.locked) #videoNoteCancel{
    pointer-events:none!important;
  }
}


/* ==========================================================
   NOVA 5.6 · Messaging Polish
   ========================================================== */
.mobile-quick-reactions{
  display:flex;align-items:center;justify-content:space-between;gap:6px;
  margin:0 3px 9px;padding:7px;border:1px solid rgba(255,255,255,.055);
  border-radius:16px;background:rgba(255,255,255,.022);
}
.mobile-quick-reactions button{
  width:42px;height:42px;display:grid;place-items:center;flex:1 1 0;min-width:0;
  padding:0;border:1px solid transparent;border-radius:13px;background:transparent;
  font-size:20px;line-height:1;
}
.mobile-quick-reactions button:active,.mobile-quick-reactions button.mine{
  transform:scale(.94);background:rgba(125,92,255,.13);border-color:rgba(143,124,255,.18);
}
.voice-speed{
  height:24px;min-width:31px;margin-left:auto;padding:0 7px;
  border:1px solid rgba(255,255,255,.055);border-radius:999px;
  background:rgba(255,255,255,.035);color:#9eacc0;font-size:8px;font-weight:850;
}
.voice-speed:active{transform:scale(.95)}
.reply.clickable-reply{
  position:relative;padding-left:10px!important;border-left:2px solid rgba(145,126,255,.52)!important;
  background:rgba(125,92,255,.055)!important;
}
.reply.clickable-reply::after{content:"↗";float:right;margin-left:8px;color:#8072bc;font-size:8px}
.message-row.mobile-swipe-ready .bubble{
  box-shadow:0 0 0 1px rgba(140,120,255,.18),0 12px 30px rgba(0,0,0,.18)!important;
}
@media(max-width:760px){
  .mobile-message-actions{grid-template-columns:repeat(4,1fr)!important}
  .mobile-message-actions button{min-height:62px!important}
  .selection-bar{gap:6px!important;padding-left:8px!important;padding-right:8px!important}
  .selection-count{min-width:68px;font-size:8px!important}
  .selection-actions{gap:4px!important;overflow-x:auto;scrollbar-width:none}
  .selection-actions::-webkit-scrollbar{display:none}
  .selection-actions button{flex:0 0 auto;min-width:38px}
  #selectAllBtn{padding-left:9px!important;padding-right:9px!important}
  .replybar{border-left:2px solid rgba(145,126,255,.42)!important}
  .replybar #replyName{color:#afa4ff!important}
}


/* ==========================================================
   NOVA 5.6 · Media Hub 2.0
   ========================================================== */
.media-hub-group{
  margin-bottom:18px;
}
.media-hub-group-title{
  position:sticky;
  top:0;
  z-index:3;
  width:max-content;
  margin:2px 0 8px;
  padding:5px 9px;
  border:1px solid rgba(255,255,255,.055);
  border-radius:999px;
  background:rgba(12,19,31,.88);
  color:#76859a;
  font-size:8px;
  font-weight:850;
  backdrop-filter:blur(16px);
}
.media-hub-circle-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(116px,1fr));
  gap:12px;
}
.media-hub-circle{
  position:relative;
  aspect-ratio:1;
  display:grid;
  place-items:center;
  overflow:hidden;
  padding:0;
  border:1px solid rgba(255,255,255,.075);
  border-radius:50%;
  background:#05080e;
  box-shadow:0 14px 34px rgba(0,0,0,.24);
}
.media-hub-circle video{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}
.media-hub-circle::after{
  content:"▶";
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  color:#fff;
  font-size:17px;
  text-shadow:0 2px 10px #000;
  background:radial-gradient(circle,rgba(0,0,0,.16),transparent 48%);
}
.media-hub-circle-meta{
  position:absolute;
  left:50%;
  bottom:7px;
  z-index:2;
  transform:translateX(-50%);
  max-width:80%;
  padding:3px 7px;
  border-radius:999px;
  background:rgba(4,7,12,.6);
  color:#dbe3ed;
  font-size:7px;
  white-space:nowrap;
  backdrop-filter:blur(10px);
}
.shared-video-notes{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
}
.shared-video-note{
  position:relative;
  width:82px;
  height:82px;
  flex:0 0 82px;
  overflow:hidden;
  padding:0;
  border:1px solid rgba(255,255,255,.075);
  border-radius:50%;
  background:#05080e;
}
.shared-video-note video{
  width:100%;
  height:100%;
  object-fit:cover;
}
.shared-video-note::after{
  content:"▶";
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  color:white;
  font-size:13px;
  text-shadow:0 2px 8px #000;
}
.media-tab .media-count{
  display:inline-grid;
  place-items:center;
  min-width:16px;
  height:16px;
  margin-left:4px;
  padding:0 4px;
  border-radius:999px;
  background:rgba(255,255,255,.05);
  color:#738197;
  font-size:7px;
}
.media-tab.active .media-count{
  background:rgba(125,92,255,.12);
  color:#c7beff;
}
.media-hub-row .hub-voice-play{
  flex:0 0 auto;
  min-width:42px;
}
@media(max-width:760px){
  .media-hub-tabs{
    overflow-x:auto!important;
    flex-wrap:nowrap!important;
    scrollbar-width:none;
  }
  .media-hub-tabs::-webkit-scrollbar{display:none}
  .media-hub-tabs .media-tab{
    flex:0 0 auto;
  }
  .media-hub-circle-grid{
    grid-template-columns:repeat(3,1fr);
    gap:9px;
  }
  .media-hub-circle-meta{
    bottom:5px;
    font-size:6px;
  }
}


/* NOVA 6.1 · единая система окон */
.nova-modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.nova-modal-head h3{
  margin:0;
}
.nova-modal-head .muted{
  margin-top:4px;
  font-size:10px;
}
body.nova-modal-open{
  overflow:hidden;
}
.modal{
  overscroll-behavior:contain;
}
.modal-card{
  position:relative;
}
@media (max-width:760px){
  .nova-modal-head{
    position:sticky;
    top:-1px;
    z-index:8;
    padding:2px 0 9px;
    background:linear-gradient(180deg,rgba(14,22,36,.98) 75%,rgba(14,22,36,0));
    backdrop-filter:blur(12px);
  }
  .nova-modal-head .chat-info-close{
    flex:0 0 auto;
  }
}


/* NOVA 6.2 · видеосообщение: круговой таймер и приятное раскрытие */
.video-note-recorder .video-note-preview,
.video-note-recorder .video-note-stage{
  position:relative;
}
#videoNoteRecordTime{
  position:absolute;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  z-index:12;
  min-width:58px;
  height:30px;
  padding:0 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:rgba(5,9,16,.62);
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 8px 28px rgba(0,0,0,.28);
  backdrop-filter:blur(12px);
  color:#fff;
  font-size:11px;
  font-weight:900;
  font-variant-numeric:tabular-nums;
  letter-spacing:.04em;
  pointer-events:none;
}
.video-note-ring{
  position:absolute;
  inset:-7px;
  z-index:8;
  border-radius:50%;
  pointer-events:none;
  background:conic-gradient(#9b87ff var(--nova-progress,0deg),rgba(255,255,255,.12) 0deg);
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 4px),#000 calc(100% - 3px));
  mask:radial-gradient(farthest-side,transparent calc(100% - 4px),#000 calc(100% - 3px));
  filter:drop-shadow(0 0 8px rgba(139,114,255,.25));
  transition:background .16s linear;
}
.video-note{
  transition:width .24s ease,height .24s ease,transform .24s ease,filter .24s ease;
}
.video-note.nova-video-note-playing{
  width:min(330px,72vw)!important;
  height:min(330px,72vw)!important;
  transform:translateZ(0) scale(1.02);
  filter:drop-shadow(0 16px 34px rgba(0,0,0,.28));
}
@media(max-width:760px){
  .video-note.nova-video-note-playing{
    width:min(300px,78vw)!important;
    height:min(300px,78vw)!important;
  }
}


/* NOVA 6.2.1 · кастомный видеосообщение без нативного HTML5-контролбара */
.video-note{
  position:relative;
  cursor:pointer;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
}
.video-note video{
  pointer-events:none;
}
.video-note .nova-circle-play{
  position:absolute;
  inset:0;
  margin:auto;
  width:62px;
  height:62px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:rgba(15,20,42,.58);
  border:1px solid rgba(255,255,255,.10);
  box-shadow:0 10px 30px rgba(0,0,0,.25);
  backdrop-filter:blur(12px);
  color:#fff;
  font-size:24px;
  line-height:1;
  transition:transform .18s ease,opacity .18s ease,background .18s ease;
  z-index:5;
}
.video-note:hover .nova-circle-play{
  transform:scale(1.05);
  background:rgba(24,31,62,.7);
}
.video-note.nova-video-note-playing .nova-circle-play{
  opacity:0;
  transform:scale(.88);
}
.video-note .nova-circle-progress{
  position:absolute;
  inset:-5px;
  border-radius:50%;
  z-index:4;
  pointer-events:none;
  background:conic-gradient(#8b72ff var(--nova-play-progress,0deg),rgba(255,255,255,.10) 0deg);
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 2px));
  mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 2px));
  filter:drop-shadow(0 0 7px rgba(139,114,255,.22));
}
.video-note .nova-circle-time{
  position:absolute;
  left:50%;
  bottom:13px;
  transform:translateX(-50%);
  z-index:6;
  min-width:44px;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(6,10,18,.58);
  border:1px solid rgba(255,255,255,.10);
  backdrop-filter:blur(10px);
  color:#fff;
  font-size:10px;
  font-weight:900;
  font-variant-numeric:tabular-nums;
  text-align:center;
  pointer-events:none;
}
.video-note.nova-video-note-playing .nova-circle-time{
  opacity:.86;
}


/* NOVA 6.2.2 · настоящий фикс прогресса видеосообщениеа */
.video-note .video-note-progress,
.video-note .video-note-time,
.video-note .video-note-toggle{
  display:none!important;
}

.video-note .nova-circle-progress{
  inset:4px!important;
  z-index:7!important;
  border-radius:50%;
  background:
    conic-gradient(
      from -90deg,
      #6ea8ff 0deg,
      #9b78ff var(--nova-play-progress,0deg),
      rgba(255,255,255,.13) var(--nova-play-progress,0deg),
      rgba(255,255,255,.13) 360deg
    )!important;
  -webkit-mask:radial-gradient(
    farthest-side,
    transparent calc(100% - 4px),
    #000 calc(100% - 3px)
  )!important;
  mask:radial-gradient(
    farthest-side,
    transparent calc(100% - 4px),
    #000 calc(100% - 3px)
  )!important;
  filter:drop-shadow(0 0 5px rgba(139,114,255,.3));
}

.video-note .nova-circle-play{
  z-index:8!important;
}

.video-note .nova-circle-time{
  z-index:9!important;
  bottom:14px!important;
  min-width:52px;
  padding:5px 9px;
  font-size:10px;
  background:rgba(5,9,16,.62);
  border:1px solid rgba(255,255,255,.12);
}

.video-note.nova-video-note-playing .nova-circle-play{
  opacity:0!important;
  pointer-events:none;
}


/* NOVA 6.3 · качество и плавность медиа */
.voice-wave,.voice-bar,.voice-progress,.video-note,.nova-circle-progress{
  transition:
    transform .18s ease,
    opacity .18s ease,
    filter .18s ease,
    width .22s ease,
    height .22s ease,
    background .14s linear;
}
.voice-wave{transform:translateZ(0)}
.video-note video{
  transform:translateZ(0);
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
}
.video-note.nova-video-note-playing{will-change:width,height,transform}
.voice-play{
  display:grid;
  place-items:center;
  overflow:hidden;
}
.voice-play .nova-voice-icon{
  position:relative;
  display:block;
  width:16px;
  height:16px;
}
.voice-play .nova-voice-icon.play::before{
  content:'';
  position:absolute;
  left:3px;
  top:1px;
  width:0;
  height:0;
  border-top:7px solid transparent;
  border-bottom:7px solid transparent;
  border-left:11px solid currentColor;
}
.voice-play .nova-voice-icon.pause::before,
.voice-play .nova-voice-icon.pause::after{
  content:'';
  position:absolute;
  top:1px;
  width:5px;
  height:14px;
  border-radius:3px;
  background:currentColor;
}
.voice-play .nova-voice-icon.pause::before{left:2px}
.voice-play .nova-voice-icon.pause::after{right:2px}
.voice-play:active{transform:scale(.96)}


/* NOVA 6.4 · polished message actions */
#contextMenu.message-context-rich{
  width:260px;
  max-width:calc(100vw - 18px);
  padding:8px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.09);
  border-radius:18px;
  background:
    radial-gradient(circle at 82% 0%,rgba(125,92,255,.12),transparent 34%),
    rgba(12,19,31,.94);
  box-shadow:0 22px 70px rgba(0,0,0,.42);
  backdrop-filter:blur(28px) saturate(135%);
  -webkit-backdrop-filter:blur(28px) saturate(135%);
}
.message-context-preview{
  margin:0 0 7px;
  padding:9px 10px;
  border:1px solid rgba(255,255,255,.055);
  border-radius:13px;
  background:rgba(255,255,255,.025);
}
.message-context-preview b{
  display:block;
  margin-bottom:4px;
  overflow:hidden;
  color:#aaa0ff;
  font-size:9px;
  font-weight:850;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.message-context-preview span{
  display:block;
  overflow:hidden;
  color:#93a0b3;
  font-size:9px;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.message-context-reactions{
  display:grid;
  grid-template-columns:repeat(6,1fr);
  gap:4px;
  margin-bottom:7px;
}
#contextMenu.message-context-rich .message-context-reactions button{
  width:100%;
  height:34px;
  min-height:34px;
  padding:0;
  display:grid;
  place-items:center;
  border-radius:10px;
  text-align:center;
  font-size:16px;
}
#contextMenu.message-context-rich .message-context-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
}
#contextMenu.message-context-rich .message-context-actions button{
  min-height:40px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:7px 9px;
  border-radius:11px;
}
#contextMenu.message-context-rich .message-context-actions button>span:first-child{
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  flex:0 0 22px;
  border-radius:8px;
  background:rgba(255,255,255,.04);
  color:#cfd7e5;
  font-size:12px;
}
#contextMenu.message-context-rich .message-context-actions button.danger{
  color:#ff9bad;
}
#contextMenu.message-context-rich .message-context-actions button.danger>span:first-child{
  background:rgba(251,113,133,.08);
  color:#ff9bad;
}
.message-row .bubble{
  transition:transform .14s ease,box-shadow .14s ease,background .14s ease;
}
.message-row.nova-message-pressed .bubble{
  transform:scale(.988);
}
@media(max-width:760px){
  .mobile-message-sheet-preview{
    border-color:rgba(125,92,255,.10)!important;
    background:linear-gradient(135deg,rgba(125,92,255,.06),rgba(255,255,255,.018))!important;
  }
  .mobile-message-actions button:active,
  .mobile-quick-reactions button:active{
    transform:scale(.96);
  }
}
