/* --- ПЕРЕМЕННЫЕ И ТЕМЫ --- */
        :root {
            --bg: #030303;
            --surface: #0a0a0c;
            --card: rgba(17, 17, 20, 0.85); /* Матовое стекло */
            --border: #1f1f23;
            --accent: #10b981; 
            --accent-glow: rgba(16, 185, 129, 0.25); /* Теперь обновляется через JS */
            --danger: #ef4444;
            --text: #ffffff;
            --text-dim: #71717a;
            --header-bg: rgba(3, 3, 3, 0.7);
            --input-bg: rgba(0, 0, 0, 0.5);
            --sidebar-bg: #0c0c0e;
            --room-hover: rgba(255, 255, 255, 0.05);
            --shadow: 0 10px 40px rgba(0,0,0,0.5);
            --glass: blur(15px);
            --transition: all 0.3s ease;
        }

        body.light-theme {
            --bg: #f8fafc;
            --surface: #ffffff;
            --card: rgba(255, 255, 255, 0.85);
            --border: #e2e8f0;
            --text: #0f172a;
            --text-dim: #64748b;
            --header-bg: rgba(255, 255, 255, 0.85);
            --input-bg: rgba(241, 245, 249, 0.7);
            --sidebar-bg: #f8fafc;
            --room-hover: rgba(0, 0, 0, 0.05);
            --shadow: 0 4px 25px rgba(0,0,0,0.04);
        }

        /* --- БАЗОВЫЕ СТИЛИ --- */
        * { box-sizing: border-box; -webkit-font-smoothing: antialiased; outline: none; }
        ::-webkit-scrollbar { width: 5px; height: 5px; }
        ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--accent); }

        body { 
            background-color: var(--bg); color: var(--text); 
            font-family: 'Plus Jakarta Sans', sans-serif; margin: 0; 
            overflow-x: hidden; transition: background-color 0.4s, color 0.4s; 
        }
        .container { max-width: 1200px; margin: 0 auto; padding: 0 30px; }

        /* --- ШАПКА И НАВИГАЦИЯ --- */
        header { 
            background: var(--header-bg); backdrop-filter: var(--glass); 
            border-bottom: 1px solid var(--border); position: sticky; 
            top: 0; z-index: 1000; transition: var(--transition); 
        }
        .header-inner { display: flex; justify-content: space-between; align-items: center; height: 90px; }
        .brand-box { display: flex; align-items: center; gap: 15px; cursor: pointer; transition: var(--transition); }
        .radar-svg { width: 44px; height: 44px; filter: drop-shadow(0 0 12px var(--accent-glow)); }

        .nav-tabs { display: flex; gap: 8px; background: var(--input-bg); padding: 5px; border-radius: 16px; border: 1px solid var(--border); transition: var(--transition); }
        .tab-link { padding: 10px 24px; border-radius: 12px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--text-dim); transition: var(--transition); border: none; background: transparent; position: relative; }
        .tab-link.active { color: var(--text); background: var(--border); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
        .tab-link:hover { color: var(--text); }
        
        .btn-create { color: var(--accent); background: var(--accent-glow); }
        .btn-create:hover { background: var(--accent); color: #fff; }

        .notif-badge { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; background: var(--danger); border-radius: 50%; display: none; box-shadow: 0 0 12px var(--danger); animation: pulse 2s infinite; }
        @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

        .profile-section { display: flex; align-items: center; gap: 10px; }
        .theme-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); font-size: 16px; }
        .theme-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
        
        .user-pill { display: flex; align-items: center; gap: 10px; background: var(--surface); padding: 6px 15px 6px 8px; border-radius: 30px; border: 1px solid var(--border); transition: var(--transition); cursor: pointer; }
        .user-pill:hover { border-color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
        .user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #000; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }

        /* --- КАТЕГОРИИ (Обновленный скролл) --- */
        .category-scroller { display: flex; gap: 12px; margin: 30px 0; overflow-x: auto; padding-bottom: 10px; }
        .category-scroller::-webkit-scrollbar { height: 4px; }
        
        .cat-card { 
            background: var(--card); border: 1px solid var(--border); padding: 12px 20px; 
            border-radius: 14px; cursor: pointer; white-space: nowrap; transition: var(--transition); 
            font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; 
            color: var(--text-dim); backdrop-filter: var(--glass);
        }
        .cat-card i { color: var(--accent); font-size: 18px; transition: var(--transition); }
        .cat-card:hover, .cat-card.active { background: var(--accent); color: #000; border-color: var(--accent); box-shadow: 0 5px 15px var(--accent-glow); }
        .cat-card:hover i, .cat-card.active i { color: #000; }

        /* --- ПОИСК --- */
        .search-container { margin-bottom: 30px; width: 100%; }
        .search-bar-wrapper { position: relative; display: flex; align-items: center; }
        .search-icon { position: absolute; left: 20px; color: var(--text-dim); font-size: 16px; z-index: 5; pointer-events: none; }
        .text-search-input { 
            width: 100%; background: var(--card); border: 1px solid var(--border); color: var(--text); 
            padding: 18px 20px 18px 50px; border-radius: 20px; font-family: inherit; font-size: 15px; 
            transition: var(--transition); box-shadow: var(--shadow); backdrop-filter: var(--glass);
            -webkit-appearance: none;
            appearance: none;
        }
        .text-search-input:focus { border-color: var(--accent); box-shadow: 0 0 15px var(--accent-glow); }

        /* --- КАРТОЧКИ ОБЪЯВЛЕНИЙ --- */
        .glass-card { background: var(--card); border: 1px solid var(--border); border-radius: 24px; padding: 30px; box-shadow: var(--shadow); backdrop-filter: var(--glass); transition: var(--transition); }
        .feed-container { max-width: 900px; margin: 0 auto; }
        
        .post-card { background: var(--card); border: 1px solid var(--border); border-radius: 24px; display: grid; grid-template-columns: 320px 1fr; overflow: hidden; margin-bottom: 25px; box-shadow: var(--shadow); backdrop-filter: var(--glass); transition: var(--transition); }
        .post-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 15px 35px var(--accent-glow); }
        .post-img { width: 100%; height: 100%; object-fit: cover; border-right: 1px solid var(--border); transition: var(--transition); }
        .post-info { padding: 30px; display: flex; flex-direction: column; justify-content: space-between; }
        
        .post-header-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; transition: var(--transition); }
        .post-actions { display: flex; gap: 5px; }
        .action-icon-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; transition: 0.2s; font-size: 16px; padding: 5px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
        .action-icon-btn:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); }
        .action-icon-btn.check-btn:hover { color: var(--accent); background: var(--accent-glow); }

        .badge { font-size: 10px; font-weight: 800; padding: 6px 12px; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.5px; }
        .post-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
        .post-title-row h2 { margin: 0; font-size: 20px; line-height: 1.3; color: var(--text); transition: var(--transition); }
        .post-price { color: var(--accent); font-size: 22px; font-weight: 800; white-space: nowrap; transition: var(--transition); }
        .post-desc { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin: 15px 0 5px 0; flex: 1; }
        .post-address-text { color: var(--text-dim); font-size: 12px; display: flex; align-items: center; gap: 5px; font-weight: 600; transition: var(--transition); }
        .post-footer { display: flex; justify-content: flex-end; margin-top: 15px; }

        /* --- ВВОД И КНОПКИ --- */
        .compact-input { background: var(--input-bg); border: 1px solid var(--border); color: var(--text); padding: 14px 18px; border-radius: 12px; width: 100%; font-family: inherit; font-size: 14px; transition: var(--transition); }
        .compact-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
        textarea.compact-input { resize: none; height: 100px; }
        
        .btn-main { background: var(--accent); color: #000; padding: 16px 24px; border-radius: 12px; font-weight: 800; font-size: 14px; border: none; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
        .btn-main:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 20px var(--accent-glow); filter: brightness(1.1); }
        .btn-main:disabled { opacity: 0.6; cursor: not-allowed; }

        /* --- ПРОФИЛЬ --- */
        .profile-edit-avatar { width: 100px; height: 100px; border-radius: 50%; margin: 0 auto; position: relative; cursor: pointer; overflow: hidden; border: 3px solid var(--accent); box-shadow: 0 10px 25px var(--accent-glow); background: var(--surface); display: flex; align-items: center; justify-content: center; }
        .profile-edit-avatar img { width: 100%; height: 100%; object-fit: cover; z-index: 1; }
        .avatar-placeholder { font-size: 36px; font-weight: 800; color: var(--accent); z-index: 0; }
        .avatar-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; opacity: 0; transition: var(--transition); z-index: 2; }
        .profile-edit-avatar:hover .avatar-overlay { opacity: 1; }

        /* --- МЕССЕНДЖЕР --- */
        .messenger { display: grid; grid-template-columns: 320px 1fr; background: var(--card); border: 1px solid var(--border); border-radius: 24px; min-height: 600px; overflow: hidden; margin: 30px 0; box-shadow: var(--shadow); backdrop-filter: var(--glass); transition: var(--transition); }
        .chat-sidebar { background: var(--sidebar-bg); border-right: 1px solid var(--border); overflow-y: auto; transition: var(--transition); }
        .room-btn { padding: 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 15px; position: relative; }
        .room-btn:hover { background: var(--room-hover); }
        .room-btn.active { background: var(--room-hover); border-left: 4px solid var(--accent); }
        .unread-dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; position: absolute; right: 20px; box-shadow: 0 0 8px var(--accent); }
        .chat-view { display: flex; flex-direction: column; background: var(--bg); position: relative; transition: var(--transition); }
        .chat-header { padding: 20px 30px; border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 85px; transition: var(--transition); }
        .chat-msg-area { flex: 1; padding: 30px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
        
        .msg { max-width: 75%; padding: 12px 18px; border-radius: 16px; font-size: 14px; line-height: 1.5; position: relative; animation: slideUp 0.2s ease-out; }
        @keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        .msg.me { background: var(--accent); color: #000; align-self: flex-end; border-bottom-right-radius: 4px; }
        .msg.them { background: var(--card); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; color: var(--text); }
        .msg-time { font-size: 10px; opacity: 0.6; margin-top: 5px; display: block; text-align: right; color: inherit; }
        .chat-input-bar { padding: 20px; border-top: 1px solid var(--border); background: var(--surface); display: flex; gap: 15px; align-items: center; transition: var(--transition); }

        /* --- МОДАЛКИ --- */
        .modal-overlay { 
            position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
            background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); 
            z-index: 2000; display: flex; align-items: center; justify-content: center; 
            padding: 16px; box-sizing: border-box;
        }
        .modal-overlay .modal-content, .modal-overlay > .glass-card {
            max-height: calc(100vh - 32px); overflow-y: auto; 
            -webkit-overflow-scrolling: touch;
        }
        .modal-content { max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto; }
        .photo-area { border: 2px dashed var(--border); border-radius: 12px; padding: 30px 20px; text-align: center; cursor: pointer; transition: var(--transition); background: var(--input-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; }
        .photo-area:hover { border-color: var(--accent); background: var(--accent-glow); }
        #preview { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; display: none; margin-top: 15px; }

        footer { padding: 60px 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-dim); transition: var(--transition); font-size: 13px; }

        /* --- GOOGLE BUTTON --- */
        .btn-social-google {
            display: flex; align-items: center; justify-content: center; gap: 12px;
            width: 100%; padding: 14px 20px; border-radius: 14px;
            background: #fff; color: #1f1f1f; border: 1.5px solid #dadce0;
            font-size: 15px; font-weight: 700; cursor: pointer;
            transition: var(--transition); font-family: inherit; margin-bottom: 4px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }
        .btn-social-google:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.18); transform: translateY(-1px); border-color: #bbb; }

        /* --- БОКОВАЯ ПАНЕЛЬ (SLIDE) --- */
        #side-panel {
            position: fixed; top: 0; left: 0; height: 100vh; width: 300px;
            background: var(--sidebar-bg); z-index: 3000;
            transform: translateX(-100%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
            display: flex; flex-direction: column; overflow-y: auto;
            border-right: 2px solid transparent;
            background-clip: padding-box;
        }
        #side-panel.open { transform: translateX(0); }
        #side-panel::before {
            content: ''; position: absolute; top: 0; right: -2px; width: 2px; height: 100%;
            background: linear-gradient(180deg, transparent, var(--accent), transparent);
            box-shadow: 0 0 8px var(--accent); transition: var(--transition);
        }
        #side-trigger {
            position: fixed; left: 0; top: 50%; transform: translateY(-50%);
            width: 6px; height: 60px; z-index: 2999; cursor: pointer;
            background: var(--accent); border-radius: 0 6px 6px 0;
            opacity: 0.4; transition: opacity 0.3s;
        }
        #side-trigger:hover { opacity: 1; }
        .side-panel-header {
            padding: 28px 24px 16px; border-bottom: 1px solid var(--border);
            display: flex; align-items: center; justify-content: space-between;
        }
        .side-panel-logo { font-size: 18px; font-weight: 800; color: var(--accent); }
        .side-section { padding: 16px 20px 8px; }
        .side-section-title { font-size: 10px; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
        .side-btn {
            display: flex; align-items: center; gap: 14px; width: 100%;
            padding: 12px 14px; border-radius: 12px; border: none;
            background: transparent; color: var(--text); font-size: 14px; font-weight: 600;
            cursor: pointer; transition: var(--transition); text-align: left; font-family: inherit;
        }
        .side-btn:hover { background: var(--room-hover); color: var(--accent); }
        .side-btn i { width: 20px; text-align: center; color: var(--accent); font-size: 16px; }
        .side-btn.danger { color: var(--danger); }
        .side-btn.danger i { color: var(--danger); }
        .side-panel-footer { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--border); }

        /* --- НАСТРОЙКИ ПАНЕЛЬ --- */
        .settings-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 10px; margin-bottom: 4px; }
        .settings-row:hover { background: var(--room-hover); }
        .settings-label { font-size: 13px; font-weight: 600; color: var(--text); }
        .settings-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
        .range-input { width: 100%; accent-color: var(--accent); cursor: pointer; }
        .toggle-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
        .toggle-switch input { opacity: 0; width: 0; height: 0; }
        .toggle-slider { position: absolute; inset: 0; background: var(--border); border-radius: 24px; transition: 0.3s; cursor: pointer; }
        .toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s; }
        input:checked + .toggle-slider { background: var(--accent); }
        input:checked + .toggle-slider::before { transform: translateX(18px); }

        /* --- ПРЕМИУМ ОБЪЯВЛЕНИЕ --- */
        .post-card.premium {
            border-color: #f59e0b !important;
            box-shadow: 0 0 0 1px #f59e0b, 0 0 20px rgba(245,158,11,0.3), var(--shadow) !important;
            animation: premiumGlow 2.5s ease-in-out infinite alternate;
        }
        @keyframes premiumGlow {
            from { box-shadow: 0 0 8px rgba(245,158,11,0.3), 0 0 0 1px #f59e0b; }
            to   { box-shadow: 0 0 22px rgba(245,158,11,0.55), 0 0 0 1px #f59e0b; }
        }
        .premium-crown {
            position: absolute; top: 10px; left: 10px; z-index: 5;
            background: rgba(245,158,11,0.9); color: #000; font-size: 13px;
            padding: 4px 8px; border-radius: 8px; font-weight: 800;
            backdrop-filter: blur(4px);
        }

        /* --- СОРТИРОВКА --- */
        .sort-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
        .sort-btn {
            padding: 7px 14px; border-radius: 10px; border: 1px solid var(--border);
            background: var(--input-bg); color: var(--text-dim); font-size: 12px; font-weight: 700;
            cursor: pointer; transition: var(--transition); font-family: inherit;
        }
        .sort-btn:hover, .sort-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

        /* --- ТОКЕНЫ В КАРТОЧКЕ --- */
        .token-coins { display: inline-flex; align-items: center; position: relative; }
        .token-coin {
            width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
            border: 2px solid var(--bg); display: flex; align-items: center; justify-content: center;
            font-size: 10px; font-weight: 900; color: #000;
        }
        .token-coin:nth-child(2) { margin-left: -10px; }

        /* --- ЯЗЫК --- */
        .lang-btn {
            background: var(--surface); border: 1px solid var(--border); color: var(--text);
            padding: 6px 12px; border-radius: 10px; font-size: 12px; font-weight: 700;
            cursor: pointer; transition: var(--transition); font-family: inherit;
        }
        .lang-btn:hover { border-color: var(--accent); color: var(--accent); }

        /* --- TOAST --- */
        .toast {
            position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(80px);
            background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
            padding: 14px 24px; font-size: 14px; font-weight: 600; color: var(--text);
            z-index: 9999; transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
            opacity: 0; box-shadow: 0 8px 32px rgba(0,0,0,0.3); white-space: nowrap;
        }
        .toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
        .toast.success { border-color: var(--accent); color: var(--accent); }
        .toast.error { border-color: var(--danger); color: var(--danger); }

        /* --- ЭСКРОУ --- */
        .escrow-badge {
            display: inline-flex; align-items: center; gap: 6px;
            background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.4);
            border-radius: 8px; padding: 4px 10px; font-size: 11px; font-weight: 700; color: #818cf8;
        }

        /* --- ВЕЩИ РЯДОМ --- */
        .nearby-bar {
            display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
            background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px;
        }
        .nearby-bar select { background: var(--input-bg); border: 1px solid var(--border); color: var(--text); padding: 6px 10px; border-radius: 8px; font-size: 13px; font-family: inherit; }

        /* УБРАТЬ СТАРЫЕ СОЦСЕТИ */
        .social-login-grid, .btn-social { display: none !important; }
        .token-badge {
            display: inline-flex; align-items: center; gap: 6px;
            background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.05));
            border: 1px solid var(--accent); border-radius: 20px;
            padding: 5px 12px; font-size: 13px; font-weight: 700; color: var(--accent);
            cursor: default;
        }
        .token-icon {
            width: 18px; height: 18px; border-radius: 50%;
            background: var(--accent); display: flex; align-items: center; justify-content: center;
            font-size: 9px; font-weight: 900; color: #000;
        }
        .reputation-bar-wrap {
            margin: 10px 0 5px 0;
        }
        .reputation-bar-bg {
            height: 6px; background: var(--border); border-radius: 10px; overflow: hidden; margin-top: 5px;
        }
        .reputation-bar-fill {
            height: 100%; border-radius: 10px; transition: width 0.5s ease;
        }
        .rep-label {
            font-size: 11px; font-weight: 700; display: flex; justify-content: space-between; color: var(--text-dim);
        }
        /* --- ВХОД ЧЕРЕЗ СОЦСЕТИ --- */
        .social-divider {
            display: flex; align-items: center; gap: 12px; margin: 18px 0;
            color: var(--text-dim); font-size: 12px; font-weight: 600;
        }
        .social-divider::before, .social-divider::after {
            content: ''; flex: 1; height: 1px; background: var(--border);
        }
        .social-login-grid {
            display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px;
        }
        .btn-social {
            display: flex; align-items: center; justify-content: center; gap: 8px;
            padding: 11px 8px; border-radius: 12px; font-size: 13px; font-weight: 700;
            border: 1px solid var(--border); background: var(--input-bg); color: var(--text);
            cursor: pointer; transition: var(--transition); width: 100%;
        }
        .btn-social:hover { border-color: var(--accent); background: var(--accent-glow); transform: translateY(-1px); }
        .btn-social i { font-size: 16px; }
        .btn-social .fab.fa-google { color: #ea4335; }
        .btn-social .fab.fa-facebook { color: #1877f2; }
        .btn-social .fab.fa-github { color: var(--text); }
        .btn-social .fab.fa-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
        /* Rate-limit protection message */
        .rate-warn { font-size: 11px; color: var(--danger); margin-top: 6px; display: none; }
        /* Брутфорс защита: счётчик попыток */
        #auth-attempts-warn { font-size: 11px; color: var(--danger); margin: 4px 0; display: none; }

        @media (max-width: 1100px) { 
            .post-card, .messenger { grid-template-columns: 1fr; } 
            .header-inner { height: auto; padding: 15px 0; flex-wrap: wrap; gap: 15px; } 
            .nav-tabs { order: 3; width: 100%; justify-content: center; } 
            .post-img { height: 250px; border-right: none; border-bottom: 1px solid var(--border); }
            .chat-sidebar { max-height: 300px; }
        }

        /* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
        @media (max-width: 768px) {
            /* Шапка */
            .header-inner { 
                padding: 10px 16px; height: 56px; flex-wrap: nowrap;
                display: flex; align-items: center; justify-content: space-between;
            }
            .nav-tabs { display: none !important; }
            .logo { font-size: 16px; }
            .profile-section { gap: 6px; }
            .theme-btn { width: 32px; height: 32px; font-size: 13px; }
            #user-pill { gap: 6px; padding: 4px 8px; }
            #u-name { font-size: 12px; }
            #u-token-badge { font-size: 11px; padding: 3px 8px; }
            #btn-mod-panel { display: none !important; }
            #btn-lang { padding: 4px 8px; font-size: 11px; }

            /* Контент */
            .container { padding: 0 12px; }
            main { padding-bottom: 80px; }

            /* Карточки */
            .post-card { border-radius: 14px; margin-bottom: 12px; }
            .post-img { height: 200px; }
            .post-info { padding: 14px; }
            .post-title-row h2 { font-size: 15px; }
            .post-desc { font-size: 13px; }
            .btn-main { min-height: 44px; font-size: 13px; }

            /* Сортировка */
            .sort-bar { gap: 6px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
            .sort-bar::-webkit-scrollbar { display: none; }
            .sort-btn { white-space: nowrap; flex-shrink: 0; padding: 6px 12px; font-size: 11px; }

            /* Скрыть боковую панель на мобиле */
            #side-panel { display: none !important; }
            #side-trigger { display: none !important; }

            /* Модальные окна */
            .modal-content { width: 95% !important; max-width: 95% !important; max-height: 85vh !important; overflow-y: auto; }

            /* Мессенджер */
            .messenger { height: calc(100vh - 140px); }
            .chat-sidebar { max-height: 200px; font-size: 13px; }

            /* Статистика */
            #stats-widget { padding: 12px; }
            #stats-widget > div:last-child { grid-template-columns: repeat(2, 1fr) !important; }

            /* Форма создания */
            .form-group-row { flex-direction: column; }

            /* Кнопки действий */
            .action-icon-btn { width: 36px; height: 36px; }
        }

        /* ===== НИЖНЯЯ НАВИГАЦИЯ (только мобиль) ===== */
        #bottom-nav {
            display: none;
            position: fixed; bottom: 0; left: 0; right: 0; z-index: 4000;
            background: var(--sidebar-bg); border-top: 1px solid var(--border);
            padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
            backdrop-filter: blur(20px);
        }
        #bottom-nav .bnav-inner {
            display: flex; justify-content: space-around; align-items: center;
        }
        .bnav-btn {
            display: flex; flex-direction: column; align-items: center; gap: 3px;
            padding: 6px 12px; border: none; background: none; cursor: pointer;
            color: var(--text-dim); font-family: inherit; transition: var(--transition);
            min-width: 44px; min-height: 44px; justify-content: center; border-radius: 12px;
        }
        .bnav-btn.active { color: var(--accent); }
        .bnav-btn i { font-size: 20px; }
        .bnav-btn span { font-size: 10px; font-weight: 700; }
        .bnav-notif { 
            position: absolute; top: 2px; right: 8px; width: 8px; height: 8px;
            background: var(--danger); border-radius: 50%; display: none;
        }

        @media (max-width: 768px) {
            #bottom-nav { display: block; }
            
            /* Улучшенная мобильная адаптация */
            * { -webkit-tap-highlight-color: transparent; }
            body { font-size: 16px; }
            
            /* Шапка */
            header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; width: 100%; }
            main { margin-top: 60px; padding: 16px 12px 100px 12px !important; }
            .container { padding: 0 12px !important; }
            .header-inner { height: 60px; padding: 8px 12px; }
            .brand-box { gap: 8px; }
            .radar-svg { width: 36px; height: 36px; }
            .nav-tabs { display: none !important; }
            
            /* Профиль */
            .profile-section { gap: 4px; }
            .theme-btn { width: 36px; height: 36px; }
            .user-pill { padding: 4px 10px; }
            .user-pill span { display: none; }
            #u-avatar { width: 32px; height: 32px; font-size: 14px; }
            
            /* Контент */
            .post-card { border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
            .post-img { height: 180px; }
            .post-info { padding: 12px; }
            .post-header-top { flex-wrap: wrap; gap: 8px; }
            .post-title-row { flex-direction: column; gap: 8px; }
            .post-title-row h2 { font-size: 14px; line-height: 1.3; margin: 0; }
            .post-price { font-size: 12px; }
            .badge { font-size: 10px; padding: 4px 8px; }
            .post-footer { gap: 6px; }
            .btn-main { 
                width: 100%; padding: 12px 16px; 
                border-radius: 10px; font-size: 13px; 
                min-height: 44px; font-weight: 700;
            }
            .action-icon-btn { width: 32px; height: 32px; font-size: 13px; }
            
            /* Модальные окна */
            .modal { top: 0 !important; }
            .modal-content { 
                width: 100% !important; max-width: calc(100vw - 24px) !important; 
                max-height: calc(100vh - 120px) !important; 
                border-radius: 16px 16px 0 0;
                margin: auto;
            }
            .modal-inner { padding: 16px; }
            .modal-header { padding: 12px 0; }
            .modal-header h3 { font-size: 16px; }
            
            /* Форма */
            .form-group { margin-bottom: 12px; }
            .form-group label { font-size: 13px; }
            .form-group input, 
            .form-group select, 
            .form-group textarea {
                width: 100%; padding: 12px; 
                font-size: 16px; border-radius: 8px;
                border: 1px solid var(--border);
            }
            .form-group-row { flex-direction: column; gap: 12px; }
            .form-group-row > * { flex: 1 !important; }
            
            /* Сортировка */
            .sort-bar { 
                gap: 8px; overflow-x: auto; overflow-y: hidden; 
                flex-wrap: nowrap; padding: 0 12px 8px 12px;
                margin-left: -12px; margin-right: -12px;
                padding-left: 12px; padding-right: 12px;
            }
            .sort-bar::-webkit-scrollbar { height: 3px; }
            .sort-bar::-webkit-scrollbar-thumb { background: var(--border); }
            .sort-btn { 
                white-space: nowrap; flex-shrink: 0; 
                padding: 8px 14px; font-size: 12px; 
                border-radius: 20px;
            }
            .sort-btn.active { background: var(--accent); color: #000; }
            
            /* Категории */
            .cat-cards { overflow-x: auto; padding-bottom: 8px; margin-bottom: 0; }
            .cat-cards::-webkit-scrollbar { height: 3px; }
            .cat-card { 
                white-space: nowrap; min-width: 80px; 
                padding: 8px 12px; font-size: 12px;
                flex-shrink: 0;
            }
            
            /* Поиск */
            #text-search { 
                width: 100% !important; 
                padding: 10px 12px;
                font-size: 14px;
                border-radius: 8px;
            }
            
            /* Мессенджер */
            .messenger { 
                grid-template-columns: 1fr !important; 
                height: auto; gap: 0;
            }
            .chat-sidebar { 
                max-height: 150px; overflow-y: auto;
                border-bottom: 1px solid var(--border);
            }
            .chat-window { height: 300px; }
            .chat-input-wrap { 
                display: flex; gap: 8px; 
                align-items: flex-end; 
                padding: 12px;
            }
            #chat-input { 
                flex: 1; padding: 10px 12px; 
                min-height: 40px; border-radius: 8px;
                font-size: 14px;
            }
            #btn-send-msg { 
                width: 40px; height: 40px; 
                padding: 0; border-radius: 8px;
            }
            .msg { 
                padding: 8px 12px; 
                margin-bottom: 8px;
                border-radius: 10px;
                font-size: 13px;
            }
            
            /* Нижняя навигация */
            .bnav-btn { 
                min-width: 50px; min-height: 50px; 
                padding: 8px 0;
            }
            .bnav-btn i { font-size: 22px; }
            .bnav-btn span { font-size: 9px; }
            .bnav-notif { width: 10px; height: 10px; top: 0; right: 4px; }
            
            /* Модалка профиля */
            #profile-modal .modal-content { width: 100% !important; }
            #profile-name-input { width: 100%; font-size: 16px; }
            #profile-file-input { width: 100%; }
            #btn-save-profile { width: 100%; }
            
            /* Модалка создания поста */
            #create-modal .modal-inner { max-height: calc(100vh - 80px); overflow-y: auto; }
            #post-title, #post-desc, #post-address { width: 100%; }
            .preview-box { max-width: 100%; margin: 0 auto; }
            #preview { max-width: 100%; height: auto; }
            
            /* Эскроу и кнопки */
            #chat-escrow-btn, #chat-received-btn { 
                min-width: 40px; min-height: 40px;
                padding: 8px !important;
                font-size: 11px;
            }
            
            /* Таблицы и списки */
            .room-btn { 
                padding: 12px; 
                border-radius: 8px;
                margin-bottom: 6px;
            }
            .room-btn .user-avatar { width: 40px; height: 40px; }
            
            /* Текст */
            h1 { font-size: 20px; }
            h2 { font-size: 16px; }
            h3 { font-size: 14px; }
            p { font-size: 13px; line-height: 1.5; }
            
            /* Дополнительные правила */
            .token-coin { width: 18px; height: 18px; font-size: 8px; }
            .unread-dot { width: 10px; height: 10px; }
            
            /* Входные элементы */
            input, select, textarea { font-size: 16px !important; }
            button { font-size: 14px; }
            
            /* Скрыть элементы для ПК */
            #side-panel { display: none !important; }
            #side-trigger { display: none !important; }
            
            /* Улучшение касаний */
            a, button { 
                min-height: 44px; 
                min-width: 44px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
            }
        }
        
        /* Очень маленькие экраны */
        @media (max-width: 480px) {
            .header-inner { height: 50px; }
            .brand-box { gap: 6px; }
            .radar-svg { width: 32px; height: 32px; }
            
            .container { padding: 0 10px !important; }
            main { margin-top: 50px; padding: 10px !important; }
            
            .post-img { height: 140px; }
            .post-info { padding: 10px; }
            .post-title-row h2 { font-size: 13px; }
            .post-desc { font-size: 12px; }
            .badge { font-size: 9px; padding: 3px 6px; }
            
            .btn-main { font-size: 12px; padding: 10px 12px; }
            .action-icon-btn { width: 28px; height: 28px; }
            
            .modal-content { max-width: calc(100vw - 12px) !important; }
            .modal-inner { padding: 12px; }
            
            #bottom-nav { padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
            .bnav-btn { min-height: 48px; }
            
            .sort-bar { padding: 0 10px 8px 10px; }
            .sort-btn { padding: 6px 10px; font-size: 11px; }
            
            .theme-btn { width: 32px; height: 32px; }
            #u-avatar { width: 28px; height: 28px; }
            
            .room-btn .user-avatar { width: 36px; height: 36px; }
            .room-btn { padding: 10px; }
            
            .form-group input, 
            .form-group select, 
            .form-group textarea { padding: 10px; font-size: 14px; }
        }
        
        /* Ландшафтная ориентация на мобилях */
        @media (max-width: 768px) and (orientation: landscape) {
            .header-inner { height: 50px; }
            main { margin-top: 50px; padding: 10px 12px 70px 12px !important; }
            .post-img { height: 120px; }
            .chat-window { height: 200px; }
        }
