/* Olchi.uz — веб-прототип. Дизайн «Риштан»: кобальт риштанской керамики,
   фарфоровый фон и шафрановый ценник — единственный яркий акцент.
   Шрифты: Unbounded (заголовки, цены, цифры) и Golos Text (интерфейс). */
:root {
  --bg: #edf1f6;          /* фарфор */
  --surface: #ffffff;
  --surface-2: #e3e9f2;
  --text: #13213a;        /* чернила */
  --muted: #5b6880;
  --line: #d3dbe7;
  --accent: #1e45b8;      /* кобальт */
  --accent-ink: #ffffff;
  --accent-soft: #dfe7fa;
  --accent-deep: #142f86;
  --tag: #f7c744;         /* шафрановый ценник */
  --tag-ink: #2b2000;
  --teal: #0b7f7b;        /* ишкор — бирюзовая глазурь */
  --teal-soft: #d8f0ee;
  --warn: #b3263b;        /* гранат */
  --warn-soft: #fbe3e7;
  --gold: #855f00;
  --gold-soft: #fcefc4;
  --danger: #b3263b;
  --r-xl: 26px;
  --radius: 18px;
  --radius-sm: 12px;
  --display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --font: "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1525;
    --surface: #16213a;
    --surface-2: #1d2a47;
    --text: #e6ecf7;
    --muted: #93a0ba;
    --line: #283757;
    --accent: #7c9bff;
    --accent-ink: #0a1638;
    --accent-soft: #1e2d57;
    --accent-deep: #1b3591;
    --teal: #4fd1c5;
    --teal-soft: #123a3c;
    --warn: #ff8a9b;
    --warn-soft: #3d1a24;
    --gold: #f7c744;
    --gold-soft: #3a2f10;
    --danger: #ff8a9b;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Во всю ширину экрана; на широких экранах контент — колонкой по центру (--col). */
.device {
  --col: 720px;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.app { display: flex; flex-direction: column; height: 100%; }

/* ---------- Ценник: фирменный элемент (цены, логотип, главный блок) ---------- */
.price, .brand-mark, .hero-tag {
  --hole: var(--surface);
  position: relative;
  background: var(--tag);
  color: var(--tag-ink);
  clip-path: polygon(11px 0, 100% 0, 100% 100%, 11px 100%, 0 50%);
}
.price::before, .brand-mark::before, .hero-tag::before {
  content: ""; position: absolute; left: 7px; top: 50%;
  width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: var(--hole);
}

/* Шапка */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 10px;
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 {
  font-family: var(--display); font-size: 17px; font-weight: 600; margin: 0; flex: 1;
  letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.brand-mark {
  --hole: var(--bg);
  width: 40px; height: 30px; padding-left: 10px; flex: none;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 15px;
}
.brand-name { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand-tld { color: var(--accent); }
/* Шапка администратора: рядом три переключателя ролей — название короче и чуть мельче */
.brand-name.short { font-size: 15px; white-space: nowrap; }
@media (max-width: 400px) {
  .brand-name.short { font-size: 14px; }
  .topbar .role-switch.three button { padding: 7px 7px; font-size: 12px; }
}
@media (max-width: 345px) { .brand-name.short { display: none; } } /* очень узкий экран: только логотип */
.icon-btn {
  width: 40px; height: 40px; border-radius: 13px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; font-size: 18px; flex: none;
}
.role-switch {
  display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px;
}
.role-switch button {
  border: 0; background: transparent; padding: 7px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.role-switch button.on { background: var(--text); color: var(--bg); }
.role-switch.three button { padding: 7px 10px; font-size: 12.5px; }
@media (max-width: 400px) {
  .brand-name { font-size: 15px; }
  .role-switch button { padding: 7px 10px; }
}

/* Контент */
.screen { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px 28px; -webkit-overflow-scrolling: touch; }
.screen.with-nav { padding-bottom: 28px; }
.section-title { font-size: 15px; font-weight: 600; color: var(--text); margin: 26px 2px 10px; }
.lead { color: var(--muted); margin: 0 2px 16px; }
h2 {
  font-family: var(--display); font-size: 23px; font-weight: 600; line-height: 1.2;
  letter-spacing: -0.02em; margin: 8px 2px 8px;
}

.card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line);
  padding: 16px; margin-bottom: 12px;
}
.card.tap { cursor: pointer; transition: border-color .15s, transform .08s; }
.card.tap:active { transform: scale(0.99); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.strong { font-weight: 600; }

/* Главный блок покупателя: кобальт с ценником-вопросом */
.hero {
  position: relative; overflow: hidden;
  background: var(--accent-deep);
  color: #fff; border-radius: var(--r-xl); padding: 24px 20px 20px; margin: 6px 0 8px;
}
.hero::after { /* концентрические круги, как роспись на риштанском блюде */
  content: ""; position: absolute; right: -80px; bottom: -90px; width: 240px; height: 240px; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 14px, rgba(255,255,255,.08) 14px 16px);
  pointer-events: none;
}
.hero h3 {
  font-family: var(--display); margin: 0 0 10px; font-size: 27px; font-weight: 700;
  line-height: 1.12; letter-spacing: -0.03em; max-width: 9ch;
}
.hero p { margin: 0 0 20px; color: rgba(255,255,255,.82); max-width: 30ch; position: relative; z-index: 1; }
.hero .btn { background: #fff; color: var(--accent-deep); position: relative; z-index: 1; }
.hero-tag {
  --hole: var(--accent-deep);
  position: absolute; right: 18px; top: 24px; z-index: 1;
  padding: 8px 14px 8px 22px; font-family: var(--display); font-weight: 700; font-size: 15px;
  transform: rotate(8deg); transform-origin: 4px 50%;
  animation: swing 2.4s ease-in-out .3s 1 both;
}
@keyframes swing {
  0% { transform: rotate(-16deg); } 30% { transform: rotate(16deg); }
  55% { transform: rotate(3deg); } 78% { transform: rotate(11deg); } 100% { transform: rotate(8deg); }
}

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 15px 18px; font-weight: 600; font-size: 15.5px;
  background: var(--accent); color: var(--accent-ink); width: 100%;
  transition: filter .15s, transform .08s;
}
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost { background: transparent; color: var(--accent); padding: 10px; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.sm { padding: 8px 12px; font-size: 13.5px; border-radius: 10px; width: auto; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
a.btn { text-decoration: none; }

/* Липкая панель действий внизу экрана мастера */
.action-bar {
  position: sticky; bottom: 0; margin: 18px -16px -28px; padding: 14px 16px calc(env(safe-area-inset-bottom) + 16px);
  background: linear-gradient(to top, var(--bg) 78%, transparent);
}

/* Чипы и списки выбора */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 0; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line);
  padding: 9px 15px; border-radius: 999px; font-weight: 500; font-size: 14.5px;
}
.chip.on { background: var(--text); box-shadow: none; color: var(--bg); }

.pick-list { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.pick {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.pick:last-child { border-bottom: 0; }
.pick .grow { flex: 1; }
.pick .sub { display: block; font-size: 13px; color: var(--muted); }
.pick.on { background: var(--accent-soft); }
.check {
  width: 22px; height: 22px; border-radius: 7px; box-shadow: inset 0 0 0 2px var(--line);
  display: grid; place-items: center; font-size: 13px; color: transparent; flex: none;
}
.pick.on .check { background: var(--accent); box-shadow: none; color: var(--accent-ink); }
.chev { color: var(--muted); font-size: 20px; line-height: 1; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 14px; text-align: left; min-height: 104px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  transition: border-color .15s;
}
.tile:disabled { opacity: .5; cursor: not-allowed; }
.tile .emoji {
  font-size: 20px; width: 40px; height: 40px; border-radius: 12px; background: var(--bg);
  display: grid; place-items: center;
}
.tile .t { font-weight: 600; line-height: 1.25; }
.tile .c { font-size: 12.5px; color: var(--muted); }

/* Прогресс мастера */
.steps { display: flex; gap: 5px; margin: 4px 2px 16px; }
.steps span { flex: 1; height: 5px; border-radius: 5px; background: var(--line); }
.steps span.on { background: var(--accent); }

/* Поля */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin: 0 2px 6px; }
.input, textarea.input {
  width: 100%; border: 0; border-radius: var(--radius-sm); padding: 13px 14px; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line); outline: none;
}
.input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
textarea.input { min-height: 124px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; -webkit-appearance: none; }
.counter { text-align: right; font-size: 12px; color: var(--muted); margin: 4px 2px 0; font-variant-numeric: tabular-nums; }

.photos { display: flex; gap: 8px; flex-wrap: wrap; }
.photo {
  width: 84px; height: 84px; border-radius: 14px; background: var(--surface-2) center/cover no-repeat;
  position: relative;
}
.photo .x {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--bg); background: var(--text); color: var(--bg); font-size: 11px; line-height: 20px; padding: 0;
}
.photo.add {
  display: grid; place-items: center; color: var(--accent); font-size: 26px; cursor: pointer;
  background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent);
}

/* Бейджи */
.badge { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.green { background: var(--teal-soft); color: var(--teal); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.gray { background: var(--surface-2); color: var(--muted); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

/* Ожидание */
.wait { text-align: center; padding: 24px 8px 8px; }
.ring { width: 168px; height: 168px; margin: 8px auto 20px; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-size: 44px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.pulse-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); margin-right: 6px; animation: pulse 1.4s infinite; vertical-align: middle; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
/* Полоса статуса над предложениями: «ещё ждём ответы» / «запрос открыт». */
.live-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin: 0 0 14px; border-radius: 14px; background: var(--teal-soft); color: var(--teal); font-size: 14px; font-weight: 600; }
.live-bar b { font-variant-numeric: tabular-nums; }
.live-bar.calm { background: var(--surface-2); color: var(--muted); font-weight: 500; }

/* Карточка предложения */
.offer { padding: 0; overflow: hidden; }
.offer .gallery { display: flex; gap: 2px; height: 184px; background: var(--surface-2); overflow-x: auto; scroll-snap-type: x mandatory; }
.offer .gallery > div { flex: 0 0 100%; background: center/cover no-repeat; scroll-snap-align: start; display: grid; place-items: center; color: var(--muted); font-size: 44px; }
.offer .gallery.multi > div { flex-basis: 85%; }
.offer .body { padding: 14px 16px 16px; }
.price {
  display: inline-flex; align-items: center; flex: none;
  padding: 6px 12px 6px 21px;
  font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -0.02em;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.offer .price { transform: rotate(-2deg); }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; margin: 12px 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.contact {
  background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 12px 14px;
  font-weight: 600; display: flex; align-items: center; gap: 8px; margin-top: 8px; text-decoration: none;
}

/* Нижняя навигация */
.tabbar {
  position: sticky; bottom: 0; margin-top: auto;
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
}
.tabbar button {
  flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 2px 0;
}
.tabbar .ic {
  width: 54px; height: 30px; border-radius: 999px; display: grid; place-items: center; position: relative;
  transition: background .2s;
}
.tabbar .ic svg { width: 22px; height: 22px; }
.tabbar button.on { color: var(--text); }
.tabbar button.on .ic { background: var(--accent-soft); color: var(--accent); }
.tabbar .dot::after { content: ""; position: absolute; top: 3px; right: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--surface); }

/* Тост и модалка */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 500; font-size: 14px;
  z-index: 50; width: max-content; max-width: min(90vw, 400px); text-align: center; animation: rise .2s ease-out;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px) } }
