/* ── Telegram Theme Variables ────────────────────────────────── */
:root {
  --tg-bg:          var(--tg-theme-bg-color,        #ffffff);
  --tg-fg:          var(--tg-theme-text-color,       #181a1e);
  --tg-hint:        var(--tg-theme-hint-color,       #717182);
  --tg-link:        var(--tg-theme-link-color,       #2c7be5);
  --tg-btn:         var(--tg-theme-button-color,     #ff2f4d);
  --tg-btn-text:    var(--tg-theme-button-text-color,#ffffff);
  --tg-secondary:   var(--tg-theme-secondary-bg-color,#f2f2f7);

  /* Brand */
  --accent-a:       #ff2f4d;
  --accent-b:       #d9042b;
  --accent-grad:    linear-gradient(135deg, var(--accent-a), var(--accent-b));
  --success:        #10b981;
  --danger:         #d4183d;
  --favorite:       #f59e0b;

  /* Surfaces */
  --bg:             var(--tg-bg);
  --surface:        var(--tg-bg);
  --surface-raised: var(--tg-secondary);
  --fg:             var(--tg-fg);
  --fg-muted:       var(--tg-hint);
  --border:         rgba(0,0,0,.08);

  /* Radius */
  --r-xl: 1.5rem;
  --r-lg: 1.125rem;
  --r-md: 0.875rem;
  --r-sm: 0.625rem;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(9,14,28,.07);
  --shadow-md: 0 8px 24px rgba(9,14,28,.10);
  --shadow-lg: 0 16px 40px rgba(9,14,28,.14);
}

/* Dark theme — respect Telegram's palette automatically via --tg-* vars */
[data-theme="dark"] {
  --border:         rgba(255,255,255,.09);
  --shadow-sm:      0 2px 8px rgba(0,0,0,.25);
  --shadow-md:      0 8px 24px rgba(0,0,0,.35);
  --shadow-lg:      0 16px 40px rgba(0,0,0,.45);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", "Golos Text", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ── Splash ──────────────────────────────────────────────────── */
.splash {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  gap: .75rem;
  text-align: center;
  color: #fff;
  background: var(--accent-grad);
}

.splash-card {
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 2rem;
  padding: 2.25rem 2.75rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 48px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.18);
}

.splash-logo-img {
  width: 200px;
  max-width: 60vw;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,.25));
}

.splash-tagline {
  color: rgba(255,255,255,.88);
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .025em;
  text-align: center;
  margin: 0;
}

/* ── Onboarding ──────────────────────────────────────────────── */
.onboarding {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: linear-gradient(to bottom, var(--accent-a) 0 38%, var(--bg) 38% 100%);
}

.onboarding-card {
  width: min(100%, 24rem);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem 1.25rem;
  display: grid;
  gap: .9rem;
}

.onboarding-step {
  font-size: .75rem;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.onboarding-card h2 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.15;
}

.onboarding-card p {
  margin: 0;
  color: var(--fg-muted);
  line-height: 1.55;
  font-size: .95rem;
}

.onboarding-dots {
  display: flex;
  gap: .45rem;
  align-items: center;
}

.dot {
  width: .45rem;
  height: .45rem;
  border-radius: 999px;
  background: #d4d7de;
  transition: width .2s ease, background .2s ease;
}

.dot.active {
  width: 1.25rem;
  background: var(--accent-b);
}

/* ── App shell ───────────────────────────────────────────────── */
.app {
  min-height: 100dvh;
  max-width: 28rem;
  margin: 0 auto;
  background: var(--surface-raised);
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom));
  position: relative;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  background: var(--accent-grad);
  padding: calc(1.1rem + env(safe-area-inset-top)) 1.25rem 5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='100' cy='20' r='60' fill='rgba(255,255,255,.05)'/%3E%3Ccircle cx='10' cy='100' r='40' fill='rgba(255,255,255,.04)'/%3E%3C/svg%3E") no-repeat right top;
  background-size: 260px;
  pointer-events: none;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  position: relative;
}

.hero h1 {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.hero-meta {
  margin-top: .35rem;
  font-size: .9rem;
  opacity: .88;
}

.hero-actions { display: flex; gap: .5rem; }

.hero-btn {
  min-width: 3rem;
  height: 2.75rem;
  border-radius: var(--r-md);
  border: 1.5px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  padding: 0 .9rem;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background .15s ease;
}

.hero-btn:active { background: rgba(255,255,255,.25); }

.hero-icon-btn {
  display: grid;
  place-items: center;
  padding: 0;
  width: 2.75rem;
}

.hero-icon-btn svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Controls ────────────────────────────────────────────────── */
.controls {
  margin-top: -3.2rem;
  padding: 0 1rem;
  display: grid;
  gap: .65rem;
  position: relative;
  z-index: 2;
}

.search-wrap { position: relative; }

.search-icon {
  position: absolute;
  left: .95rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  width: 1.2rem;
  height: 1.2rem;
  pointer-events: none;
}

.search-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control-input,
.control-select,
.btn {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--fg);
  padding: .9rem 1rem;
  font-size: .95rem;
  line-height: 1.35;
  box-shadow: var(--shadow-sm);
}

.search-input { padding-left: 2.7rem; }

.control-select {
  appearance: none;
  background-image:
    linear-gradient(45deg,  transparent 50%, #9ca3af 50%),
    linear-gradient(135deg, #9ca3af 50%, transparent 50%);
  background-position:
    calc(100% - 1.2rem) calc(50% - .2rem),
    calc(100% - .78rem) calc(50% - .2rem);
  background-size: .42rem .42rem, .42rem .42rem;
  background-repeat: no-repeat;
}

.btn {
  cursor: pointer;
  font-weight: 600;
  transition: transform .12s ease, opacity .12s ease;
}

.btn:active { transform: scale(.97); opacity: .9; }

.btn-primary {
  border-color: transparent;
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(217,4,43,.28);
}

/* ── Screen ──────────────────────────────────────────────────── */
.screen { padding: .85rem 1rem 0; }

/* ── Cards grid ──────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.favorites-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}

.favorites-row .car-card { width: 100%; }
.favorites-row .car-photo-wrap { aspect-ratio: 16 / 9; }

/* ── Car card ────────────────────────────────────────────────── */
.car-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.car-card:active {
  transform: scale(.975);
  box-shadow: var(--shadow-md);
}

.car-photo-wrap {
  aspect-ratio: 3 / 2;
  background: #e2e6ed;
  position: relative;
}

.car-photo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.22) 0%, transparent 55%);
  pointer-events: none;
}

.car-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.car-body {
  padding: .75rem .85rem .9rem;
  display: grid;
  gap: .4rem;
}

.car-title {
  font-size: .95rem;
  line-height: 1.25;
  font-weight: 700;
}

.car-meta {
  font-size: .78rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.car-price-row {
  margin-top: .1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .3rem;
  min-width: 0;
}

.car-price {
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: -.015em;
  display: inline-flex;
  align-items: baseline;
  gap: .15rem;
  min-width: 0;
  flex: 1 1 auto;
}

.car-price-value {
  font-size: clamp(.76rem, 2.9vw, .94rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.car-price-unit {
  font-size: .72rem;
  font-weight: 700;
  color: var(--fg-muted);
  white-space: nowrap;
  text-transform: lowercase;
}

.car-status {
  border-radius: .6rem;
  padding: .22rem .48rem;
  font-size: .58rem;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
  letter-spacing: .01em;
}

.car-status.available { background: var(--success); color: #fff; }
.car-status.sold      { background: var(--danger);  color: #fff; }

/* ── Favourite button ────────────────────────────────────────── */
.fav-btn {
  position: absolute;
  top: .65rem;
  right: .65rem;
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: .8rem;
  backdrop-filter: blur(8px);
  background: rgba(18,22,30,.55);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  transition: background .15s ease;
}

.fav-btn.active { background: linear-gradient(145deg, #f6b026, #f18a20); }

.fav-icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fav-btn.active .fav-icon { fill: #fff; stroke: #fff; }

/* ── Load more ───────────────────────────────────────────────── */
.load-more-wrap { margin-top: .85rem; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-block {
  grid-column: 1 / -1;
  border: 1.5px dashed var(--border);
  border-radius: var(--r-lg);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--fg-muted);
  font-size: .9rem;
}

/* ── Subscription ────────────────────────────────────────────── */
.sub-card {
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 1.1rem;
  display: grid;
  gap: .75rem;
}

.sub-card h2, .sub-card h3 { margin: 0; }

.sub-card p { margin: 0; color: var(--fg-muted); font-size: .9rem; }

.sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}

.sub-grid label,
.filters-body label,
.lead-card label {
  display: grid;
  gap: .3rem;
  font-size: .78rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.sub-actions { display: grid; }

.sub-result {
  margin-top: .1rem;
  font-size: .88rem;
  color: var(--fg);
  font-weight: 600;
}

/* ── Bottom nav ──────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(100%, 28rem);
  z-index: 18;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: .1rem 1rem env(safe-area-inset-bottom);
}

.nav-btn {
  border: 0;
  background: transparent;
  padding: .62rem .25rem .65rem;
  display: grid;
  place-items: center;
  gap: .18rem;
  color: var(--fg-muted);
  font-size: .75rem;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color .15s ease;
}

.nav-btn.active { color: var(--fg); font-weight: 700; }

.nav-btn.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2rem;
  height: 2.5px;
  border-radius: 0 0 2px 2px;
  background: var(--accent-b);
}

.nav-icon {
  width: 1.4rem;
  height: 1.4rem;
  display: inline-flex;
}

.nav-icon-svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Filters panel ───────────────────────────────────────────── */
.filters-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  padding: calc(.85rem + env(safe-area-inset-top)) .95rem calc(.85rem + env(safe-area-inset-bottom));
  overflow: auto;
}

.filters-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
}

.filters-head h2 {
  margin: 0;
  color: var(--fg);
  font-size: 1.15rem;
  font-weight: 700;
}

.filters-body {
  margin-top: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  padding: .85rem;
  display: grid;
  gap: .65rem;
}

.filters-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}

.filters-actions {
  position: sticky;
  bottom: 0;
  margin-top: .7rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem;
}

/* ── Overlay (detail / lead) ─────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  padding: calc(.4rem + env(safe-area-inset-top)) .4rem calc(.4rem + env(safe-area-inset-bottom));
}

/* ── Detail card ─────────────────────────────────────────────── */
.detail-card,
.lead-card {
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.detail-card {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-width: 28rem;
  margin: 0 auto;
}

/* ── Detail header ───────────────────────────────────────────── */
.detail-head {
  padding: .55rem .65rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
}

.detail-head-actions { display: flex; gap: .4rem; }

.detail-head .btn {
  height: 2.25rem;
  padding: 0 .75rem;
  font-size: .8rem;
  border-radius: .75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  box-shadow: none;
}

#detail-close { min-width: 4.5rem; }
.detail-head-actions .btn { min-width: 5.75rem; }

/* ── Detail content ──────────────────────────────────────────── */
.detail-content {
  overflow: auto;
  padding: .75rem;
  display: grid;
  gap: .85rem;
  /* leave space for sticky CTA */
  padding-bottom: .5rem;
}

.detail-gallery { display: grid; gap: .55rem; }

.detail-main-wrap { position: relative; }

.detail-main-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  object-fit: cover;
  background: #dbe0e8;
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
  height: 2.1rem;
  border: none;
  border-radius: 999px;
  background: rgba(18,22,30,.55);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.gallery-nav-btn.prev { left: .45rem; }
.gallery-nav-btn.next { right: .45rem; }

.detail-gallery-counter {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  border-radius: 999px;
  padding: .18rem .5rem;
  font-size: .7rem;
  font-weight: 600;
  color: #fff;
  background: rgba(18,22,30,.56);
}

.detail-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 5.2rem;
  gap: .45rem;
  overflow-x: auto;
}

.thumb-btn {
  border: 2.5px solid transparent;
  border-radius: .6rem;
  overflow: hidden;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transition: border-color .15s ease;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.thumb-btn.active { border-color: var(--accent-b); }

.detail-gallery-note {
  font-size: .78rem;
  color: var(--fg-muted);
}

/* ── Detail summary ──────────────────────────────────────────── */
.detail-summary { display: grid; gap: .4rem; }

.detail-summary h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.15;
}

.detail-title { font-size: .95rem; font-weight: 600; }

.detail-meta { font-size: .84rem; color: var(--fg-muted); }

.detail-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
}

.detail-price {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  gap: .22rem;
  min-width: 0;
}

.detail-price-unit {
  font-size: .78rem;
  color: var(--fg-muted);
  font-weight: 700;
  text-transform: lowercase;
}

.detail-section {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: .75rem;
  display: grid;
  gap: .5rem;
}

.detail-section h3 { margin: 0; font-size: 1rem; font-weight: 700; }

.detail-section p,
.detail-section ul {
  margin: 0;
  color: color-mix(in srgb, var(--fg), transparent 6%);
  line-height: 1.48;
  font-size: .9rem;
}

.detail-section ul { padding-left: 1.1rem; }

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .45rem;
}

.spec-item {
  border: 1px solid var(--border);
  border-radius: .6rem;
  padding: .5rem .58rem;
  display: grid;
  gap: .2rem;
  background: var(--surface-raised);
}

.spec-item strong { font-size: .78rem; font-weight: 700; }
.spec-item span   { font-size: .84rem; color: var(--fg-muted); }

/* ── Sticky CTA (detail) ─────────────────────────────────────── */
.detail-cta {
  padding: .75rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  gap: .5rem;
}

.detail-cta-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-size: .78rem;
  color: var(--fg-muted);
  font-weight: 500;
  text-align: center;
}

.detail-cta-hint-dot {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1;   transform: scale(1);   }
  50%       { opacity: .55; transform: scale(1.25); }
}

.detail-cta-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .55rem;
}

.btn-cta {
  border-color: transparent;
  background: var(--accent-grad);
  color: #fff;
  border-radius: var(--r-lg);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.01em;
  padding: .9rem 1.25rem;
  box-shadow: 0 6px 20px rgba(217,4,43,.32);
  position: relative;
  overflow: hidden;
}

.btn-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent 0%, rgba(255,255,255,.12) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shimmer-cta 3s ease-in-out infinite;
}

@keyframes shimmer-cta {
  0%   { transform: translateX(-100%); }
  60%  { transform: translateX(100%);  }
  100% { transform: translateX(100%);  }
}

.btn-contact {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.btn-contact svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: var(--fg-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Contact choice sheet ────────────────────────────────────── */
.csheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.csheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px);
}

.csheet-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: .75rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
  display: grid;
  gap: .55rem;
  animation: sheet-up .25s ease-out;
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

.csheet-handle {
  width: 2.5rem;
  height: .28rem;
  border-radius: 99px;
  background: var(--border);
  justify-self: center;
  margin-bottom: .3rem;
}

.csheet-car-chip {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .45rem .7rem;
  font-size: .8rem;
  color: var(--fg-muted);
  font-weight: 500;
  text-align: center;
}

.csheet-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
}

