@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input,
textarea,
[contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

img,
video {
    -webkit-user-drag: none;
}

svg {
    pointer-events: none;
}

a,
button,
[onclick],
.chat-item,
.ctx-item,
.sidebar-dropdown-item,
.search-result-item,
.gift-card {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255, 255, 255, .05);
}

a img,
button img,
[onclick] img,
.chat-item img {
    pointer-events: auto;
}

@media print {
    body {
        display: none !important;
    }
}

:root {
    --bg-primary: #0F1117;
    --bg-secondary: rgba(22, 24, 35, 0.75);
    --bg-tertiary: rgba(30, 33, 48, 0.65);
    --bg-chat: #0F1117;
    --bg-glass: rgba(22, 24, 35, 0.6);
    --bg-glass-light: rgba(255, 255, 255, 0.04);
    --bg-glass-card: rgba(22, 24, 35, 0.7);
    --bg-message-own: #6366F1;
    --bg-message-other: rgba(30, 33, 48, 0.8);
    --bg-input: rgba(22, 24, 35, 0.8);
    --text-primary: #F0F2F5;
    --text-secondary: #9CA3B0;
    --text-muted: #5C6370;
    --accent: #818CF8;
    --accent-hover: #A5B4FC;
    --accent-light: rgba(129, 140, 248, 0.12);
    --accent-glow: rgba(129, 140, 248, 0.25);
    --danger: #F87171;
    --danger-hover: #FCA5A5;
    --success: #34D399;
    --warning: #FBBF24;
    --border: rgba(255, 255, 255, 0.07);
    --border-light: rgba(255, 255, 255, 0.04);
    --border-accent: rgba(129, 140, 248, 0.2);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glass: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(129, 140, 248, 0.15);
    --blur: blur(16px);
    --blur-heavy: blur(32px);
    --radius-sm: 12px;
    --radius-md: 14px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;
    --transition: 0.2s cubic-bezier(.4, 0, .2, 1);
    --transition-slow: 0.3s cubic-bezier(.4, 0, .2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --online: #34D399;
    --developer-badge: #FBBF24;
    --nft-badge: #A78BFA;
    --star-color: #FBBF24;
    --gift-glow: rgba(251, 191, 36, 0.15);
}

/* ═══════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════ */

html,
body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(99, 102, 241, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 70%, rgba(139, 92, 246, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 50% 30% at 50% 10%, rgba(129, 140, 248, 0.04) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
    letter-spacing: -0.01em;
}

.icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
}

.icon-svg svg {
    display: block;
}

a {
    color: #FFFFFF;
    text-decoration: none;
    transition: opacity var(--transition);
}

a:hover {
    opacity: 0.7;
}

input,
textarea,
button,
select {
    font-family: var(--font);
    font-size: 14px;
}

::selection {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ═══════════════════════════════════════════
   AUTH
   ═══════════════════════════════════════════ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    overflow: auto;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 40px 32px;
    animation: fadeIn 0.3s ease;
}

/* Verification Code Input */
.verification-code-input {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
}

.verification-code-input input {
    width: 56px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    font-family: var(--font);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
    caret-color: #fff;
}

.verification-code-input input:focus {
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.verification-code-input input::placeholder {
    color: var(--text-muted);
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 6px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color var(--transition);
}

.form-input:focus {
    border-color: rgba(255, 255, 255, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input-prefix {
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color var(--transition);
}

.form-input-prefix:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
}

.form-input-prefix span {
    padding: 12px 0 12px 14px;
    color: var(--text-secondary);
    font-size: 15px;
}

.form-input-prefix .form-input {
    border: none;
    background: transparent;
    padding-left: 4px;
}

.form-input-prefix .form-input:focus {
    box-shadow: none;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
}

.form-error.active {
    display: block;
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    outline: none;
    text-decoration: none;
    line-height: 1;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #818CF8, #A78BFA);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: rgba(30, 33, 48, 0.6);
    color: var(--text-primary);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.btn-secondary:hover {
    background: rgba(129, 140, 248, 0.1);
    border-color: var(--border-accent);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--border-accent);
    background: rgba(129, 140, 248, 0.06);
    box-shadow: var(--shadow-glow);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-danger:active {
    transform: scale(0.97);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.btn-icon:hover {
    color: var(--accent-hover);
    background: rgba(129, 140, 248, 0.1);
}

/* ═══════════════════════════════════════════
   MESSENGER LAYOUT
   ═══════════════════════════════════════════ */

.messenger-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ═══════════════════════════════════════════
   SIDEBAR — Chat List
   ═══════════════════════════════════════════ */

.sidebar {
    width: 340px;
    min-width: 340px;
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(129, 140, 248, 0.08);
    display: flex;
    flex-direction: column;
    height: 100vh;
    transition: transform 0.2s ease;
}

.sidebar-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(129, 140, 248, 0.06);
    min-height: 56px;
}

.sidebar-menu-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 20px;
}

.sidebar-menu-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-search {
    flex: 1;
    position: relative;
}

.sidebar-search input {
    width: 100%;
    padding: 9px 14px 9px 36px;
    background: rgba(129, 140, 248, 0.06);
    border: 1px solid rgba(129, 140, 248, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--transition);
}

.sidebar-search input:focus {
    border-color: rgba(129, 140, 248, 0.3);
    background: rgba(129, 140, 248, 0.1);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.08);
}

.sidebar-search input::placeholder {
    color: var(--text-muted);
}

.sidebar-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

/* Chat List */
.chat-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    border-left: 2px solid transparent;
    border-radius: 0;
}

.chat-item:hover {
    background: rgba(129, 140, 248, 0.06);
    border-left-color: rgba(129, 140, 248, 0.3);
}

.chat-item.active {
    background: rgba(129, 140, 248, 0.1);
    border-left-color: var(--accent);
    box-shadow: inset 0 0 30px rgba(129, 140, 248, 0.05);
}

.chat-item-avatar {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.chat-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.online-badge {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background: var(--online);
    border: 2px solid var(--bg-primary);
    border-radius: var(--radius-full);
}

.chat-item-info {
    flex: 1;
    min-width: 0;
}

.chat-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}

.chat-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
}