.sheet-bg { position: fixed; inset: 0; background: rgba(13, 21, 37, .45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  background: var(--bg); width: 100%; max-width: 440px; border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 22px 16px calc(env(safe-area-inset-bottom) + 18px); animation: up .22s ease-out;
}
@keyframes up { from { transform: translateY(24px); opacity: .4 } }
.sheet h3 { font-family: var(--display); font-weight: 600; margin: 0 0 8px; font-size: 18px; letter-spacing: -0.01em; }

.empty { text-align: center; color: var(--muted); padding: 44px 16px; }
.empty .big { font-size: 42px; margin-bottom: 10px; }
.empty .empty-ic { display: flex; justify-content: center; color: var(--muted); }
.empty .empty-ic svg { width: 44px; height: 44px; }
.proto-note { font-size: 12.5px; color: var(--muted); text-align: center; margin: 20px 0 4px; }

/* Вход */
.screen.login { display: flex; flex-direction: column; justify-content: center; padding-top: 24px; }
.login-hero { margin-bottom: 32px; }
.login-hero h1 {
  font-family: var(--display); font-size: 38px; font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  margin: 24px 0 12px;
}
.login-hero p { color: var(--muted); margin: 0; max-width: 32ch; }
.brand-mark.big { width: 78px; height: 54px; padding-left: 16px; font-size: 26px; transform: rotate(-6deg); }

/* Админка */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-grid .tile { min-height: 96px; }
.admin-grid .tile .t { font-size: 14px; }
.stat { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.card.list { padding: 6px 12px; }
.list-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.grow-btn { flex: 1; border: 0; background: transparent; text-align: left; padding: 6px 4px; font-size: 14.5px; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
.stepper { display: flex; align-items: center; gap: 18px; }
.stepper .icon-btn:disabled { opacity: .4; }

/* ---------- Геопозиция и карты ---------- */
/* «Рядом со мной»: кобальтовая плашка, круги расходятся от шафранового значка, как сигнал */
.near-card {
  position: relative; overflow: hidden; width: 100%; text-align: left;
  display: flex; align-items: center; gap: 14px;
  border: 0; border-radius: var(--radius); padding: 16px;
  background: var(--accent-deep); color: #fff;
}
.near-card::after {
  content: ""; position: absolute; left: -58px; top: 50%; width: 220px; height: 220px; margin-top: -110px;
  border-radius: 50%; pointer-events: none;
  background: repeating-radial-gradient(circle, transparent 0 15px, rgba(255,255,255,.09) 15px 17px);
}
.near-card:active { transform: scale(0.99); }
.near-card .grow { flex: 1; position: relative; z-index: 1; }
.near-card .t { display: block; font-family: var(--display); font-weight: 600; font-size: 16.5px; letter-spacing: -0.01em; }
.near-card .c { display: block; font-size: 13px; color: rgba(255,255,255,.78); margin-top: 2px; }
.near-card .chev { color: rgba(255,255,255,.7); position: relative; z-index: 1; }
.near-ic {
  position: relative; z-index: 1; flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--tag); color: var(--tag-ink);
  box-shadow: 0 0 0 6px rgba(247,199,68,.18);
}
.near-ic svg { width: 24px; height: 24px; }

.lead-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 16px; }
.lead-row .lead { margin: 0 2px; }
.near-chip {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  border: 0; border-radius: 999px; padding: 7px 13px 7px 10px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13.5px;
}
.near-chip svg { width: 17px; height: 17px; }

/* Строка площадки: выбор + кнопка карты */
.pick-item { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.pick-item:last-child { border-bottom: 0; }
.pick-item .pick { border-bottom: 0; flex: 1; min-width: 0; }
.pick-item.on { background: var(--accent-soft); }
.pick .sub .dist { color: var(--accent); font-weight: 600; }
.map-btn {
  flex: none; width: 40px; height: 40px; margin-right: 12px; border-radius: 12px;
  border: 0; display: grid; place-items: center;
  background: var(--bg); color: var(--accent);
  transition: background .15s;
}
.map-btn svg { width: 21px; height: 21px; }
.pick-item.on .map-btn { background: var(--surface); }
.icon-btn.map-sm { color: var(--accent); }
.icon-btn.map-sm svg { width: 18px; height: 18px; }

.map-link {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; padding: 0;
  border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 13px; white-space: nowrap;
}
.map-link svg { width: 15px; height: 15px; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn.sm svg { width: 17px; height: 17px; }

/* Карта на экране «Рядом» и в шторке */
.near-map, .sheet-map {
  height: 210px; border-radius: var(--radius); overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--line); position: relative; z-index: 0;
}
.near-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 2px 10px; }
.near-meta .btn.sm { padding: 6px 8px; }
.map-sheet { max-height: 92dvh; overflow-y: auto; }
.map-sheet .sheet-map { height: 240px; margin-bottom: 12px; }
.map-sheet > .btn, .map-sheet > a.btn { margin-top: 10px; }
.dist-card {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.dist-card .price { --hole: var(--surface); font-size: 17px; transform: rotate(-3deg); }
.map-fallback { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13.5px; text-align: center; padding: 16px; }

/* Метки на карте */
.map-pin { position: relative; width: 30px; height: 40px; filter: drop-shadow(0 3px 4px rgba(19,33,58,.3)); }
.map-pin .pin-body { fill: var(--accent); stroke: #fff; stroke-width: 2.5; }
.map-pin span {
  position: absolute; left: 0; right: 0; top: 6px; text-align: center;
  font-family: var(--display); font-weight: 700; font-size: 12.5px; color: var(--accent-ink);
}
.map-pin.off {
  width: 14px; height: 14px; border-radius: 50%; filter: none;
  background: var(--surface); box-shadow: inset 0 0 0 3px var(--muted), 0 1px 3px rgba(19,33,58,.25);
}
.me-dot {
  width: 20px; height: 20px; border-radius: 50%; background: var(--teal);
  border: 3px solid #fff; box-shadow: 0 1px 4px rgba(19,33,58,.35);
  animation: me-ping 2s ease-out infinite;
}
@keyframes me-ping {
  0% { box-shadow: 0 0 0 0 rgba(11,127,123,.45), 0 1px 4px rgba(19,33,58,.35); }
  100% { box-shadow: 0 0 0 16px rgba(11,127,123,0), 0 1px 4px rgba(19,33,58,.35); }
}
.leaflet-container { font-family: var(--font); background: var(--surface-2); }
/* Яркую карту OSM приглушаем в фарфоровые тона, чтобы метки-кобальт были главными */
.leaflet-tile-pane { filter: grayscale(.75) sepia(.12) hue-rotate(185deg) saturate(1.4) brightness(1.04) contrast(.92); }
.leaflet-control-attribution { font-size: 10px; background: rgba(255,255,255,.7) !important; }
.leaflet-bar a { color: var(--text) !important; }
@media (prefers-color-scheme: dark) {
  .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) grayscale(.6) brightness(.82) contrast(.9); }
  .map-pin span { color: var(--accent-ink); }
  .leaflet-control-attribution { background: rgba(13,21,37,.7) !important; color: var(--muted); }
  .leaflet-control-attribution a { color: var(--muted); }
  .leaflet-bar a { background: var(--surface); border-color: var(--line); color: var(--text) !important; }
}

/* ---------- Карты v2: Яндекс, маршрут, точка продавца, общая карта ---------- */
.map-loading { background: linear-gradient(100deg, var(--surface-2) 30%, var(--bg) 50%, var(--surface-2) 70%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -300% 0; } }
/* Подложку Яндекса приглушаем так же, как OSM: метки-кобальт остаются главными */
.ymap [class*="ground-pane"] { filter: grayscale(.7) sepia(.1) hue-rotate(185deg) saturate(1.3) brightness(1.03) contrast(.95); }
@media (prefers-color-scheme: dark) {
  .ymap [class*="ground-pane"] { filter: invert(1) hue-rotate(180deg) grayscale(.6) brightness(.82) contrast(.9); }
}
.ymap [class*="copyrights-pane"] { transform: scale(.85); transform-origin: right bottom; }

.tile.wide { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; }
.map-emoji { color: var(--accent); }
.map-emoji svg { width: 22px; height: 22px; }

.map-pin.drag .pin-body { fill: var(--tag); stroke: var(--tag-ink); stroke-width: 2; }
.map-pin.drag::after {
  content: ""; position: absolute; left: 11px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--tag-ink);
}
.map-pin.off.focus { box-shadow: inset 0 0 0 3px var(--accent), 0 0 0 5px var(--accent-soft); }