.csheet-subtitle {
  margin: 0;
  font-size: .84rem;
  color: var(--fg-muted);
  text-align: center;
}

.csheet-options { display: grid; gap: .6rem; margin-top: .25rem; }

.csheet-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-raised);
  padding: .85rem .9rem;
  cursor: pointer;
  color: var(--fg);
  text-align: left;
  transition: border-color .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.csheet-option:active {
  background: color-mix(in srgb, var(--surface-raised), var(--accent-a) 8%);
  border-color: var(--accent-a);
}

.csheet-opt-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent-a), transparent 88%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.csheet-opt-icon svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: var(--accent-a);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.csheet-opt-body {
  flex: 1;
  display: grid;
  gap: .15rem;
}

.csheet-opt-body strong {
  font-size: .95rem;
  font-weight: 700;
}

.csheet-opt-body span {
  font-size: .78rem;
  color: var(--fg-muted);
}

.csheet-opt-arrow {
  font-size: 1.3rem;
  color: var(--fg-muted);
  font-weight: 300;
  flex-shrink: 0;
}

.csheet-cancel {
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-size: .9rem;
  font-weight: 600;
  padding: .55rem;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

/* ── Lead modal ──────────────────────────────────────────────── */
.overlay.hidden { display: none !important; }

.lead-card {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  max-width: 28rem;
  width: 100%;
  margin: auto auto 0;
  max-height: 92dvh;
  overflow-y: auto;
  padding: .75rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom));
  display: grid;
  gap: .7rem;
  box-shadow: var(--shadow-lg);
  animation: sheet-up .25s ease-out;
}

