/* ============================================
   TELL — стили v4 «Закат над морем»
   Глубокий морской фон, тёплые коралл/янтарь,
   стеклянные панели, мозаика категорий.
   ============================================ */

:root {
    --sun-1: #FF7A59;
    --sun-2: #FFB35C;
    --sea: #2DD4DA;
    --sun: linear-gradient(135deg, #FF7A59 0%, #FFB35C 100%);
    --accent: #FF9A5C;

    --bg: #060F1C;
    --mesh:
        radial-gradient(560px 460px at 105% 0%, rgba(255, 122, 89, 0.30), transparent 70%),
        radial-gradient(520px 520px at -10% 40%, rgba(45, 212, 218, 0.20), transparent 70%),
        radial-gradient(600px 480px at 70% 108%, rgba(124, 92, 255, 0.22), transparent 70%),
        #060F1C;
    --blob-a: rgba(255, 122, 89, 0.42);
    --blob-b: rgba(45, 212, 218, 0.30);

    --glass: rgba(255, 255, 255, 0.07);
    --glass-strong: rgba(255, 255, 255, 0.14);
    --glass-border: rgba(255, 255, 255, 0.14);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(255, 255, 255, 0.03);
    --blur: blur(24px) saturate(170%);
    --shadow: 0 14px 40px rgba(0, 6, 20, 0.5);

    --text: #F4F8FF;
    --text-secondary: rgba(230, 240, 255, 0.72);
    --text-muted: rgba(230, 240, 255, 0.48);

    --success: #4ADE80;
    --danger: #FF6B7A;

    --r-md: 16px;
    --r-lg: 24px;
    --r-xl: 30px;
    --r-full: 9999px;

    --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Unbounded', 'Manrope', sans-serif;
    --nav-height: 70px;
    --ease: cubic-bezier(0.3, 0.7, 0.2, 1);
    --spring: cubic-bezier(0.34, 1.45, 0.5, 1);
    --transition: all 0.22s var(--ease);
}

[data-theme="light"] {
    --bg: #E9F5F7;
    --mesh:
        radial-gradient(560px 460px at 105% 0%, rgba(255, 170, 130, 0.65), transparent 70%),
        radial-gradient(520px 520px at -10% 40%, rgba(120, 225, 230, 0.6), transparent 70%),
        radial-gradient(600px 480px at 70% 108%, rgba(190, 170, 255, 0.5), transparent 70%),
        #EAF5F7;
    --blob-a: rgba(255, 160, 120, 0.5);
    --blob-b: rgba(100, 220, 225, 0.45);

    --glass: rgba(255, 255, 255, 0.6);
    --glass-strong: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 0 rgba(60, 120, 140, 0.06);
    --shadow: 0 14px 36px rgba(40, 90, 120, 0.18);

    --text: #0B2230;
    --text-secondary: rgba(11, 34, 48, 0.72);
    --text-muted: rgba(11, 34, 48, 0.5);
    --accent: #F0673F;
}

/* ---------- СБРОС ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { overflow-x: hidden; }

body {
    font-family: var(--font);
    background: var(--mesh);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--nav-height) + 36px + env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
    min-height: 100dvh;
}

/* медленно плывущие световые пятна — единственная постоянная анимация */
body::before,
body::after {
    content: '';
    position: fixed;
    z-index: -1;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    will-change: transform;
}

body::before { background: var(--blob-a); top: 8%; right: -120px; animation: drift1 22s ease-in-out infinite alternate; }
body::after  { background: var(--blob-b); bottom: 12%; left: -140px; animation: drift2 26s ease-in-out infinite alternate; }

@keyframes drift1 { to { transform: translate(-90px, 220px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(120px, -200px) scale(1.2); } }

button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--sea); outline-offset: 2px; }

.app-container { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }

/* общий «стеклянный» набор */
.app-header,
.placeholder,
.search-pill,
.ad-card,
.chat-header,
.chat-input-wrapper,
.chat-bubble,
.chat-welcome,
.header-btn,
.chat-back-btn,
.chat-header-btn,
.bottom-nav-inner,
.toast {
    background: var(--glass);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-hi);
}