.chat-item-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.chat-item-message-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.chat-item-message {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    line-height: 1.3;
}

.chat-unread-badge {
    min-width: 18px;
    height: 18px;
    background: #FFFFFF;
    color: #000000;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    flex-shrink: 0;
}

/* User Badges */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-premium {
    background: rgba(234, 179, 8, 0.1);
    color: var(--developer-badge);
}

.badge-developer {
    background: rgba(234, 179, 8, 0.1);
    color: var(--developer-badge);
}

.badge-nft {
    background: rgba(167, 139, 250, 0.1);
    color: var(--nft-badge);
}

.badge-admin {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.badge-system {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   CHAT AREA
   ═══════════════════════════════════════════ */

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    position: relative;
}

.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0.25;
}

.chat-empty-icon {
    font-size: 48px;
}

.chat-empty-icon svg {
    opacity: 0.5;
}

.chat-empty span {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Chat Header */
.chat-header {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    min-height: 56px;
    z-index: 10;
}

.chat-header-back {
    display: none;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition);
}

.chat-header-back:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.chat-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    overflow: hidden;
}

.chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-header-info {
    flex: 1;
}

.chat-header-name {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.chat-header-status {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.06) transparent;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 65%;
    animation: msgIn 0.15s ease both;
}

.message-own {
    align-self: flex-end;
    align-items: flex-end;
}

.message-other {
    align-self: flex-start;
    align-items: flex-start;
}

.message-bubble {
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    position: relative;
}

.message-own .message-bubble {
    background: var(--bg-tertiary);
    border-radius: 14px 14px 4px 14px;
}

.message-own .message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -5px;
    width: 10px;
    height: 10px;
    background: var(--bg-tertiary);
    clip-path: polygon(0 0, 0% 100%, 100% 100%);
}

.message-other .message-bubble {
    background: var(--bg-secondary);
    border-radius: 14px 14px 14px 4px;
}

.message-other .message-bubble::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -5px;
    width: 10px;
    height: 10px;
    background: var(--bg-secondary);
    clip-path: polygon(100% 0, 0% 100%, 100% 100%);
}

