/* Perederzhka Mini App — Warm Pet-Friendly Design System */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --brand-primary: #FF6B35;
  --brand-primary-2: #FF8F5A;
  --brand-primary-light: #FFF0E6;
  --brand-teal: #1DB9A6;
  --brand-teal-light: #E6FFF9;
  --brand-amber: #FFB020;
  --brand-amber-light: #FFF8E6;
  --brand-cream: #FFF8F0;
  --brand-cream-2: #FFFBF5;
  --text-900: #1A1E2E;
  --text-700: #2D3748;
  --text-500: #6B7280;
  --text-400: #9CA3AF;
  --surface: #FFFFFF;
  --surface-2: #F9F7F5;
  --surface-3: #FFF8F0;
  --border: #F0E6DA;
  --border-light: #FFF0E6;
  --shadow-card: 0 4px 24px rgba(26, 30, 46, 0.06), 0 1px 4px rgba(26, 30, 46, 0.04);
  --shadow-card-hover: 0 12px 32px rgba(26, 30, 46, 0.10), 0 4px 12px rgba(26,30,46,0.06);
  --shadow-float: 0 16px 40px rgba(255,107,53,0.18), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-nav: 0 -8px 32px rgba(26,30,46,0.08), 0 -1px 0 rgba(26,30,46,0.04);
  --radius-xl: 24px;
  --radius-l: 20px;
  --radius-m: 16px;
  --radius-s: 12px;
  --radius-pill: 999px;
  /* Telegram fallback */
  --tg-theme-bg-color: var(--surface-2);
  --tg-theme-text-color: var(--text-900);
  --tg-theme-hint-color: var(--text-400);
  --tg-theme-button-color: var(--brand-primary);
  --tg-theme-button-text-color: #FFFFFF;
  --tg-theme-secondary-bg-color: var(--surface-3);
}
:root[data-theme="dark"] {
  --text-900: #F8FAFC;
  --text-700: #E2E8F0;
  --text-500: #94A3B8;
  --text-400: #64748B;
  --surface: #1E1E24;
  --surface-2: #121214;
  --surface-3: #252529;
  --border: #2A2A32;
  --border-light: #2E2E38;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-card-hover: 0 12px 32px rgba(0,0,0,0.4);
  --brand-cream: #1E1E24;
  --brand-cream-2: #252529;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { font-size:16px; -webkit-text-size-adjust:100%; scroll-behavior:smooth; height:100%; }
html, body { height:100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface-2);
  color: var(--text-900);
  line-height: 1.5;
  min-height:100vh; min-height:100dvh; height:100dvh;
  -webkit-font-smoothing: antialiased; overscroll-behavior:none;
}
#app { display:flex; flex-direction:column; height:100dvh; min-height:100dvh; max-height:100dvh; overflow:hidden; }