/* Общая карта площадок */
.screen.map-screen { display: flex; flex-direction: column; }
.all-map {
  flex: 1; min-height: 300px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2); position: relative; z-index: 0;
}
.map-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-top: 10px;
}
.map-card .btn.sm { flex: none; }
.chip.sm-chip { padding: 5px 11px; font-size: 13px; }
.map-screen .action-bar { position: static; margin: 10px 0 0; padding: 0 0 calc(env(safe-area-inset-bottom) + 4px); background: none; }
.screen.map-screen { padding-bottom: 14px; }

/* Точка продавца */
.shop-map {
  height: 220px; border-radius: var(--radius); overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--line); position: relative; z-index: 0;
}

/* Кнопки «На карте / Маршрут» в карточке предложения */
.geo-row { margin: 0 0 10px; }
.geo-row .btn.sm { width: 100%; padding: 9px 8px; }

/* Выбор приложения для маршрута */
.route-apps .pick { text-decoration: none; color: inherit; }
.route-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; color: var(--accent); }
.route-ic svg { width: 22px; height: 22px; }
.app-ic {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 16px; color: #fff;
}
.app-ic.ya { background: #fc3f1d; }
.app-ic.navi { background: #1a1a1a; }
.app-ic.dgis { background: #19aa1e; }
.app-ic.gm { background: #fff; color: #4285f4; box-shadow: inset 0 0 0 1.5px var(--line); }
.app-ic.ap { background: linear-gradient(135deg, #5ac8fa, #34c759); }

/* Поиск адреса */
.addr-results { margin-top: 10px; max-height: 46dvh; overflow-y: auto; }
.addr-results .pick { padding: 11px 14px; }
.addr-note { padding: 8px 4px; }
.mkt-search { position: relative; margin: 0 0 12px; }
.mkt-search .input { padding-left: 42px; -webkit-appearance: none; appearance: none; }
.mkt-search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); display: flex; color: var(--muted); pointer-events: none; }
.mkt-search-ic svg { width: 18px; height: 18px; }
.mkt-results { margin: -4px 0 12px; }
.mkt-results:empty { display: none; }
.map-btn.as-ic { margin: 0; width: 34px; height: 34px; pointer-events: none; }

#shop-geo-note { flex: 1; min-width: 0; }
.near-meta .btn.sm { flex: none; }

/* ---------- Широкие экраны: колонка контента по центру, фон и панели — на всю ширину ---------- */
.topbar { padding-left: max(16px, calc((100% - var(--col)) / 2)); padding-right: max(16px, calc((100% - var(--col)) / 2)); }
.screen > *:not(.action-bar) { max-width: var(--col); margin-left: auto; margin-right: auto; }
.screen.map-screen > * { width: 100%; }
.action-bar { padding-left: max(16px, calc((100% - var(--col)) / 2 + 16px)); padding-right: max(16px, calc((100% - var(--col)) / 2 + 16px)); }
.tabbar { padding-left: max(8px, calc((100% - 560px) / 2)); padding-right: max(8px, calc((100% - 560px) / 2)); }
.sheet { max-width: 560px; }
@media (min-width: 760px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .admin-grid { grid-template-columns: repeat(4, 1fr); }
  .offer .gallery { height: 260px; }
  .near-map, .sheet-map, .shop-map { height: 300px; }
  .hero { padding: 32px 28px 28px; }
  .hero h3 { max-width: none; }
}

/* Подсказки при вводе запроса */
.sugg { margin: -4px 0 14px; }
.sugg:empty { display: none; }
.sugg-title { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 10px 2px 8px; text-transform: uppercase; letter-spacing: .04em; }
.sugg-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.sugg-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 11px 14px; font-size: 15px; color: var(--muted);
}
.sugg-item:last-child { border-bottom: 0; }
.sugg-item svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.sugg-item span:first-of-type { flex: 1; min-width: 0; }
.sugg-item b { color: var(--text); font-weight: 600; }
.sugg-arrow { color: var(--muted); font-size: 14px; }
.chip.sugg-chip { padding: 7px 13px; font-size: 13.5px; }
.chip.sugg-chip.add { color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent-soft); background: var(--accent-soft); }

/* Вкладки «Рынки / ТЦ» и выбранные площадки */
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 11px; font-weight: 600; font-size: 14.5px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(19,33,58,.12); }
.seg-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; }
.sel-chips { margin-bottom: 4px; }
.sel-chips .chip { padding: 6px 12px; font-size: 13.5px; }