.lead-card-handle {
  width: 2.5rem;
  height: .28rem;
  border-radius: 99px;
  background: var(--border);
  justify-self: center;
  margin-bottom: .1rem;
}

.lead-car-chip {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .5rem .75rem;
  font-size: .8rem;
  color: var(--fg-muted);
  font-weight: 500;
  line-height: 1.4;
}

.lead-card h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.lead-subtitle {
  margin: 0;
  font-size: .84rem;
  color: var(--fg-muted);
}

.lead-required { color: var(--danger); }
.lead-optional { color: var(--fg-muted); font-weight: 400; font-size: .78rem; }

.lead-tg-row {
  display: flex;
  align-items: center;
  gap: 0;
}
.lead-tg-at {
  background: var(--surface-raised);
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--r) 0 0 var(--r);
  padding: 0 .6rem;
  height: 2.6rem;
  display: flex;
  align-items: center;
  font-size: .95rem;
  color: var(--fg-muted);
  flex-shrink: 0;
}
.lead-tg-input {
  border-radius: 0 var(--r) var(--r) 0 !important;
  flex: 1;
}
.lead-tg-hint {
  font-size: .74rem;
  color: var(--fg-muted);
  margin-top: .2rem;
}

.textarea { min-height: 4.5rem; resize: vertical; }