.message-sender {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.message-content {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    justify-content: flex-end;
    font-variant-numeric: tabular-nums;
}

.message-date-divider {
    text-align: center;
    padding: 16px 0;
}

.message-date-divider span {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    padding: 4px 14px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Input */
.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(129, 140, 248, 0.08);
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: rgba(15, 17, 23, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.chat-input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.chat-input {
    width: 100%;
    background: rgba(129, 140, 248, 0.06);
    border: 1px solid rgba(129, 140, 248, 0.1);
    border-radius: 14px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    resize: none;
    min-height: 42px;
    max-height: 140px;
    line-height: 1.45;
    transition: all var(--transition);
    font-family: var(--font);
}

.chat-input:focus {
    border-color: rgba(129, 140, 248, 0.35);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.08);
    background: rgba(129, 140, 248, 0.08);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    border: none;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.send-btn:hover {
    background: #E0E0E0;
}

.send-btn:active {
    transform: scale(0.92);
}

.send-btn svg {
    color: #000000 !important;
    fill: #000000 !important;
}

/* Typing */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--bg-secondary);
    border-radius: 14px 14px 14px 4px;
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.4s ease infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.15s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    background: rgba(22, 24, 35, 0.85);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid rgba(129, 140, 248, 0.12);
    border-radius: var(--radius-xl);
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(129, 140, 248, 0.05);
    animation: modalIn 0.2s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.modal-body {
    padding: 16px 24px 24px;
}

/* ═══════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════ */

.settings-page {
    min-height: 100vh;
    background: var(--bg-primary);
}

.settings-sidebar {
    width: 260px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.settings-header {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.settings-header h2 {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.settings-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.settings-section-title {
    padding: 14px 20px 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background var(--transition);
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.settings-item-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.settings-item-label {
    flex: 1;
    font-size: 14px;
}

.settings-item-value {
    font-size: 13px;
    color: var(--text-muted);
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition);
    border-left: 2px solid transparent;
}

.settings-nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.settings-nav-item.active {
    color: var(--text-primary);
    border-left-color: #FFFFFF;
    background: rgba(255, 255, 255, 0.04);
}

/* Settings Page (Full) */
.settings-page {
    min-height: 100vh;
    background: var(--bg-primary);
    padding-bottom: 80px;
}

.settings-page .settings-content {
    max-width: 560px;
    margin: 0 auto;
    padding: 16px;
}

.settings-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 20px;
}

.settings-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.settings-avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.settings-avatar {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-secondary);
    overflow: hidden;
    flex-shrink: 0;
}

.settings-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Session History */
.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.session-item:last-child {
    border-bottom: none;
}

.session-info {
    flex: 1;
    min-width: 0;
}

.session-ip {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.session-ua {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-date {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    animation: fadeIn 0.2s ease;
    font-family: var(--font);
}

.toast.success {
    background: var(--bg-secondary);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.toast.error {
    background: var(--bg-secondary);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* NFT Card Styles */
.nft-card {
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    transition: all var(--transition);
}

.nft-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.nft-card .card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 120px;
}

.nft-card .card-icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

/* ═══════════════════════════════════════════
   BOTTOM NAV (Mobile)
   ═══════════════════════════════════════════ */

.bottom-nav {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(15, 17, 23, 0.8);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border-top: 1px solid rgba(129, 140, 248, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 200;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(129, 140, 248, 0.05);
    flex-shrink: 0;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 14px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-muted);
    transition: color .2s ease, transform .15s ease;
    border-radius: 12px;
    position: relative;
    min-width: 56px;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:hover {
    color: var(--accent-hover);
    background: rgba(129, 140, 248, 0.08);
}

.bottom-nav-item.active {
    color: var(--accent);
}

.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

.bottom-nav-item.active .bottom-nav-icon {
    transform: scale(1.1);
}

.bottom-nav-icon {
    font-size: 22px;
    line-height: 1;
    transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}

.bottom-nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.bottom-nav-badge {
    position: absolute;
    top: 0;
    right: 6px;
    min-width: 18px;
    height: 18px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.has-bottom-nav .messenger-layout {
    height: 100vh;
}

.has-bottom-nav .sidebar {
    height: 100vh;
    border-right: none;
}

.has-bottom-nav .messenger-layout .chat-area {
    display: none;
}

.has-bottom-nav .messenger-layout.chat-open .sidebar {
    display: none;
}

.has-bottom-nav .messenger-layout.chat-open .chat-area {
    display: flex;
    height: 100vh;
}

/* ═══════════════════════════════════════════
   PROFILE
   ═══════════════════════════════════════════ */

.has-bottom-nav .profile-page {
    min-height: calc(100vh - 64px);
    padding-bottom: 20px;
}

.profile-page {
    min-height: 100vh;
    background: var(--bg-primary);
    overflow-y: auto;
}

.profile-header {
    position: relative;
    background: var(--bg-primary);
    padding: 0;
    border-bottom: 1px solid rgba(129, 140, 248, 0.08);
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.profile-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    position: relative;
    z-index: 2;
}

.profile-back-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition);
}

.profile-back-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.profile-edit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    font-family: var(--font);
}

.profile-edit-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.profile-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 20px 28px;
    position: relative;
    z-index: 2;
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 14px;
    overflow: hidden;
    transition: transform var(--transition);
}

.profile-avatar-large:hover {
    transform: scale(1.04);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name-section {
    text-align: center;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: -0.03em;
}

.profile-status-text {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.profile-status-dot {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-full);
    background: var(--online);
}

.profile-content {
    padding: 0;
}

.profile-info-card {
    background: rgba(22, 24, 35, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(129, 140, 248, 0.08);
    border-radius: var(--radius-lg);
    margin: 12px 16px;
    padding: 0;
    overflow: hidden;
}

.profile-info-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(129, 140, 248, 0.06);
    transition: background var(--transition);
    cursor: default;
}

.profile-info-item:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.profile-info-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.profile-info-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.profile-info-content {
    flex: 1;
    min-width: 0;
}

.profile-info-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
    margin-bottom: 2px;
}

.profile-info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 400;
}

.profile-info-value.text {
    color: var(--text-secondary);
}

.profile-info-extra {
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: 13px;
}

.profile-info-also {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.profile-section-title {
    padding: 24px 20px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-top: 6px solid rgba(255, 255, 255, .03);
}

.profile-action-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(129, 140, 248, 0.06);
    background: transparent;
}

.profile-action-item:last-child {
    border-bottom: 1px solid rgba(129, 140, 248, 0.06);
}

.profile-action-item:hover {
    background: rgba(129, 140, 248, 0.06);
    padding-left: 24px;
}

.profile-action-item.danger {
    color: var(--danger);
}

.profile-action-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--accent);
}

.profile-action-label {
    flex: 1;
    font-size: 14px;
}

.profile-action-value {
    font-size: 13px;
    color: var(--text-muted);
}

.profile-stars-card {
    margin: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all var(--transition);
}

.profile-stars-card:hover {
    background: var(--bg-tertiary);
}

.profile-stars-icon {
    font-size: 28px;
}

.profile-stars-info {
    flex: 1;
}

.profile-stars-amount {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.profile-stars-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.profile-stars-arrow {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   ADMIN
   ═══════════════════════════════════════════ */

.admin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.admin-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition);
    border-left: 2px solid transparent;
}

.admin-nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.admin-nav-item.active {
    color: #FFFFFF;
    border-left-color: #FFFFFF;
    background: rgba(255, 255, 255, 0.04);
}

.admin-nav-item .icon {
    width: 20px;
    text-align: center;
}

/* ═══════════════════════════════════════════
   SIDEBAR DROPDOWN
   ═══════════════════════════════════════════ */

.sidebar-dropdown {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
    animation: slideDown 0.15s ease both !important;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: none;
    padding: 4px 0;
}

.sidebar-dropdown.active {
    display: block;
}

.sidebar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background var(--transition);
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
}