/* Экран запроса у продавца */
.offer-head { margin: 22px 2px 12px; }
.screen.login > * { max-width: 420px; width: 100%; }

/* Статус заявки продавца */
.status-card { border-left: 4px solid var(--gold, #d99a1e); }
.status-card.warn { border-left-color: var(--danger); }
/* «Моего рынка / ТЦ нет в списке» в конце списка площадок */
.pick.add-place { width: 100%; background: var(--surface); border: 1.5px dashed var(--accent); border-radius: var(--radius); }
.pick.add-place .add-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-soft, #e6ecfb); color: var(--accent); font-weight: 700; }
.pick.add-place.on .add-ic { background: var(--accent); color: #fff; }
.pick.add-place .chev { font-size: 13px; color: var(--accent); }

/* Привязка номера по SMS */
.nowrap { white-space: nowrap; }
.sms-back, .screen.login > .sms-back { align-self: flex-start; width: auto; text-align: left; background: none; border: 0; padding: 6px 0; margin: 0 0 18px; color: var(--accent); font: 600 15px var(--font); cursor: pointer; }
.sms-head { margin-bottom: 22px; }
.sms-head h2 { margin: 14px 0 6px; }
.sms-head p { margin: 0; }
.sms-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.sms-ic svg { width: 28px; height: 28px; }
.otp { position: relative; display: block; margin-bottom: 8px; cursor: text; }
.otp-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; border: 0; z-index: 1; caret-color: transparent; }
.otp-cells { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.otp-cell {
  height: 64px; border-radius: var(--radius-sm); background: var(--surface); border: 1.5px solid var(--line);
  display: grid; place-items: center; font-family: var(--display); font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
}
.otp-cell.full { border-color: var(--text); }
.otp:focus-within .otp-cell.cur { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.otp.bad .otp-cell { border-color: var(--warn); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px) } 75% { transform: translateX(4px) } }
.otp-err { min-height: 20px; color: var(--warn); font-size: 13.5px; font-weight: 500; margin: 0 2px 10px; }
.sms-resend { text-align: center; color: var(--muted); font-size: 14px; margin: 16px 0 0; min-height: 22px; }
.sms-link { background: none; border: 0; padding: 0; color: var(--accent); font: 600 14.5px var(--font); cursor: pointer; }
.sms-demo {
  display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 12px 12px 12px 14px;
  border-radius: var(--radius-sm); border: 1px dashed var(--gold); background: var(--gold-soft); font-size: 14px;
}
.sms-demo .grow { flex: 1; }
.sms-demo b { font-family: var(--display); letter-spacing: .08em; }
.sms-push {
  position: fixed; top: calc(env(safe-area-inset-top) + 10px); left: 50%; transform: translateX(-50%); z-index: 60;
  width: min(420px, calc(100vw - 20px)); display: flex; gap: 12px; align-items: flex-start; text-align: left;
  padding: 12px 14px; border: 0; border-radius: 20px; cursor: pointer; color: var(--text); font: 14px var(--font);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(13, 21, 37, .22); animation: drop .3s ease-out;
}
.sms-push.out { transition: transform .35s, opacity .35s; transform: translate(-50%, -24px); opacity: 0; }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0 } }
.sms-push .grow { flex: 1; min-width: 0; }
.sms-push-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #34c759; color: #fff; }
.sms-push-ic svg { width: 20px; height: 20px; }
.sms-push-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.sms-push-top b { color: var(--text); font-weight: 600; }
.sms-push-text { display: block; margin-top: 2px; line-height: 1.35; }