.lead-method-group { display: grid; gap: .4rem; }

.lead-method-label {
  font-size: .78rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.lead-methods {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.lead-method-btn {
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--fg-muted);
  padding: .45rem .85rem;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.lead-method-btn.active {
  border-color: var(--accent-a);
  color: var(--accent-a);
  background: color-mix(in srgb, var(--accent-a), transparent 90%);
}

.lead-submit-btn {
  margin-top: .25rem;
  width: 100%;
}

.lead-cancel-link {
  border: none;
  background: transparent;
  color: var(--fg-muted);
  font-size: .88rem;
  font-weight: 600;
  padding: .4rem;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

/* ── Lead success screen ─────────────────────────────────────── */
.lead-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0 .5rem;
  text-align: center;
}

.lead-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(34,197,94,.35);
}

.lead-success-icon svg {
  width: 34px;
  height: 34px;
  stroke: #fff;
}

.lead-success-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0;
}

.lead-success-sub {
  font-size: .9rem;
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Detail social-proof pill ────────────────────────────────── */
.detail-social-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .28rem .7rem;
  font-size: .75rem;
  color: var(--fg-muted);
  font-weight: 500;
  width: fit-content;
  transition: opacity .3s ease;
}

.detail-social-pill.detail-social-fade { opacity: 0; }