.sidebar-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-dropdown-item .icon {
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.sidebar-dropdown-sep {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════
   CHANNELS
   ═══════════════════════════════════════════ */

.channel-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all var(--transition);
}

.channel-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.channel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.channel-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    overflow: hidden;
}

.channel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ═══════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════ */

.toast-msg {
    border-radius: 10px !important;
    padding: 10px 18px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
}

/* ═══════════════════════════════════════════
   ONLINE PULSE
   ═══════════════════════════════════════════ */

.online-badge {
    animation: onlinePulse 3s ease infinite;
}

@keyframes onlinePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 0 3px rgba(34, 197, 94, 0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* ═══════════════════════════════════════════
   MARKETPLACE
   ═══════════════════════════════════════════ */

.marketplace-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: all var(--transition);
    cursor: pointer;
}

.marketplace-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
    .messenger-layout {
        position: relative;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        transition: transform .25s ease;
    }

    .messenger-layout .chat-area {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10;
        display: flex;
    }

    .messenger-layout:not(.chat-open) .chat-area {
        z-index: 5;
    }

    .messenger-layout.chat-open .sidebar {
        transform: translateX(-100%);
        pointer-events: none;
    }

    .messenger-layout.chat-open .chat-area {
        z-index: 25;
    }

    .chat-header-back {
        display: flex;
    }

    .chat-header {
        padding: 8px 12px;
        min-height: 52px;
    }

    .chat-header-actions {
        gap: 2px;
    }

    .chat-header-actions .btn-icon {
        width: 34px;
        height: 34px;
    }

    .chat-item {
        padding: 12px 16px;
        min-height: 64px;
    }

    .chat-item-avatar {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .chat-item-name {
        font-size: 15px;
    }

    .chat-item-preview {
        font-size: 13px;
    }

    .messages-container {
        padding: 12px 10px;
        -webkit-overflow-scrolling: touch;
    }

    .message {
        max-width: 85%;
    }

    .message-bubble {
        padding: 8px 12px;
        font-size: 15px;
    }

    .chat-input-area {
        padding: 6px 8px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
        gap: 4px;
    }

    .chat-input-area .btn-icon {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .chat-input {
        font-size: 16px !important;
    }

    .send-btn {
        width: 40px;
        height: 40px;
    }

    .sidebar-search input {
        font-size: 16px;
    }

    .has-bottom-nav.messenger-body .bottom-nav {
        display: flex;
    }

    .messenger-layout.chat-open~.bottom-nav,
    .chat-open~.bottom-nav {
        display: none !important;
    }

    .settings-sidebar {
        display: none;
    }

    .admin-sidebar {
        display: none;
    }

    .modal {
        max-width: 95vw;
        margin: 0 auto;
    }
}

@media (min-width: 769px) {
    .has-bottom-nav .messenger-layout .chat-area {
        display: flex !important;
    }

    .has-bottom-nav .messenger-layout .sidebar {
        display: flex !important;
    }
}

/* ─── Override defaults for avatar gradient ─── */
.chat-item-avatar,
.profile-avatar-large {
    background: var(--bg-tertiary) !important;
}

/* ═══════════════════════════════════════════
   CONTACTS PAGE
   ═══════════════════════════════════════════ */

.contacts-page {
    min-height: 100vh;
    background: var(--bg-primary);
    padding-bottom: 80px;
}

.contacts-header {
    padding: 20px 20px 12px;
    border-bottom: 1px solid var(--border);
}

.contacts-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.contacts-search {
    padding: 12px 16px;
}

.contacts-search input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    font-family: var(--font);
    transition: border-color var(--transition);
}

.contacts-search input:focus {
    border-color: rgba(255, 255, 255, 0.15);
}

.contacts-search input::placeholder {
    color: var(--text-muted);
}

.contacts-list {
    padding: 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.contact-item:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.contact-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: -0.01em;
}

