/* ============================================
   TELL — стили новых экранов:
   страница жилья, календарь, карта, профиль, формы
   ============================================ */

/* ---------- ЭКРАН ЖИЛЬЯ / ФОРМЫ ---------- */
.listing-screen {
    position: fixed;
    inset: 0;
    max-width: 480px;
    margin: 0 auto;
    z-index: 300;
    display: none;
    flex-direction: column;
    background: var(--bg);
}

.listing-scroll {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px));
}

/* ---------- ГАЛЕРЕЯ ---------- */
.listing-gallery { position: relative; height: 340px; background: linear-gradient(145deg, #1F4E6B, #0D2A3F); }

.gallery-track {
    display: flex;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.gallery-track::-webkit-scrollbar { display: none; }

.gallery-track img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: center;
    cursor: zoom-in;
}

.gallery-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.gallery-empty i { font-size: 36px; }

.gallery-back {
    position: absolute;
    top: calc(14px + env(safe-area-inset-top, 0px));
    left: 14px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(8, 18, 32, 0.5);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: #FFF;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-back:active { transform: scale(0.9); }

.gallery-count {
    position: absolute;
    right: 14px;
    bottom: 44px;
    padding: 5px 12px;
    border-radius: var(--r-full);
    background: rgba(8, 18, 32, 0.55);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #FFF;
    font-size: 12px;
    font-weight: 700;
}

.gallery-badge { top: calc(20px + env(safe-area-inset-top, 0px)); left: auto; right: 14px; }

/* ---------- ТЕЛО СТРАНИЦЫ ---------- */
.listing-body {
    position: relative;
    margin-top: -28px;
    padding: 24px 18px 8px;
    background: var(--bg);
    border-radius: 30px 30px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 6, 20, 0.25);
}

.listing-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }

.listing-price { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.8px; color: var(--sun-2); }
[data-theme="light"] .listing-price { color: var(--accent); }

.verified-chip { font-size: 12px; font-weight: 700; color: var(--success); display: inline-flex; gap: 6px; align-items: center; }

.listing-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.25; margin-bottom: 8px; }

.listing-loc { font-size: 14px; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.listing-loc i { color: var(--sea); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: var(--r-full);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
}

.chip i { color: var(--sun-2); font-size: 13px; }
[data-theme="light"] .chip i { color: var(--accent); }

.chip-soft { font-weight: 500; }

.chip-toggle { cursor: pointer; transition: var(--transition); }
.chip-toggle.on { background: var(--sun); color: #3A1406; border-color: rgba(255, 255, 255, 0.4); }
.chip-toggle.on i { color: #3A1406; }

/* ---------- ХОЗЯИН ---------- */
.owner-card {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: var(--r-lg);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-hi);
}

.owner-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

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

.owner-info { min-width: 0; }
.owner-name { font-size: 16px; font-weight: 800; }
.owner-sub { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.owner-rating { color: var(--sun-2); font-weight: 800; }
[data-theme="light"] .owner-rating { color: var(--accent); }
.owner-about { margin-top: 12px; font-size: 14px; color: var(--text-secondary); line-height: 1.55; }

/* ---------- РАЗДЕЛЫ ---------- */
.l-section { margin-top: 28px; }

.l-h { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -0.4px; margin-bottom: 12px; }

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

.terms { display: flex; flex-direction: column; gap: 10px; }

.term-row { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: var(--glass); border: 1px solid var(--glass-border); }

.term-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--sun-1) 18%, transparent);
    color: var(--sun-2);
    font-size: 15px;
}

[data-theme="light"] .term-icon { color: var(--accent); }

.term-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.term-value { font-size: 14.5px; font-weight: 600; line-height: 1.35; }

.rules { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rules li { position: relative; padding-left: 22px; font-size: 14.5px; color: var(--text-secondary); line-height: 1.45; }
.rules li::before { content: ''; position: absolute; left: 4px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); }

/* ---------- РАССТОЯНИЕ ДО МОРЯ ---------- */
.sea-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: var(--r-lg);
    background: linear-gradient(135deg, #0FA3A3 0%, #2DD4DA 100%);
    color: #04302E;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 26px rgba(15, 163, 163, 0.35);
}

