/* ============ AvtoBozor — дизайн (сафед / сиёҳ) ============ */
:root {
  --bg: #ffffff;
  --bg2: #f2f2f2;
  --bg3: #e9e9e9;
  --card: #ffffff;
  --text: #0b0b0c;
  --muted: #7c7c80;
  --line: #e6e6e6;
  --dark: #121212;
  --on-dark: #ffffff;
  --primary: #0a84ff;
  --primary-2: #0070e0;
  --green: #34c759;
  --green-txt: #16a34a;
  --green-bg: #dcfce7;
  --blue: #3aa0ff;
  --red: #ff3b30;
  --star: #ffb800;
  --finder: #d8ecff;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.06);
  --radius: 16px;
  --tabbar-h: 64px;
  color-scheme: light;
}
html[data-mode="dark"] {
  --bg: #000000;
  --bg2: #1c1c1e;
  --bg3: #2c2c2e;
  --card: #111113;
  --text: #f5f5f7;
  --muted: #98989f;
  --line: #2a2a2d;
  --dark: #f5f5f7;
  --on-dark: #000000;
  --primary: #0a84ff;
  --primary-2: #3d9bff;
  --green-txt: #4ade80;
  --green-bg: #12351f;
  --finder: #0f2236;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
button { font: inherit; color: inherit; cursor: pointer; }
.ic { flex: none; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.wrap.narrow { max-width: 640px; }
.flex1 { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.big { font-size: 20px; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.nowrap { white-space: nowrap; }
.ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link { color: var(--primary); }
.ul { text-decoration: underline; text-underline-offset: 3px; }
[hidden] { display: none !important; }
html[data-mode="light"] .only-dark, html[data-mode="dark"] .only-light { display: none !important; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--bg); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px); }
.topbar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-height: 64px; padding-top: 10px; padding-bottom: 10px; }
.topbar-in .search-box { order: 3; flex-basis: 100%; }
.topbar-in .top-actions { margin-left: auto; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; flex: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.logo-text { font-weight: 800; letter-spacing: -.01em; }
.logo-text b { color: var(--primary); font-weight: 800; }
.topbar .logo-text { display: none; }
.search-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 8px 0 16px; background: var(--bg2); border-radius: 24px; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; color: var(--text); }
.search-box input::placeholder { color: var(--muted); }
.search-ic { color: var(--muted); display: flex; }
.search-filter { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.search-box.in-profile { margin: 12px 0 16px; padding: 0 16px; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; flex: none; }
.icon-btn:hover { background: var(--bg2); }
.pill-btn { height: 44px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-radius: 22px; background: var(--bg2); font-weight: 500; font-size: 16px; white-space: nowrap; }
.lang-btn { padding: 0 12px; font-weight: 700; font-size: 14px; }
.hide-m { display: none !important; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 0; font-weight: 500; font-size: 16px; white-space: nowrap; transition: filter .15s, transform .05s; }
.btn:active { transform: scale(.98); }
.btn:hover { filter: brightness(.95); }
.btn-lg { height: 54px; font-size: 18px; border-radius: 14px; padding: 0 24px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-dark { background: var(--dark); color: var(--on-dark); }
.btn-soft { background: var(--bg2); color: var(--text); }
.btn-green { background: var(--green); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-danger { background: #ffe9e7; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 0; font-size: 17px; position: relative; list-style: none; }
.link-btn::-webkit-details-marker { display: none; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--dark); color: var(--on-dark); display: grid; place-items: center; }
.dot-red { position: absolute; top: 4px; left: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); }

/* ---------- Flash ---------- */
.flash { margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: var(--green-bg); color: var(--green-txt); font-weight: 500; }
.flash-err { background: #ffe9e7; background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.flash-warn { background: #fff4d6; background: color-mix(in srgb, var(--star) 18%, transparent); color: #a16207; }
html[data-mode="dark"] .flash-warn { color: #fbbf24; }

/* ---------- Home tiles ---------- */
.main { min-height: 60vh; }
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 12px 0 24px; }
.tile { position: relative; overflow: hidden; background: var(--bg2); border-radius: var(--radius); min-height: 100px; padding: 12px 14px; grid-column: span 2; transition: background .15s, transform .1s; }
.tile:active { transform: scale(.98); }
.tile:hover { background: var(--bg3); }
.tile-cars, .tile-new, .tile-trucks, .tile-moto { grid-column: span 3; }
.tile-name { position: relative; z-index: 1; font-size: 16px; font-weight: 500; line-height: 1.2; display: block; max-width: 78%; overflow-wrap: anywhere; hyphens: auto; }
.tile-img { position: absolute; right: -6px; bottom: -4px; width: 74%; max-width: 170px; height: auto; pointer-events: none; }
.tile-img.is-photo { right: 6px; bottom: 6px; width: 56%; aspect-ratio: 4/3; object-fit: contain; }

.finder { background: var(--finder); border-radius: 24px; padding: 22px 16px; margin: 0 -16px 32px; }
.finder h2 { margin-bottom: 16px; }
.finder-form { display: grid; gap: 12px; }
.finder-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.finder .field { background: var(--card); border-color: transparent; height: 54px; }
.finder .btn { justify-self: start; }

.section { margin: 32px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 8px; }
.svc { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 4px; border-radius: var(--radius); }
.svc:hover { background: var(--bg2); }
.svc-img { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; }
.svc-img.is-photo { object-fit: contain; }
.svc-name { font-size: 15px; line-height: 1.2; }
.promo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: var(--dark); color: var(--on-dark); border-radius: 20px; padding: 22px; margin: 24px 0; }
.promo p { margin: 6px 0 0; opacity: .75; }

.chips { display: flex; gap: 8px; }
.scroll-x { overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.scroll-x::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 18px; border-radius: 14px; background: var(--bg2); border: 0; font-size: 16px; white-space: nowrap; }
.chip-on { background: var(--dark); color: var(--on-dark); }
.chip-dark { background: var(--dark); color: var(--on-dark); padding: 0 16px; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 12px; }
.card { background: transparent; display: flex; flex-direction: column; position: relative; min-width: 0; }
.card-photo { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--bg2); overflow: hidden; border-radius: 14px; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-photo img { transform: scale(1.03); }
.card-tags { position: absolute; left: 0; bottom: 10px; display: flex; gap: 0; }
.tag { display: inline-block; padding: 4px 14px 4px 12px; font-size: 14px; font-weight: 500; color: #fff; background: var(--primary); clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); }
.tag-green { background: #00b956; }
.tag-gray { background: #555; }
.tag-blue { background: var(--blue); }
.card-body { padding: 8px 2px 4px; display: flex; flex-direction: column; gap: 2px; }
.card-head { display: flex; gap: 6px; align-items: flex-start; justify-content: space-between; }
.card-title { font-size: 17px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { font-size: 19px; font-weight: 800; margin-top: 4px; white-space: nowrap; }
.old-price { color: var(--muted); font-size: 15px; text-decoration: line-through; }
.card-sub { color: var(--muted); font-size: 15px; }
.card-seller { font-size: 15px; }
.card-meta { color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fav-btn { border: 0; background: none; padding: 0; width: 30px; height: 30px; display: grid; place-items: center; color: var(--text); flex: none; }
.fav-btn.on { color: var(--red); }
.fav-btn.on .ic { fill: currentColor; }
.fav-btn:active { transform: scale(1.2); }

.list { display: grid; gap: 28px; }
.card-big { box-shadow: none; border-radius: 0; background: transparent; }
.card-big .card-photo { aspect-ratio: 4 / 3; border-radius: 12px; }
.card-big .card-body { padding: 10px 0 0; }
.card-big .card-price { font-size: 26px; order: -1; margin: 0 0 2px; }
.card-big .card-title { font-size: 19px; }
.card-big .old-price { order: -1; }

/* ---------- Page heads / tabs ---------- */
.page-head { margin: 8px 0 12px; display: grid; gap: 8px; }
.page-head.row-between { display: flex; }
.page-title { margin: 12px 0 20px; }
.toolbar { margin: 14px 0 20px; }
.tabs { display: flex; gap: 24px; border-bottom: 2px solid var(--line); margin: 20px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 8px 0 12px; font-size: 22px; font-weight: 800; color: var(--muted); white-space: nowrap; margin-bottom: -2px; border-bottom: 4px solid transparent; }
.tabs a.on { color: var(--text); border-color: var(--text); }
.tabs sup { font-size: 13px; font-weight: 600; }

.dropdown { position: relative; }
.dropdown summary { cursor: pointer; }
.dropdown-menu { position: absolute; z-index: 20; top: 100%; left: 0; min-width: 220px; background: var(--card); border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.18); padding: 6px; margin-top: 6px; }
.dropdown-menu a { display: block; padding: 11px 14px; border-radius: 10px; }
.dropdown-menu a:hover, .dropdown-menu a.on { background: var(--bg2); }

.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 32px 0; }
.pager a, .pager b, .pager span { min-width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--bg2); padding: 0 8px; }
.pager b { background: var(--dark); color: var(--on-dark); }
.pager span { background: none; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty p { margin: 8px 0 20px; font-size: 17px; }
.empty-ico { font-size: 56px; }

/* ---------- Sheets ---------- */
.sheet { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet-panel { background: var(--bg); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .25s cubic-bezier(.2,.8,.2,1); }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--bg3); margin: 4px auto 16px; }
.sheet-list a { display: block; padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 17px; }
.sheet-list a.on { font-weight: 700; color: var(--primary); }
.sheet-foot { position: sticky; bottom: 0; background: var(--bg); padding: 16px 0 0; margin-top: 16px; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-panel { border-radius: 24px; } }

/* ---------- Forms ---------- */
.form { display: block; }
.lbl { display: block; font-size: 15px; color: var(--muted); margin: 16px 0 6px; }
.field { width: 100%; height: 50px; padding: 0 14px; border-radius: 12px; border: 1.5px solid transparent; background: var(--bg2); color: var(--text); font-size: 17px; outline: none; appearance: none; -webkit-appearance: none; }
select.field { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
select.field:disabled { opacity: .55; }
textarea.field { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.4; }
.field:focus { border-color: var(--primary); background-color: var(--bg); }
.field-sm { height: 36px; font-size: 14px; padding: 0 30px 0 10px; background-position: right 8px center; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two .lbl { margin-top: 16px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 0; font-size: 16px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); flex: none; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 12px; background: var(--bg2); font-size: 15px; }
.seg input:checked + span { background: var(--dark); color: var(--on-dark); }
.seg input:focus-visible + span { outline: 2px solid var(--primary); }
.seg-2 { display: grid; grid-template-columns: 1fr 1fr; }
.seg-2 span { justify-content: center; width: 100%; }
.cat-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cat-opt input { position: absolute; opacity: 0; }
.cat-opt span { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--bg2); font-size: 15px; cursor: pointer; min-height: 56px; border: 2px solid transparent; }
.cat-opt b { font-size: 24px; }
.cat-opt input:checked + span { border-color: var(--primary); background: var(--bg); background: color-mix(in srgb, var(--primary) 10%, var(--bg)); }
.upload { display: block; position: relative; border: 2px dashed var(--line); border-radius: 16px; padding: 24px; text-align: center; color: var(--muted); cursor: pointer; }
.upload:hover { border-color: var(--primary); color: var(--primary); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0; }
.thumbs:empty { display: none; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; background: var(--bg2); font-size: 13px; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.thumb span { display: flex; align-items: center; gap: 4px; padding: 6px; }

/* ---------- Item page ---------- */
.item { position: relative; }
.item-tools { display: flex; justify-content: flex-end; gap: 2px; margin: -4px -8px 4px 0; }
.item-grid { display: grid; gap: 24px; }
.gallery { position: relative; margin: 0 -16px; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 8px; padding: 0 16px; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: none; width: 92%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; scroll-snap-align: center; background: var(--bg2); cursor: zoom-in; }
.gallery-track img:only-child { width: 100%; }
.gallery-count { position: absolute; top: 12px; left: 28px; background: rgba(0,0,0,.55); color: #fff; font-size: 15px; padding: 4px 10px; border-radius: 10px; }
.price-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.price-big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.badge-price { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 12px; font-size: 16px; background: var(--green-bg); color: var(--green-txt); font-weight: 500; }
.badge-great { background: var(--green); color: #fff; }
.item-title { font-size: 22px; font-weight: 400; margin: 6px 0 16px; line-height: 1.3; }
.credit-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg2); border-radius: 20px; padding: 18px 20px; margin: 16px 0; }
.credit-sum { font-size: 20px; font-weight: 700; }
.credit-ico { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #34c759, #0a84ff); flex: none; }
.seller-card { margin: 16px 0; }
.seller { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.seller-info { display: grid; gap: 2px; }
.seller-name { font-size: 22px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.verified { width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-grid; place-items: center; }
.verified-big { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 600; margin-top: 8px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #0a84ff, #5e5ce6); color: #fff; font-weight: 800; font-size: 20px; flex: none; }
.avatar-lg { width: 72px; height: 72px; font-size: 30px; }
.avatar-xl { width: 96px; height: 96px; font-size: 40px; }
.rating-line { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; }
.rating-line.big { font-size: 20px; margin: 6px 0; }
.stars { display: inline-flex; gap: 2px; }
.star { position: relative; width: 18px; height: 18px; background: var(--bg3); -webkit-mask: var(--star-svg) center / contain no-repeat; mask: var(--star-svg) center / contain no-repeat; }
.star span { position: absolute; inset: 0 auto 0 0; background: var(--star); }
:root { --star-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3l-5.9 3.3 1.3-6.6L2.5 9.4l6.6-.8z'/%3E%3C/svg%3E"); }
.rating-line.big .star { width: 22px; height: 22px; }
.addr { display: flex; gap: 6px; align-items: flex-start; margin: 16px 0; font-size: 17px; }
.h2 { margin: 28px 0 14px; }
.specs { margin: 0; display: grid; gap: 10px; }
.specs div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 17px; }
.specs dt { color: var(--muted); overflow: hidden; white-space: nowrap; }
.specs dt span::after { content: " ........................................................................................................"; color: var(--line); }
.specs dd { margin: 0; }
.desc { font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
.owner-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.owner-bar form { margin: 0; }
.btn-col { display: grid; gap: 10px; margin: 16px 0; }
.scroll-grid { grid-auto-flow: column; grid-auto-columns: 46%; grid-template-columns: none; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 12px; scroll-snap-type: x mandatory; }
.scroll-grid > * { scroll-snap-align: start; }
.actionbar { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + 8px + env(safe-area-inset-bottom)); z-index: 60; display: flex; gap: 10px; padding: 12px; background: var(--card); border-radius: 22px; box-shadow: 0 6px 30px rgba(0,0,0,.18); }
.actionbar .btn { flex: 1; }
.has-actionbar .site-footer { padding-bottom: 100px; }

.lightbox { position: fixed; inset: 0; z-index: 300; background: #000; display: grid; place-items: center; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-close { position: absolute; top: 12px; right: 12px; color: #fff; background: rgba(255,255,255,.12); }

/* ---------- Profile ---------- */
.profile-head { display: flex; justify-content: space-between; gap: 16px; margin: 16px 0; font-size: 17px; line-height: 1.5; }
.profile-head h1 { font-size: 30px; }
.profile-card { display: flex; gap: 16px; align-items: center; padding: 20px; background: var(--bg2); border-radius: 20px; margin: 16px 0; line-height: 1.5; }
.menu-list { display: grid; background: var(--bg2); border-radius: 20px; overflow: hidden; margin: 16px 0; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 0; background: none; text-align: left; font-size: 17px; border-bottom: 1px solid var(--line); }
.menu-list > :last-child { border-bottom: 0; }
.menu-list span { flex: 1; }
.menu-list em { font-style: normal; color: var(--muted); }
.settings { background: var(--bg2); border-radius: 20px; padding: 4px 18px 18px; }
.settings summary { display: flex; gap: 14px; align-items: center; padding: 12px 0; font-size: 17px; cursor: pointer; list-style: none; }
.settings .field { background: var(--bg); }
.review { padding: 16px 0; border-bottom: 1px solid var(--line); }
.review p { margin: 6px 0 0; }
.review-form { display: grid; gap: 10px; padding: 16px; background: var(--bg2); border-radius: 16px; margin-bottom: 16px; }
.review-form .field { background: var(--bg); }
.review-form .btn { justify-self: start; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.star-input input { position: absolute; opacity: 0; }
.star-input label { font-size: 34px; color: var(--bg3); cursor: pointer; line-height: 1; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--star); }

/* ---------- My ads ---------- */
.my-list { display: grid; gap: 12px; }
.my-item { display: flex; gap: 14px; padding: 12px; background: var(--bg2); border-radius: 18px; }
.my-photo { flex: none; width: 112px; }
.my-photo img { width: 112px; height: 112px; object-fit: cover; border-radius: 12px; background: var(--bg3); }
.my-body { flex: 1; min-width: 0; display: grid; gap: 4px; align-content: start; }
.my-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.my-actions form { display: contents; }

/* ---------- Messages ---------- */
.threads { display: grid; }
.thread { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.thread img { width: 60px; height: 60px; object-fit: cover; border-radius: 12px; flex: none; background: var(--bg2); }
.thread-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.thread.unread .thread-body > .ellipsis:last-child { font-weight: 700; }
.badge-num { font-style: normal; min-width: 22px; height: 22px; border-radius: 11px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; padding: 0 6px; }
.chat-page { padding-bottom: 0; }
.chat-page .tabbar, .chat-page .site-footer { display: none; }
.chat { display: flex; flex-direction: column; min-height: calc(100vh - 64px); min-height: calc(100dvh - 64px); }
.chat-head { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.chat-head img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.chat-head .small { color: var(--muted); }
.chat-msgs { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 16px 0; }
.chat-day { align-self: center; font-size: 13px; color: var(--muted); background: var(--bg2); padding: 3px 10px; border-radius: 10px; margin: 8px 0; }
.bubble { max-width: 80%; padding: 9px 12px 6px; border-radius: 18px; font-size: 16px; overflow-wrap: anywhere; }
.bubble time { display: block; text-align: right; font-size: 11px; opacity: .65; margin-top: 2px; }
.bubble.mine { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 6px; }
.bubble.theirs { align-self: flex-start; background: var(--bg2); border-bottom-left-radius: 6px; }
.chat-form { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: flex-end; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: var(--bg); }
.chat-form textarea { flex: 1; min-height: 44px; max-height: 160px; padding: 11px 14px; border-radius: 22px; border: 0; background: var(--bg2); color: var(--text); font: inherit; resize: none; outline: none; }

/* ---------- Auth ---------- */
.auth-page .tabbar { display: none; }
.auth-page { padding-bottom: 0; }
.auth { max-width: 480px; margin: 0 auto; padding: 0 16px 32px; }
.auth-hero { position: relative; overflow: hidden; border-radius: 32px; background: #050608; color: #fff; padding: 140px 24px 32px; text-align: center; margin-top: 8px; }
.auth-hero.small-hero { padding-top: 80px; }
.auth-glow { position: absolute; inset: -30% -20% auto; height: 120%; background: radial-gradient(40% 35% at 25% 35%, rgba(52,199,89,.75), transparent 70%), radial-gradient(45% 40% at 70% 45%, rgba(10,132,255,.8), transparent 70%), radial-gradient(35% 30% at 55% 20%, rgba(94,92,230,.7), transparent 70%); filter: blur(30px); animation: glow 9s ease-in-out infinite alternate; }
@keyframes glow { to { transform: translate(6%, 4%) scale(1.1); } }
.auth-hero > *:not(.auth-glow) { position: relative; }
.auth-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 24px; margin-bottom: 18px; }
.auth-hero h1 { font-size: 28px; }
.auth-hero p { opacity: .75; margin: 10px 0 0; font-size: 17px; }
.auth-card { padding: 20px 0; display: grid; gap: 10px; }
.auth-card .form { display: block; }

/* ---------- Tabbar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--bg); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 12px; }
.tabbar a.on { color: var(--text); }
.tabbar a.on .ic { stroke-width: 2.4; }
.badge-dot { position: absolute; top: 6px; left: calc(50% + 6px); font-style: normal; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; padding: 32px 0 24px; border-top: 1px solid var(--line); }
.foot-grid { display: grid; gap: 24px; }
.foot-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.foot-links a:hover { color: var(--primary); }

/* ---------- Admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stats div { background: var(--bg2); border-radius: 16px; padding: 16px; display: grid; }
.stats b { font-size: 26px; }
.stats span { color: var(--muted); font-size: 14px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-weight: 500; }
.table .dim { opacity: .5; }
.inline { display: inline-flex; gap: 4px; }
.prose { font-size: 17px; line-height: 1.6; }

.only-m { }
/* ---------- Desktop ---------- */
@media (min-width: 760px) {
  .topbar .logo-text { display: inline; }
  .topbar-in { flex-wrap: nowrap; height: 72px; padding-top: 0; padding-bottom: 0; }
  .topbar-in .search-box { order: 0; flex-basis: auto; }
  .topbar-in .top-actions { margin-left: 0; }
  .hide-m { display: inline-flex !important; }
  .only-m { display: none !important; }
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  .tiles { grid-template-columns: repeat(6, 1fr); }
  .tile, .tile-cars, .tile-new, .tile-trucks, .tile-moto { grid-column: span 2; min-height: 130px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 24px 16px; }
  .finder { margin: 0 0 40px; padding: 28px; }
  .finder-form { grid-template-columns: 1fr 1fr 2fr auto; align-items: center; }
  .finder-form .field[data-model][hidden] { display: block !important; visibility: hidden; }
  .svc-grid { grid-template-columns: repeat(6, 1fr); }
  .list { grid-template-columns: 1fr; }
  .card-big { flex-direction: row; gap: 20px; }
  .card-big .card-photo { width: 340px; flex: none; }
  .card-big .card-body { padding: 0; flex: 1; }
  .item-grid { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .gallery { margin: 0; }
  .gallery-track { padding: 0; }
  .gallery-track img { width: 100%; }
  .gallery-count { left: 12px; }
  .side-sticky { position: sticky; top: 84px; background: var(--card); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
  .side-sticky .price-big { font-size: 30px; }
  .scroll-grid { grid-auto-columns: calc(33.3% - 11px); margin: 0; padding: 4px 0 12px; }
  .cat-pick { grid-template-columns: repeat(3, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .chat-page .site-footer { display: none; }
  .auth-hero { padding-top: 120px; }
  .actionbar { display: none; }
  .has-actionbar .site-footer { padding-bottom: 24px; }
}
@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .tiles { grid-template-columns: repeat(7, 1fr); }
  .tile, .tile-cars, .tile-new, .tile-trucks, .tile-moto { grid-column: span 1; }
  .tile-name { max-width: 100%; }
}
@media (max-width: 380px) {
  .tile-name { font-size: 15px; }
  .pill-btn { padding: 0 12px; }
  .price-big { font-size: 30px; }
}
@media (max-width: 759px) { .tile-rent .tile-name, .tile-parts .tile-name, .tile-services .tile-name { font-size: 14px; max-width: 100%; } .tile-rent .tile-img, .tile-parts .tile-img, .tile-services .tile-img { width: 92%; } }

/* =================== AUTOSALES v2 =================== */
:root { --tile: #f2f1f0; }
html[data-mode="dark"] { --tile: #1c1c1e; }
.tile, .finder .field { background-color: var(--tile); }
.tile { background: var(--tile); }

/* Safe area (iPhone, барнома) */
.topbar { padding-top: env(safe-area-inset-top); }
.is-app .site-footer { display: none; }
.is-app body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.is-app input, .is-app textarea { -webkit-user-select: text; user-select: text; }
a, button { -webkit-tap-highlight-color: transparent; }

/* Аватар */
.avatar { overflow: hidden; color: #fff; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm { width: 40px; height: 40px; font-size: 17px; }
.avatar-tab { width: 28px; height: 28px; font-size: 13px; border: 2px solid transparent; }
.tabbar a.on .avatar-tab { border-color: var(--text); }
.top-avatar { display: block; flex: none; }

/* Корт */
.card-title { font-size: 16px; }
.card-price { font-size: 18px; }
.card-pc { position: absolute; right: 8px; top: 8px; display: inline-flex; gap: 3px; align-items: center; font-size: 12px; color: #fff; background: rgba(0,0,0,.45); padding: 2px 7px; border-radius: 8px; }
.tag-top { position: absolute; left: 8px; top: 8px; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #ff9500, #ff5e3a); padding: 3px 8px; border-radius: 8px; letter-spacing: .03em; }
.tag { font-size: 13px; padding: 3px 14px 3px 10px; }
.card-big .card-photo { border-radius: 14px; }
.card-big .card-price { font-size: 24px; }

/* Реклама */
.ad { grid-column: 1 / -1; }
.ad-in { display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: var(--bg2); position: relative; }
.ad-media { display: block; position: relative; aspect-ratio: 16 / 9; background: #000; }
.ad-media img, .ad-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-body { display: grid; gap: 4px; padding: 14px 16px 16px; }
.ad-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ad-title { font-size: 19px; font-weight: 800; line-height: 1.2; }
.ad-text { color: var(--muted); font-size: 15px; }
.ad-btn { justify-self: start; margin-top: 8px; height: 40px; }
.ad-text-only .ad-in, .ad-text .ad-in { background: linear-gradient(135deg, #0a84ff 0%, #00c48c 100%); color: #fff; }
.ad-text .ad-label, .ad-text .ad-text { color: rgba(255,255,255,.85); }
.ad-text .ad-btn { background: #fff; color: #0b0b0c; }
.ad-text .ad-title { font-size: 22px; }
.list .ad { margin: 4px 0; }
@media (min-width: 760px) {
  .ad-image .ad-in, .ad-video .ad-in { flex-direction: row; }
  .ad-image .ad-media, .ad-video .ad-media { width: 52%; flex: none; }
  .ad-body { align-content: center; padding: 20px 24px; }
  .ad-title { font-size: 24px; }
}

/* Маркаҳо */
.brands { display: flex; gap: 10px; }
.brand-chip { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; font-size: 13px; text-align: center; }
.brand-chip span:last-child { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-badge { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--tile); font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: var(--text); border: 1px solid var(--line); }
.brand-list { display: grid; grid-template-columns: 1fr; }
.brand-list a { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.brand-list .brand-badge { width: 44px; height: 44px; font-size: 14px; }
.brand-list span:not(.brand-badge) { flex: 1; }
.brand-list em { font-style: normal; color: var(--muted); }
@media (min-width: 760px) { .brand-list { grid-template-columns: repeat(3, 1fr); column-gap: 24px; } }

/* Хизматрасониҳо */
.svc-grid { gap: 14px 6px; }
.svc { padding: 6px 2px; }
.svc-name { font-size: 14px; }
.svc-list { display: grid; }
.svc-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 17px; }
.svc-row .svc-img { width: 48px; height: 48px; border-radius: 14px; }
.svc-row span { flex: 1; }
.svc-row em { font-style: normal; color: var(--muted); }
.chip-img { width: 22px; height: 22px; border-radius: 6px; }
.empty-img { width: 200px; margin: 0 auto 8px; }
.empty-ico { color: var(--muted); display: flex; justify-content: center; }

/* Финдер (мисли Avito) */
.finder .field { background: var(--card); }
.finder-form > .field { height: 54px; }

/* Илова кардани эълон */
.cat-opt img { width: 54px; height: 36px; object-fit: contain; flex: none; }
.cat-opt span { gap: 8px; }

/* Профил: обложка + аватар (мисли YouTube) */
.channel { margin: 8px 0 16px; }
.cover { position: relative; aspect-ratio: 3 / 1; border-radius: 20px; background: linear-gradient(120deg, #0a84ff 0%, #00c48c 60%, #34c759 100%) center / cover no-repeat; overflow: hidden; }
.cover-actions { position: absolute; right: 10px; bottom: 10px; margin: 0; }
.cover-del { position: absolute; right: 10px; top: 10px; margin: 0; }
.chip-glass { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 14px; cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.channel-row { display: flex; align-items: flex-start; gap: 14px; margin: -36px 0 0 14px; position: relative; }
.channel-row > .avatar, .channel-row > a, .channel-row > form { flex: none; }
.channel-row .avatar-xl { width: 96px; height: 96px; font-size: 40px; border: 4px solid var(--bg); box-sizing: content-box; }
.channel-info { display: grid; gap: 4px; padding: 44px 0 4px; min-width: 0; flex: 1; }
.channel-info .rating-line, .channel-info .stars-line { white-space: nowrap; }
.channel-info h1 { font-size: 21px; line-height: 1.2; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; }
.ava-edit { margin: 0; }
.ava-edit label { position: relative; display: block; cursor: pointer; }
.ava-cam { position: absolute; right: 2px; bottom: 2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--dark); color: var(--on-dark); border: 3px solid var(--bg); }
.loading { opacity: .5; pointer-events: none; }
.about { margin: 12px 0 0; font-size: 16px; }

/* Экрани даромадан (мисли барнома) */
.auth-page { padding-bottom: 0; background: #05070b; }
.auth-page .tabbar, .auth-page .site-footer { display: none; }
.auth-screen { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; color: #fff; overflow: hidden; background: #05070b; padding: env(safe-area-inset-top) 20px calc(20px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.auth-screen .auth-glow { position: absolute; inset: -20% -40% 30%; background: radial-gradient(35% 30% at 25% 40%, rgba(0,196,140,.75), transparent 70%), radial-gradient(40% 35% at 70% 45%, rgba(10,132,255,.85), transparent 70%), radial-gradient(30% 25% at 50% 20%, rgba(94,92,230,.7), transparent 70%); filter: blur(40px); animation: glow 10s ease-in-out infinite alternate; pointer-events: none; }
.auth-top { position: relative; display: flex; justify-content: space-between; align-items: center; height: 60px; }
.auth-x { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; }
.auth-screen .lang-btn { background: rgba(255,255,255,.12); color: #fff; }
.auth-center { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; text-align: center; padding: 24px 0; }
.auth-center.small { flex: 0; padding: 4px 0 16px; }
.auth-logo { border-radius: 20px; box-shadow: 0 10px 40px rgba(10,132,255,.45); }
.auth-name { font-size: 30px; font-weight: 800; margin-top: 12px; letter-spacing: .01em; }
.auth-name b { color: #4fb3ff; }
.auth-center h1 { font-size: 26px; margin-top: 18px; }
.auth-center p { opacity: .72; margin: 10px 0 0; font-size: 16px; max-width: 340px; }
.auth-bottom { position: relative; display: grid; gap: 10px; }
.auth-form { display: grid; gap: 10px; }
.auth-form .field { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.08); height: 54px; }
.auth-form .field::placeholder { color: rgba(255,255,255,.55); }
.auth-form .field:focus { background: rgba(255,255,255,.16); border-color: #4fb3ff; }
.auth-form select.field option { color: #000; }
.auth-form .check { color: rgba(255,255,255,.8); font-size: 14px; }
.btn-white { background: #fff; color: #0b0b0c; }
.btn-glass { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.12); }
.auth-skip { text-align: center; color: rgba(255,255,255,.7); padding: 10px; font-size: 15px; }
.auth-terms { text-align: center; color: rgba(255,255,255,.5); font-size: 12.5px; margin: 6px 0 0; }
.auth-screen .flash-err { background: rgba(255,59,48,.18); color: #ffb4ae; }

/* Насби барнома */
.install { position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom)); z-index: 95; display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 12px; background: var(--card); border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.22); animation: up .35s cubic-bezier(.2,.8,.2,1); }
.install img { border-radius: 12px; flex: none; }
.install-txt { flex: 1; min-width: 0; display: grid; font-size: 13px; line-height: 1.3; }
.install-txt b { font-size: 15px; }
.install-txt span { color: var(--muted); }
.ios-steps { padding-left: 22px; font-size: 17px; line-height: 1.5; margin: 12px 0 20px; }
.ios-steps li { margin: 8px 0; }
.ios-ic { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--bg2); color: var(--primary); }
@media (min-width: 760px) { .install { left: auto; right: 20px; bottom: 20px; width: 400px; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px); transform: translateX(-50%); z-index: 400; background: var(--dark); color: var(--on-dark); padding: 10px 16px; border-radius: 14px; font-size: 14px; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: opacity .4s; }
.toast.out { opacity: 0; }

/* Админ */
.admin-grid { display: grid; gap: 20px; }
.panel { background: var(--bg2); border-radius: 20px; padding: 16px; }
.panel .field { background: var(--bg); }
.range { width: 100%; accent-color: var(--primary); }
.dim { opacity: .55; }
.ad-thumb { width: 112px; height: 112px; border-radius: 12px; overflow: hidden; background: var(--bg3); display: grid; place-items: center; color: var(--muted); }
.ad-thumb img, .ad-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.media-item { background: var(--bg2); border-radius: 16px; padding: 10px; display: grid; gap: 8px; }
.media-prev { background: var(--tile); border-radius: 12px; aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; }
.media-prev img { max-width: 90%; max-height: 90%; object-fit: contain; }
.media-item label.btn { cursor: pointer; }
@media (min-width: 900px) { .admin-grid { grid-template-columns: 400px 1fr; align-items: start; } }

/* v2 fixes: add-form category grid never overflows */
.cat-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cat-opt { position: relative; min-width: 0; }
.cat-opt span { min-width: 0; overflow-wrap: anywhere; hyphens: auto; font-size: 14px; line-height: 1.25; }
.cat-opt img { width: 46px; height: 32px; }
@media (min-width: 720px) { .cat-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