/* ---------- ХЕДЕР ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 12px 14px 0;
    padding: 9px 10px 9px 12px;
    border-radius: var(--r-full);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--glass-hi), var(--shadow);
    background: rgba(8, 18, 32, 0.62);
}

[data-theme="light"] .app-header { background: rgba(255, 255, 255, 0.78); }

.app-logo { display: flex; align-items: center; gap: 10px; }

.app-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--sun);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 6px 18px rgba(255, 122, 89, 0.5);
}

.app-logo-text { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.5px; }

.app-header-actions { display: flex; gap: 8px; }

.header-btn,
.chat-back-btn,
.chat-header-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text);
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.header-btn:active,
.chat-back-btn:active,
.chat-header-btn:active { transform: scale(0.88); background: var(--glass-strong); }

/* ---------- КОНТЕНТ ---------- */
.app-main { padding: 26px 18px 16px; }

.page-title {
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -0.8px;
    line-height: 1.15;
    margin-bottom: 8px;
}

.page-subtitle { font-size: 15px; color: var(--text-secondary); margin-bottom: 24px; }

/* ---------- ГЛАВНЫЙ ЭКРАН ---------- */
.hero-title {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -1.2px;
    line-height: 1.12;
    margin-bottom: 10px;
    max-width: 11em;
    text-wrap: balance;
}

.hero-sub { font-size: 15px; color: var(--text-secondary); margin-bottom: 22px; max-width: 26em; }

.search-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 6px 6px 18px;
    border-radius: var(--r-full);
    margin-bottom: 22px;
    box-shadow: var(--glass-hi), var(--shadow);
}

.search-pill > i { color: var(--text-muted); font-size: 15px; }

.search-pill input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    padding: 12px 6px;
}

.search-pill input::placeholder { color: var(--text-muted); }

.search-pill:focus-within { border-color: rgba(255, 179, 92, 0.7); box-shadow: var(--glass-hi), var(--shadow), 0 0 0 4px rgba(255, 154, 92, 0.18); }

.search-go {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: var(--sun);
    color: #3A1406;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 18px rgba(255, 122, 89, 0.45);
}

.search-go:active { transform: scale(0.88); }

/* ---------- МОЗАИКА КАТЕГОРИЙ ---------- */
.group-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.group-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-xl);
    padding: 16px;
    min-height: 148px;
    cursor: pointer;
    color: #FFF;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), var(--shadow);
    transition: transform 0.25s var(--spring);
}

.group-card:active { transform: scale(0.96); }

.group-card.wide { grid-column: span 2; min-height: 176px; }

