:root {
  --bg: #f2f3f5;
  --card: #ffffff;
  --line: #e0e3e8;
  --text: #111111;
  --muted: #6b7280;
  --blue: #0059ff;
  --blue-dark: #0047cc;
  --blue-soft: #e8f0ff;
  --danger: #e53935;
  --radius: 8px;
  --font: "Manrope", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: #fff; border-bottom: 1px solid var(--line);
}
.topbar-inner {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; letter-spacing: -.04em; border: 0; background: transparent; color: var(--text);
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--blue); color: #fff; font-size: .8rem; font-weight: 900;
}
.brand-text { font-size: 1.25rem; }
.brand-text span { color: var(--blue); }
.search-wrap { flex: 1; display: flex; max-width: 640px; }
.search {
  flex: 1; border: 2px solid var(--blue); border-right: 0;
  border-radius: 8px 0 0 8px; padding: 11px 14px; outline: none; background: #fff;
}
.search-btn {
  border: 0; background: var(--blue); color: #fff; font-weight: 700;
  padding: 0 22px; border-radius: 0 8px 8px 0;
}
.search-btn:hover { background: var(--blue-dark); }
.top-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.top-link {
  position: relative; border: 0; background: transparent; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 10px; border-radius: 8px; min-width: 68px;
}
.top-link:hover, .top-link.active { background: var(--blue-soft); color: var(--blue-dark); }
.top-link-ico { font-size: 1.05rem; line-height: 1; }
.top-link-txt { font-size: .7rem; font-weight: 700; color: var(--muted); }
.top-link.active .top-link-txt, .top-link:hover .top-link-txt { color: var(--blue-dark); }
.badge {
  position: absolute; top: 0; right: 4px;
  min-width: 16px; height: 16px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .65rem; font-weight: 800;
  display: grid; place-items: center; padding: 0 4px;
}
@media (max-width: 900px) {
  .top-link-txt { display: none; }
  .top-link { min-width: 42px; }
}

.cats-bar {
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 64px; z-index: 35;
}
.cats-bar-inner {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  display: flex; gap: 6px; overflow-x: auto;
  padding: 10px 0; scrollbar-width: none;
}
.cats-bar-inner::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: 0 0 auto; border: 0; background: transparent;
  border-radius: 0; padding: 8px 12px; font-weight: 700; font-size: .9rem; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.cat-pill.on, .cat-pill:hover { color: var(--blue); border-bottom-color: var(--blue); background: transparent; }

.layout {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  display: grid; gap: 20px;
  padding: 16px 0 110px;
}
.layout.with-aside, .layout.feed-only { grid-template-columns: 1fr; }
@media (min-width: 1024px) {
  .layout.with-aside { grid-template-columns: 240px 1fr; padding-bottom: 40px; }
  .layout.feed-only { grid-template-columns: 240px 1fr; padding-bottom: 40px; }
  .bottom { display: none !important; }
  .layout.feed-only .sidebar-filters { display: block; }
}
.sidebar, .sidebar-filters {
  display: none; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; height: fit-content;
  position: sticky; top: 120px;
}
@media (min-width: 1024px) {
  .layout.with-aside .sidebar { display: block; }
  .layout.feed-only .sidebar-filters { display: block; }
}
.side-title { font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px 10px; }
.nav-item {
  width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--text); padding: 10px 12px; border-radius: 8px;
  margin-bottom: 2px; font-weight: 600; font-size: .92rem;
}
.nav-item.active, .nav-item:hover { background: var(--blue-soft); color: var(--blue-dark); }
.filter-group { margin-bottom: 14px; }
.filter-group label { display: block; font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.filter-group select, .filter-group input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff;
}
.main { min-width: 0; }