.contact-phone {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.contact-status {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.contact-status.online {
    color: var(--success);
}

/* ═══════════════════════════════════════════
   CHANNELS PAGE
   ═══════════════════════════════════════════ */

.channels-page {
    min-height: 100vh;
    background: var(--bg-primary);
    padding-bottom: 80px;
}

.channels-header {
    padding: 20px 20px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.channels-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.channels-list {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.channel-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

/* ═══════════════════════════════════════════
   LOADING & EMPTY STATES
   ═══════════════════════════════════════════ */

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.loading-spinner::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--text-secondary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ═══════════════════════════════════════════
   MARKETPLACE EXTRA
   ═══════════════════════════════════════════ */

.market-header {
    padding: 20px 20px 12px;
    border-bottom: 1px solid var(--border);
}

.market-header h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.market-tabs {
    display: flex;
    gap: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}

.market-tabs::-webkit-scrollbar {
    display: none;
}

.market-tab {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font);
}

.market-tab:hover {
    color: var(--text-primary);
}

.market-tab.active {
    color: #FFFFFF;
    border-bottom-color: #FFFFFF;
}

.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    padding: 16px;
}

/* ═══════════════════════════════════════════
   BADGE EXTRAS
   ═══════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.badge-developer {
    background: rgba(234, 179, 8, 0.1);
    color: var(--developer-badge);
}

.badge-admin {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.badge-system {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   RATE TICKER (Marketplace)
   ═══════════════════════════════════════════ */

.rate-ticker {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border);
}

.rate-ticker::-webkit-scrollbar {
    display: none;
}

.rate-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   MOBILE RESPONSIVE FIXES
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
    }

    .messenger-layout .chat-area {
        display: none;
    }

    .messenger-layout.chat-open .sidebar {
        display: none;
    }

    .messenger-layout.chat-open .chat-area {
        display: flex;
    }

    .chat-header-back {
        display: flex;
    }

    .settings-sidebar {
        display: none;
    }

    .admin-sidebar {
        display: none;
    }

    .profile-stars-card {
        margin: 12px;
    }

    .market-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 12px;
        gap: 6px;
    }

    .modal {
        width: 94%;
        max-width: none;
        border-radius: 14px;
    }

    .contacts-page {
        padding-bottom: 70px;
    }

    .channels-page {
        padding-bottom: 70px;
    }

    .profile-page {
        padding-bottom: 70px;
    }

    body.has-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .messages-container {
        padding: 12px 14px;
    }

    .message {
        max-width: 80%;
    }
}

@media (min-width: 769px) {
    .has-bottom-nav .messenger-layout .chat-area {
        display: flex !important;
    }

    .has-bottom-nav .messenger-layout .sidebar {
        display: flex !important;
    }
}

@media (max-width: 480px) {
    .bottom-nav-item {
        padding: 6px 10px;
        min-width: 50px;
    }

    .bottom-nav-label {
        font-size: 9px;
    }

    .chat-header {
        padding: 10px 14px;
    }

    .chat-input-area {
        padding: 8px 10px;
    }

    .contact-item {
        padding: 10px 14px;
    }

    .market-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
}

/* ═══════════════════════════════════════════
   EXTRA UTILITY STYLES
   ═══════════════════════════════════════════ */

/* Settings Back Button */
.settings-back {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all var(--transition);
    flex-shrink: 0;
}

.settings-back:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

/* Tab Buttons */
.tab-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: #FFFFFF;
    color: #000000;
    border-color: #FFFFFF;
}

/* Rate Ticker Items */
.rate-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s ease infinite;
    flex-shrink: 0;
}

.rate-icon {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.rate-val {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* Select Input Styling */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B6B6B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

select.form-input option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Textarea */
textarea.form-input {
    min-height: 80px;
    line-height: 1.5;
}

/* Form Prefix */
.form-prefix {
    color: var(--text-secondary);
    font-size: 15px;
    padding-left: 14px;
    flex-shrink: 0;
}

/* Profile Edit Btn group fix */
.profile-edit-btn .icon-svg {
    display: inline-flex;
}

/* Stars Modal */
.stars-modal-balance {
    text-align: center;
    padding: 24px 0;
}

.stars-modal-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--star-color);
    letter-spacing: -0.03em;
}

.stars-modal-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Marketplace Card Inline Styles Override */
.marketplace-listing {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition);
}

.marketplace-listing:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Audio Player */
audio {
    filter: invert(1) brightness(0.8);
    border-radius: 8px;
}

/* Profile Buttons Inline Override */
.profile-header-top .btn-icon {
    color: rgba(255, 255, 255, 0.6);
}

.profile-header-top .btn-icon:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Wallpaper Item Active */
.wallpaper-item.active {
    border-color: #FFFFFF;
}

/* ═══════════════════════════════════════════
   MARKETPLACE TABS (.mp-tab)
   ═══════════════════════════════════════════ */

.mp-tab {
    padding: 7px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    white-space: nowrap;
}

.mp-tab:hover {
    color: var(--text-primary);
}

.mp-tab.active {
    background: #FFFFFF;
    color: #000000;
    border-color: #FFFFFF;
}

/* Sell Type Buttons */
.sell-type-btn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}

.sell-type-btn.active {
    background: #FFFFFF;
    color: #000000;
    border-color: #FFFFFF;
}

/* tg-modal fallback */
.tg-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

/* ═══════════════════════════════════════════
   ADMIN PANEL FULL STYLING
   ═══════════════════════════════════════════ */

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

.admin-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding-top: 0;
}

.admin-sidebar-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.admin-sidebar-header h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.admin-sidebar-header p {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition);
    border-left: 2px solid transparent;
    cursor: pointer;
}

.admin-nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.admin-nav-item.active {
    color: #FFFFFF;
    border-left-color: #FFFFFF;
    background: rgba(255, 255, 255, 0.04);
}

.admin-nav-item .icon {
    width: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    max-width: 900px;
}

.admin-content h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

/* Admin Stat Cards */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.admin-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}