.sea-icon { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.sea-banner b { display: block; font-family: var(--font-display); font-size: 17px; letter-spacing: -0.4px; }
.sea-banner span { font-size: 13px; font-weight: 600; opacity: 0.8; }

/* ---------- КАРТА ---------- */
.listing-map {
    position: relative;
    z-index: 0;
    isolation: isolate;
    height: 240px;
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: var(--glass);
}

.pick-map { height: 280px; margin-top: 10px; }

[data-theme="dark"] .listing-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.7); }

.listing-map .leaflet-control-attribution { font-size: 9px; background: rgba(255, 255, 255, 0.6); }

.map-pin-wrap { background: none; border: none; }

.map-pin {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFF;
    font-size: 16px;
    border: 3px solid #FFF;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.pin-home { background: linear-gradient(135deg, #FF7A59, #FFB35C); color: #3A1406; }
.pin-sea { background: linear-gradient(135deg, #0FA3A3, #2DD4DA); color: #04302E; }

.map-hint {
    position: absolute;
    z-index: 500;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    padding: 6px 14px;
    border-radius: var(--r-full);
    background: rgba(8, 18, 32, 0.65);
    color: #FFF;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
}

.map-fallback { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-secondary); font-size: 13px; text-align: center; padding: 20px; }
.map-fallback i { font-size: 28px; color: var(--sea); }

.map-link { margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; color: var(--accent); font-size: 14px; font-weight: 700; text-decoration: none; }

/* ---------- КАЛЕНДАРЬ ---------- */
.cal { padding: 14px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi); }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }

.cal-title { font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: -0.3px; }

.cal-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-strong);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-nav:disabled { opacity: 0.3; cursor: default; }

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

.cal-week { margin-bottom: 4px; }
.cal-week span { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 4px 0; }

.cal-grid { row-gap: 4px; }

.cal-day {
    position: relative;
    aspect-ratio: 1;
    margin: 0 1px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.cal-day:not(:disabled):active { transform: scale(0.92); }

.cal-day.past { color: var(--text-muted); opacity: 0.4; cursor: default; }

.cal-day.busy {
    color: var(--text-muted);
    background: repeating-linear-gradient(135deg, rgba(255, 107, 122, 0.18) 0 4px, rgba(255, 107, 122, 0.05) 4px 8px);
}

.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--sea); }

.cal-day.in-range { background: color-mix(in srgb, var(--sun-1) 26%, transparent); border-radius: 0; margin: 0; }

.cal-day.sel-start, .cal-day.sel-end {
    background: var(--sun);
    color: #3A1406;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(255, 122, 89, 0.4);
}

.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 12px; font-size: 12px; color: var(--text-secondary); }
.cal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cal-legend em { font-style: normal; color: var(--text-muted); }

.lg { width: 14px; height: 14px; border-radius: 5px; display: inline-block; }
.lg-free { border: 1.5px solid var(--glass-border); }
.lg-busy { background: repeating-linear-gradient(135deg, rgba(255, 107, 122, 0.5) 0 3px, rgba(255, 107, 122, 0.15) 3px 6px); }
.lg-sel { background: var(--sun); }

.cal-summary {
    margin-top: 12px;
    padding: 13px 16px;
    border-radius: var(--r-md);
    background: var(--glass);
    border: 1px dashed var(--glass-border);
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.cal-summary.ready { border-style: solid; border-color: rgba(255, 179, 92, 0.55); color: var(--text); }
.cal-summary b { font-weight: 800; }
.cal-total { margin-left: auto; font-family: var(--font-display); font-weight: 700; color: var(--sun-2); }
[data-theme="light"] .cal-total { color: var(--accent); }

/* ---------- ЛЕНТА ВНУТРИ СТРАНИЦЫ ---------- */
.featured-list-inner { margin: 0 -18px; padding: 4px 18px 8px; }

/* ---------- НИЖНЯЯ ПАНЕЛЬ ДЕЙСТВИЙ ---------- */
.listing-actions {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: var(--r-full);
    background: rgba(8, 18, 32, 0.72);
    -webkit-backdrop-filter: var(--blur);
    backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-hi), var(--shadow);
}

[data-theme="light"] .listing-actions { background: rgba(255, 255, 255, 0.85); }