.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.bottom button {
  border: 0; background: transparent; color: var(--muted);
  font-size: .68rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bottom button.active { color: var(--blue); }
.bottom .fab {
  width: 48px; height: 48px; margin: -16px auto 0; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 1.5rem;
  display: grid; place-items: center;
}

.promo-strip { display: flex; gap: 10px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.promo-item { flex: 0 0 auto; width: min(280px, 70vw); height: 100px; border-radius: 10px; overflow: hidden; background: #eee; }
.promo-item img { width: 100%; height: 100%; object-fit: cover; }

.toolbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.count { color: var(--muted); font-weight: 600; font-size: .92rem; }
.sorts { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: .82rem;
}
.chip.on { background: var(--blue-soft); color: var(--blue-dark); border-color: #c5d8ff; }

/* Auto.ru-like horizontal listings */
.grid {
  display: grid; grid-template-columns: 1fr; gap: 10px;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; text-align: left; padding: 0;
  display: grid; grid-template-columns: 180px 1fr; gap: 0;
  transition: border-color .15s ease;
}
.card:hover { border-color: #b8c7e6; }
.card-photo {
  aspect-ratio: auto; min-height: 136px; height: 100%;
  background: #edf0f4; display: grid; place-items: center; position: relative;
}
.card-photo .ph { font-size: 2rem; opacity: .35; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; min-height: 136px; }
.tag {
  position: absolute; left: 8px; top: 8px;
  background: rgba(255,255,255,.96);
  border-radius: 6px; padding: 3px 8px; font-size: .68rem; font-weight: 800; color: var(--text);
}
.card-body { padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.price { font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; margin-bottom: 2px; color: var(--text); }
.price.huge { font-size: clamp(1.5rem, 3vw, 2rem); margin: 8px 0; }
.title { font-weight: 700; font-size: 1rem; line-height: 1.35; color: var(--blue-dark); }
.meta { color: var(--muted); font-size: .84rem; }
@media (max-width: 640px) {
  .card { grid-template-columns: 120px 1fr; }
  .card-photo, .card-photo img { min-height: 110px; }
  .price { font-size: 1.05rem; }
  .title { font-size: .92rem; }
}

.btn-primary, .btn-secondary {
  border-radius: 8px; padding: 11px 16px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { border: 0; background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { border: 1px solid var(--line); background: #fff; color: var(--text); }
.btn-secondary:hover { border-color: var(--blue); color: var(--blue-dark); }
.wide { width: 100%; }

.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; margin-bottom: 12px;
}
.panel h2, .panel h3, .page-head h1 { margin: 0 0 8px; letter-spacing: -.02em; }
.page-head { margin-bottom: 12px; }
.page-head p { margin: 0; }
.muted { color: var(--muted); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-2 { display: grid; gap: 12px; }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }

label { display: grid; gap: 6px; margin-bottom: 12px; color: var(--muted); font-size: .85rem; font-weight: 700; }
input, select, textarea {
  width: 100%; background: #fff; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 11px 12px; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,89,255,.12);
}
.vin-row { display: flex; gap: 8px; }
.vin-row input { flex: 1; }
.vin-box, .vin-result {
  margin: 8px 0 14px; padding: 12px 14px; border-radius: 8px;
  background: var(--blue-soft); border: 1px solid #c5d8ff;
}
.vin-result .raw {
  margin-top: 10px; background: #111; color: #d7ffe7; padding: 12px;
  border-radius: 8px; overflow: auto; font-size: .75rem;
}

.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 28px 16px;
  background: linear-gradient(180deg, #eef2f8, #f2f3f5);
}
.auth-card {
  width: min(420px, 100%); background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 28px 24px 22px;
  box-shadow: 0 12px 40px rgba(17, 24, 39, .06);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand b { font-size: 1.05rem; letter-spacing: -.02em; }
.auth-form h1 {
  margin: 0 0 18px; font-size: 1.55rem; letter-spacing: -.03em; font-weight: 800;
}
.auth-form .btn-primary { margin-top: 4px; min-height: 46px; font-weight: 700; }
.auth-switch {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
  text-align: center; color: var(--muted); font-size: .95rem;
  display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap;
}
.auth-link {
  border: 0; background: transparent; color: var(--blue); font-weight: 700;
  padding: 0; font-size: inherit;
}
.auth-link:hover { color: var(--blue-dark); text-decoration: underline; }
.auth-back {
  display: block; width: 100%; margin-top: 14px; border: 0; background: transparent;
  color: var(--muted); font-weight: 600; font-size: .9rem; padding: 8px 0;
}
.auth-back:hover { color: var(--blue-dark); }
.auth-card-wide { width: min(520px, 100%); }
.reg-section-title {
  margin: 6px 0 10px; font-size: .78rem; font-weight: 800;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.role-cards { display: grid; gap: 8px; margin-bottom: 14px; }
.role-card {
  text-align: left; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px;
}
.role-card b { font-size: .95rem; }
.role-card span { color: var(--muted); font-size: .82rem; }
.role-card.on, .role-card:hover { border-color: var(--blue); background: var(--blue-soft); }
.verify-status {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: #f3f5f8; color: var(--muted); font-size: .88rem; font-weight: 600;
}
.verify-status.ok { background: #e8f7ee; color: #0f7a3c; }
.modal-form select {
  width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; font: inherit;
}
.card-photo .ph {
  width: 100%; height: 100%; min-height: 136px;
  background: linear-gradient(135deg, #e8edf5, #d9e0ea);
}

.service-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
@media (min-width: 800px) { .service-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.service-card {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: 16px; text-align: left; display: grid; gap: 6px;
}
.service-card span { color: var(--muted); font-size: .85rem; }
.service-card:hover { border-color: var(--blue); }
.service-card.accent { background: var(--blue-soft); border-color: #c5d8ff; }

.list { display: grid; gap: 8px; }
.list-item {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.list-item.unread { border-color: #c5d8ff; background: #f5f8ff; }

.profile-card { display: flex; gap: 14px; align-items: center; }
.avatar {
  width: 56px; height: 56px; border-radius: 12px; background: var(--blue);
  color: #fff; display: grid; place-items: center; font-weight: 900;
}
.role-row { display: flex; flex-wrap: wrap; gap: 8px; }
.links { display: grid; gap: 10px; }
.links a { color: var(--blue); font-weight: 700; }

.back {
  border: 0; background: transparent; color: var(--muted); font-weight: 700;
  margin-bottom: 10px; padding: 0;
}
.detail {
  display: grid; gap: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; margin-bottom: 14px;
}
@media (min-width: 900px) { .detail { grid-template-columns: 1.2fr .8fr; } }
.detail-photo { background: #edf0f4; min-height: 280px; display: grid; place-items: center; }
.detail-photo.gallery {
  display: grid; gap: 10px; padding: 0; background: #fff; place-items: stretch;
}
.detail-photo.gallery .gallery-main {
  width: 100%; max-height: 420px; object-fit: cover; border-radius: 12px 12px 0 0;
  background: #edf0f4; min-height: 240px;
}
.detail-photo.gallery .gallery-main.broken { display: none; }
.gallery-thumbs {
  display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 12px;
  scrollbar-width: thin;
}
.gallery-thumb {
  flex: 0 0 auto; width: 72px; height: 56px; padding: 0; border: 2px solid transparent;
  border-radius: 8px; overflow: hidden; background: #edf0f4;
}
.gallery-thumb.on { border-color: var(--blue); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.broken { display: none; }
.detail-photo .ph.big {
  width: 100%; min-height: 280px; border-radius: 12px;
  background: linear-gradient(135deg, #e8edf5, #d9e0ea);
}
.detail-body { padding: 20px; }
.desc { line-height: 1.55; color: #333; white-space: normal; word-break: break-word; }
.cabinet-switch { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 8px 10px; }
.osago-frame {
  width: 100%; min-height: 720px; height: 75vh; margin-top: 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff;
}
.specs {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px;
  margin: 14px 0 16px;
}
.spec {
  background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  display: grid; gap: 2px;
}
.spec span { color: var(--muted); font-size: .75rem; font-weight: 700; }
.spec b { font-size: .95rem; }
.skeleton-list { display: grid; gap: 10px; }
.skeleton-card {
  height: 136px; border-radius: 10px; border: 1px solid var(--line);
  background: linear-gradient(90deg, #eceff3 25%, #f7f8fa 37%, #eceff3 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.desc { line-height: 1.5; color: #333; }

.empty {
  text-align: center; padding: 48px 16px; color: var(--muted);
  background: #fff; border: 1px dashed var(--line); border-radius: 10px;
}
.empty-wow .empty-title {
  color: var(--text); font-weight: 800; font-size: 1.15rem; margin-bottom: 6px;
}
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: #1a1a1a; color: #fff; padding: 12px 16px;
  border-radius: 10px; z-index: 80; max-width: 90vw;
}
.toast.err { background: #8b1e1e; }
.toast.ok { background: #123d28; }
@media (min-width: 1024px) { .toast { bottom: 28px; } }

.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(17, 24, 39, .45);
  display: grid; place-items: center; padding: 16px;
}
.modal-card {
  width: min(420px, 100%); background: #fff; border-radius: 14px;
  border: 1px solid var(--line); padding: 22px 20px 18px;
  box-shadow: 0 20px 50px rgba(17,24,39,.18);
}
.modal-card h2 { margin: 0 0 14px; font-size: 1.25rem; letter-spacing: -.02em; }
.modal-form label { margin-bottom: 12px; }
.modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px;
}
.modal-actions .btn-primary, .modal-actions .btn-secondary { min-width: 110px; }

.flags { display: grid; gap: 8px; margin-top: 12px; }
.flag {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 8px; background: #fafafa; border: 1px solid var(--line);
  font-size: .86rem; font-weight: 700;
}
.flag.bad { background: #fff5f5; border-color: #ffc9c9; color: #b71c1c; }
.flag.ok { background: #f3fff6; border-color: #b7ebc6; color: #1b5e20; }

/* Карта клуба */
.layout.map-layout {
  display: block;
  max-width: none;
  padding: 0;
}
.layout.map-layout .main {
  max-width: none;
  padding: 0;
  width: 100%;
}
.club-map-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 140px);
}
.club-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.club-map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.map-chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 14px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
}
.map-chip.on {
  border-color: var(--blue);
  color: var(--blue);
  background: rgba(0, 89, 255, .06);
}
.club-map-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.map-hint {
  font-size: .85rem;
  color: var(--muted, #6b7280);
  font-weight: 600;
}
.club-map-frame {
  position: relative;
  flex: 1;
  min-height: 420px;
  height: calc(100vh - 220px);
  background: #e8eef7;
}
.club-map {
  width: 100%;
  height: 100%;
}
.club-map.map-picking {
  cursor: crosshair;
}
.club-map-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
}
.map-soon {
  max-width: 420px;
  text-align: center;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 18px;
  pointer-events: auto;
}
.map-soon b { display: block; font-size: 1.15rem; margin-bottom: 8px; }
.map-soon code {
  font-size: .82rem;
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
}
.map-disclaimer {
  margin: 0;
  padding: 10px 16px 18px;
  font-size: .82rem;
}
.map-balloon { min-width: 180px; max-width: 260px; }
.map-balloon-type {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--blue);
  margin-bottom: 4px;
}
.map-balloon-title { font-weight: 800; margin-bottom: 4px; }
.map-balloon-comment { font-size: .9rem; margin-bottom: 6px; }
.map-balloon-time { font-size: .78rem; margin-bottom: 8px; }
.map-balloon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.btn-sm {
  padding: 6px 10px !important;
  font-size: .8rem !important;
  min-width: 0 !important;
}
@media (max-width: 720px) {
  .club-map-frame { height: calc(100vh - 260px); min-height: 360px; }
}
