/* Дизайн-система «Отдам-Продам» (отдам-продам.рф).
   Тёплый абрикосовый акцент, кремовый фон, мягкие скругления. */
:root {
  --bg: #fbf6ef;
  --surface: #ffffff;
  --surface-2: #f6eee4;
  --ink: #2a211b;
  --ink-2: #4a3d33;
  --muted: #7d6d61;
  --line: #ecdfd1;
  --accent: #e8692e;
  --accent-ink: #b8481b;
  --accent-soft: #fde7da;
  --free: #2f7d4f;
  --free-soft: #e1f2e6;
  --sun: #f6b73c;
  --sun-soft: #fff1d2;
  --warn: #9a5b00;
  --danger: #b3261e;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(62, 39, 20, .06), 0 6px 18px rgba(62, 39, 20, .06);
  --shadow-up: 0 10px 30px rgba(62, 39, 20, .14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --header-h: 64px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(232, 105, 46, .45); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* Header */
.hdr { position: sticky; top: 0; z-index: 40; background: rgba(251, 246, 239, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.hdr-in { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.logo svg { width: 38px; height: 38px; flex: none; }
.logo-word { font-weight: 800; font-size: 18px; letter-spacing: -.02em; line-height: 1; }
.logo-word i { font-style: normal; color: var(--accent); }
.logo-sub { display: block; font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: .02em; margin-top: 3px; }
.search { position: relative; display: flex; }
.search input { width: 100%; height: 44px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 46px 0 42px; outline: none; transition: border-color .15s; }
.search input:focus { border-color: var(--accent); }
.search .ico { position: absolute; left: 14px; top: 12px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search button { position: absolute; right: 4px; top: 4px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; }
.hdr-act { display: flex; gap: 8px; align-items: center; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; }
.badge-n { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 700; text-decoration: none; white-space: nowrap; background: var(--surface); border-color: var(--line); }
.btn svg { width: 20px; height: 20px; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-soft { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-tg { background: #2a211b; border-color: #2a211b; color: #fff; min-height: 52px; font-size: 17px; }
.btn-tg:hover { background: #000; }
.add-wide { display: none; }
@media (max-width: 719px) {
  .hdr-in { grid-template-columns: auto 1fr auto; row-gap: 8px; }
  .search { grid-column: 1 / -1; grid-row: 2; }
  .logo-sub { display: none; }
}
@media (min-width: 720px) { .add-wide { display: inline-flex; } .add-narrow { display: none; } }

/* Honest promise banner */
.promise { margin: 14px 0 4px; display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-md); background: linear-gradient(100deg, var(--accent-soft), var(--sun-soft)); color: var(--ink-2); font-size: 14px; }
.promise b { color: var(--ink); }
.promise svg { width: 28px; height: 28px; flex: none; color: var(--accent-ink); }

/* Chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); text-decoration: none; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chip:hover { border-color: #dbc8b6; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips.sub .chip { height: 32px; font-size: 13px; background: transparent; }
.chips.sub .chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.chip .x { font-size: 16px; line-height: 1; opacity: .7; }

/* Toolbar */
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0; }
@media (max-width: 719px) { .tools { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 10px 16px; } .tools::-webkit-scrollbar { display: none; } .tools > * { flex: none; } .promise { font-size: 13px; padding: 10px 12px; } }
.tools .spacer { flex: 1; }
.seg { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; font-size: 14px; }
.seg svg { width: 18px; height: 18px; }
.seg.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.sel { height: 40px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 34px 0 14px; font-size: 14px; font-weight: 600; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%237d6d61' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.meta { color: var(--muted); font-size: 14px; margin: 2px 0 10px; min-height: 20px; }
.near-note { font-size: 13px; color: var(--muted); }

/* Sections */
.sec { margin: 22px 0 8px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.sec-h h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.sec-h a { color: var(--accent-ink); font-weight: 700; text-decoration: none; font-size: 14px; }
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(158px, 46%); gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.strip > * { scroll-snap-align: start; }
@media (min-width: 720px) { .strip { grid-auto-columns: 210px; } }
.strip.is-empty { display: block; }
.strip.is-empty .empty { box-shadow: none; padding: 20px 16px; }
.free-sec { background: var(--free-soft); border-radius: var(--r-lg); padding: 16px; }
.free-sec .sec-h h2 { color: var(--free); }

/* Grid + card */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-up); }
.card-ph { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); overflow: hidden; }
.card-ph img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.card-ph img.ok { opacity: 1; }
.card-ph .noph { position: absolute; inset: 0; display: grid; place-items: center; color: #c8b4a2; }
.card-ph .noph svg { width: 42%; height: 42%; }
.card-ph .cnt { position: absolute; left: 8px; top: 8px; background: rgba(42, 33, 27, .7); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.card-tags { position: absolute; left: 8px; right: 52px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--surface); color: var(--ink-2); }
.tag-today { background: var(--sun); color: #3d2a00; }
.tag-free { background: var(--free); color: #fff; }
.tag-sold { background: var(--ink); color: #fff; }
.tag-pending { background: var(--sun-soft); color: var(--warn); border: 1px solid #f1d38c; }
.heart { position: absolute; right: 8px; top: 8px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); display: grid; place-items: center; color: var(--ink-2); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.heart svg { width: 21px; height: 21px; }
.heart.on { color: var(--accent); }
.heart.on svg path { fill: currentColor; }
.card-b { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.price { font-weight: 800; font-size: 18px; letter-spacing: -.01em; }
.price.free { color: var(--free); }
.price.sold { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.card-t { font-size: 15px; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.card-m { font-size: 13px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.dist { color: var(--accent-ink); font-weight: 700; }

/* Skeleton */
.sk { background: linear-gradient(90deg, #f1e7dc 25%, #f8f1e9 37%, #f1e7dc 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.card.skel .card-ph { border-radius: 0; }
.sk-line { height: 14px; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } .card { transition: none; } }

/* Empty */
.empty { text-align: center; padding: 36px 18px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); grid-column: 1 / -1; }
.empty svg { width: 64px; height: 64px; color: var(--accent); }
.empty h3 { margin: 10px 0 6px; font-size: 19px; }
.empty p { margin: 0 auto 14px; color: var(--muted); max-width: 440px; }
.empty .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.more { display: flex; justify-content: center; margin: 18px 0; }

/* Bottom sheet filters */
.sheet-bg { position: fixed; inset: 0; background: rgba(42, 33, 27, .38); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
.sheet { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 8px 18px 18px; transform: translateY(105%); transition: transform .25s ease; }
.sheet.open { transform: none; }
.sheet-bg.open { opacity: 1; pointer-events: auto; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet h3 { margin: 0 0 12px; font-size: 20px; }
@media (min-width: 720px) { .sheet { left: auto; top: 0; width: 400px; max-height: none; border-radius: 24px 0 0 24px; transform: translateX(105%); } .sheet .grab { display: none; } }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.inp { width: 100%; min-height: 46px; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--surface); outline: none; }
.inp:focus { border-color: var(--accent); }
textarea.inp { min-height: 130px; resize: vertical; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.sheet-act { position: sticky; bottom: -18px; background: var(--surface); padding: 12px 0 0; display: flex; gap: 10px; }

/* Item page */
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; font-size: 14px; color: var(--muted); padding: 12px 0; }
.crumbs a { color: var(--muted); }
.item { display: grid; gap: 18px; }
@media (min-width: 900px) { .item { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } .item-gal { grid-column: 1; grid-row: 1; } .item-about { grid-column: 1; grid-row: 2; } .item-side { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: calc(var(--header-h) + 24px); } }
.gal { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); }
.gal-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gal-track::-webkit-scrollbar { display: none; }
.gal-slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 3; display: grid; place-items: center; background: #efe5da; }
.gal-slide img { width: 100%; height: 100%; object-fit: contain; }
.gal-slide .noph { color: #c8b4a2; width: 30%; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); display: none; place-items: center; box-shadow: var(--shadow); }
.gal-nav svg { width: 22px; height: 22px; }
.gal-nav.prev { left: 10px; } .gal-nav.next { right: 10px; }
@media (hover: hover) { .gal-nav { display: grid; } }
.gal-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.gal-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .6); box-shadow: 0 0 2px rgba(0, 0, 0, .3); }
.gal-dots i.on { background: #fff; width: 18px; border-radius: 4px; }
.gal-count { position: absolute; right: 10px; top: 10px; background: rgba(42, 33, 27, .7); color: #fff; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.gal.full { position: fixed; inset: 0; z-index: 80; border-radius: 0; background: #000; display: flex; align-items: center; }
.gal.full .gal-track { width: 100%; }
.gal.full .gal-slide { aspect-ratio: auto; height: 100vh; background: #000; }
.gal-close { display: none; position: absolute; top: 12px; left: 12px; z-index: 2; }
.gal.full .gal-close { display: grid; }
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; }
.item-price { font-size: 30px; font-weight: 850; letter-spacing: -.02em; margin: 0; }
.item-price.free { color: var(--free); }
.item-title { font-size: 21px; margin: 4px 0 10px; line-height: 1.25; word-break: break-word; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.facts b { color: var(--ink-2); font-weight: 600; }
.acts { display: grid; gap: 10px; }
.acts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.desc { white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--ink-2); }
.panel h2 { font-size: 17px; margin: 0 0 8px; }
.pending-box { background: var(--sun-soft); border: 1px solid #f1d38c; color: #5a3a00; border-radius: var(--r-md); padding: 14px; margin-bottom: 14px; }
.tips { font-size: 14px; color: var(--ink-2); margin: 0; padding-left: 18px; }
.tips li { margin: 3px 0; }

/* Form */
.form { max-width: 680px; margin: 0 auto; }
.form h1 { font-size: 26px; margin: 14px 0 4px; letter-spacing: -.02em; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.err { color: var(--danger); font-weight: 600; }
.quick { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.thumbs div { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.geo-ok { display: flex; align-items: center; gap: 8px; color: var(--free); font-weight: 700; }
.success { text-align: center; }
.success .big { font-size: 46px; }
.steps { text-align: left; margin: 14px auto; max-width: 420px; padding-left: 20px; color: var(--ink-2); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; opacity: 0; transition: .2s; z-index: 90; pointer-events: none; max-width: 92vw; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.foot { margin: 40px 0 0; padding: 22px 16px 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.foot a { color: var(--accent-ink); }
/* VK ID вход в шапке */
.auth-box { display: flex; align-items: center; gap: 8px; }
.vk-login { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; background: #0077ff; color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.vk-login svg { width: 18px; height: 18px; }
.me-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: inherit; font-weight: 700; font-size: 14px; white-space: nowrap; }
.me-link img, .me-ava { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #e9e2d8; flex: none; }
@media (max-width: 700px) { .vk-login .lbl-long, .me-link .lbl { display: none; } }
.my-list { display: grid; gap: 10px; }
.my-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid #eee3d6; text-decoration: none; color: inherit; }
.my-st { font-size: 13px; font-weight: 700; white-space: nowrap; }