.admin-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.admin-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Admin Tables */
.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.admin-table th {
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.admin-table td {
    padding: 10px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.admin-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.admin-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════
   PROFILE MOBILE FIX
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {
    .profile-header {
        min-height: 200px;
    }

    .profile-avatar-large {
        width: 80px;
        height: 80px;
        font-size: 30px;
    }

    .profile-name {
        font-size: 20px;
    }

    .profile-header-top {
        padding: 10px 14px;
    }

    .profile-edit-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .profile-info-item {
        padding: 11px 14px;
    }

    .profile-info-label {
        font-size: 10px;
    }

    .profile-info-value {
        font-size: 13px;
    }

    .profile-stars-card {
        margin: 10px;
        padding: 14px 16px;
    }

    .profile-stars-amount {
        font-size: 20px;
    }

    .profile-action-item {
        padding: 11px 14px;
    }
}

@media (max-width: 480px) {
    .profile-header {
        min-height: 180px;
    }

    .profile-avatar-large {
        width: 72px;
        height: 72px;
        font-size: 26px;
    }

    .profile-name {
        font-size: 18px;
    }

    .profile-avatar-section {
        padding: 4px 14px 20px;
    }
}

/* ═══════════════════════════════════════════
   ADMIN EXTRA (logo, card, buttons)
   ═══════════════════════════════════════════ */

.admin-logo {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}

.admin-logo h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.admin-logo span {
    font-size: 11px;
    color: var(--text-muted);
}

.admin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.admin-nav {
    padding: 8px 0;
    flex: 1;
}

/* Button variants */
.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 8px;
}

/* Form Error */
.form-error {
    color: var(--danger);
    font-size: 12px;
    margin-bottom: 10px;
    min-height: 16px;
}

/* Code element */
code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Checkbox dark */
input[type="checkbox"] {
    accent-color: #fff;
    width: 16px;
    height: 16px;
}

/* Admin responsive */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .admin-nav {
        display: flex;
        overflow-x: auto;
        scrollbar-width: none;
        padding: 8px;
        gap: 4px;
    }

    .admin-nav::-webkit-scrollbar {
        display: none;
    }

    .admin-nav-item {
        padding: 8px 14px;
        white-space: nowrap;
        border-left: none;
        border-bottom: 2px solid transparent;
        font-size: 13px;
    }

    .admin-nav-item.active {
        border-left-color: transparent;
        border-bottom-color: #fff;
    }

    .admin-content {
        padding: 16px;
    }
}

/* ═══════════════════════════════════════════
   GIFT STATUS EMOJI
   ═══════════════════════════════════════════ */

.gift-status-emoji {
    font-size: 18px;
    animation: giftPulse 3s ease-in-out infinite;
}

@keyframes giftPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* ═══════════════════════════════════════════
   IMPROVED GLOBAL DIVIDERS
   ═══════════════════════════════════════════ */

.settings-section {
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.settings-section:last-child {
    border-bottom: none;
}

/* Chat list subtle separators */
.chat-item+.chat-item {
    border-top: 1px solid rgba(255, 255, 255, .03);
}

/* Session item dividers */
.session-item+.session-item {
    border-top: 1px solid rgba(255, 255, 255, .06);
}

/* ═══════════════════════════════════════════
   GLOBAL MOBILE OPTIMIZATION
   ═══════════════════════════════════════════ */

@media (max-width: 768px) {

    /* Messenger sidebar full width on mobile */
    .messenger-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        border-right: none;
    }

    /* Chat area full width */
    .chat-area {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
    }

    /* Chat header mobile */
    .chat-header {
        padding: 10px 12px;
    }

    /* Input area mobile */
    .chat-input-area {
        padding: 8px 12px;
    }

    .chat-input {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    /* Contacts mobile */
    .contacts-header {
        padding: 14px 16px 10px;
    }

    .contacts-header h2 {
        font-size: 18px;
    }

    /* Settings mobile */
    .settings-header {
        padding: 14px 16px !important;
    }

    .settings-section {
        padding: 14px 16px !important;
    }

    /* Generic spacing */
    .profile-stars-card {
        border-radius: 0;
        margin: 0 !important;
        border-left: none;
        border-right: none;
    }

    /* Make fonts hit area larger */
    .profile-action-item {
        padding: 16px 18px;
        min-height: 48px;
    }

    .profile-info-item {
        padding: 14px 18px;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .contacts-search {
        padding: 8px 12px;
    }

    .contact-item {
        padding: 10px 14px;
    }

    .profile-action-item {
        padding: 14px 16px;
        gap: 12px;
    }

    .profile-action-label {
        font-size: 14px;
    }
}

/* ═══════════════════════════════════════════
   PRIVACY TOGGLE SWITCHES
   ═══════════════════════════════════════════ */

.privacy-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    transition: background .15s ease;
}

.privacy-toggle:last-child {
    border-bottom: none;
}

.privacy-toggle:hover {
    background: rgba(255, 255, 255, .02);
}

.privacy-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.privacy-toggle-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.privacy-toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, .1);
    border-radius: 24px;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: rgba(255, 255, 255, .5);
    border-radius: 50%;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

.toggle-switch input:checked+.toggle-slider {
    background: #fff;
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
    background: #000;
}