.gc-housing { background: linear-gradient(150deg, #FF7A59 0%, #C2417A 100%); }
.gc-work    { background: linear-gradient(150deg, #3E5BFF 0%, #21B6F0 100%); }
.gc-market  { background: linear-gradient(150deg, #FFB020 0%, #FF6B4A 100%); }
.gc-trips   { background: linear-gradient(150deg, #0FA3A3 0%, #4FE0A0 100%); }

/* фото на плитке «Жильё» */
.group-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.55;
    mix-blend-mode: luminosity;
}

.group-card.wide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 8, 30, 0) 30%, rgba(10, 8, 30, 0.55) 100%);
}

/* большая бледная иконка-водяной знак */
.group-ghost {
    position: absolute;
    right: -10px;
    top: -6px;
    font-size: 96px;
    color: rgba(255, 255, 255, 0.16);
    transform: rotate(-12deg);
    pointer-events: none;
}

.group-icon {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.group-title { position: relative; z-index: 2; font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.2; }

.group-desc { position: relative; z-index: 2; font-size: 13px; opacity: 0.85; }

.group-count {
    position: absolute;
    z-index: 2;
    top: 18px;
    right: 16px;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: var(--r-full);
    background: rgba(0, 0, 0, 0.28);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* ---------- ЛЕНТА ОБЪЯВЛЕНИЙ ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 2px 14px; }

.section-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.4px; }

.section-link { background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 700; cursor: pointer; }

.featured-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    margin: 0 -18px;
    padding: 4px 18px 28px;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 18px;
    scrollbar-width: none;
}

.featured-list::-webkit-scrollbar { display: none; }

.ad-card {
    flex: 0 0 218px;
    scroll-snap-align: start;
    border-radius: var(--r-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s var(--spring);
    box-shadow: var(--glass-hi), 0 6px 14px rgba(0, 6, 20, 0.28);
}

.ad-card:active { transform: scale(0.97); }

.ad-card-img {
    position: relative;
    height: 132px;
    background: linear-gradient(145deg, #1F4E6B, #0D2A3F);
    overflow: hidden;
}

.ad-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ad-card-body { padding: 12px 14px 14px; }

.ad-card-price { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.4px; color: var(--sun-2); margin-bottom: 3px; }
[data-theme="light"] .ad-card-price { color: var(--accent); }

.ad-card-title { font-size: 14px; font-weight: 700; line-height: 1.3; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.ad-card-loc { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }

.ad-card-loc i { color: var(--sea); font-size: 11px; }

/* ---------- ПЛЕЙСХОЛДЕР ---------- */
.placeholder {
    border-radius: var(--r-xl);
    padding: 30px 22px;
    text-align: center;
    margin-bottom: 14px;
    box-shadow: var(--glass-hi), var(--shadow);
}

.placeholder-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--sun);
    color: #3A1406;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 10px 26px rgba(255, 122, 89, 0.45);
}

.placeholder-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.4px; }

.placeholder-text { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ---------- НИЖНЯЯ НАВИГАЦИЯ ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    padding: 0 16px calc(12px + env(safe-area-inset-bottom, 0px));
    pointer-events: none;
}

.bottom-nav-inner {
    position: relative;
    width: 100%;
    max-width: 448px;
    border-radius: var(--r-full);
    padding: 6px;
    display: flex;
    gap: 2px;
    box-shadow: var(--glass-hi), var(--shadow);
    pointer-events: auto;
    background: rgba(8, 18, 32, 0.62);
}

[data-theme="light"] .bottom-nav-inner { background: rgba(255, 255, 255, 0.78); }

.nav-indicator {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    width: 0;
    z-index: 0;
    pointer-events: none;
    transition: transform 0.55s var(--spring), width 0.55s var(--spring);
}

.nav-indicator::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--r-full);
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 20px rgba(255, 122, 89, 0.3);
}

.nav-indicator.moving::before { animation: bubbleStretch 0.55s ease; }

@keyframes bubbleStretch {
    0%   { transform: scale(1, 1); }
    35%  { transform: scale(1.22, 0.86); }
    70%  { transform: scale(0.97, 1.07); }
    100% { transform: scale(1, 1); }
}

.nav-item {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 2px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s var(--ease);
    border-radius: var(--r-full);
}

.nav-item:active { transform: scale(0.93); }

.nav-item.active { color: var(--text); font-weight: 700; }

.nav-item.active .nav-icon { color: var(--sun-2); }
[data-theme="light"] .nav-item.active .nav-icon { color: var(--accent); }

.nav-icon { font-size: 19px; height: 22px; display: flex; align-items: center; justify-content: center; transition: color 0.3s ease; }

.nav-label { font-size: 11px; white-space: nowrap; }

/* ---------- КНОПКА ---------- */
.primary-btn {
    margin-top: 18px;
    padding: 14px 24px;
    background: var(--sun);
    color: #3A1406;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--r-full);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 10px 26px rgba(255, 122, 89, 0.4);
}

.primary-btn:active { transform: scale(0.95); }

/* ---------- ПРОФИЛЬ ---------- */
.profile-avatar-placeholder { display: flex; flex-direction: column; align-items: center; padding: 8px 0 28px; }

.avatar-circle {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    background: var(--sun);
    color: #3A1406;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin-bottom: 16px;
    border: 3px solid var(--glass-border);
    box-shadow: 0 0 0 8px var(--glass), 0 16px 40px rgba(255, 122, 89, 0.45);
}

.profile-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 2px; }

.profile-id { font-size: 13px; color: var(--text-muted); }

/* ============================================
   ЧАТ
   ============================================ */
.group-screen {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    background: var(--mesh);
    z-index: 200;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 14px 0;
    margin-top: calc(12px + env(safe-area-inset-top, 0px));
    padding: 8px 12px 8px 8px;
    border-radius: var(--r-full);
    flex-shrink: 0;
    box-shadow: var(--glass-hi), var(--shadow);
    z-index: 2;
}

.chat-back-btn, .chat-header-btn { background: var(--glass-strong); }

.chat-header-info { flex: 1; min-width: 0; }

.chat-header-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }

.chat-header-subtitle { font-size: 12px; color: var(--success); font-weight: 600; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
    overflow-anchor: none;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-welcome {
    text-align: center;
    padding: 22px 20px;
    border-radius: var(--r-xl);
    margin-bottom: 8px;
}

.chat-welcome-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--sun);
    color: #3A1406;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 22px rgba(255, 122, 89, 0.45);
}