.detail-social-icon {
  font-size: .78rem;
  line-height: 1;
}

#detail-social-num {
  font-weight: 700;
  color: var(--fg);
}

/* ── Fullscreen lightbox ─────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.95);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox.hidden { display: none !important; }

.lb-img {
  max-width: 100%;
  max-height: 100dvh;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-close {
  position: absolute;
  top: max(.75rem, env(safe-area-inset-top));
  right: .85rem;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 1rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.6rem;
  height: 2.6rem;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  z-index: 2;
}

.lb-prev { left: .6rem; }
.lb-next { right: .6rem; }

.lb-counter {
  position: absolute;
  bottom: max(.85rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: .28rem .65rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* ── Detail main image — show pointer cursor for tap-to-zoom ─── */
.detail-main-image { cursor: zoom-in; }

/* ── Skeleton ────────────────────────────────────────────────── */
.skeleton {
  border-radius: .55rem;
  background: linear-gradient(90deg, var(--surface-raised), color-mix(in srgb, var(--surface-raised), white 40%), var(--surface-raised));
  background-size: 200% 100%;
  animation: shimmer 1.25s linear infinite;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to   { background-position: -100% 0; }
}

.line-1 { height: .85rem; }
.line-2 { height: .85rem; width: 76%; }
.line-3 { height: .85rem; width: 52%; }

/* ── Scrollbar hide ──────────────────────────────────────────── */
.detail-content,
.detail-thumbs,
.favorites-row,
.filters-panel,
.screen {
  scrollbar-width: none;
}

.detail-content::-webkit-scrollbar,
.detail-thumbs::-webkit-scrollbar,
.favorites-row::-webkit-scrollbar,
.filters-panel::-webkit-scrollbar,
.screen::-webkit-scrollbar { width: 0; height: 0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 430px) {
  .hero h1 { font-size: 1.75rem; }
}

@media (max-width: 385px) {
  .sub-grid, .filters-range, .spec-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.6rem; }
}
