/* sell ствол — шаблон sellstvol.ru */
:root {
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-light: #eff6ff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #f1f5f9;
    --card: #ffffff;
    --yellow: #fef9c3;
    --yellow-border: #fde047;
    --orange: #fff7ed;
    --radius: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,.06);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.08);
    --transition: .2s ease;
    --vip: #eab308;
    --urgent: #ea580c;
    --glass: rgba(255, 255, 255, .82);
    --bg-soft: #f8fafc;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
    display: flex;
    flex-direction: column;
}
.container { max-width: 1140px; margin: 0 auto; padding: 0 16px; width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
img { max-width: 100%; height: auto; display: block; }

.bg-particles {
    display: none;
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    opacity: .45;
}
.header, .legal-strip, .main-content, .footer, .flash-container, .mobile-bottom-nav { position: relative; z-index: 1; }
.main-content { flex: 1; padding-bottom: 8px; }

/* Универсальный контейнер для фото — фиксирует «сползание» */
.thumb-box {
    width: 100px; height: 72px; flex-shrink: 0;
    overflow: hidden; border-radius: 8px;
    background: #f8fafc; border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
}
.thumb-img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: cover; }
.thumb-placeholder { object-fit: contain !important; padding: 6px; }

@keyframes fadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }
@keyframes shimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes floatSoft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes tierGlowVip {
    0%, 100% { box-shadow: 0 0 6px rgba(234,179,8,.12), 0 2px 8px rgba(0,0,0,.05); }
    50% { box-shadow: 0 0 10px rgba(234,179,8,.2), 0 2px 8px rgba(0,0,0,.05); }
}
@keyframes tierGlowUrgent {
    0%, 100% { box-shadow: 0 0 6px rgba(249,115,22,.1), 0 2px 8px rgba(0,0,0,.05); }
    50% { box-shadow: 0 0 10px rgba(249,115,22,.18), 0 2px 8px rgba(0,0,0,.05); }
}
@keyframes tierBadgeShine {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.animate-fade-up { animation: fadeUp .45s ease forwards; }
.reveal-ready { opacity: 0; transform: translateY(20px); transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal-ready.revealed { opacity: 1; transform: none; }

/* ── HEADER (desktop — классика) ── */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
}
.header-row {
    display: flex; align-items: center; gap: 20px;
    padding: 14px 20px; max-width: 1140px; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 20px; font-weight: 500; flex-shrink: 0; }
.logo img { width: 40px; height: 40px; border-radius: 50%; }
.logo strong { font-weight: 700; color: var(--blue); }

.nav-main { display: flex; gap: 4px; flex: 1; }
.nav-link { padding: 8px 14px; border-radius: 8px; color: var(--text-muted); font-size: 15px; font-weight: 500; transition: var(--transition); white-space: nowrap; }
.nav-link:hover, .nav-link.active { background: var(--blue-light); color: var(--blue); }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 18px; border-radius: 10px; font-weight: 600; font-size: 14px;
    border: none; cursor: pointer; transition: var(--transition); font-family: inherit; text-decoration: none;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-header-outline { background: var(--card); color: var(--blue); border: 1.5px solid var(--blue); }
.btn-header-outline:hover { background: var(--blue-light); color: var(--blue); }
.btn-outline { background: var(--card); border: 1.5px solid var(--border); color: var(--text); }
.btn-admin-sm { background: #7c3aed; color: #fff; font-size: 12px; padding: 7px 12px; border-radius: 8px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-success { background: #16a34a; color: #fff; }

.header-icon {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 1px solid var(--border); background: var(--card);
    font-size: 18px; position: relative; transition: var(--transition);
}
.header-icon:hover { border-color: var(--blue); }
.header-avatar {
    width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.badge { position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; }

.search-row {
    display: flex; gap: 10px; padding: 0 20px 14px; max-width: 1140px; margin: 0 auto; align-items: center;
}
.search-row input[type="text"] {
    flex: 1; padding: 11px 16px; border: 1px solid var(--border); border-radius: 10px;
    font-size: 15px; font-family: inherit; background: var(--card);
}
.search-row input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.search-row select { padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: var(--card); min-width: 150px; }

.mobile-menu-btn { display: none; }

.menu-backdrop {
    display: none;
    position: fixed; inset: 0; z-index: 140;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
body.menu-open .menu-backdrop { display: block; }

.chat-back-btn {
    display: none;
    width: 36px; height: 36px; flex-shrink: 0;
    align-items: center; justify-content: center;
    border-radius: 10px; background: var(--bg);
    border: 1px solid var(--border); color: var(--text);
    font-size: 18px; font-weight: 700;
}

/* ── LEGAL STRIP ── */
.legal-strip { background: var(--yellow); border-bottom: 1px solid var(--yellow-border); }
.legal-strip-inner {
    display: flex; align-items: center; gap: 10px; padding: 10px 20px;
    font-size: 13px; color: #713f12; flex-wrap: wrap; justify-content: center;
}
.legal-strip a { color: var(--blue); font-weight: 600; white-space: nowrap; }
.banner-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #713f12; opacity: .6; line-height: 1; }

/* ── GUEST ALERT ── */
.guest-alert { padding: 16px 0 0; }
.guest-alert-box {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: var(--orange); border: 1px solid #fed7aa; border-radius: var(--radius);
    padding: 18px 22px;
}
.guest-alert-icon { font-size: 28px; flex-shrink: 0; }
.guest-alert-text { flex: 1; min-width: 200px; }
.guest-alert-text strong { display: block; font-size: 16px; margin-bottom: 4px; color: #9a3412; }
.guest-alert-text p { font-size: 14px; color: #78350f; margin: 0; }
.guest-alert-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── HERO ── */
.hero-banner { padding: 20px 0 16px; }
.hero-box {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff; border-radius: var(--radius); padding: 32px 36px;
    box-shadow: var(--shadow);
}
.hero-box h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.hero-box p { font-size: 16px; opacity: .9; }

/* ── CATEGORIES ── */
.categories-section { padding: 8px 0 16px; }
.categories-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cat-item {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 10px; text-align: center; color: var(--text);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    transition: var(--transition); cursor: pointer; font: inherit; width: 100%;
}
.cat-item.active-cat {
    border-color: var(--blue); background: var(--blue-light); color: var(--blue);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .15);
}
.cat-item:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--blue); }
.cat-item.active-cat:hover { transform: translateY(-2px); }
.cat-item img { width: 52px; height: 52px; object-fit: contain; }
.cat-item span { font-size: 12px; font-weight: 600; line-height: 1.25; }
.form-fields-group[hidden] { display: none !important; }

/* ── FILTERS ── */
.filters-section { padding: 0 0 16px; }
.filters-row {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 16px;
}
.filter-select, .filter-input {
    padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit; background: var(--card); color: var(--text);
}
.filter-input { width: 110px; }
.filter-select:focus, .filter-input:focus { outline: none; border-color: var(--blue); }

/* ── LISTINGS ── */
.listings-section { padding: 8px 0 48px; }
.listings-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.listings-header h2, .section-heading { font-size: 20px; font-weight: 700; }
.section-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
    background: var(--card); border: 1px solid var(--border); color: var(--text-muted);
    transition: var(--transition);
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip-urgent.active { background: #ea580c; border-color: #ea580c; }
.chip-vip.active { background: #ca8a04; border-color: #ca8a04; }

.listings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.listing-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    overflow: hidden; color: var(--text); display: flex; flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    position: relative;
}
.listing-card:hover { transform: translateY(-2px); }
.listing-card:not(.listing-card-vip):not(.listing-card-urgent):hover {
    border-color: var(--blue); box-shadow: var(--shadow);
}

.listing-card-vip {
    border: 1px solid #e8c547;
    animation: tierGlowVip 5s ease-in-out infinite;
}
.listing-card-urgent:not(.listing-card-vip) {
    border: 1px solid #fdba74;
    animation: tierGlowUrgent 5s ease-in-out infinite;
}
.listing-card-vip:hover { border-color: #d4a017; }
.listing-card-urgent:not(.listing-card-vip):hover { border-color: #f97316; }

.listing-image { position: relative; height: 165px; background: #f8fafc; overflow: hidden; flex-shrink: 0; }
.listing-image img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: cover; transition: transform .3s; }
.listing-card:hover .listing-image img:not(.placeholder-img) { transform: scale(1.03); }
.listing-image img.placeholder-img { object-fit: contain; padding: 16px; }

.card-badge {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    padding: 0; border: none; background: none;
}
.listing-card:has(.badge-vip) .badge-urgent { top: 38px; }

.tier-badge {
    display: inline-flex; align-items: center;
    height: 24px; border-radius: 6px; overflow: hidden;
    font-size: 10px; font-weight: 800; letter-spacing: .04em;
    text-transform: uppercase; line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.tier-badge-lg { height: 28px; border-radius: 8px; font-size: 11px; }
.tier-badge-icon {
    width: 26px; height: 100%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.tier-badge-label {
    display: flex; align-items: center;
    padding: 0 8px 0 2px; white-space: nowrap;
}
.tier-badge-lg .tier-badge-label { padding: 0 10px 0 4px; }

.tier-badge-vip {
    background: linear-gradient(135deg, #f7e08a 0%, #e8c547 50%, #d4a017 100%);
    background-size: 200% 100%;
    color: #5c4a00;
    animation: tierBadgeShine 8s ease-in-out infinite;
}
.tier-badge-vip .tier-badge-icon { background: rgba(255,255,255,.22); }
.tier-badge-vip .tier-badge-label { text-shadow: 0 1px 0 rgba(255,255,255,.3); }
.tier-svg-crown { width: 13px; height: 11px; display: block; }

.tier-badge-urgent {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: #fff;
}
.tier-badge-urgent .tier-badge-label { text-shadow: 0 1px 1px rgba(0,0,0,.15); }
.tier-svg-flame { width: 11px; height: 14px; display: block; }

.listing-body { padding: 12px 14px 14px; flex: 1; display: flex; flex-direction: column; }
.listing-price { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.listing-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; line-height: 1.3; }
.listing-category { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.listing-location { font-size: 13px; color: var(--text-muted); }
.listing-footer {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: var(--text-muted); margin-top: auto;
}
.listing-place { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
.listing-views { display: flex; align-items: center; gap: 3px; flex-shrink: 0; font-weight: 600; }
.views-eye { opacity: .75; }
.old-price { font-size: 14px; color: var(--text-muted); text-decoration: line-through; font-weight: 400; }

/* ── LISTING PAGE ── */
.listing-page { padding: 24px 0 48px; }
.listing-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 32px; }
.gallery-main { position: relative; border-radius: 10px; overflow: hidden; background: #f8fafc; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; }
.gallery-main img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-main img.placeholder-img { object-fit: contain; padding: 24px; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; }
.gallery-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.gallery-thumbs img.active { border-color: var(--blue); }

.listing-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tag-type { background: var(--blue-light); color: var(--blue); padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.tag-vip, .tag-urgent { padding: 0; background: none; border-radius: 0; }
.tag-wanted { background: #dbeafe; color: #1d4ed8; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.tag-wanted-sm { font-size: 11px; padding: 2px 8px; margin-right: 4px; }
.badge-wanted { background: #2563eb; color: #fff; }

.wanted-page { padding-bottom: 48px; }
.wanted-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin: 24px 0; flex-wrap: wrap; }
.wanted-lead { color: var(--text-muted); max-width: 640px; margin-top: 8px; }
.wanted-count { color: var(--text-muted); margin: 16px 0; }
.wanted-snippet { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
.listing-card-wanted .wanted-card-image { background: linear-gradient(135deg, #eff6ff, #f8fafc); }
.wanted-budget { color: var(--blue); }
.wanted-form-intro { margin-bottom: 24px; }
.wanted-form-intro .page-title { margin-top: 12px; }
.wanted-detail-image { background: linear-gradient(135deg, #eff6ff, #f8fafc); display: flex; align-items: center; justify-content: center; }
.wanted-offer-hint { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 16px; margin: 20px 0; }
.wanted-offer-hint p { margin: 6px 0 0; color: var(--text-muted); font-size: 14px; }
.seller-role-hint { display: block; font-size: 13px; color: var(--text-muted); }
.form-note { background: var(--bg-soft); border-radius: 10px; padding: 14px; margin: 20px 0; color: var(--text-muted); font-size: 14px; }
.listing-page-title { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.listing-page-price { font-size: 30px; font-weight: 800; margin-bottom: 20px; }

.specs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.spec-item { background: var(--bg); padding: 12px; border-radius: 8px; border: 1px solid var(--border); }
.spec-item span { display: block; font-size: 12px; color: var(--text-muted); }
.spec-item strong { font-size: 15px; }

.listing-description { margin-bottom: 20px; }
.listing-description h3 { font-size: 16px; margin-bottom: 8px; }
.listing-description p { color: var(--text-muted); font-size: 15px; }

.seller-block { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.seller-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.seller-rating { color: #ca8a04; font-size: 14px; margin-left: 8px; }
.verified { color: #16a34a; font-size: 13px; font-weight: 600; margin-left: 6px; }
.verified-badge-sm {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%; background: #dcfce7; color: #16a34a;
    font-size: 10px; font-weight: 700; margin-left: 4px;
}
.profile-verify-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; max-width: 420px; }
.seller-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.similar-section { margin-top: 8px; }
.similar-section .section-heading { margin-bottom: 16px; }

/* ── FORMS / AUTH ── */
.form-page, .payment-page, .profile-page, .admin-page, .messages-page, .messages-inbox-page, .favorites-page { padding: 28px 0 48px; }
.admin-header h1 { font-size: 26px; font-weight: 700; }
.page-title { font-size: 28px; font-weight: 700; margin-bottom: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { font-weight: 600; font-size: 14px; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
    padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 15px; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.listing-form, .settings-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }

/* ── PHOTO UPLOAD ── */
.photo-upload { display: flex; gap: 12px; flex-wrap: wrap; }
.photo-slot {
    position: relative; width: 100px; height: 100px;
    border: 2px dashed var(--border); border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden; background: #f8fafc;
    transition: var(--transition);
}
.photo-slot:hover { border-color: var(--blue); background: var(--blue-light); }
.photo-slot input[type="file"] {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer; z-index: 2; font-size: 0;
}
.photo-slot > span {
    font-size: 36px; font-weight: 300; color: var(--text-muted);
    pointer-events: none; line-height: 1; z-index: 1;
}
.photo-slot.has-preview > span { display: none; }
.photo-slot.has-preview input[type="file"] { z-index: 4; }
.photo-slot img.preview {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 2; border-radius: 10px;
    pointer-events: none;
}
.photo-slot.has-preview {
    border-style: solid; border-color: var(--blue);
}
.photo-remove {
    display: none;
    position: absolute; top: 3px; right: 3px; z-index: 10;
    width: 26px; height: 26px; padding: 0;
    border: 2px solid #fff; border-radius: 50%;
    background: #dc2626; color: #fff;
    font-size: 18px; line-height: 1; font-weight: 700;
    cursor: pointer; align-items: center; justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,.35);
    pointer-events: auto;
}
.photo-slot.has-preview .photo-remove { display: flex; }
.photo-remove:hover { background: #b91c1c; }
.photo-preview { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.photo-upload-hint { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

.tier-selector h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.tier-card input[type="radio"] { display: none; }
.tier-card:has(input:checked) { border-color: var(--blue); background: var(--blue-light); }
.tier-content { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.tier-name { font-weight: 700; font-size: 15px; }
.tier-price { font-size: 18px; font-weight: 800; color: var(--blue); }
.tier-desc { font-size: 12px; color: var(--text-muted); }
.fee-preview { margin: 20px 0; font-size: 16px; }
.free-badge-lg { color: #16a34a; font-weight: 600; }

.auth-page { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px; width: 100%; max-width: 420px; box-shadow: var(--shadow); }
.auth-logo { width: 64px; margin: 0 auto 14px; border-radius: 50%; }
.auth-card h1 { text-align: center; font-size: 24px; margin-bottom: 6px; }
.auth-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 22px; font-size: 14px; }
.auth-link { text-align: center; margin-top: 18px; color: var(--text-muted); font-size: 14px; }
.checkbox-agree {
    display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 22px;
    font-size: 13px; color: var(--text-muted); line-height: 1.45; cursor: pointer;
}
.checkbox-agree input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--blue); }
.checkbox-agree a { font-weight: 600; }

/* ── FLASH ── */
.flash-container { position: fixed; top: 80px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); max-width: 360px; }
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.flash-danger { background: #fee2e2; color: #991b1b; }
.flash-warning { background: #fef3c7; color: #92400e; }
.flash-info { background: #dbeafe; color: #1e40af; }

/* ── MESSENGER / CHAT ── */
.messages-inbox-page { padding: 24px 0 48px; }
.messages-layout {
    display: grid; grid-template-columns: 340px 1fr; gap: 0;
    background: var(--card); border: 1px solid var(--border); border-radius: 16px;
    overflow: hidden; box-shadow: var(--shadow);
    height: clamp(480px, calc(100vh - 240px), 680px);
}
.messages-sidebar {
    border-right: 1px solid var(--border); display: flex; flex-direction: column;
    background: #fafbfc; min-height: 0; overflow: hidden;
}
.messages-sidebar-head { padding: 20px 18px 14px; border-bottom: 1px solid var(--border); }
.messages-sidebar-head h1 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.messages-search {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px;
    font-size: 14px; font-family: inherit; background: var(--card);
}
.messages-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.messages-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
.messages-list-item {
    display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
    border-radius: 12px; color: var(--text); transition: var(--transition); position: relative;
}
.messages-list-item:hover { background: var(--blue-light); }
.messages-list-item.active { background: var(--blue-light); border: 1px solid #bfdbfe; }
.messages-avatar {
    width: 44px; height: 44px; border-radius: 50%; background: var(--blue); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; flex-shrink: 0;
}
.messages-preview { flex: 1; min-width: 0; }
.messages-preview-top { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.messages-preview-top strong { font-size: 15px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messages-date { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.messages-listing-title { font-size: 12px; color: var(--blue); font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.messages-last { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.messages-unread {
    position: absolute; top: 12px; right: 10px; background: var(--blue); color: #fff;
    font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.messages-sidebar-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.messages-main {
    display: flex; flex-direction: column; min-height: 0; overflow: hidden;
    background: var(--card); height: 100%;
}
.messages-empty {
    flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 40px; color: var(--text-muted);
}
.messages-empty-icon { font-size: 56px; opacity: .35; margin-bottom: 16px; }
.messages-empty h2 { font-size: 22px; color: var(--text); margin-bottom: 8px; }

.chat-panel {
    display: flex; flex-direction: column; min-height: 0; height: 100%; overflow: hidden;
}
.chat-panel-header {
    display: flex; justify-content: flex-start; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--card);
    flex-shrink: 0;
}
.chat-panel-user { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.chat-panel-user strong { display: block; font-size: 16px; }
.chat-panel-listing { display: block; font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.chat-panel-listing:hover { color: var(--blue); }
.chat-panel-actions { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }

.chat-alert { padding: 10px 16px; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; flex-shrink: 0; }
.chat-alert-warning { background: #fff7ed; border-bottom: 1px solid #fed7aa; color: #9a3412; }
.chat-alert-danger { background: #fef2f2; border-bottom: 1px solid #fecaca; color: #991b1b; }
.chat-monitor-notice {
    font-size: 12px; color: var(--text-muted); background: #f8fafc;
    border-bottom: 1px solid var(--border); padding: 8px 16px; flex-shrink: 0;
}

.chat-messages {
    flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
    padding: 20px; display: flex; flex-direction: column; gap: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.chat-waiting { text-align: center; color: var(--text-muted); padding: 60px 20px; }

.message { max-width: 78%; display: flex; flex-direction: column; }
.message-own { align-self: flex-end; align-items: flex-end; }
.message-other { align-self: flex-start; align-items: flex-start; }
.message-bubble { display: flex; flex-direction: column; }
.message-content {
    padding: 11px 15px; border-radius: 16px; font-size: 15px; line-height: 1.45;
    word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.message-own .message-content { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.message-other .message-content { background: var(--card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.message-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; padding: 0 4px; }

.msg-flag {
    display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 8px;
    border-radius: 6px; margin-bottom: 4px;
}
.msg-flag-warning { background: #fef3c7; color: #92400e; }
.msg-flag-danger { background: #fee2e2; color: #991b1b; }
.message-flagged-warning .message-content { box-shadow: 0 0 0 2px #f59e0b; }
.message-flagged-danger .message-content { box-shadow: 0 0 0 2px #ef4444; }

.chat-input {
    display: flex; gap: 8px; align-items: center; flex-shrink: 0;
    background: var(--card); border-top: 1px solid var(--border); padding: 14px 16px;
}
.chat-input input {
    flex: 1; border: 1px solid var(--border); background: var(--bg); border-radius: 24px;
    padding: 11px 18px; font-size: 15px; font-family: inherit;
}
.chat-input input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.msg-file { display: inline-block; margin-top: 6px; color: inherit; text-decoration: underline; }
.attach-btn {
    cursor: pointer; font-size: 18px; padding: 8px; border-radius: 50%;
    transition: var(--transition); flex-shrink: 0;
}
.attach-btn:hover { background: var(--bg); }

.chat-toast {
    padding: 10px 16px; font-size: 13px; border-bottom: 1px solid var(--border);
    animation: fadeUp .3s ease;
}
.chat-toast-warning { background: #fff7ed; color: #9a3412; }
.chat-toast-danger { background: #fef2f2; color: #991b1b; }

/* Старый одиночный чат — совместимость */
.chat-page { padding: 20px 0 48px; max-width: 860px; margin: 0 auto; }

/* ── ADMIN ── */
.admin-header { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.stat-num { display: block; font-size: 26px; font-weight: 800; color: var(--blue); }
.admin-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 9px 16px; border-radius: 8px; background: var(--card); border: 1px solid var(--border); color: var(--text-muted); font-weight: 600; font-size: 14px; }
.tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.admin-table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.admin-table th { background: var(--bg); font-weight: 600; }
.status-badge { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.status-success { background: #dcfce7; color: #166534; }
.status-warning { background: #fef3c7; color: #92400e; }
.status-danger { background: #fee2e2; color: #991b1b; }
.status-info { background: #dbeafe; color: #1e40af; }
.status-muted { background: #f1f5f9; color: #64748b; }

/* ── HOME SECTIONS ── */
.home-stats { padding: 0 0 8px; }
.home-stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.home-stat-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px 16px; text-align: center;
    box-shadow: var(--shadow); transition: var(--transition);
}
.home-stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.home-stat-num {
    display: block; font-size: 28px; font-weight: 800; color: var(--blue);
    line-height: 1.1; margin-bottom: 4px;
}
.home-stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.home-stat-vip .home-stat-num { color: var(--vip); }
.home-stat-urgent .home-stat-num { color: var(--urgent); }

.home-trust { padding: 8px 0 20px; }
.home-trust-inner {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.home-trust-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--card); border: 1px solid var(--border); border-radius: 999px;
    padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--text);
    box-shadow: var(--shadow);
}
.home-trust-badge span { font-size: 18px; line-height: 1; }

.home-features { padding: 32px 0; }
.home-section-head { text-align: center; margin-bottom: 24px; }
.home-section-head h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.home-section-head p { font-size: 15px; color: var(--text-muted); }
.home-features-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.home-feature-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 22px 18px; text-align: center; transition: var(--transition);
}
.home-feature-card:hover { border-color: #bfdbfe; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.home-feature-icon {
    width: 48px; height: 48px; margin: 0 auto 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--blue-light); border-radius: 12px; font-size: 24px;
}
.home-feature-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.home-feature-card p { font-size: 13px; color: var(--text-muted); line-height: 1.45; }

.home-steps { padding: 8px 0 32px; }
.home-steps-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.home-step-card {
    background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px 20px; position: relative; overflow: hidden;
}
.home-step-num {
    position: absolute; top: 12px; right: 14px;
    font-size: 42px; font-weight: 800; color: rgba(37, 99, 235, .08); line-height: 1;
}
.home-step-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.home-step-card p { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.home-step-card a { font-size: 13px; font-weight: 600; margin-top: 10px; display: inline-block; }

.home-cta { padding: 0 0 36px; }
.home-cta-box {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%);
    color: #fff; border-radius: var(--radius); padding: 32px 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    box-shadow: 0 8px 32px rgba(37, 99, 235, .28);
}
.home-cta-box h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.home-cta-box p { font-size: 15px; opacity: .92; max-width: 520px; }
.home-cta-actions { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }
.home-cta-box .btn-primary {
    background: #fff; color: var(--blue); border: none;
}
.home-cta-box .btn-primary:hover { background: #eff6ff; color: var(--blue-dark); }
.home-cta-box .btn-header-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, .75);
    color: #fff;
}
.home-cta-box .btn-header-outline:hover { background: rgba(255,255,255,.15); color: #fff; border-color: #fff; }

/* ── FOOTER ── */
.footer {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #94a3b8; margin-top: 0; flex-shrink: 0;
}
.footer-brand {
    display: flex; align-items: center; gap: 12px;
    padding: 28px 20px 0; max-width: 1140px; margin: 0 auto;
    border-bottom: 1px solid #334155;
}
.footer-brand img { width: 36px; height: 36px; border-radius: 8px; }
.footer-brand-text strong { color: #f1f5f9; font-size: 18px; }
.footer-brand-text span { display: block; font-size: 13px; color: #64748b; margin-top: 2px; }
.footer-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
    padding: 28px 20px 28px; max-width: 1140px; margin: 0 auto;
}
.footer-col h4 { color: #f1f5f9; font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.footer-col a, .footer-col span { display: block; font-size: 14px; color: #94a3b8; margin-bottom: 8px; line-height: 1.4; }
.footer-col a:hover { color: #fff; }
.footer-important { color: #fbbf24 !important; font-weight: 600; }
.footer-inn { font-size: 12px !important; margin-top: 4px; color: #64748b !important; }
.footer-bottom { border-top: 1px solid #334155; padding: 18px 0; text-align: center; }
.footer-bottom p { font-size: 13px; margin-bottom: 4px; color: #94a3b8; }
.footer-note { font-size: 12px !important; opacity: .7; }

.empty-state { text-align: center; padding: 48px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.main-content { min-height: 50vh; }

/* ── MISC / PROFILE / ADMIN DETAIL ── */
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

/* Профиль */
.profile-header {
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 28px; margin-bottom: 28px; box-shadow: var(--shadow);
}
.profile-avatar-wrap { flex-shrink: 0; }
.profile-avatar-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.profile-avatar-letter {
    width: 80px; height: 80px; border-radius: 50%; background: var(--blue); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700;
}
.profile-info { flex: 1; min-width: 200px; }
.profile-info h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.profile-meta { color: var(--text-muted); font-size: 15px; margin-bottom: 8px; }
.profile-bio { color: var(--text-muted); font-size: 14px; margin-bottom: 12px; }
.profile-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.profile-stat { text-align: center; min-width: 80px; }
.profile-stat strong { display: block; font-size: 24px; font-weight: 800; color: var(--blue); }
.profile-stat span { font-size: 13px; color: var(--text-muted); }

.my-listings { display: flex; flex-direction: column; gap: 12px; }
.my-listing-card {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 20px; box-shadow: var(--shadow);
}
.my-listing-body { flex: 1; min-width: 180px; }
.my-listing-body h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.my-listing-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.my-listing-price { font-size: 18px; font-weight: 700; color: var(--text); }
.my-listing-expires { font-size: 13px; color: var(--text-muted); }
.my-listing-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Админ */
.admin-badge { background: var(--blue-light); color: var(--blue); padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.admin-search {
    display: flex; gap: 10px; margin-bottom: 16px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 16px;
}
.admin-search input {
    flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 15px; font-family: inherit;
}
.admin-search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.admin-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-block { padding: 20px; }
.dash-block h3 { margin-bottom: 14px; font-size: 16px; font-weight: 700; }

.actions-cell { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.admin-pay-actions { display: flex; flex-direction: column; gap: 4px; min-width: 130px; margin-right: 4px; }
.admin-pay-form { display: block; width: 100%; }
.admin-pay-btn { width: 100%; font-size: 11px; padding: 7px 8px; line-height: 1.2; white-space: normal; text-align: center; }
.inline-form { display: inline-flex; margin: 0; }

.duration-cell { min-width: 160px; }
.expires-date { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.duration-controls { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
.btn-dur {
    padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--card); font-size: 12px; font-weight: 700; cursor: pointer;
    font-family: inherit; transition: var(--transition);
}
.btn-dur:hover { border-color: var(--blue); color: var(--blue); }
.btn-dur-minus:hover { border-color: #dc2626; color: #dc2626; background: #fef2f2; }
.btn-dur-plus:hover { border-color: #16a34a; color: #16a34a; background: #dcfce7; }
.set-date-form { display: flex; gap: 4px; align-items: center; }
.date-input { padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; width: 130px; }

.admin-user-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
.admin-user-card { padding: 24px; }
.admin-user-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.admin-user-card.full-width { grid-column: 1 / -1; }
.admin-user-card .form-group { margin-bottom: 14px; }
.admin-user-card textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 15px; margin-bottom: 12px; resize: vertical; }
.admin-user-card select { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.admin-action-form { margin-top: 14px; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row-danger { background: #fef2f2 !important; }
.row-warning { background: #fffbeb !important; }
.badge-inline { background: #ef4444; color: #fff; padding: 2px 8px; border-radius: 10px; font-size: 11px; margin-left: 4px; }
.empty-cell { text-align: center; padding: 40px !important; color: var(--text-muted); }

/* Сообщения / избранное */
.chats-list { display: flex; flex-direction: column; gap: 10px; }
.chat-item {
    display: flex; align-items: center; gap: 14px;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 18px; color: var(--text); transition: var(--transition);
}
.chat-item:hover { border-color: var(--blue); box-shadow: var(--shadow); color: var(--text); }
.chat-item-img { width: 56px; height: 56px; flex-shrink: 0; overflow: hidden; border-radius: 8px; background: #f8fafc; border: 1px solid var(--border); }
.chat-item-img img { width: 100%; height: 100%; object-fit: cover; }
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-body h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.chat-item-body p { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-meta { text-align: right; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

.notifications-list { display: flex; flex-direction: column; gap: 8px; }
.notification-item {
    background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--blue);
    border-radius: var(--radius); padding: 14px 18px;
}
.notification-item span { font-size: 12px; color: var(--text-muted); display: block; margin-top: 8px; }
.notif-action { margin-top: 10px; }

.support-contacts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.support-contact-card { padding: 20px; }
.support-layout { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

.payment-card, .disclaimer-content { padding: 36px; box-shadow: var(--shadow); }
.payment-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    max-width: 560px; margin: 0 auto;
}
.payment-subtitle { color: var(--text-muted); margin-bottom: 24px; font-size: 14px; }
.payment-details { background: var(--bg-soft); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; }
.payment-item, .payment-total {
    display: flex; justify-content: space-between; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--border); font-size: 14px;
}
.payment-item:last-of-type { border-bottom: none; }
.payment-total { border-top: 2px solid var(--border); border-bottom: none; margin-top: 4px; padding-top: 14px; font-size: 16px; }
.fee-amount { color: var(--blue); font-size: 22px; }
.payment-methods { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.payment-method-form { margin: 0; }
.payment-method {
    display: flex; align-items: center; gap: 14px; width: 100%;
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; transition: var(--transition); text-align: left; cursor: pointer;
    color: inherit; font: inherit;
}
.payment-method:hover { border-color: #93c5fd; box-shadow: var(--shadow); transform: translateY(-1px); }
.payment-method strong { display: block; font-size: 15px; margin-bottom: 2px; }
.payment-method span { font-size: 13px; color: var(--text-muted); }
.method-icon { font-size: 28px; flex-shrink: 0; }
.payment-unavailable {
    background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius);
    padding: 16px 18px; text-align: center;
}
.payment-unavailable p { font-size: 14px; color: #78350f; margin: 8px 0 12px; }
.payment-note { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.payment-note-small { margin-top: 8px; opacity: .85; }
.payment-wait-card { text-align: center; max-width: 480px; }
.payment-wait-icon { font-size: 48px; margin-bottom: 12px; }
.payment-wait-spinner {
    width: 32px; height: 32px; margin: 16px auto;
    border: 3px solid var(--border); border-top-color: var(--blue);
    border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.payment-method.yoomoney { border-color: #a7f3d0; background: #f0fdf4; }
.payment-one-btn { width: 100%; padding: 16px 24px; font-size: 17px; margin-top: 8px; }
.manual-pay-block h2 { font-size: 18px; margin-bottom: 14px; }
.manual-card-info {
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; margin-bottom: 16px; font-size: 14px;
}
.manual-card-info p { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.manual-card-info p:last-child { border-bottom: none; }
.manual-card-info span { color: var(--text-muted); }
.payment-code-box {
    text-align: center; background: #eff6ff; border: 2px dashed #93c5fd;
    border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
}
.payment-code-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.payment-code-value { font-size: 36px; font-weight: 800; letter-spacing: 4px; color: var(--blue); font-variant-numeric: tabular-nums; }
.payment-code-hint { font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.payment-wait-banner {
    background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius);
    padding: 18px; margin-bottom: 16px; text-align: center;
}
.payment-wait-banner p { font-size: 14px; color: #78350f; margin: 8px 0 12px; }
.payment-service-notice {
    background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius);
    padding: 16px 18px; margin-bottom: 18px; text-align: left;
}
.payment-service-notice strong { display: block; font-size: 15px; color: #1e40af; margin-bottom: 6px; }
.payment-service-notice p { font-size: 14px; color: #1e3a8a; margin: 0; line-height: 1.5; }
.payment-timing-hint { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; }
.payment-timing-bottom { text-align: center; margin-top: 14px; }
.payment-timing-hint strong { color: var(--text); }
.pay-code-cell { font-weight: 700; letter-spacing: 1px; background: #eff6ff; padding: 2px 6px; border-radius: 4px; }
.btn-warning { background: #f59e0b; color: #fff; border: none; }
.btn-warning:hover { background: #d97706; color: #fff; }
.settings-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; word-break: break-all; }
.settings-hint code { background: var(--bg-soft); padding: 2px 6px; border-radius: 4px; font-size: 12px; }

.payment-mode-switch {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 20px;
}
.payment-mode-option { cursor: pointer; margin: 0; }
.payment-mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.payment-mode-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 18px 16px; border: 2px solid var(--border); border-radius: var(--radius);
    background: var(--card); transition: var(--transition); min-height: 100%;
}
.payment-mode-card strong { font-size: 16px; color: var(--text); }
.payment-mode-card small { font-size: 12px; color: var(--text-muted); line-height: 1.4; text-align: left; }
.payment-mode-icon { font-size: 28px; line-height: 1; margin-bottom: 4px; }
.payment-mode-option input:checked + .payment-mode-card {
    border-color: var(--blue); background: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.payment-free-toggle { margin-top: 4px; }
.settings-advanced { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--bg-soft); }
.settings-advanced summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.payment-mode-inline { display: block; margin: 12px 0; }
.payment-mode-card-sm { flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; min-height: 0; }

@media (max-width: 560px) {
    .payment-mode-switch { grid-template-columns: 1fr; }
}
.tier-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.tier-card { cursor: pointer; border: 2px solid var(--border); border-radius: var(--radius); }
.settings-block { padding: 20px; margin-bottom: 16px; }
.highlight-block { background: var(--blue-light); border-color: #bfdbfe; }
.toggle-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle-slider { width: 48px; height: 26px; background: #cbd5e1; border-radius: 13px; position: relative; transition: var(--transition); }
.toggle-slider::after { content: ''; position: absolute; width: 20px; height: 20px; background: #fff; border-radius: 50%; top: 3px; left: 3px; transition: var(--transition); }
.toggle-switch input { display: none; }
.toggle-switch input:checked + .toggle-slider { background: #16a34a; }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(22px); }

.msg-image { max-width: 200px; max-height: 200px; border-radius: 8px; margin-top: 6px; object-fit: cover; }
.attach-btn { cursor: pointer; font-size: 18px; padding: 6px; }

/* ── MOBILE BOTTOM NAV ── */
.mobile-bottom-nav { display: none; }

/* ── RESPONSIVE (мобильная — премиум) ── */
@media (max-width: 900px) {
    body { background: #eef2ff; }

    .bg-particles { display: block; }

    .header {
        background: var(--glass);
        border-bottom: 1px solid rgba(226, 232, 240, .8);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        position: sticky; top: 0; z-index: 100;
    }

    .btn-primary {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
    }
    .btn-primary:hover {
        background: linear-gradient(135deg, #1d4ed8, #1e3a8a);
        transform: translateY(-1px);
    }

    .hero-box {
        background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
        box-shadow: var(--shadow-lg);
        position: relative; overflow: hidden;
    }
    .hero-box::before {
        content: ''; position: absolute; inset: 0;
        background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.12) 50%, transparent 60%);
        background-size: 200% 100%;
        animation: shimmer 6s ease-in-out infinite;
        pointer-events: none;
    }
    .hero-box h1, .hero-box p { position: relative; z-index: 1; }

    .listing-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }

    .header-row { padding: 10px 12px; gap: 10px; flex-wrap: nowrap; }
    .logo span { display: none; }
    .logo img { width: 36px; height: 36px; }
    .header-actions .btn-header-outline { display: none; }
    .header-actions { gap: 4px; }
    .header-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 8px; }
    .header-avatar { width: 34px; height: 34px; font-size: 14px; }
    .btn-admin-sm { padding: 5px 8px; font-size: 11px; }

    .nav-main {
        display: none;
        position: fixed; top: 58px; left: 12px; right: 12px;
        background: var(--card); border: 1px solid var(--border);
        border-radius: var(--radius); box-shadow: var(--shadow-lg);
        flex-direction: column; padding: 8px; z-index: 210;
        animation: fadeUp .25s ease;
    }
    body.menu-open .header { z-index: 200; }
    body.menu-open .nav-main { display: flex; }
    .nav-link { padding: 12px 14px; border-radius: 8px; }

    .mobile-menu-btn {
        display: flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; background: var(--blue-light);
        border: 1px solid #bfdbfe; border-radius: 10px;
        font-size: 20px; cursor: pointer; color: var(--blue); flex-shrink: 0;
    }

    .search-row {
        flex-wrap: wrap; padding: 0 12px 10px; gap: 8px;
    }
    .search-row input[type="text"] {
        width: 100%; flex: 1 1 100%; min-width: 0; order: 1;
    }
    .search-row .btn-primary { order: 2; flex: 1; }
    .search-row select { order: 3; flex: 1; min-width: 0; width: auto; }

    .legal-strip-inner { padding: 8px 12px; font-size: 12px; gap: 6px; }

    .categories-row { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .cat-item { padding: 12px 6px; gap: 6px; }
    .cat-item img { width: 40px; height: 40px; }
    .cat-item span { font-size: 10px; }

    .filters-row { padding: 10px; gap: 8px; }
    .filter-select, .filter-input { flex: 1; min-width: calc(50% - 4px); font-size: 13px; }
    .filter-input { width: auto; }

    .listings-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .listing-image { height: 130px; }
    .listing-body { padding: 10px 12px 12px; }
    .listing-price { font-size: 16px; }
    .listing-title { font-size: 13px; }
    .listing-location { font-size: 11px; }

    .listings-header { flex-direction: column; align-items: flex-start; gap: 8px; }
    .listings-header h2 { font-size: 18px; }
    .section-chips { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    .chip { flex-shrink: 0; font-size: 12px; padding: 5px 12px; }

    .hero-box { padding: 22px 20px; }
    .hero-box h1 { font-size: 20px; }
    .hero-box p { font-size: 14px; }

    .listing-detail { grid-template-columns: 1fr; padding: 16px; gap: 20px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .form-grid, .tier-cards, .admin-dashboard, .admin-user-grid { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-stats { justify-content: center; }
    .my-listing-card { flex-direction: column; align-items: flex-start; }
    .messages-layout { grid-template-columns: 1fr; height: calc(100dvh - 130px); min-height: 420px; border-radius: 12px; }
    .messages-inbox-page { padding: 8px 0 80px; }
    .messages-inbox-page .container { padding: 0 8px; max-width: 100%; }
    .messages-sidebar { max-height: 38vh; border-right: none; border-bottom: 1px solid var(--border); }
    .messages-layout.has-active-chat .messages-sidebar { display: none; }
    .messages-layout.has-active-chat { height: calc(100dvh - 130px); }
    .messages-layout.has-active-chat .messages-main { min-height: 0; flex: 1; }
    .messages-main, .chat-panel { min-height: 0; height: 100%; }
    .chat-panel-header { padding: 10px 12px; flex-wrap: nowrap; gap: 8px; }
    .chat-panel-header .chat-panel-user { min-width: 0; flex: 1; }
    .chat-panel-listing { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .chat-back-btn { display: inline-flex; }
    .chat-messages { padding: 12px 10px; gap: 10px; flex: 1; min-height: 0; }
    .message { max-width: 88%; }
    .message-content { font-size: 14px; padding: 10px 13px; }
    .chat-input { padding: 10px 8px; gap: 6px; flex-wrap: nowrap; }
    .chat-input input { min-width: 0; font-size: 16px; padding: 10px 14px; }
    .chat-input .btn-primary { padding: 10px 14px; font-size: 13px; flex-shrink: 0; }
    .chat-alert, .chat-monitor-notice { font-size: 12px; padding: 8px 10px; }
    .messages-list-item { padding: 10px 12px; }
    .messages-avatar { width: 40px; height: 40px; font-size: 15px; }

    .wanted-hero { flex-direction: column; margin: 16px 0; }
    .wanted-hero .btn { width: 100%; }

    body:has(.mobile-bottom-nav) .main-content { padding-bottom: 16px; }

    .home-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .home-features-grid { grid-template-columns: repeat(2, 1fr); }
    .home-steps-grid { grid-template-columns: 1fr; }
    .home-cta-box { flex-direction: column; align-items: flex-start; padding: 24px 20px; }
    .home-cta-actions { width: 100%; }
    .home-cta-actions .btn { flex: 1; text-align: center; justify-content: center; }
    .footer-brand { padding: 20px 16px 0; }
    .mobile-bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        background: var(--glass); backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--border);
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        z-index: 120; justify-content: space-around; gap: 2px;
        box-shadow: 0 -4px 24px rgba(15, 23, 42, .08);
    }
    .mbn-item {
        flex: 1; display: flex; flex-direction: column; align-items: center;
        gap: 2px; padding: 6px 4px; border-radius: 10px;
        color: var(--text-muted); font-size: 10px; font-weight: 600;
        transition: var(--transition); min-width: 0;
    }
    .mbn-item span { font-size: 20px; line-height: 1; }
    .mbn-item.active { color: var(--blue); background: var(--blue-light); }
    .mbn-item:active { transform: scale(.95); }
}

@media (max-width: 560px) {
    .container { padding: 0 12px; }
    .categories-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .footer-grid { grid-template-columns: 1fr; }
    .guest-alert-box { flex-direction: column; align-items: flex-start; }
    .listing-page-price { font-size: 24px; }
    .listing-page-title { font-size: 20px; }
    .specs-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .bg-particles { display: none; }
}