.act-call, .act-write {
    height: 52px;
    border-radius: var(--r-full);
    border: none;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.act-call { flex: 0 0 auto; padding: 0 22px; background: var(--glass-strong); color: var(--text); border: 1px solid var(--glass-border); }

.act-write {
    flex: 1;
    min-width: 0;
    padding: 0 16px;
    background: var(--sun);
    color: #3A1406;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 22px rgba(255, 122, 89, 0.4);
}

.act-write span { overflow: hidden; text-overflow: ellipsis; }

.act-call:active, .act-write:active { transform: scale(0.95); }

/* ---------- ФОТО НА ВЕСЬ ЭКРАН ---------- */
.lightbox { position: fixed; inset: 0; z-index: 900; background: rgba(0, 0, 0, 0.94); display: flex; flex-direction: column; }

.lightbox-track { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lightbox-track::-webkit-scrollbar { display: none; }

.lightbox-slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; }
.lightbox-slide img { max-width: 100%; max-height: 100%; object-fit: contain; }

.lightbox-close {
    position: absolute;
    top: calc(14px + env(safe-area-inset-top, 0px));
    right: 14px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.12);
    color: #FFF;
    font-size: 18px;
    cursor: pointer;
}

.lightbox-count { position: absolute; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); color: #FFF; font-size: 13px; font-weight: 700; }

/* ---------- ЧАТ: КЛИК ПО ОБЪЯВЛЕНИЮ ---------- */
.chat-message-ad { cursor: pointer; }
.chat-avatar { overflow: hidden; }
.chat-avatar-img { width: 100%; height: 100%; object-fit: cover; }

.chat-ad-more {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
}

.chat-ad-more i { font-size: 11px; }

/* ============================================
   ПРОФИЛЬ
   ============================================ */
.profile-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 0 6px; }

.avatar-circle { overflow: hidden; }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.avatar-sm { width: 84px; height: 84px; font-size: 30px; margin: 0; box-shadow: 0 0 0 5px var(--glass), 0 10px 26px rgba(255, 122, 89, 0.35); }

.profile-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 6px; font-size: 13px; color: var(--text-secondary); }
.profile-meta i { margin-right: 6px; color: var(--sea); }

.profile-about { margin: 12px 8px 16px; font-size: 14px; line-height: 1.55; color: var(--text-secondary); max-width: 30em; }
.profile-about.muted { color: var(--text-muted); }

.ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--r-full);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--glass-hi);
    transition: var(--transition);
}

.ghost-btn:active { transform: scale(0.95); }
.ghost-btn.small { padding: 9px 15px; font-size: 13px; }

.wide-btn { width: 100%; justify-content: center; margin-top: 14px; }

.profile-foot { margin-top: 14px; text-align: center; font-size: 12px; color: var(--text-muted); }

.my-ads { display: flex; flex-direction: column; gap: 10px; }

.my-ad {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: var(--r-lg);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-hi);
}

.my-ad-thumb { width: 72px; height: 72px; border-radius: 16px; overflow: hidden; flex-shrink: 0; background: linear-gradient(145deg, #1F4E6B, #0D2A3F); display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.5); cursor: pointer; }
.my-ad-thumb img { width: 100%; height: 100%; object-fit: cover; }

.my-ad-info { flex: 1; min-width: 0; cursor: pointer; }
.my-ad-title { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-ad-price { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--sun-2); margin: 2px 0; }
[data-theme="light"] .my-ad-price { color: var(--accent); }
.my-ad-loc { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.my-ad-actions { display: flex; flex-direction: column; gap: 6px; }
.my-ad-actions button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--glass-strong); color: var(--text); font-size: 13px; cursor: pointer; }
.my-ad-actions button:last-child { color: var(--danger); }

/* ---------- ДИАЛОГИ ---------- */
.dialogs { display: flex; flex-direction: column; gap: 10px; }

.dialog-row { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi); cursor: pointer; transition: var(--transition); }
.dialog-row:active { transform: scale(0.98); }