/* ═══════════════════════════════════════════
   STRIVERDEV-INSPIRED DESIGN POLISH
   ═══════════════════════════════════════════ */

/* Smooth hover reveals on cards */
.profile-info-card,
.profile-stars-card,
.settings-section {
    transition: transform .2s ease, box-shadow .2s ease;
}

.profile-stars-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
}

/* Buttons — smooth press effect */
.btn-primary,
.btn-secondary,
.btn {
    transition: all .15s cubic-bezier(.4, 0, .2, 1);
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.97);
}

/* Gift grid items — subtle scale on hover */
.gift-grid-item {
    transition: transform .2s ease, box-shadow .2s ease;
}

.gift-grid-item:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}

/* Channel cards — hover lift */
.ch-card {
    transition: transform .15s ease, background .12s ease, box-shadow .15s ease;
}

.ch-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

/* Settings section headers */
.settings-section h3 {
    padding: 16px 20px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Improved input fields — clean focus ring */
.form-input:focus {
    border-color: rgba(255, 255, 255, .2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .04);
}

/* Post cards — hover lift */
.post-card {
    transition: transform .15s ease, box-shadow .15s ease;
}

.post-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

/* Contact items — smooth reveal */
.contact-item {
    transition: background .12s ease, transform .12s ease;
}

.contact-item:active {
    transform: scale(0.99);
}

/* Chat items — active pulse */
.chat-item {
    transition: background .12s ease, border-left-color .15s ease;
}

/* Message bubbles — subtle shadow */
.message-bubble {
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

/* Scrollbar refinement */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .14);
}

/* Modal backdrop — smoother */
.modal-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Modal entrance — polished */
@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Send button — glow on hover */
.send-btn:hover {
    box-shadow: 0 0 16px rgba(255, 255, 255, .15);
}

/* Bottom nav — refined shadows */
.bottom-nav {
    box-shadow: 0 -1px 20px rgba(0, 0, 0, .4);
}

/* Profile Gift Collapsible */
.gift-grid-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}

.gift-grid-collapsible.active {
    max-height: 480px;
    overflow-y: auto;
    transition: max-height 0.4s ease-out;
}

.gift-grid-collapsible::-webkit-scrollbar {
    width: 4px;
}

.gift-grid-collapsible::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .1);
    border-radius: 4px;
}

.gift-arrow {
    display: inline-flex;
    transition: transform 0.3s cubic-bezier(0.1, 0.7, 0.1, 1);
}

.gift-arrow.active {
    transform: rotate(90deg);
}

.gift-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: max-content;
    gap: 10px;
    align-content: start;
}