/* «Где искать?»: быстрые способы над списком площадок */
.venue-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.quick {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.quick:first-child { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.quick:first-child .c { color: inherit; opacity: .8; }
.quick:first-child .quick-ic { background: var(--tag); color: var(--tag-ink); }
.quick .grow { flex: 1; min-width: 0; }
.quick .t { display: block; font-weight: 600; font-size: 15px; line-height: 1.2; }
.quick .c { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.quick-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.quick-ic svg { width: 20px; height: 20px; }

/* История: срок запроса */
.req-term { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--gold-soft); color: var(--gold); font-variant-numeric: tabular-nums; }
.req-term svg { width: 15px; height: 15px; }
.req-term.live { background: var(--teal-soft); color: var(--teal); }
.req-term.done { background: var(--surface-2); color: var(--muted); font-weight: 500; }

/* Шаг «Где искать» после выбора категории: напоминание, что ищем */
.draft-cat { display: inline-flex; align-items: center; gap: 6px; margin: 0 2px 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-weight: 600; }

/* Закрытый запрос: карточка «Ваш запрос» и «Отправить заново» */
.req-summary { margin-bottom: 14px; }
.req-summary .photos { margin-top: 10px; }
.req-summary .photo { width: 64px; height: 64px; }
.req-term.inline { margin-top: 0; }
/* Низ карточки «Истории»: срок слева, число предложений справа */
.req-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.req-offers { margin: 8px 0 3px auto; font-size: 13px; font-weight: 600; color: var(--teal); white-space: nowrap; }
.req-offers.none { color: var(--muted); font-weight: 500; }
.resend-card { margin: 0; }
.resend-photos { display: flex; gap: 6px; margin-top: 6px; }
.resend-photos span { width: 52px; height: 52px; border-radius: 10px; background: var(--surface-2) center/cover no-repeat; }

/* Админка: категории */
.cat-row .grow-btn { display: flex; align-items: center; gap: 10px; }
.cat-row .sub, .cat-name .sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cat-row.off .cat-name { opacity: .6; }
.cat-emoji { font-size: 22px; line-height: 1; }
.cat-head.off { opacity: .85; }
.btn-row .btn.sm { flex: 1; }
.check-row { display: flex; align-items: center; gap: 10px; margin: 2px 2px 14px; font-size: 14.5px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.btn.danger-text { color: var(--danger); width: 100%; margin-top: 4px; }
.cat-row .icon-btn:disabled { opacity: .3; }


/* Новый запрос: больше воздуха между фото и кнопкой «Отправить продавцам» */
.compose-photos { margin-bottom: 0; }
.compose-photos + .action-bar { margin-top: 36px; }

/* Лента запросов других пользователей */
.feed-live { display: flex; align-items: center; gap: 0; margin: -4px 2px 14px; color: var(--teal); font-weight: 600; }
.feed-live.off { color: var(--muted); }
.feed-live.off .pulse-dot { background: var(--muted); animation: none; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-item { display: flex; }
.feed-item.right { justify-content: flex-end; }
.feed-item.right .feed-bubble { border-radius: 20px 20px 6px 20px; background: var(--accent-soft); }
.feed-bubble {
  position: relative; width: min(80vw, 100%); /* 80% ширины окна; на широком экране — не шире колонки */ background: var(--surface); border-radius: 20px 20px 20px 6px;
  padding: 12px 14px 10px; box-shadow: 0 1px 0 var(--line), 0 6px 18px -12px rgba(19, 33, 58, .35);
}
.feed-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); }
.feed-cat { font-weight: 600; }
.feed-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed-text { font-size: 16px; font-weight: 600; margin: 4px 0 6px; line-height: 1.35; }
.feed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--muted); }
.feed-mk { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.feed-mk svg { width: 15px; height: 15px; flex: none; }
.feed-ans { font-size: 12px; font-weight: 600; color: var(--teal); background: var(--teal-soft); border-radius: 999px; padding: 2px 8px; }
.feed-ans.wait { color: var(--gold); background: var(--gold-soft); }
.feed-same { margin: 6px -6px -4px; padding: 6px 6px; font-size: 13px; }
.feed-same svg { width: 15px; height: 15px; }
.feed-new { overflow: hidden; animation: feed-in .55s cubic-bezier(.2, .8, .2, 1.1) both; }
@keyframes feed-in {
  from { opacity: 0; max-height: 0; transform: translateY(-16px) scale(.94); }
  60% { opacity: 1; }
  to { opacity: 1; max-height: 260px; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .feed-new { animation: none; } }

/* Админка: демо-данные */
.demo-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.demo-row:last-child { border-bottom: 0; }
.demo-row input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.demo-row .sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.demo-row.locked { cursor: default; opacity: .75; }

/* Под кнопкой действия теперь нижнее меню — отступ для «чёлки» iPhone уже есть у меню */
.screen:has(+ .tabbar) .action-bar { padding-bottom: 6px; bottom: -18px; } /* ~16px до меню: близко, но не вплотную */

/* Текстовая кнопка (без фона), например «Создать новый запрос» в истории */
.text-btn { display: inline-block; border: 0; background: none; padding: 4px 2px; margin: 0 0 14px; color: var(--accent); font-weight: 600; font-size: 15px; cursor: pointer; }
.text-btn:active { opacity: .6; }

/* Удаление текстом красного цвета, без фона и обводки (например, «Удалить запрос из истории») */
.btn.delete { background: none; box-shadow: none; border: 0; color: var(--danger); margin-top: 6px; padding: 10px; font-weight: 600; filter: none; }

/* Таймер до автозакрытия запроса */
.live-bar .close-left { font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; align-self: flex-end; }

/* Галерея фото продавца: листается вбок, в углу — сколько фото */
.offer .gallery-wrap { position: relative; }
.offer .gallery { scrollbar-width: none; }
.offer .gallery::-webkit-scrollbar { display: none; }
.gallery-count { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(19, 33, 58, .62); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; }
.gallery-count svg { width: 14px; height: 14px; }

/* Наведение — только там, где есть мышь. На телефоне :hover «залипает» после касания
   (и подсвечивает строку, оказавшуюся под пальцем после перехода), поэтому там — только :active. */
@media (hover: hover) and (pointer: fine) {
  .card.tap:hover { border-color: var(--accent); }
  .btn:hover:not(:disabled) { filter: brightness(1.07); }
  .pick:hover { background: var(--bg); }
  .pick.on:hover { background: var(--accent-soft); }
  .tile:hover:not(:disabled) { border-color: var(--accent); }
  .photo.add:hover { background: var(--accent-soft); }
  .near-card:hover { filter: brightness(1.08); }
  .near-chip:hover { filter: brightness(0.97); }
  .pick-item.on .pick:hover { background: transparent; }
  .map-btn:hover { background: var(--accent-soft); }
  .sugg-item:hover { background: var(--bg); }
}
@media (hover: none), (pointer: coarse) {
  .card.tap:active { border-color: var(--accent); }
  .btn:active:not(:disabled) { filter: brightness(1.07); }
  .pick:active { background: var(--bg); }
  .pick.on:active { background: var(--accent-soft); }
  .tile:active:not(:disabled) { border-color: var(--accent); }
  .photo.add:active { background: var(--accent-soft); }
  .near-card:active { filter: brightness(1.08); }
  .near-chip:active { filter: brightness(0.97); }
  .pick-item.on .pick:active { background: transparent; }
  .map-btn:active { background: var(--accent-soft); }
  .sugg-item:active { background: var(--bg); }
}