.dialog-avatar { width: 46px; height: 46px; font-size: 18px; }
.dialog-info { flex: 1; min-width: 0; }
.dialog-name { font-size: 15px; font-weight: 800; }
.dialog-ad { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog-time { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ============================================
   ШТОРКА И ФОРМЫ
   ============================================ */
.sheet-overlay { position: fixed; inset: 0; z-index: 800; background: rgba(2, 8, 20, 0.55); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity 0.25s ease; }
.sheet-overlay.open { opacity: 1; }

.sheet-panel {
    width: 100%;
    max-width: 480px;
    max-height: 90dvh;
    overflow-y: auto;
    padding: 10px 18px calc(22px + env(safe-area-inset-bottom, 0px));
    border-radius: 30px 30px 0 0;
    background: var(--bg);
    border: 1px solid var(--glass-border);
    transform: translateY(40px);
    transition: transform 0.35s var(--spring);
}

.sheet-overlay.open .sheet-panel { transform: translateY(0); }

.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--glass-border); margin: 0 auto 14px; }
.sheet-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 16px; }

.avatar-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.avatar-edit-btns { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; padding-left: 4px; }

.field input, .field textarea {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--r-md);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    outline: none;
    resize: vertical;
    transition: var(--transition);
}

.field input::placeholder, .field textarea::placeholder { color: var(--text-muted); }
.field input:focus, .field textarea:focus { border-color: rgba(255, 179, 92, 0.7); box-shadow: 0 0 0 4px rgba(255, 154, 92, 0.16); }

.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-screen .form-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.form-top-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: -0.4px; }

.form-scroll { padding: 6px 18px calc(112px + env(safe-area-inset-bottom, 0px)); }

