:root {
  --bg: #f4f5f7;
  --bg-soft: #eef1f5;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #2c2c2c;
  --muted: #6b7280;
  --muted-2: #8b93a1;
  --line: #e3e6ec;
  --line-strong: #d0d5dd;
  --blue: #0468ff;
  --blue-hover: #0056db;
  --blue-soft: #e8f1ff;
  --green: #15b374;
  --green-hover: #119962;
  --danger: #e5484d;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(26, 26, 26, 0.06);
  --shadow-hover: 0 8px 24px rgba(26, 26, 26, 0.1);
  --font: "Golos Text", "Segoe UI", sans-serif;
  --display: "Golos Text", "Segoe UI", sans-serif;
  --header-h: 64px;
  --content: 1160px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.lb-open { overflow: hidden; }

.page-bg,
.page-grain { display: none; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  height: var(--header-h);
  padding: 0 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(26,26,26,0.02);
}
.brand {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-size: 1.35rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.nav { display: flex; gap: 0.35rem 1rem; align-items: center; }
.nav a {
  color: var(--ink-2);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.35rem 0.2rem;
}
.nav a:hover { color: var(--blue); }
.nav-cta {
  color: #fff !important;
  background: var(--blue);
  padding: 0.55rem 0.95rem !important;
  border-radius: 8px;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--blue-hover); color: #fff !important; }

main {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.hero {
  margin: 1.25rem 0 0;
  padding: 1.75rem 1.5rem 1.6rem;
  background:
    linear-gradient(135deg, #0468ff 0%, #1a7bff 42%, #3a9bff 100%);
  border-radius: 16px;
  color: #fff;
  box-shadow: 0 12px 32px rgba(4, 104, 255, 0.22);
  animation: rise 0.45s ease both;
}
.hero-brand {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}
.hero h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
  max-width: 18ch;
}
.hero-lead {
  margin: 0 0 1.15rem;
  max-width: 38rem;
  color: rgba(255,255,255,0.9);
  font-size: 1.02rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.hero .btn-primary {
  background: #fff;
  color: var(--blue);
}
.hero .btn-primary:hover {
  background: #f3f7ff;
  color: var(--blue-hover);
}
.hero .btn-ghost {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
}
.hero .btn-ghost:hover { background: rgba(255,255,255,0.2); color: #fff; }

.source-banner {
  margin-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.95rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.source-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: min(100%, 280px);
}
.source-banner-text strong {
  font-size: 0.98rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.source-banner-text span {
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 46rem;
}
.source-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.source-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.82rem;
  font-weight: 650;
}

.catalog-note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 48rem;
  line-height: 1.45;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 600;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 6px 16px rgba(21, 179, 116, 0.25);
}
.btn-primary:hover { background: var(--green-hover); color: #fff; }
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

.section { margin-top: 1.75rem; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.section-head h2,
.section h1,
.listing h1,
.form-section h1 {
  margin: 0 0 0.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.muted { color: var(--muted); }
.empty {
  color: var(--muted);
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Compact offer list (Cian-like) */
.grid {
  display: grid;
  gap: 0.65rem;
}
.card {
  display: grid;
  grid-template-columns: 168px 1fr;
  min-height: 128px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  color: inherit;
  box-shadow: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  border-color: #c9d5ea;
  box-shadow: var(--shadow);
  color: inherit;
}
.card-media {
  position: relative;
  aspect-ratio: auto;
  min-height: 128px;
  max-height: 148px;
  background: var(--bg-soft);
  overflow: hidden;
}
.card-photos {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.4rem;
  border-radius: 6px;
}
.card-media img {
  width: 100%;
  height: 100%;
  min-height: 128px;
  max-height: 148px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.card:hover .card-media img { transform: scale(1.03); }
.card-placeholder {
  height: 100%;
  min-height: 128px;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 0.82rem;
  background: linear-gradient(180deg, #f7f8fa, #eef1f5);
}
.card-body {
  padding: 0.7rem 0.9rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.card-top {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.05rem;
}
.card-source {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
}
.card-fresh {
  color: var(--muted-2);
  font-size: 0.75rem;
}
.card-price {
  font-weight: 800;
  color: var(--ink);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.card-title {
  font-weight: 600;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta .dot {
  margin: 0 0.25rem;
  color: var(--line-strong);
}
.card-desc {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 0.35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.filters label,
.submit-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.filters input,
.filters select,
.submit-form input,
.submit-form select,
.submit-form textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.62rem 0.75rem;
}
.filters input:focus,
.filters select:focus,
.submit-form input:focus,
.submit-form select:focus,
.submit-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
.filters .btn,
.submit-form .btn { align-self: end; }

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.4rem;
  color: var(--muted);
}

.catalog-top h1 { font-size: 1.7rem; }

.listing {
  max-width: 980px;
  margin: 0 auto;
  animation: rise 0.4s ease both;
}
.listing-top {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.listing-agg {
  margin: 0.45rem 0 0;
  font-size: 0.9rem;
}
.back {
  color: var(--muted);
  display: inline-block;
  margin: 1rem 0 0.2rem;
  font-size: 0.92rem;
}
.badge {
  display: inline-block;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 650;
  margin: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.82rem;
}
.source-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.8rem;
}
.fresh-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: #eefbf4;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 600;
}
.params-grid {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.params-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.15rem;
}
.params-value {
  color: var(--ink);
  font-weight: 650;
  font-size: 0.95rem;
}
.listing h1 {
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  line-height: 1.2;
  margin-top: 0.55rem;
}
.listing-price {
  font-size: clamp(1.7rem, 3.2vw, 2.15rem);
  font-weight: 800;
  color: var(--ink);
  margin: 0.4rem 0 0.2rem;
  letter-spacing: -0.02em;
}
.listing-loc {
  color: var(--muted);
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.gallery-stage {
  position: relative;
  margin: 1.1rem 0 0.7rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
}
.gallery-main {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #111827;
  box-shadow: var(--shadow);
  min-height: 360px;
}
.gallery-main img {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 72vh;
  min-height: 360px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.gallery-zoom {
  position: absolute;
  right: 0.8rem;
  bottom: 0.8rem;
  border: 0;
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.gallery-nav {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.gallery-nav:hover {
  border-color: var(--blue);
  color: var(--blue);
}
.gallery-counter {
  position: absolute;
  left: 50%;
  bottom: 0.8rem;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.7);
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #fff;
  pointer-events: none;
}
.gallery-thumbs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}
.thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 72px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--bg-soft);
  cursor: pointer;
  opacity: 0.85;
}
.thumb:hover { opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.is-active { border-color: var(--blue); opacity: 1; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 14, 22, 0.92);
  display: grid;
  place-items: center;
  padding: 1rem;
  animation: fadein 0.16s ease both;
}
.lightbox[hidden] { display: none !important; }
.lightbox img {
  max-width: min(1280px, 96vw);
  max-height: 90vh;
  object-fit: contain;
  border-radius: 10px;
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(255,255,255,0.12);
  color: #fff;
  cursor: pointer;
}
.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  font-size: 1.5rem;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 999px;
  font-size: 1.8rem;
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-counter {
  position: absolute;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0,0,0,0.45);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.listing-block { margin-top: 1.4rem; }
.listing-block h2 {
  font-size: 1.15rem;
  font-weight: 750;
  margin: 0 0 0.45rem;
}
.desc {
  white-space: pre-wrap;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0;
}
.channels { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.channels a {
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
}
.channels a:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.contact-block {
  margin-top: 1.35rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.call-btn {
  min-width: min(100%, 300px);
  font-size: 1.02rem;
  padding: 0.85rem 1.2rem;
  background: var(--green);
  box-shadow: 0 8px 20px rgba(21, 179, 116, 0.28);
}
.call-btn:hover { background: var(--green-hover); color: #fff; }
.phone-hint { margin-top: 0.55rem; }
.contact-text { color: var(--ink); font-size: 1.05rem; margin: 0; }
.source-link { margin-top: 0.7rem; }

.form-section { max-width: 640px; }
.submit-form {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.alert {
  background: #fff1f0;
  border: 1px solid #ffcdc9;
  color: #9b1c1c;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
}
.auth-switch { margin-top: 1rem; }
.account-section { max-width: 720px; }
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 1.5rem;
}
.account-list-title {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}
.account-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.account-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.account-list li strong { display: block; margin-bottom: 0.15rem; }
.status-pill {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
}
.status-pending { background: #fff4e5; color: #9a5b00; }
.status-published { background: #e8f8ef; color: #0f7a45; }
.status-rejected { background: #fff1f0; color: #9b1c1c; }
.status-archived { background: #f1f3f5; color: #5c6770; }
.hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  width: 0;
}

.cta-band {
  padding: 1.4rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.cta-band h2 { margin-top: 0; }

.site-footer {
  max-width: var(--content);
  margin: 0 auto;
  padding: 1.6rem 1.25rem 2.4rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}
.footer-brand {
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 0.45rem;
}
.footer-note {
  margin: 0 0 0.85rem;
  max-width: 42rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--blue); }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 820px) {
  .card {
    grid-template-columns: 120px 1fr;
    min-height: 112px;
  }
  .card-media,
  .card-media img,
  .card-placeholder {
    min-height: 112px;
    max-height: 132px;
    aspect-ratio: auto;
  }
  .card-desc {
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 520px) {
  .card {
    grid-template-columns: 96px 1fr;
  }
  .card-media,
  .card-media img,
  .card-placeholder {
    min-height: 104px;
    max-height: 120px;
  }
  .card-body { padding: 0.55rem 0.7rem 0.6rem; }
  .card-price { font-size: 1rem; }
  .card-desc { -webkit-line-clamp: 2; font-size: 0.8rem; }
}

@media (max-width: 720px) {
  .gallery-stage { grid-template-columns: 1fr; }
  .gallery-nav {
    position: absolute;
    z-index: 2;
    top: 50%;
    transform: translateY(-50%);
  }
  .gallery-prev { left: 0.5rem; }
  .gallery-next { right: 0.5rem; }
  .gallery-main { min-height: 230px; }
  .gallery-main img {
    aspect-ratio: 4 / 3;
    max-height: 58vh;
    min-height: 230px;
  }
  .lightbox-prev { left: 0.35rem; }
  .lightbox-next { right: 0.35rem; }
  .hero { padding: 1.35rem 1.1rem 1.25rem; border-radius: 12px; }
}

@media (max-width: 640px) {
  .site-header { padding: 0 0.9rem; }
  .nav { gap: 0.45rem; font-size: 0.9rem; }
  main { padding: 0 0.9rem 2.2rem; }
  .brand { font-size: 1.15rem; }
}