/* Header — warm gradient with paw */
.header {
  position:sticky; top:0; z-index:100;
  display:flex; align-items:center; justify-content:space-between;
  height:68px; padding:0 16px;
  background: linear-gradient(135deg, #FF6B35 0%, #FF8F5A 50%, #FFB088 100%);
  color:white;
  box-shadow: 0 4px 20px rgba(255,107,53,0.25);
}
.header::after {
  content:''; position:absolute; inset:0;
  background: radial-gradient(600px 200px at 20% 0%, rgba(255,255,255,0.18), transparent 60%),
              radial-gradient(400px 160px at 90% 100%, rgba(255,209,102,0.25), transparent 50%);
  pointer-events:none;
}
.header-left { display:flex; align-items:center; gap:12px; position:relative; z-index:1; }
.logo {
  width:42px; height:42px; border-radius:14px;
  background: rgba(255,255,255,0.22); backdrop-filter: blur(8px);
  border:1.5px solid rgba(255,255,255,0.35);
  display:flex; align-items:center; justify-content:center;
  font-size:22px; box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.header-text { display:flex; flex-direction:column; line-height:1.1; }
.header-title { font-family:'Manrope', sans-serif; font-size:18px; font-weight:800; letter-spacing:-0.02em; color:white; }
.header-subtitle { font-size:11px; font-weight:600; letter-spacing:0.06em; text-transform:uppercase; color:rgba(255,255,255,0.85); margin-top:2px; }
.header-right { display:flex; align-items:center; gap:8px; position:relative; z-index:1; }
.icon-btn {
  width:44px; height:44px; border-radius:14px;
  background: rgba(255,255,255,0.18); backdrop-filter: blur(8px);
  border:1.5px solid rgba(255,255,255,0.25);
  color:white; display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition: all 0.2s ease; position:relative;
}
.icon-btn:hover { background: rgba(255,255,255,0.28); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn.small { width:38px; height:38px; border-radius:12px; background: var(--surface-3); border:1px solid var(--border); color: var(--text-700); }
.icon-btn.small:hover { background: var(--surface); border-color: var(--brand-primary); color: var(--brand-primary); }
.badge { position:absolute; top:-6px; right:-6px; min-width:20px; height:20px; padding:0 6px; background:#FF3B30; color:white; font-size:11px; font-weight:800; border-radius:999px; display:flex; align-items:center; justify-content:center; border:2px solid white; box-shadow:0 2px 8px rgba(255,59,48,0.4); }

/* Main */
.main { flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; padding-bottom:180px; scrollbar-width:thin; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; touch-action: pan-y; }
.layout { overscroll-behavior:contain; }
.listings-grid { padding-bottom: 24px; min-height: min-content; }
.main::-webkit-scrollbar { width:4px; } .main::-webkit-scrollbar-thumb { background: var(--border); border-radius:999px; }
.tab-content { padding:16px; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:translateY(0)} }

/* Hero for browse */
.hero {
  background: linear-gradient(135deg, #FFF8F0 0%, #FFEDD5 100%);
  border:1px solid var(--border-light);
  border-radius: var(--radius-l);
  padding:16px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-bottom:16px;
  position:relative; overflow:hidden;
}
.hero::before { content:''; position:absolute; width:120px; height:120px; right:-20px; top:-30px; background: radial-gradient(circle, rgba(255,107,53,0.12), transparent 70%); }
.hero-text h2 { font-family:'Manrope',sans-serif; font-size:17px; font-weight:800; color: var(--text-900); line-height:1.2; }
.hero-text p { font-size:13px; color: var(--text-500); margin-top:4px; }
.hero-illust { width:56px; height:56px; border-radius:16px; background: linear-gradient(135deg, #FF6B35, #FFB088); display:flex; align-items:center; justify-content:center; font-size:28px; flex-shrink:0; box-shadow: 0 8px 20px rgba(255,107,53,0.25); }

/* Filters */
.filters-bar { display:flex; gap:8px; overflow-x:auto; padding:4px 2px 14px; scrollbar-width:none; -ms-overflow-style:none; }
.filters-bar::-webkit-scrollbar { display:none; }
.filter-btn {
  display:inline-flex; align-items:center; gap:7px;
  padding:10px 14px; border-radius:999px;
  background: var(--surface); border:1.5px solid var(--border);
  font-size:13.5px; font-weight:600; color: var(--text-700);
  white-space:nowrap; cursor:pointer; transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.filter-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); transform: translateY(-1px); box-shadow: var(--shadow-card); }
.filter-btn.active {
  background: var(--brand-primary); border-color: var(--brand-primary);
  color:white; box-shadow: 0 6px 16px rgba(255,107,53,0.3);
}
.filter-btn.active svg { stroke:white; }
.filter-btn svg { width:16px; height:16px; flex-shrink:0; }

/* Listings */
.listings-container { display:flex; flex-direction:column; gap:14px; }
.loading { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px 20px; gap:14px; color: var(--text-400); }
.spinner { width:30px; height:30px; border:3px solid var(--border); border-top-color: var(--brand-primary); border-radius:50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface) 50%, var(--surface-3) 75%); background-size:200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.load-more-btn {
  width:100%; padding:14px; margin-top:8px;
  background: var(--surface); border:1.5px solid var(--border);
  border-radius: var(--radius-m); font-size:14px; font-weight:700; color: var(--text-700);
  cursor:pointer; transition: all 0.2s ease;
}
.load-more-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--brand-primary-light); }
.empty-state {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:48px 24px; text-align:center; gap:14px;
  background: var(--surface); border:1.5px dashed var(--border); border-radius: var(--radius-l);
}
.empty-illust {
  width:84px; height:84px; border-radius:24px;
  background: linear-gradient(135deg, #FFF0E6 0%, #FFE4CC 100%);
  border:1.5px solid var(--border-light);
  display:flex; align-items:center; justify-content:center; font-size:42px;
  box-shadow: 0 8px 24px rgba(255,107,53,0.12);
}
.empty-state h3 { font-family:'Manrope',sans-serif; font-size:17px; font-weight:800; color: var(--text-900); }
.empty-state p { font-size:14px; color: var(--text-500); max-width:300px; line-height:1.5; }

/* Section headers */
.section-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; gap:12px; }
.section-head h2 { font-family:'Manrope',sans-serif; font-size:20px; font-weight:800; letter-spacing:-0.02em; color: var(--text-900); }
.section-head p { font-size:13px; color: var(--text-500); }

/* Buttons */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:13px 18px; border:none; border-radius: var(--radius-s);
  font-size:14px; font-weight:700; cursor:pointer; transition: all 0.2s ease;
  text-decoration:none; white-space:nowrap; letter-spacing:-0.01em;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, #FF6B35 0%, #FF8A5C 100%);
  color:white; box-shadow: 0 8px 20px rgba(255,107,53,0.28), 0 2px 6px rgba(255,107,53,0.2);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(255,107,53,0.32); filter: brightness(1.03); }
.btn-secondary { background: var(--surface); border:1.5px solid var(--border); color: var(--text-700); box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.btn-secondary:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--brand-primary-light); }
::root[data-theme="dark"] .btn-secondary { background: var(--surface-2); border-color: var(--border); color: var(--text-700); }
::root[data-theme="dark"] .btn-secondary:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: rgba(255,107,53,0.12); }
.btn-ghost { background: transparent; color: var(--text-500); }
.btn-danger { background: #FF3B30; color:white; box-shadow: 0 6px 16px rgba(255,59,48,0.25); }
.btn.small { padding:9px 14px; font-size:13px; border-radius:10px; }

/* FAB — extended */
.fab {
  position:fixed; bottom:88px; right:16px;
  display:flex; align-items:center; gap:10px;
  padding:14px 18px; border-radius: 999px;
  background: linear-gradient(135deg, #FF6B35 0%, #FF8F5A 100%);
  color:white; border:none;
  box-shadow: var(--shadow-float);
  cursor:pointer; transition: all 0.25s ease; z-index:1000;
  font-family:'Manrope',sans-serif; font-size:14px; font-weight:800; letter-spacing:-0.01em;
}
.fab:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 20px 40px rgba(255,107,53,0.3); }
.fab:active { transform: scale(0.97); }
.fab.hidden { opacity:0; pointer-events:none; transform: translateY(12px) scale(0.9); }
.fab .fab-icon { width:22px; height:22px; display:flex; align-items:center; justify-content:center; background: rgba(255,255,255,0.22); border-radius:999px; }

/* Bottom nav — floating pill */
.bottom-nav {
  position:fixed; bottom:12px; left:12px; right:12px;
  display:flex; align-items:center; justify-content:space-around;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(16px) saturate(180%);
  border:1px solid rgba(255,255,255,0.8); border-radius: 22px;
  padding:6px; box-shadow: var(--shadow-nav);
  z-index:1000;
}
.leaflet-control-attribution { pointer-events:none; }
.leaflet-control-container { pointer-events:none; }
.leaflet-control-container .leaflet-control { pointer-events:auto; }
:root[data-theme="dark"] .bottom-nav { background: rgba(30,30,36,0.92); border-color: rgba(255,255,255,0.08); }
.nav-item {
  flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:8px 6px; border-radius:16px; background:transparent; border:none;
  color: var(--text-400); cursor:pointer; transition: all 0.2s ease; position:relative;
}
.nav-item:hover { color: var(--text-700); }
.nav-item.active { color: var(--brand-primary); background: var(--brand-primary-light); }
:root[data-theme="dark"] .nav-item.active { background: rgba(255,107,53,0.15); }
.nav-item .nav-icon {
  width:28px; height:28px; border-radius:10px; display:flex; align-items:center; justify-content:center;
  transition: all 0.2s ease;
}
.nav-item.active .nav-icon { background: var(--brand-primary); color:white; box-shadow: 0 4px 12px rgba(255,107,53,0.3); }
.nav-item.active .nav-icon svg { stroke:white; }
.nav-item span { font-size:10.5px; font-weight:700; letter-spacing:0.02em; }

/* Card — elevated, warm */
.listing-card {
  background: var(--surface);
  border-radius: var(--radius-l);
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  cursor:pointer;
}
.listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); border-color: var(--border-light); }
.listing-image {
  width:100%; aspect-ratio: 16/10; position:relative; overflow:hidden;
  background: linear-gradient(135deg, #FFF0E6 0%, #FFE8D6 100%);
  display:flex; align-items:center; justify-content:center;
}
.listing-image .img-emoji { font-size:64px; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.08)); }
.listing-image::after {
  content:''; position:absolute; inset:0;
  background: linear-gradient(to bottom, transparent 40%, rgba(26,30,46,0.45) 100%);
  opacity:0; transition: opacity 0.25s ease;
}
.listing-card:hover .listing-image::after { opacity:1; }
/* Animal gradients */
.listing-card[data-animal="cat"] .listing-image { background: linear-gradient(135deg, #FFF0E6, #FFD6B8); }
.listing-card[data-animal="dog"] .listing-image { background: linear-gradient(135deg, #E6FFF9, #B8FFE8); }
.listing-card[data-animal="rabbit"] .listing-image { background: linear-gradient(135deg, #FFF8E6, #FFE8B8); }
.listing-card[data-animal="bird"] .listing-image { background: linear-gradient(135deg, #E6F0FF, #D6E8FF); }
.listing-card[data-animal="other"] .listing-image { background: linear-gradient(135deg, #F3E8FF, #E8D6FF); }
/* Badges on image */
.badge-row { position:absolute; top:12px; left:12px; right:12px; display:flex; align-items:flex-start; justify-content:space-between; gap:8px; z-index:2; }
.badge-left, .badge-right { display:flex; gap:6px; flex-wrap:wrap; }
.pill {
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px; border-radius:999px;
  font-size:11px; font-weight:800; letter-spacing:0.04em; text-transform:uppercase;
  backdrop-filter: blur(8px); border:1px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.pill-urgent { background: #FF3B30; color:white; border-color: rgba(255,255,255,0.3); }
.pill-type-offer { background: rgba(255,255,255,0.92); color: var(--text-700); }
.pill-type-request { background: #1A1E2E; color:white; border-color: rgba(255,255,255,0.15); }
.pill-verified { background: #1DB9A6; color:white; }
.pill-trusted { background: #FFB020; color:#1A1E2E; }
.pill-photo { background: rgba(26,30,46,0.72); color:white; border-color: rgba(255,255,255,0.15); }
.listing-status-badge {
  position:absolute; top:12px; right:12px; z-index:2;
  padding:6px 10px; border-radius:999px; font-size:11px; font-weight:800; letter-spacing:0.04em; text-transform:uppercase;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.listing-status-badge.pending { background:#FFB020; color:#1A1E2E; }
.listing-status-badge.approved { background:#1DB9A6; color:white; }
.listing-status-badge.rejected { background:#FF3B30; color:white; }
.listing-status-badge.archived { background: var(--text-400); color:white; }

.listing-content { padding:14px 16px 16px; }
.listing-header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; }
.listing-type { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; color: var(--text-400); }
.listing-type .type-dot { width:8px; height:8px; border-radius:50%; background: var(--brand-primary); }
.listing-meta { display:flex; align-items:center; gap:10px; font-size:12px; color: var(--text-400); }
.listing-views, .listing-distance { display:inline-flex; align-items:center; gap:5px; background: var(--surface-3); padding:4px 8px; border-radius:999px; font-weight:600; }
.listing-distance { background: var(--brand-primary-light); color: var(--brand-primary); }
.listing-title { font-family:'Manrope',sans-serif; font-size:17px; font-weight:800; letter-spacing:-0.02em; color: var(--text-900); line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-bottom:6px; }
.listing-dates { font-size:13px; color: var(--text-500); display:flex; align-items:center; gap:6px; margin-bottom:8px; }
.listing-dates::before { content:'📅'; font-size:12px; }
.listing-location { font-size:13px; color: var(--text-500); display:flex; align-items:center; gap:6px; margin-bottom:10px; }
.listing-location svg { width:14px; height:14px; color: var(--text-400); flex-shrink:0; }
.listing-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-top:12px; border-top:1px solid var(--border); }
.listing-compensation { display:inline-flex; align-items:center; gap:7px; padding:8px 12px; background: var(--surface-3); border:1px solid var(--border); border-radius:999px; font-size:12.5px; font-weight:700; color: var(--text-700); }
.listing-compensation.free { background: var(--brand-teal-light); border-color: #B8F0E8; color: #0E7A6E; }
.listing-compensation.paid { background: var(--brand-amber-light); border-color: #FFE8B8; color: #8A5A00; }
.listing-compensation.exchange { background: #F3E8FF; border-color: #E8D6FF; color: #6B21A8; }
.listing-actions { display:flex; align-items:center; gap:8px; }
.favorite-btn { width:42px; height:42px; border-radius:12px; border:1.5px solid var(--border); background: var(--surface); color: var(--text-400); display:flex; align-items:center; justify-content:center; cursor:pointer; transition: all 0.2s ease; }
.favorite-btn:hover { border-color: #FFB3C1; color:#FF3B30; background:#FFF0F3; transform: translateY(-1px); }
.favorite-btn.active { background:#FF3B30; border-color:#FF3B30; color:white; box-shadow: 0 6px 16px rgba(255,59,48,0.3); }
.favorite-btn.active svg { fill:white; stroke:white; }
.contact-btn { padding:11px 16px; border-radius:12px; background: var(--text-900); color:white; border:none; font-size:13px; font-weight:700; cursor:pointer; transition: all 0.2s ease; box-shadow: 0 4px 12px rgba(26,30,46,0.18); }
.contact-btn:hover { background: #2D3748; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(26,30,46,0.22); }

/* My listing variant */
.my-listing .listing-actions { flex-wrap:wrap; }
.my-listing .listing-actions .btn { flex:1; min-width:90px; }

/* Subscription */
.subscription-card {
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-l);
  padding:16px; box-shadow: var(--shadow-card); display:flex; flex-direction:column; gap:12px;
}
.sub-filters { display:flex; flex-wrap:wrap; gap:8px; }
.sub-filter {
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 12px; background: var(--surface-3); border:1px solid var(--border);
  border-radius:999px; font-size:13px; font-weight:600; color: var(--text-700);
}
.sub-filter::before { content:''; width:8px; height:8px; border-radius:50%; background: var(--brand-primary); }
.sub-filter[data-type="animal"]::before { background: var(--brand-teal); }
.sub-filter[data-type="location"]::before { background: var(--brand-amber); }
.sub-filter[data-type="radius"]::before { background: #8B5CF6; }
.sub-actions { display:flex; gap:8px; justify-content:flex-end; }

/* Modal — bottom sheet with handle — above bottom-nav (1000) */
.modal-overlay {
  position:fixed; inset:0; background: rgba(26,30,46,0.45); backdrop-filter: blur(12px) saturate(140%);
  z-index:2000; display:flex; align-items:flex-end; justify-content:center; padding:0; animation: fadeIn 0.2s ease;
}
.modal {
  width:100%; max-width:520px; max-height:82vh; background: var(--surface);
  border-radius: 24px 24px 0 0; overflow:hidden; display:flex; flex-direction:column;
  box-shadow: 0 -16px 48px rgba(0,0,0,0.18); animation: slideUp 0.35s cubic-bezier(0.16,1,0.3,1);
  border:1px solid var(--border);
  margin-bottom: 84px;
  transition: max-height 0.25s ease, margin-bottom 0.25s ease;
}
.modal::before { content:''; width:40px; height:4px; background: var(--border); border-radius:999px; margin:10px auto 0; }
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:18px 20px 14px; border-bottom:1px solid var(--border); position:sticky; top:0; background: var(--surface); z-index:1; }
.modal-header h2 { font-family:'Manrope',sans-serif; font-size:18px; font-weight:800; letter-spacing:-0.02em; }
.modal-close { width:36px; height:36px; border-radius:12px; background: var(--surface-3); border:1px solid var(--border); color: var(--text-700); display:flex; align-items:center; justify-content:center; cursor:pointer; transition: all 0.2s ease; }
.modal-close:hover { background: var(--surface); border-color: var(--text-400); }
.modal-body { padding:20px; overflow-y:auto; flex:1; }
.modal-footer { display:flex; gap:12px; padding:16px 20px; border-top:1px solid var(--border); background: var(--surface-2); position:sticky; bottom:0; }
.modal-footer .btn { flex:1; }

/* Forms */
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:12px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color: var(--text-500); margin-bottom:8px; }
.form-group input, .form-group select, .form-group textarea {
  width:100%; padding:13px 14px; background: var(--surface); border:1.5px solid var(--border);
  border-radius: var(--radius-s); font-size:15px; font-weight:500; color: var(--text-900); font-family:inherit;
  transition: all 0.2s ease; box-shadow: 0 1px 4px rgba(0,0,0,0.02);
  -webkit-text-fill-color: var(--text-900);
  caret-color: var(--brand-primary);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline:none; border-color: var(--brand-primary); box-shadow: 0 0 0 4px rgba(255,107,53,0.12), 0 4px 12px rgba(0,0,0,0.06); background: var(--surface); color: var(--text-900); -webkit-text-fill-color: var(--text-900); }
::root[data-theme="dark"] .form-group input:focus, ::root[data-theme="dark"] .form-group select:focus, ::root[data-theme="dark"] .form-group textarea:focus { background: var(--surface-3); }
:root[data-theme="dark"] .form-group input,
:root[data-theme="dark"] .form-group select,
:root[data-theme="dark"] .form-group textarea {
  background: #1E1E24; color: #F8FAFC; border-color: #2A2A32; -webkit-text-fill-color: #F8FAFC;
}
:root[data-theme="dark"] .form-group input:focus,
:root[data-theme="dark"] .form-group select:focus,
:root[data-theme="dark"] .form-group textarea:focus {
  background: #252529; color: #F8FAFC; border-color: var(--brand-primary); -webkit-text-fill-color: #F8FAFC;
}
:root[data-theme="dark"] .form-group input::placeholder,
:root[data-theme="dark"] .form-group textarea::placeholder { color: #64748B; -webkit-text-fill-color: #64748B; }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-400); }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.form-group.checkbox { display:flex; align-items:center; gap:10px; padding:12px; background: var(--surface-3); border:1px solid var(--border); border-radius: var(--radius-s); }
.form-group.checkbox input { width:20px; height:20px; accent-color: var(--brand-primary); }

/* Toast — floating card */
.toast-container { position:fixed; bottom:100px; left:16px; right:16px; max-width:420px; margin:0 auto; z-index:300; display:flex; flex-direction:column; gap:10px; pointer-events:none; }
.toast {
  display:flex; align-items:center; gap:12px; padding:14px 16px;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m);
  box-shadow: 0 12px 32px rgba(0,0,0,0.14), 0 4px 12px rgba(0,0,0,0.08);
  animation: slideInToast 0.35s cubic-bezier(0.16,1,0.3,1); pointer-events:auto;
}
@keyframes slideInToast { from{opacity:0; transform:translateY(16px) scale(0.98)} to{opacity:1; transform:translateY(0) scale(1)} }
.toast.success { border-left:4px solid #1DB9A6; }
.toast.error { border-left:4px solid #FF3B30; }
.toast.warning { border-left:4px solid #FFB020; }
.toast-message { flex:1; font-size:13.5px; font-weight:600; color: var(--text-700); line-height:1.4; }
.toast-close { width:30px; height:30px; border-radius:10px; background: var(--surface-3); border:1px solid var(--border); color: var(--text-400); display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; }

/* ===== Marketplace layout — как у Авито/полноценного сайта ===== */
.topbar {
  position:sticky; top:0; z-index:110;
  background: var(--surface);
  border-bottom:1px solid var(--border);
  box-shadow: 0 1px 12px rgba(26,30,46,0.06);
}
.topbar-inner {
  max-width:1280px; margin:0 auto;
  display:flex; align-items:center; gap:16px;
  height:64px; padding:0 16px;
}
.topbar-left { display:flex; align-items:center; gap:12px; flex-shrink:0; }
.brand { display:flex; flex-direction:column; line-height:1; gap:6px; }
.brand-title { font-family:'Manrope',sans-serif; font-size:19px; font-weight:800; letter-spacing:-0.03em; color: var(--text-900); }
.brand-sub { font-size:11px; font-weight:700; letter-spacing:0.14em; text-transform:uppercase; color: var(--brand-primary); margin-top:2px; }
.topbar-city { display:inline-flex; align-items:center; gap:6px; padding:8px 12px; background: var(--surface-3); border:1px solid var(--border); border-radius:999px; font-size:13px; font-weight:600; color: var(--text-700); cursor:pointer; }
@media(min-width:900px){ .topbar-city{display:inline-flex} }
.topbar-center { flex:1; max-width:560px; margin:0 12px; }
.search-wrap {
  display:flex; align-items:center; gap:8px;
  background: var(--surface-3); border:1.5px solid var(--border); border-radius:14px;
  padding:6px 6px 6px 14px; transition: all 0.2s ease;
}
.search-wrap:focus-within { background: var(--surface); border-color: var(--brand-primary); box-shadow: 0 0 0 4px rgba(255,107,53,0.12); }
.search-wrap input { flex:1; border:none; background:transparent; outline:none; font-size:14.5px; font-weight:500; color: var(--text-900); min-width:0; }
.search-wrap input::placeholder { color: var(--text-400); }
.search-btn { padding:10px 16px; border-radius:10px; background: var(--text-900); color:white; border:none; font-size:13px; font-weight:700; cursor:pointer; transition: all 0.2s ease; flex-shrink:0; }
.search-btn:hover { background: #2D3748; transform: translateY(-1px); }
.topbar-right { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.lang-toggle { padding:8px 12px; border-radius:999px; background: var(--surface-3); border:1.5px solid var(--border); font-size:13px; font-weight:700; color: var(--text-700); cursor:pointer; transition:all 0.2s ease; letter-spacing:0.5px; }
.lang-toggle:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
::root[data-theme="dark"] .lang-toggle { border-color: rgba(255,255,255,0.1); color: var(--text-700); }
.topbar-action {
  display:none; align-items:center; gap:8px; padding:10px 16px;
  background: linear-gradient(135deg, #FF6B35 0%, #FF8F5A 100%); color:white; border:none; border-radius:12px;
  font-size:13px; font-weight:700; cursor:pointer; box-shadow: 0 6px 16px rgba(255,107,53,0.25); transition: all 0.2s ease;
}
@media(min-width:900px){ .topbar-action{display:inline-flex} }
.topbar-action:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(255,107,53,0.32); }
.topbar-action-icon { width:20px; height:20px; background: rgba(255,255,255,0.22); border-radius:999px; display:flex; align-items:center; justify-content:center; font-size:14px; }
.topbar .icon-btn { background: var(--surface-3); border:1px solid var(--border); color: var(--text-700); width:42px; height:42px; border-radius:12px; }
.topbar .icon-btn:hover { background: var(--surface); border-color: var(--brand-primary); color: var(--brand-primary); }

.topbar-cats {
  max-width:1280px; margin:0 auto; padding:10px 16px 12px;
  display:flex; gap:8px; overflow-x:auto; scrollbar-width:none; border-top:1px solid var(--border);
}
.topbar-cats::-webkit-scrollbar{display:none}
.cat-pill {
  display:inline-flex; align-items:center; gap:6px; padding:8px 14px;
  background: var(--surface-3); border:1px solid var(--border); border-radius:999px;
  font-size:13px; font-weight:600; color: var(--text-700); white-space:nowrap; cursor:pointer; transition: all 0.2s ease;
}
.cat-pill:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--surface); }
.cat-pill.active { background: var(--text-900); color:white; border-color: var(--text-900); box-shadow: 0 4px 12px rgba(26,30,46,0.18); }
::root[data-theme="dark"] .cat-pill.active { background: var(--brand-primary); border-color: var(--brand-primary); box-shadow: 0 4px 12px rgba(255,107,53,0.3); }
.cat-pill.ghost { background: transparent; border-style:dashed; color: var(--text-700); }
.cat-pill.ghost.active { border-style:solid; }
::root[data-theme="dark"] .cat-pill { background: var(--surface-3); color: var(--text-700); border-color: var(--border); }
::root[data-theme="dark"] .cat-pill:hover { background: var(--surface-2); border-color: var(--brand-primary); color: var(--brand-primary); }
.cats-divider { width:1px; height:24px; background: var(--border); flex-shrink:0; margin:0 4px; align-self:center; }

/* Layout */
.layout {
  max-width:1280px; margin:0 auto; width:100%;
  display:flex; gap:20px; padding:16px;
  align-items: flex-start;
  flex:1; min-height:0; overflow:visible;
}
.sidebar {
  width:280px; flex-shrink:0; position:sticky; top:0;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-l);
  padding:16px; box-shadow: var(--shadow-card);
  display:flex; flex-direction:column; gap:18px;
  max-height: calc(100vh - 140px); overflow-y:auto; align-self:flex-start;
}
.sidebar-head { display:flex; align-items:center; justify-content:space-between; }
.sidebar-head h3 { font-family:'Manrope',sans-serif; font-size:15px; font-weight:800; }
.filter-group { display:flex; flex-direction:column; gap:10px; }
.filter-group h4 { font-size:12px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color: var(--text-500); }
.radio, .check { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:10px; cursor:pointer; transition: background 0.15s ease; font-size:13.5px; font-weight:500; color: var(--text-700); }
.radio:hover, .check:hover { background: var(--surface-3); }
.radio input, .check input { width:18px; height:18px; accent-color: var(--brand-primary); flex-shrink:0; }
.select {
  width:100%; min-width:220px; padding:14px 16px; background: var(--surface-3); border:1.5px solid var(--border);
  border-radius:12px; font-size:14.5px; font-weight:600; color: var(--text-900); min-height:48px; appearance:none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238E8E93' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.filter-group .select { width:100%; min-width:100%; }
::root[data-theme="dark"] .select { background: var(--surface-3); color: var(--text-900); border-color: var(--border); }
.sidebar-hint { font-size:11px; color: var(--text-400); line-height:1.4; text-align:center; }
.content-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:14px; }
.content-head h2 { font-family:'Manrope',sans-serif; font-size:22px; font-weight:800; letter-spacing:-0.02em; }
.listings-grid { display:grid; grid-template-columns:1fr; gap:14px; }
.site-footer {
  margin-top:24px; padding:18px 0 8px; border-top:1px solid var(--border);
  display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px;
  font-size:12.5px; color: var(--text-400);
}
.site-footer a { color: var(--text-500); text-decoration:none; font-weight:500; }
.site-footer a:hover { color: var(--brand-primary); }

/* Responsive — desktop site vs mobile mini-app */
@media (max-width: 900px) {
  .topbar-inner { height:auto; min-height:56px; flex-wrap:wrap; padding:8px 16px; gap:10px; }
  .topbar-left { flex:1; }
  .topbar-center { display:flex; flex:1 1 100%; order:3; max-width:none; margin:0; }
  .search-wrap { flex:1; }
  .topbar { height:auto; }
  .topbar-cats { padding:10px 16px 12px; }
  .layout { flex-direction:column; padding:12px; gap:12px; }
  .sidebar { width:100%; position:static; max-height:none; display:none; }
  .sidebar.open { display:flex; }
  .listings-grid { grid-template-columns:1fr; }
  .content-head { flex-direction:column; align-items:stretch; }
}
@media (min-width: 901px) {
  .main { padding-bottom:100px; }
  .fab { bottom:24px; }
  .listings-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1100px) {
  .listings-grid { grid-template-columns: repeat(3, 1fr); }
  .listings-grid .listing-card { display:flex; flex-direction:column; }
}
@media (max-width:480px) { .modal { border-radius:24px 24px 0 0; } .fab { bottom:88px; right:14px; padding:14px 16px; } .hero { padding:14px; } }
@media (min-width:640px) { .listings-container { display:grid; grid-template-columns:1fr 1fr; gap:16px; } .listing-image { aspect-ratio: 4/3; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after{ animation-duration:0.01ms !important; transition-duration:0.01ms !important; } }

/* Website vs Mini App scroll fix */
html.is-website #app { height:auto; min-height:100vh; max-height:none; overflow:visible; }
html.is-website body { height:auto; min-height:100vh; overflow:auto; -webkit-overflow-scrolling:touch; }
html.is-website .layout { overflow:visible; flex:none; min-height:auto; }
html.is-website .main { flex:none; min-height:auto; overflow:visible; height:auto; max-height:none; padding-bottom:100px; }