.chat-welcome-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; margin-bottom: 6px; letter-spacing: -0.3px; }

.chat-welcome-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

.chat-message { display: flex; gap: 8px; align-items: flex-end; animation: fadeIn 0.25s ease; }

.chat-message-mine { flex-direction: row-reverse; }

.chat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    font-size: 14px;
    font-weight: 800;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.chat-bubble-wrap { max-width: 80%; display: flex; flex-direction: column; }

.chat-bubble-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; padding-left: 6px; }

.chat-user-name { font-size: 12px; font-weight: 700; color: var(--text); }

.chat-time { font-size: 11px; color: var(--text-muted); }

.chat-bubble {
    border-radius: 20px 20px 20px 6px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.chat-bubble-mine {
    background: var(--sun);
    color: #34120A;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 20px 20px 6px 20px;
    max-width: 100%;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 22px rgba(255, 122, 89, 0.35);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.chat-bubble-image { margin-bottom: 6px; border-radius: 14px; overflow: hidden; max-width: 100%; }

.chat-bubble-image img {
    display: block;
    max-width: 100%;
    max-height: 300px;
    min-height: 100px;
    object-fit: cover;
    border-radius: 14px;
    background: var(--glass);
}

.chat-bubble-mine .chat-bubble-image img { max-width: 240px; }

.chat-time-mine { font-size: 11px; color: var(--text-muted); margin-top: 3px; text-align: right; padding-right: 6px; }

/* ---------- КАРТОЧКА ОБЪЯВЛЕНИЯ В ЧАТЕ ---------- */
.chat-ad-image {
    position: relative;
    width: calc(100% + 28px);
    margin: -10px -14px 10px;
    height: 170px;
    border-radius: 19px 19px 0 0;
    overflow: hidden;
    background: linear-gradient(145deg, #1F4E6B, #0D2A3F);
}

.chat-ad-image img { width: 100%; height: 100%; object-fit: cover; }

.chat-ad-title { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; margin-bottom: 2px; }

.chat-ad-price { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 6px; color: var(--sun-2); }
[data-theme="light"] .chat-ad-price { color: var(--accent); }

.chat-ad-location { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }

.chat-ad-location i { color: var(--sea); font-size: 12px; }

.chat-ad-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.45; padding-top: 8px; border-top: 1px solid var(--glass-border); }

/* ---------- ПОЛЕ ВВОДА ---------- */
.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 14px;
    margin-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 6px;
    border-radius: var(--r-full);
    flex-shrink: 0;
    box-shadow: var(--glass-hi), var(--shadow);
}

.chat-attach-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    background: transparent;
    border: none;
}

.chat-attach-btn:active { transform: scale(0.88); color: var(--text); }

.chat-input {
    flex: 1;
    min-width: 0;
    padding: 11px 6px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    outline: none;
}

.chat-input::placeholder { color: var(--text-muted); }

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--sun);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #3A1406;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 18px rgba(255, 122, 89, 0.45);
}

.chat-send-btn:active { transform: scale(0.88); }

/* ---------- БЕЙДЖИ ---------- */
.ad-badge {
    position: absolute;
    padding: 4px 11px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 700;
    color: #FFF;
    z-index: 5;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.ad-badge-urgent { top: 10px; left: 10px; background: rgba(255, 91, 110, 0.88); }

.ad-badge-verified {
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(45, 200, 120, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* ---------- РАЗДЕЛИТЕЛЬ ИСТОРИИ ---------- */
.chat-history-divider { display: flex; align-items: center; margin: 12px 0; }

.chat-history-divider::before,
.chat-history-divider::after { content: ''; flex: 1; height: 1px; background: var(--glass-border); }

.chat-history-divider span { padding: 0 12px; font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* ---------- ТОСТ ---------- */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + 44px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translate(-50%, 40px);
    color: var(--text);
    padding: 12px 22px;
    border-radius: var(--r-full);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--glass-hi), var(--shadow);
    z-index: 1000;
    transition: transform 0.3s var(--ease), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    max-width: calc(100% - 40px);
    text-align: center;
}

.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- АНИМАЦИИ ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 380px) {
    .hero-title { font-size: 25px; }
    .page-title { font-size: 23px; }
    .nav-label { font-size: 10px; }
    .group-card { min-height: 132px; }
    .group-card.wide { min-height: 160px; }
}