@media (max-width: 480px) {
    .gift-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .gift-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.gift-grid-item {
    position: relative;
    aspect-ratio: 1/1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.gift-grid-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.gift-grid-item:active {
    transform: scale(0.94);
}

.gift-grid-icon {
    width: 60%;
    height: 60%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-grid-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.gift-from-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    z-index: 2;
}

.gift-serial-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

/* 403 Page Styles */
.error-page-403 {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background: var(--bg-primary);
}

.error-403-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s infinite ease-in-out;
}

.error-403-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.error-403-text {
    color: var(--text-secondary);
    max-width: 300px;
    line-height: 1.5;
    margin-bottom: 30px;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ═══════════════════════════════════════════════════════
   PREMIUM ANIMATIONS 2026
   ═══════════════════════════════════════════════════════ */

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.99);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

body {
    animation: pageIn .4s cubic-bezier(.25, .46, .45, .94) both;
}

@keyframes listIn {
    from {
        opacity: 0;
        transform: translateX(-8px) translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

.chat-item,
.contact-item,
.channel-card,
.search-result-item,
.profile-info-item,
.marketplace-item,
.gift-card {
    animation: listIn .35s cubic-bezier(.25, .46, .45, .94) both;
}

.chat-item:nth-child(1) {
    animation-delay: 0s;
}

.chat-item:nth-child(2) {
    animation-delay: .03s;
}

.chat-item:nth-child(3) {
    animation-delay: .06s;
}

.chat-item:nth-child(4) {
    animation-delay: .09s;
}

.chat-item:nth-child(5) {
    animation-delay: .12s;
}

.chat-item:nth-child(6) {
    animation-delay: .15s;
}

.chat-item:nth-child(7) {
    animation-delay: .18s;
}

.chat-item:nth-child(8) {
    animation-delay: .21s;
}

.chat-item:nth-child(n+9) {
    animation-delay: .24s;
}

@keyframes msgInLeft {
    from {
        opacity: 0;
        transform: translateX(-16px) scale(.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes msgInRight {
    from {
        opacity: 0;
        transform: translateX(16px) scale(.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.message,
.msg-bubble {
    animation: msgInLeft .3s cubic-bezier(.25, .46, .45, .94) both;
}

.message.own,
.msg-bubble.own,
.message-own {
    animation-name: msgInRight;
}

button,
.adm-btn,
.rpt-btn,
.btn,
[onclick] {
    transition: transform .1s cubic-bezier(.25, .46, .45, .94), background .2s ease, border-color .2s ease, box-shadow .2s ease, opacity .15s ease;
    will-change: transform;
}

button:active,
.adm-btn:active,
.rpt-btn:active,
.btn:active {
    transform: scale(.93);
    transition-duration: .06s;
}

.bottom-nav {
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), opacity .3s ease;
}

.bottom-nav-item {
    transition: color .2s ease, transform .2s cubic-bezier(.34, 1.56, .64, 1), background .2s ease;
}

.bottom-nav-item:active {
    transform: scale(.85);
    transition-duration: .08s;
}

.bottom-nav-item.active .bottom-nav-icon {
    transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
    transform: scale(1.15);
}

.chat-item,
.gift-card,
.nft-card,
.nft-admin-card,
.channel-card,
.adm-stat,
.mod-stat,
.rpt-card,
.frozen-row,
.marketplace-item,
.profile-info-item,
.profile-info-card {
    transition: transform .25s cubic-bezier(.25, .46, .45, .94), box-shadow .25s ease, border-color .25s ease, background .2s ease;
    will-change: transform;
}

.chat-item:hover {
    transform: translateX(3px);
    background: rgba(59, 130, 246, .04);
}

.chat-item.active {
    background: rgba(59, 130, 246, .08);
    border-left-color: var(--accent);
}

.gift-card:hover,
.nft-card:hover,
.channel-card:hover,
.marketplace-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, .3);
}

.adm-stat:hover,
.mod-stat:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .25);
    border-color: rgba(59, 130, 246, .2);
}

.nft-admin-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}

.profile-info-item:hover {
    background: rgba(255, 255, 255, .03);
    transform: translateX(2px);
}

.chat-item-avatar,
.usr-ava,
.avatar,
.profile-avatar-large {
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease;
}

.chat-item-avatar:hover,
.usr-ava:hover,
.avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

@keyframes breathe {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 211, 153, .5);
    }

    50% {
        transform: scale(1.2);
        box-shadow: 0 0 6px 2px rgba(52, 211, 153, .3);
    }
}

.online-badge,
.profile-status-dot.online {
    animation: breathe 2.5s ease-in-out infinite;
}

@keyframes overlayFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSpring {
    0% {
        opacity: 0;
        transform: scale(.85) translateY(30px);
    }

    60% {
        transform: scale(1.02) translateY(-4px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.umod-overlay.open,
.modal-overlay.open,
.gift-modal.active,
.nft-popup.active,
.report-modal.active {
    animation: overlayFade .25s ease both;
}

.umod-overlay.open .umod,
.modal-overlay.open .modal {
    animation: modalSpring .4s cubic-bezier(.175, .885, .32, 1.275) both;
}

.adm-tab,
.mod-tab {
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s cubic-bezier(.34, 1.56, .64, 1);
}

.adm-tab:active,
.mod-tab:active {
    transform: scale(.92);
}

.adm-tab.active,
.mod-tab.active {
    transform: scale(1.02);
}

input,
textarea,
select,
.adm-input,
.adm-select,
.mod-note-input {
    transition: border-color .2s ease, box-shadow .25s ease, background .2s ease, transform .15s ease;
}

input:focus,
textarea:focus,
select:focus,
.adm-input:focus,
.mod-note-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
    border-color: rgba(59, 130, 246, .4);
}

@keyframes toastBounce {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px) scale(.9);
    }

    70% {
        transform: translate(-50%, -3px) scale(1.02);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

.adm-toast.show,
.mod-toast.show {
    animation: toastBounce .4s cubic-bezier(.175, .885, .32, 1.275) both;
}

@keyframes softPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.12);
    }
}

.badge-count,
.bottom-nav-badge {
    animation: softPulse 2.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton,
.loading-placeholder {
    background: linear-gradient(105deg, var(--bg-tertiary) 0%, rgba(59, 130, 246, .06) 40%, rgba(59, 130, 246, .1) 50%, rgba(59, 130, 246, .06) 60%, var(--bg-tertiary) 100%);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

.gift-bubble {
    transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease;
}

.gift-bubble:hover {
    transform: scale(1.15) translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
}

.adm-section,
.mod-section {
    transition: opacity .25s ease;
}

.adm-section.active,
.mod-section.active {
    animation: pageIn .3s cubic-bezier(.25, .46, .45, .94) both;
}

html {
    scroll-behavior: smooth;
}

a {
    transition: color .2s ease, opacity .2s ease;
}

.adm-tbl tr {
    transition: background .2s ease;
}

.adm-tbl tr:hover {
    background: rgba(59, 130, 246, .04);
}

::selection {
    background: rgba(59, 130, 246, .25);
    color: #fff;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, .15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, .3);
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── NFT UNIQUE ANIMATIONS ── */
@keyframes nftFloat1 {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    33% {
        transform: translateY(-3px) rotate(2deg) scale(1.02);
    }

    66% {
        transform: translateY(-1px) rotate(-1deg) scale(.98);
    }
}

@keyframes nftFloat2 {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    50% {
        transform: translateY(-5px) rotate(-3deg) scale(1.04);
    }
}

@keyframes nftFloat3 {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-4px) scale(0.96);
    }
}

@keyframes nftSpin {
    0% {
        transform: rotate(0deg) translateY(0);
    }

    50% {
        transform: rotate(5deg) translateY(-2px);
    }

    100% {
        transform: rotate(0deg) translateY(0);
    }
}