.form-block { margin-bottom: 26px; }
.form-h { font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: -0.3px; margin-bottom: 12px; }
.form-hint { margin-top: 8px; font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.seg { display: flex; padding: 4px; margin-bottom: 22px; border-radius: var(--r-full); background: var(--glass); border: 1px solid var(--glass-border); }
.seg button { flex: 1; padding: 11px 8px; border: none; border-radius: var(--r-full); background: transparent; color: var(--text-secondary); font-family: var(--font); font-size: 14px; font-weight: 700; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.seg button.on { background: var(--sun); color: #3A1406; box-shadow: 0 6px 16px rgba(255, 122, 89, 0.35); }
.seg-small { margin-bottom: 0; }
.seg-small button { font-size: 13px; padding: 9px 6px; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.photo-tile { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; border: 1px solid var(--glass-border); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile.cover::after { content: 'Обложка'; position: absolute; left: 6px; bottom: 6px; padding: 3px 9px; border-radius: var(--r-full); background: rgba(8, 18, 32, 0.7); color: #FFF; font-size: 10.5px; font-weight: 700; }

.photo-tile button { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(8, 18, 32, 0.7); color: #FFF; font-size: 12px; cursor: pointer; }

.photo-add { aspect-ratio: 1; border-radius: 18px; border: 1.5px dashed var(--glass-border); background: var(--glass); color: var(--text-secondary); font-family: var(--font); font-size: 12px; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.photo-add i { font-size: 20px; color: var(--sun-2); }

.pick-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.pick-dist { font-size: 13.5px; color: var(--text-secondary); }
.pick-dist i { color: var(--sea); margin-right: 4px; }
.pick-dist b { color: var(--text); }

.form-save-space { height: 20px; }

@media (max-width: 380px) {
    .listing-gallery { height: 300px; }
    .listing-price { font-size: 21px; }
    .act-call { padding: 0 16px; }
}

/* ============================================
   АККАУНТ, РЕАКЦИИ, ОТВЕТЫ
   ============================================ */
.account-card {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; margin-bottom: 14px; border-radius: var(--r-lg, 22px);
    background: var(--glass); border: 1px solid var(--glass-border);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.account-line { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.35; color: var(--text-secondary); }
.account-line i { color: var(--accent, #ffb35c); font-size: 18px; flex-shrink: 0; }
.account-line b { color: var(--text); }
.account-card .primary-btn, .account-card .ghost-btn { flex-shrink: 0; padding: 10px 16px; font-size: 14px; }

.auth-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-border); margin-bottom: 16px; }
.auth-tab { flex: 1; padding: 10px; border: 0; border-radius: 12px; background: transparent; color: var(--text-secondary); font-family: var(--font); font-weight: 700; font-size: 14px; cursor: pointer; transition: var(--transition); }
.auth-tab.active { background: linear-gradient(135deg, #ffb35c, #ff7a59); color: #2a1200; }
.auth-error { min-height: 20px; margin: -4px 4px 10px; font-size: 13px; color: #ff7a7a; }
.auth-note { margin: 12px 4px 0; font-size: 12.5px; line-height: 1.45; color: var(--text-muted); }

/* сообщения: удержание и реакции */
#chatMessages .chat-bubble { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: pan-y; }
.chat-message.pressed .chat-bubble { transform: scale(0.97); filter: brightness(1.12); transition: transform 0.15s ease; }
.chat-message.flash .chat-bubble { animation: msgFlash 1.2s ease; }
@keyframes msgFlash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 3px rgba(255, 179, 92, 0.85); } }

.chat-reactions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.chat-reactions:empty { display: none; }
.chat-message-mine .chat-reactions { justify-content: flex-end; }
.react-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
    border: 1px solid var(--glass-border); background: var(--glass); color: var(--text);
    font-family: var(--font); font-size: 13px; line-height: 1.3; cursor: pointer;
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    animation: chipPop 0.28s var(--spring, ease);
}
.react-chip b { font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.react-chip.mine { border-color: rgba(255, 179, 92, 0.85); background: rgba(255, 179, 92, 0.2); }
.react-chip.mine b { color: var(--text); }
@keyframes chipPop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.reply-quote {
    display: flex; flex-direction: column; gap: 1px; margin-bottom: 6px; padding: 5px 10px;
    border-left: 3px solid #ffb35c; border-radius: 8px; background: rgba(0, 0, 0, 0.16);
    font-size: 12.5px; cursor: pointer; max-width: 260px;
}
.reply-quote b { font-size: 12px; color: #ffb35c; }
.reply-quote span { opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.reply-bar {
    display: flex; align-items: center; gap: 10px; padding: 8px 14px;
    background: var(--glass); border-top: 1px solid var(--glass-border);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.reply-bar > i { color: #ffb35c; }
.reply-bar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.reply-bar-text b { font-size: 12.5px; color: #ffb35c; }
.reply-bar-text span { color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar button { border: 0; background: transparent; color: var(--text-secondary); font-size: 18px; padding: 6px; cursor: pointer; }

.msg-menu-overlay { position: fixed; inset: 0; z-index: 900; background: rgba(2, 8, 20, 0.35); animation: fadeIn 0.15s ease; }
.msg-menu {
    position: fixed; min-width: 230px; padding: 8px; border-radius: 22px;
    background: var(--bg); border: 1px solid var(--glass-border);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    animation: menuPop 0.22s var(--spring, ease); transform-origin: bottom left;
}
@keyframes menuPop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.msg-menu-emojis { display: flex; justify-content: space-between; gap: 2px; padding: 2px 2px 8px; border-bottom: 1px solid var(--glass-border); margin-bottom: 4px; }
.msg-menu-emojis button { border: 0; background: transparent; font-size: 26px; padding: 4px 6px; border-radius: 12px; cursor: pointer; transition: transform 0.15s var(--spring, ease); }
.msg-menu-emojis button:active { transform: scale(1.35); }
.msg-menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 14px; background: transparent; color: var(--text); font-family: var(--font); font-size: 15px; font-weight: 600; cursor: pointer; text-align: left; }
.msg-menu-item:hover, .msg-menu-item:active { background: var(--glass); }
.msg-menu-item i { width: 18px; color: var(--text-secondary); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================
   ГРУППЫ
   ============================================ */
.my-group-card {
    margin-bottom: 18px; padding: 18px; border-radius: var(--r-lg, 24px);
    background: linear-gradient(135deg, rgba(255, 179, 92, 0.2), rgba(255, 122, 89, 0.14)), var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.my-group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.my-group-head h2 { margin: 0; font-family: var(--font-display); font-size: 20px; letter-spacing: -0.5px; }
.my-group-icon { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, #ffb35c, #ff7a59); color: #2a1200; font-size: 17px; }
.my-group-card p { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.group-avatar { background: linear-gradient(135deg, #ffb35c, #ff7a59); color: #2a1200; }

.members { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; max-height: 32dvh; overflow-y: auto; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; font-weight: 600; }
.member-row em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.wide-btn + .wide-btn { margin-top: 10px; }

.group-pick { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; margin-bottom: 8px; border-radius: 18px; border: 1px solid var(--glass-border); background: var(--glass); color: var(--text); font-family: var(--font); font-size: 15px; font-weight: 600; cursor: pointer; text-align: left; }
.group-pick i { color: var(--accent); }
.group-pick em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--text-muted); }

.group-ad { display: block; margin: 2px 0 6px; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.16); border: 1px solid var(--glass-border); cursor: pointer; max-width: 260px; }
.group-ad-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.group-ad-title i { color: #ffb35c; margin-right: 4px; }
.group-ad-price { font-family: var(--font-display); font-weight: 700; color: #ffb35c; margin-bottom: 2px; }
.group-ad-loc { font-size: 12.5px; opacity: 0.8; margin-bottom: 6px; }
.group-ad-open { font-size: 12.5px; font-weight: 700; color: #ffb35c; }

.chat-message-ad .chat-reactions { margin-left: 2px; }

/* ============================================
   БЫСТРОДЕЙСТВИЕ ЧАТА
   Размытие фона под каждым пузырём — самое дорогое для телефона:
   в длинном чате десятки слоёв blur перерисовываются при прокрутке.
   Оставляем blur только на шапке и поле ввода.
   ============================================ */
.chat-bubble, .chat-welcome {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: rgba(255, 255, 255, 0.10);
}
[data-theme="light"] .chat-bubble, [data-theme="light"] .chat-welcome { background: rgba(255, 255, 255, 0.88); }
.chat-bubble-mine { background: var(--sun); }
.chat-messages { touch-action: pan-y; overscroll-behavior: contain; contain: content; }
.chat-message { contain: layout style; }
.chat-back-btn, .chat-header-btn, .chat-send-btn, .nav-item { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.chat-back-btn { min-width: 44px; min-height: 44px; }
.chat-reactions, .reply-bar { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ============================================
   КОМПАКТНАЯ КАРТОЧКА ОБЪЯВЛЕНИЯ В ЧАТЕ
   ============================================ */
.chat-message-ad .chat-bubble {
    display: grid;
    grid-template-columns: 84px 1fr;
    grid-template-areas: "img title" "img price" "img loc";
    column-gap: 10px;
    row-gap: 0;
    align-items: center;
    padding: 8px;
    max-width: 290px;
}
.chat-message-ad .chat-ad-image {
    grid-area: img;
    width: 84px; height: 84px;
    margin: 0;
    border-radius: 14px;
}
.chat-message-ad .chat-ad-title {
    grid-area: title; margin: 0; font-size: 14px; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    align-self: end;
}
.chat-message-ad .chat-ad-price { grid-area: price; margin: 2px 0; font-size: 15px; }
.chat-message-ad .chat-ad-location { grid-area: loc; margin: 0; font-size: 12px; align-self: start; min-width: 0; }
.chat-message-ad .chat-ad-location span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-message-ad .chat-ad-desc, .chat-message-ad .chat-ad-more { display: none; }
.chat-message-ad .ad-badge { transform: scale(0.8); transform-origin: top left; }

/* ============================================
   СВАЙП ПО СООБЩЕНИЮ (как в Telegram)
   ============================================ */
.chat-message { position: relative; will-change: auto; }
.swipe-hint {
    position: absolute; right: -44px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--glass-strong); color: var(--text-secondary); font-size: 14px;
    transition: background .12s, color .12s, transform .12s;
}
.swipe-hint.ready { background: var(--accent); color: #fff; transform: translateY(-50%) scale(1.12); }
.chat-messages { overflow-x: hidden; }

/* ============================================
   СВАЙП ПО ДИАЛОГУ — КРАСНАЯ КНОПКА «УДАЛИТЬ»
   ============================================ */
.swipe-row { position: relative; overflow: hidden; border-radius: 18px; touch-action: pan-y; }
.swipe-row .swipe-fg { position: relative; z-index: 1; background: linear-gradient(var(--glass), var(--glass)), var(--bg); will-change: transform; }
.swipe-del {
    position: absolute; top: 0; right: 0; bottom: 0; width: 88px; z-index: 0;
    border: 0; background: #E5484D; color: #fff; font-weight: 700; font-size: 13px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer;
}
.swipe-del i { font-size: 16px; }
.swipe-del:active { background: #C93338; }

/* ============================================
   ПОДСКАЗКА В ЧАТЕ «ЖИЛЬЁ» + ПРОВЕРЕННЫЙ ХОЗЯИН
   ============================================ */
.housing-hint {
    margin: 4px 0 12px; padding: 12px 14px; border-radius: 16px;
    display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
    background: rgba(18, 168, 168, 0.14); border: 1px solid rgba(18, 168, 168, 0.35);
    font-size: 13px; line-height: 1.4; color: var(--text);
}
.housing-hint > i { color: var(--sea); font-size: 18px; margin-top: 1px; }
.housing-hint button {
    grid-column: 2; justify-self: start; border: 0; border-radius: 999px; padding: 7px 14px;
    background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; touch-action: manipulation;
}
.verified-pill {
    display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 2px 8px;
    border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(18, 168, 168, 0.2); color: var(--sea);
}
.msg-menu-item.danger { color: #E5484D; }

.swipe-del { visibility: hidden; }
.swipe-row.open .swipe-del, .swipe-row.swiping .swipe-del { visibility: visible; }
.swipe-fg, .chat-messages .chat-bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ===== Баннеры уведомлений сверху (в стиле Telegram) ===== */
#bannerHost{position:fixed;top:0;left:0;right:0;z-index:100000;display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:calc(env(safe-area-inset-top,0px) + 8px) 10px 0;pointer-events:none}
.banner{pointer-events:auto;width:100%;max-width:440px;display:flex;align-items:center;gap:12px;padding:10px 14px 10px 10px;
  border-radius:22px;background:rgba(28,38,56,.96);color:#fff;border:1px solid rgba(255,255,255,.08);
  box-shadow:0 10px 30px rgba(0,0,0,.35);touch-action:none;user-select:none;-webkit-user-select:none;cursor:pointer;
  transform:translateY(-130%);opacity:0;transition:transform .32s cubic-bezier(.2,.9,.3,1.1),opacity .25s}
.banner.in{transform:translateY(0);opacity:1}
.banner.out{opacity:0;transition:transform .25s ease-in,opacity .25s}
.banner.drag{transition:none}
.banner.compact{justify-content:center;width:auto;max-width:92%;padding:10px 18px;border-radius:999px}
.banner-avatar{flex:none;width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:18px;color:#fff;background:#3E7BFF}
.banner-avatar.kind-group{background:#12A8A8}.banner-avatar.kind-reply{background:#7C5CFF}.banner-avatar.kind-invite{background:#D98A1E}
.banner-avatar.kind-verify{background:#2FA66A}.banner-avatar.kind-listing{background:#C2417A}.banner-avatar.kind-info{background:#E8643F}
.banner-text{min-width:0;flex:1}
.banner-head{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.banner-title{font-weight:700;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.banner-time{flex:none;font-size:12px;opacity:.55}
.banner-body{font-size:14px;line-height:1.3;opacity:.92;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
.banner.compact .banner-body{text-align:center;opacity:1;-webkit-line-clamp:3}
@media (prefers-reduced-motion:reduce){.banner{transition:opacity .2s}}

/* ===== Карточка настроек уведомлений ===== */
.notify-card{display:flex;flex-direction:column;gap:12px}
.notify-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.notify-info{display:flex;flex-direction:column;gap:2px;min-width:0}
.notify-info span{font-size:13px;opacity:.7;line-height:1.35}
.switch{flex:none;position:relative;width:48px;height:28px;border-radius:999px;border:0;background:rgba(128,128,128,.4);cursor:pointer;transition:background .2s}
.switch i{position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;transition:transform .2s}
.switch.on{background:#2FA66A}.switch.on i{transform:translateX(20px)}
.notify-test{align-self:flex-start;border:0;background:none;color:inherit;opacity:.75;font:inherit;font-size:13px;padding:4px 0;cursor:pointer;text-decoration:underline}
