/* Доска объявлений «Дневник Диабетика» — дизайн-система приложения ДД */
:root {
  --blue: #ef5636;
  --blue-tint: #fce3db;
  --good: #2f9e5f;
  --good-tint: #e4f3e9;
  --bad: #d23b3b;
  --bad-tint: #fbe4e2;
  --warn: #d98a1f;
  --warn-tint: #fdf0dc;
  --page-bg: #f1f0ee;
  --card: #ffffff;
  --card-border: #eae7e2;
  --ink: #1c1512;
  --muted: #7a6b62;
  --faint: #a99a90;
  --line: #e9e7e3;
  --card-shadow: 0 3px 12px rgba(120,55,30,.08), 0 1px 3px rgba(120,55,30,.06);
  --btn-shadow: 0 10px 22px -8px rgba(239,86,54,.5);
  --f-display: "Coolvetica","Helvetica Neue","Arial Rounded MT Bold",system-ui,-apple-system,sans-serif;
  --f-body: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,system-ui,"Helvetica Neue",sans-serif;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --blue: #f26b4e; --blue-tint: #33201a;
    --good: #3bb56f; --good-tint: #123322;
    --bad: #e85555; --bad-tint: #331615;
    --warn: #e3a04a; --warn-tint: #33270f;
    --page-bg: #140f0c; --card: #241b16; --card-border: #322620;
    --ink: #f3ece7; --muted: #b3a396; --faint: #7d6f64;
    --line: #322620;
    --card-shadow: 0 3px 12px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  --blue: #f26b4e; --blue-tint: #33201a;
  --good: #3bb56f; --good-tint: #123322;
  --bad: #e85555; --bad-tint: #331615;
  --warn: #e3a04a; --warn-tint: #33270f;
  --page-bg: #140f0c; --card: #241b16; --card-border: #322620;
  --ink: #f3ece7; --muted: #b3a396; --faint: #7d6f64;
  --line: #322620;
  --card-shadow: 0 3px 12px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.3);
}
:root[data-theme="light"] {
  --blue: #ef5636; --blue-tint: #fce3db;
  --good: #2f9e5f; --good-tint: #e4f3e9;
  --bad: #d23b3b; --bad-tint: #fbe4e2;
  --warn: #d98a1f; --warn-tint: #fdf0dc;
  --page-bg: #f1f0ee; --card: #ffffff; --card-border: #eae7e2;
  --ink: #1c1512; --muted: #7a6b62; --faint: #a99a90;
  --line: #e9e7e3;
  --card-shadow: 0 3px 12px rgba(120,55,30,.08), 0 1px 3px rgba(120,55,30,.06);
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font: 16px/1.45 var(--f-body);
  background: var(--page-bg); color: var(--ink);
  padding-bottom: calc(66px + env(safe-area-inset-bottom));
}
button { font: inherit; cursor: pointer; }
svg.ic { width: 22px; height: 22px; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* шапка */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: var(--page-bg); border-bottom: 1px solid var(--line);
  padding: 14px 16px 10px;
}
.topbar-in { max-width: 480px; margin: 0 auto; }
.brand-title {
  font-family: var(--f-display); font-size: 22px; letter-spacing: .2px;
  color: var(--ink); line-height: 1.1;
}
.brand-title .accent { color: var(--blue); }
.brand-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

main { padding: 12px 12px 20px; max-width: 480px; margin: 0 auto; }

/* фильтры */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--card-border); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 8px 15px; font-size: 14.5px; box-shadow: var(--card-shadow);
}
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.filter-row { display: flex; gap: 8px; margin-bottom: 10px; }
.filter-row select, .filter-row input {
  flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid var(--card-border);
  border-radius: 12px; background: var(--card); color: var(--ink); font-size: 15px;
  appearance: none; -webkit-appearance: none;
}

/* карточки ленты */
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 12px; margin-bottom: 10px; display: flex; gap: 12px; align-items: stretch;
}
.card:active { transform: scale(.99); }
.imgwrap { position: relative; flex: none; width: 86px; height: 86px; }
.card-img {
  width: 100%; height: 100%; border-radius: 12px; object-fit: cover;
}
.card-img.ph {
  background: var(--blue-tint); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.card-img.ph svg.ic { width: 30px; height: 30px; stroke-width: 1.5; }
.photocount {
  position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px;
  background: rgba(18,16,15,.62); color: #fff; font-size: 11px; font-weight: 600;
  padding: 2px 6px; border-radius: 999px; line-height: 1;
}
.photocount svg { width: 12px; height: 12px; stroke: #fff; fill: none; stroke-width: 1.7; }
.card-body { min-width: 0; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700;
  border-radius: 8px; padding: 3px 9px; letter-spacing: 0;
}
.badge.sell { background: var(--blue-tint); color: var(--blue); }
.badge.buy  { background: var(--warn-tint); color: var(--warn); }
.badge.free { background: var(--good-tint); color: var(--good); }
.badge.swap { background: var(--line); color: var(--muted); }
.badge.fresh { background: var(--good-tint); color: var(--good); }
.exp {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600;
  border-radius: 8px; padding: 3px 8px; background: var(--line); color: var(--muted);
}
.exp svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.exp.exp-soon { background: var(--warn-tint); color: var(--warn); }
.exp.exp-out  { background: var(--bad-tint); color: var(--bad); }
.card-title { font-weight: 650; font-size: 15.5px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-price { font-weight: 800; margin-top: 4px; font-size: 16.5px; letter-spacing: -.2px; color: var(--ink); }
.card-price.free { color: var(--good); }
.card-price.neg { color: var(--muted); font-weight: 650; font-size: 14.5px; }
.card-meta { font-size: 13px; color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 4px; }
.card-meta svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.7; flex: none; }
.opt { color: var(--faint); font-weight: 400; font-size: .88em; }

.empty { text-align: center; color: var(--muted); padding: 44px 20px; }
.empty .empty-ic { color: var(--faint); margin-bottom: 12px; }
.empty .empty-ic svg.ic { width: 44px; height: 44px; stroke-width: 1.3; }
.empty b { color: var(--ink); }

/* фирменный заголовок страницы (единый стиль — мини-аппы и сайт) */
.page-head { text-align: center; margin: 2px 0 16px; }
.page-head h1 {
  font-family: var(--f-display); font-size: 22px; color: var(--ink); letter-spacing: .2px;
}
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 5px; line-height: 1.45; }

/* убираем брендовую шапку: в мини-аппах её показывает сам хост, на сайте бренд в hero */
html:not(.web) .topbar { display: none; }               /* мини-аппы ВК/ТГ/MAX */
html:not(.web) .tab[data-tab="home"] { display: none; } /* «Главная» — только на сайте */
@media (max-width: 879px) { html.web .topbar { display: none; } }  /* узкий сайт (навигация снизу) */
@media (min-width: 880px) {                              /* широкий сайт: только навигация, по центру */
  html.web .brand-block { display: none; }
  html.web .topbar-in { justify-content: center; }
  html.web .topbar-in .tabbar { margin-left: 0; }
}

/* футер сайта — только широкий экран (на мини-аппах/узком футера нет, там блок автора) */
.site-foot { display: none; }
.foot-in { max-width: 1140px; margin: 0 auto; text-align: center; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; margin-bottom: 12px; }
.foot-links a, .foot-links button {
  color: var(--muted); font-size: 14px; text-decoration: none;
  background: none; border: none; padding: 0; cursor: pointer; font: inherit;
}
.foot-links a:hover, .foot-links button:hover { color: var(--blue); }
.foot-links #foot-author { color: var(--blue); font-weight: 600; }
.foot-legal { color: var(--faint); font-size: 13px; }
.foot-social { display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 10px; margin: 4px 0 16px; }
.foot-social .soc-cap { font: inherit; font-weight: 400; color: var(--muted); }
.foot-social .soc { display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s; }
.foot-social .soc:hover { transform: translateY(-2px); }
.foot-social .soc svg { width: 26px; height: 26px; display: block; }
@media (min-width: 880px) {
  html.web .site-foot {
    display: block; border-top: 1px solid var(--line); margin-top: 44px;
    padding: 28px 32px 34px;
  }
  html.web .author-card { display: none; }  /* блок автора уехал в футер */
}

/* форма */
.form label { display: block; font-size: 14px; font-weight: 650; margin: 15px 0 6px;
  color: var(--ink); letter-spacing: normal; }
.form input, .form textarea, .form select {
  width: 100%; padding: 12px 13px; border: 1px solid var(--card-border); border-radius: 12px;
  background: var(--card); color: var(--ink); font-size: 16px;
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none; border-color: var(--blue);
}
.form textarea { min-height: 110px; resize: vertical; }
.hint { font-size: 12.5px; color: var(--faint); margin-top: 5px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg .chip { text-align: center; box-shadow: none; }
.photos-row { display: flex; gap: 8px; margin-top: 6px; }
.photo-slot {
  width: 78px; height: 78px; border-radius: 12px; border: 1.5px dashed var(--card-border);
  background: var(--card); display: flex; align-items: center; justify-content: center;
  color: var(--faint); overflow: hidden; position: relative;
}
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-del {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(20,15,12,.6); color: #fff; font-size: 12px; line-height: 1;
}
.btn {
  width: 100%; border: none; border-radius: 14px; padding: 15px; font-size: 16.5px;
  font-weight: 700; background: var(--blue); color: #fff; margin-top: 18px;
  box-shadow: var(--btn-shadow);
}
.btn[disabled] { opacity: .55; }
.btn.ghost { background: var(--card); color: var(--ink);
  border: 1px solid var(--card-border); box-shadow: var(--card-shadow); }

/* мои объявления */
.status { font-size: 13px; font-weight: 650; margin-top: 4px;
  display: inline-flex; align-items: center; gap: 6px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.pending { color: var(--warn); } .status.active { color: var(--good); }
.status.rejected { color: var(--bad); } .status.closed, .status.expired { color: var(--faint); }
.mini-btn {
  display: block; border: 1px solid var(--card-border); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 8px 14px; font-size: 13.5px; margin-top: 10px;
}

/* правила */
.rules { background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 18px; }
.rules h3 { margin: 16px 0 7px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.rules h3:first-child { margin-top: 0; }
.rules h3 svg.ic { width: 19px; height: 19px; }
.rules h3.ok { color: var(--good); } .rules h3.no { color: var(--bad); }
.rules h3.warn { color: var(--warn); }
.rules p, .rules li { font-size: 14.5px; color: var(--ink); }
.rules ul { padding-left: 20px; margin: 4px 0; }
.rules .sign { color: var(--muted); margin-top: 12px; font-size: 13.5px; }
.banner {
  background: var(--warn-tint); color: var(--warn); border-radius: 12px;
  padding: 10px 13px; font-size: 13.5px; margin-bottom: 12px; font-weight: 650;
}

/* таббар */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 5;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; border: none; background: none; color: var(--faint);
  padding: 9px 2px 8px; font-size: 11px; font-weight: 650;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  position: relative; text-align: center; line-height: 1.1;
}
.tab.active { color: var(--blue); }
.tab-badge {
  position: absolute; top: 3px; left: 50%; transform: translateX(6px);
  min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  background: var(--blue); color: #fff; border-radius: 8px;
  font-size: 10px; font-weight: 800; line-height: 16px; text-align: center;
}

/* панель модерации (только для админов) */
.mod-head { font-weight: 750; margin: 4px 4px 12px; color: var(--ink); }
.mod-card .desc, .fb-card .desc { white-space: pre-wrap; margin: 8px 0 4px; font-size: 14.5px; color: var(--ink); }
.mod-actions { display: flex; gap: 10px; margin-top: 12px; }
.mod-actions .btn { margin-top: 0; flex: 1; }
.btn.mod-ok { background: #1f9d55; }
.fb-card .btn { margin-top: 12px; }
.mod-seg { display: flex; gap: 8px; margin: 2px 0 14px; }
.mod-seg-btn {
  flex: 1; padding: 10px 8px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--muted); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.mod-seg-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.seg-n {
  min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; background: var(--blue); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center;
}
.mod-seg-btn.active .seg-n { background: rgba(255,255,255,.28); }
.rp-reason {
  display: flex; align-items: center; gap: 7px; font-weight: 750;
  color: #c23b22; font-size: 14px; margin-bottom: 6px;
}
.rp-reason svg.ic { color: #c23b22; }
.rp-stale { color: var(--muted); font-weight: 600; }

/* «отдам даром» в форме «Продам» */
.free-check {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 2px; padding: 10px 12px; border-radius: 12px;
  background: var(--blue-tint); cursor: pointer;
  font-size: 14.5px; font-weight: 650; color: var(--ink);
}
.free-check input { width: 20px; height: 20px; accent-color: var(--blue); flex: none; }
input.locked { color: var(--blue); font-weight: 700; background: var(--blue-tint); }

/* явное согласие при подаче объявления (152-ФЗ): отдельные непредзаполненные чекбоксы */
.form label.agree {
  display: flex; align-items: flex-start; gap: 11px;
  margin: 10px 0 0; cursor: pointer;
  font-size: 13.5px; line-height: 1.45; color: var(--ink);
  font-weight: 400; text-transform: none; letter-spacing: normal;
}
.form label.agree span { text-transform: none; font-weight: 400; letter-spacing: normal; }
.form label.agree input { width: 20px; height: 20px; accent-color: var(--blue); flex: none; margin-top: 1px; }
.form label.agree a { color: var(--blue); text-decoration: underline; }
.agree + .btn, .agree ~ .btn { margin-top: 14px; }

/* мягкое предупреждение о лекарствах в форме подачи */
.form-warn {
  margin: 8px 0 0; padding: 10px 12px; border-radius: 12px;
  background: var(--bad-tint); color: var(--bad);
  font-size: 13px; line-height: 1.45; font-weight: 600;
}
.form-warn[hidden] { display: none; }

/* статистика (дашборд для B2B) */
.stat-h { font-size: 14px; font-weight: 800; letter-spacing: normal;
  color: var(--muted); margin: 18px 2px 10px; }
.stat-h:first-child { margin-top: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 10px; text-align: center; }
.stat-tile.accent { background: var(--blue-tint); border-color: transparent; }
.stat-num { font-size: 24px; font-weight: 850; color: var(--ink); line-height: 1.1; }
.stat-tile.accent .stat-num { color: var(--blue); }
.stat-label { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.25; }
.stat-list { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 4px 14px; }
.stat-row { display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--ink); }
.stat-row:last-child { border-bottom: none; }
.stat-row b { font-weight: 800; }
.stat-row.hot { color: var(--blue); font-weight: 700; }
.stat-row.hot b { color: var(--blue); }
.wk-chart { display: flex; align-items: flex-end; justify-content: flex-start;
  gap: 10px; height: 140px; overflow-x: auto;
  padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.wk-bar { flex: 1 1 0; min-width: 28px; max-width: 44px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-end; height: 100%; gap: 4px; }
.wk-n { font-size: 11px; font-weight: 700; color: var(--muted); }
.wk-fill { width: 70%; min-height: 4px; background: var(--blue); border-radius: 5px 5px 0 0; }
.wk-lbl { font-size: 9px; color: var(--faint); }
.stat-note { color: var(--faint); font-size: 12px; margin: 16px 2px 4px; line-height: 1.5; }

/* розыгрыши: компактная строчка-уведомление в ленте */
.gv-strip {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin-bottom: 12px; padding: 12px 14px; border: none; cursor: pointer;
  background: var(--blue-tint); color: var(--blue);
  border-radius: 14px; font-weight: 700; font-size: 14.5px; text-align: left;
}
.gv-strip .gv-strip-txt {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gv-strip svg.ic { color: var(--blue); flex: none; }
.gv-strip.joined { background: #e8f6ee; color: #1f8a4c; }
.gv-strip.joined svg.ic { color: #1f8a4c; }
.gv-strip.done { background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.gv-strip.done svg.ic { color: var(--faint); }
@media (prefers-color-scheme: dark) { .gv-strip.joined { background: #16321f; color: #57c77f; } }

.gv-card {
  background: var(--card); border-radius: 18px; overflow: hidden;
  border: 2px solid var(--blue); margin-bottom: 14px;
  box-shadow: 0 6px 22px rgba(239,86,54,.16);
}
.gv-card.done { border-color: var(--line); box-shadow: none; }
.gv-card.in-modal { border: none; box-shadow: none; margin: 0; }
.gv-img { width: 100%; height: 150px; object-fit: cover; display: block; }
.gv-img.ph {
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-tint); color: var(--blue); height: 110px;
}
.gv-img.ph svg.ic { color: var(--blue); }
.gv-body { padding: 14px 16px 16px; }
.gv-badge {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--blue); font-weight: 800; font-size: 12.5px;
  letter-spacing: normal; margin-bottom: 6px;
}
.gv-badge svg.ic { color: var(--blue); width: 15px; height: 15px; }
.gv-title { font-size: 18px; font-weight: 800; color: var(--ink); line-height: 1.25; }
.gv-prize {
  display: flex; align-items: center; gap: 7px; margin-top: 8px;
  font-weight: 700; color: var(--ink); font-size: 15px;
}
.gv-prize svg.ic { color: #1f9d55; }
.gv-desc { color: var(--muted); font-size: 14px; margin-top: 8px; white-space: pre-wrap; }
.gv-join { width: 100%; margin-top: 14px; }
.gv-joined {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; padding: 12px; border-radius: 12px;
  background: #e8f6ee; color: #1f8a4c; font-weight: 750;
}
.gv-winner {
  display: flex; align-items: center; gap: 8px; margin-top: 12px;
  font-weight: 750; color: var(--ink);
}
.gv-winner svg.ic { color: var(--blue); }
.gv-count { color: var(--faint); font-size: 13px; margin-top: 8px; text-align: center; }
.ga-live {
  font-size: 11px; font-weight: 800; color: #1f8a4c;
  background: #e8f6ee; padding: 2px 8px; border-radius: 8px; vertical-align: middle;
}
.ga-photo-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 6px; }
/* кнопка/экран участников */
.ent-open {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 6px 0;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); font-weight: 650; font-size: 14px;
}
.ent-open svg.ic { color: var(--blue); }
.ent-list { max-height: 60vh; overflow-y: auto; margin-top: 6px; }
.ent-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px;
  border-bottom: 1px solid var(--line); font-size: 15px; }
.ent-row:last-child { border-bottom: none; }
.ent-num { width: 26px; color: var(--faint); font-size: 13px; font-weight: 700; flex: none; }
.ent-name { flex: 1; color: var(--ink); font-weight: 600; }
.ent-plat { color: var(--muted); font-size: 12px; font-weight: 700; }
/* барабан-раскрытие победителя */
.draw-anim { text-align: center; padding-bottom: 34px; }
.draw-name {
  font-size: 30px; font-weight: 850; color: var(--ink);
  margin: 26px 0 10px; min-height: 40px; line-height: 1.15;
  transition: transform .15s;
}
.draw-name.win {
  color: var(--blue); transform: scale(1.12);
  animation: winpop .5s ease;
}
@keyframes winpop {
  0% { transform: scale(.7); opacity: .3; }
  60% { transform: scale(1.22); }
  100% { transform: scale(1.12); }
}
.draw-sub { color: var(--muted); font-size: 14px; font-weight: 600; }
.gv-ends {
  display: flex; align-items: center; gap: 7px; margin-top: 10px;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
}
.gv-ends svg.ic { color: var(--faint); }
.gv-org {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
  color: var(--faint); font-size: 11.5px; line-height: 1.45;
}
/* окно условий участия */
.gv-cond .gv-badge { margin-bottom: 2px; }
.gv-cond-note { color: var(--muted); font-size: 14px; margin: 4px 0 14px; }
.gv-step {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-top: 1px solid var(--line);
}
.gv-step-ic {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue-tint); color: var(--blue);
  font-weight: 800; font-size: 13px; display: flex;
  align-items: center; justify-content: center;
}
.gv-step-ic.done { background: #1f9d55; color: #fff; }
.gv-step-body { flex: 1; font-size: 14px; }
.gv-step-body b { font-size: 14.5px; display: block; }
.gv-step-body span { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.btn.small {
  flex: none; width: auto; margin: 0; padding: 8px 14px;
  font-size: 13px; border-radius: 10px;
}
#gc-join { margin-top: 16px; }
#gc-join[disabled] { opacity: .5; }
@media (prefers-color-scheme: dark) {
  .gv-joined { background: #16321f; color: #57c77f; }
  .ga-live { background: #16321f; color: #57c77f; }
}

/* шторка объявления */
.overlay {
  position: fixed; inset: 0; z-index: 10; background: rgba(20,15,12,.5);
  display: flex; align-items: flex-end; justify-content: center;
}
.overlay.hidden { display: none; }
.sheet {
  background: var(--page-bg); width: 100%; max-width: 480px; max-height: 92vh;
  border-radius: 20px 20px 0 0; overflow-y: auto; padding: 16px 16px 30px;
}
.sheet-close { float: right; border: 1px solid var(--card-border); background: var(--card);
  color: var(--muted); width: 34px; height: 34px; border-radius: 50%; font-size: 15px; }
.gallery { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0 12px; }
.gallery img { height: 230px; border-radius: 14px; }
.sheet h2 { font-family: var(--f-display); font-size: 21px; margin: 8px 0 4px; letter-spacing: .2px; }
.sheet .price { font-size: 19px; font-weight: 800; color: var(--blue); }
.sheet .desc { white-space: pre-wrap; margin: 12px 0; font-size: 15px; }
.kv { color: var(--muted); font-size: 14px; margin: 4px 0; display: flex; gap: 8px; align-items: center; }
.kv svg.ic { width: 17px; height: 17px; color: var(--faint); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 20;
  background: var(--ink); color: var(--page-bg); padding: 11px 18px;
  border-radius: 999px; font-size: 14.5px; max-width: 86vw; text-align: center;
  box-shadow: var(--card-shadow);
}
.toast.hidden { display: none; }
.loader { text-align: center; color: var(--faint); padding: 30px; }

/* правила — карточки-строки в стиле приветствия */
.rules-card { display: grid; gap: 10px; }
.frow {
  display: flex; gap: 14px; padding: 15px 16px;
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--card-shadow);
}
.frow-ic {
  flex: none; width: 42px; height: 42px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
}
.frow-ic svg.ic { width: 22px; height: 22px; stroke-width: 1.7; }
.frow-ic.ok { background: var(--good-tint); color: var(--good); }
.frow-ic.no { background: var(--bad-tint); color: var(--bad); }
.frow-ic.warn { background: var(--warn-tint); color: var(--warn); }
.frow-ic.info { background: var(--blue-tint); color: var(--blue); }
.frow-body b { display: block; font-size: 15.5px; color: var(--ink); margin-bottom: 3px; }
.frow-body p { font-size: 14px; line-height: 1.5; color: var(--muted); }

/* карточка автора */
.author-card {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--card-shadow);
  padding: 16px; margin-top: 12px;
}
.author-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.author-ava {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  background: var(--blue-tint); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.author-ava svg.ic { width: 26px; height: 26px; }
.author-head b { display: block; font-family: var(--f-display); font-size: 18px; color: var(--ink); }
.author-head span { font-size: 13px; color: var(--muted); }
.author-note { font-size: 14.5px; line-height: 1.5; color: var(--muted); margin-bottom: 4px; text-align: center; }
.author-card .btn { margin-top: 14px; }
.author-link {
  display: block; text-align: center; margin-top: 12px; padding: 4px;
  color: var(--blue); font-size: 14.5px; font-weight: 600; text-decoration: none;
}

/* закреплённая «официальная» карточка (промо ДКП) — визуально отбита */
.pinned {
  background: var(--card); border: 2px solid var(--blue); border-radius: 16px;
  overflow: hidden; margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(239,86,54,.14);
}
.pinned-badge {
  background: var(--blue); color: #fff; font-size: 12px; font-weight: 700;
  letter-spacing: .4px; padding: 6px 14px; display: flex; align-items: center; gap: 6px;
}
.pinned-badge svg.ic { width: 15px; height: 15px; stroke: #fff; }
.pinned-body { display: flex; gap: 12px; padding: 13px 14px 4px; }
.pinned-img { width: 78px; height: 78px; border-radius: 11px; object-fit: cover; flex: none; }
.pinned-img.ph { background: var(--blue-tint); color: var(--blue);
  display: flex; align-items: center; justify-content: center; }
.pinned-img.ph svg.ic { width: 34px; height: 34px; }
.pinned-main { min-width: 0; }
.pinned-title { font-size: 15.5px; font-weight: 650; color: var(--ink); }
.pinned-price { font-size: 16.5px; font-weight: 750; color: var(--blue); margin-top: 4px; }
.pinned-price span { font-size: 12.5px; font-weight: 400; color: var(--muted); }
.pinned-seller { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.pinned-cta {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: calc(100% - 28px); margin: 8px 14px 0; padding: 12px; border: none;
  border-radius: 12px; background: var(--blue); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: var(--btn-shadow);
}
.pinned-disc { font-size: 11.5px; line-height: 1.4; color: var(--faint); padding: 10px 14px 13px; }

/* истории (личный блог автора) */
.stories-bar { display: flex; gap: 14px; padding: 2px 2px 14px; overflow-x: auto;
  scrollbar-width: none; }
.stories-bar::-webkit-scrollbar { display: none; }
.story-circle { flex: none; border: none; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px; }
.story-ring { width: 66px; height: 66px; border-radius: 50%; padding: 3px;
  background: var(--blue); display: flex; align-items: center; justify-content: center; }
.story-circle.seen .story-ring { background: var(--card-border); }
.story-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--page-bg); }
.story-ring svg.ic { width: 30px; height: 30px; color: #fff; stroke-width: 1.7; }
.story-name { font-size: 12px; color: var(--ink); max-width: 70px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.story-viewer { position: fixed; inset: 0; z-index: 40; background: #000;
  display: flex; flex-direction: column; }
.sv-bars { display: flex; gap: 4px; padding: calc(10px + env(safe-area-inset-top)) 12px 8px; }
.sv-bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.32); overflow: hidden; }
.sv-bar i { display: block; height: 100%; width: 0; background: #fff; }
.sv-bar.done i { width: 100%; }
.sv-close { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 14px;
  z-index: 3; background: rgba(0,0,0,.4); border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 50%; font-size: 16px; }
.sv-media { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.sv-media img, .sv-media video { max-width: 100%; max-height: 100%; }
.sv-caption { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 26px 20px calc(28px + env(safe-area-inset-bottom)); color: #fff;
  font-size: 15.5px; line-height: 1.45; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.sv-nav { position: absolute; top: 40px; bottom: 0; z-index: 1; }
.sv-prev { left: 0; width: 33%; }
.sv-next { right: 0; width: 67%; }

/* форма обратной связи */
.fb-note { font-size: 14.5px; line-height: 1.5; color: var(--muted); margin-bottom: 12px; }
.fb-text {
  width: 100%; min-height: 130px; resize: vertical; padding: 13px;
  border: 1px solid var(--card-border); border-radius: 12px;
  background: var(--card); color: var(--ink); font-size: 16px; font-family: inherit;
}
.fb-text:focus { outline: none; border-color: var(--blue); }

/* жалоба на объявление */
.report-link {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; margin-top: 12px; padding: 10px; background: none; border: none;
  color: var(--faint); font-size: 13.5px;
}
.report-link svg.ic { width: 15px; height: 15px; }
.report-sheet {
  margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px;
}
.report-sheet h3 { font-size: 15px; margin-bottom: 10px; color: var(--ink); }
.report-opt {
  display: block; width: 100%; text-align: left; padding: 13px 14px; margin-bottom: 8px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 12px;
  color: var(--ink); font-size: 15px;
}
.report-opt.cancel { color: var(--muted); text-align: center; border: none; background: none; }

/* онбординг (приветствие при первом запуске) */
.onb {
  position: fixed; inset: 0; z-index: 30; background: var(--page-bg);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
.onb-skip {
  align-self: flex-end; margin: 14px 16px 0; padding: 6px 4px;
  background: none; border: none; color: var(--faint); font-size: 14.5px;
}
.onb-body {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; padding: 0 32px;
}
.onb-badge {
  width: 92px; height: 92px; border-radius: 26px; background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px; box-shadow: var(--btn-shadow);
}
.onb-badge svg.ic { width: 46px; height: 46px; stroke: #fff; stroke-width: 1.6; }
.onb-body h2 {
  font-family: var(--f-display); font-size: 26px; color: var(--ink);
  margin-bottom: 12px; letter-spacing: .2px;
}
.onb-body p { font-size: 16px; line-height: 1.55; color: var(--muted); max-width: 340px; }
.onb-dots { display: flex; gap: 8px; justify-content: center; margin-top: 28px; }
.onb-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--card-border); transition: width .2s; }
.onb-dot.on { background: var(--blue); width: 22px; border-radius: 4px; }
.onb-foot { padding: 0 24px calc(26px + env(safe-area-inset-bottom)); max-width: 480px; width: 100%; margin: 0 auto; }
.onb-foot .btn { margin-top: 0; }

/* ============ ДЕСКТОПНЫЙ САЙТ (только веб-версия .web на широком экране) ============ */
/* Класс .web ставится ТОЛЬКО для сайта в браузере; мини-аппы ВК/ТГ/MAX остаются
   мобильными (узкими) — их этот блок не касается. */
@media (min-width: 880px) {
  html.web body { padding-bottom: 24px; }

  /* широкая шапка: бренд слева, навигация справа */
  html.web .topbar { padding: 14px 32px; }
  html.web .topbar-in {
    max-width: 1140px; display: flex; align-items: center; gap: 24px;
  }
  html.web .brand-block { flex: 1; min-width: 0; }
  html.web .brand-title { font-size: 25px; }
  html.web .brand-sub { font-size: 13px; }

  /* нижний таббар → верхняя горизонтальная навигация (перенесён в шапку из JS) */
  html.web .topbar-in .tabbar {
    position: static; transform: none; width: auto; max-width: none;
    background: none; border-top: none; padding: 0; gap: 6px;
  }
  html.web .topbar-in .tabbar .tab {
    flex: none; flex-direction: row; gap: 8px; padding: 9px 15px;
    font-size: 14.5px; border-radius: 11px;
  }
  html.web .topbar-in .tabbar .tab .ic { width: 19px; height: 19px; }
  html.web .topbar-in .tabbar .tab.active { background: var(--blue-tint); }

  html.web main { max-width: 1140px; padding: 22px 32px 48px; }

  /* лента — адаптивная сетка вертикальных карточек */
  html.web #feed-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px;
  }
  /* пустое состояние/лоадер — на всю ширину грида, а не в одну ячейку */
  html.web #feed-list .empty, html.web #feed-list .loader { grid-column: 1 / -1; }
  html.web #feed-list .card {
    flex-direction: column; padding: 0; margin-bottom: 0; gap: 0; overflow: hidden;
    transition: transform .12s, box-shadow .12s;
  }
  html.web #feed-list .card:hover {
    transform: translateY(-2px); box-shadow: 0 12px 28px rgba(120,55,30,.15);
  }
  html.web #feed-list .card:active { transform: translateY(0); }
  html.web #feed-list .imgwrap { width: 100%; height: 176px; }
  html.web #feed-list .card-img { border-radius: 0; }
  html.web #feed-list .card-body { padding: 12px 14px 15px; }

  /* «узкие» экраны (форма, правила, статистика, вход) — по центру, не на всю ширину */
  html.web .filters, html.web .filter-row { max-width: 780px; }
  html.web .form, html.web .empty, html.web .fb-note, html.web .fb-text,
  html.web .mod-head, html.web .mod-seg, html.web #mod-body, html.web .stat-grid,
  html.web .stat-list, html.web .wk-chart, html.web .stat-h, html.web .stat-note,
  html.web .gv-card {
    max-width: 640px; margin-left: auto; margin-right: auto;
  }

  /* правила — сетка карточек 2×2 вместо одинокой колонки */
  html.web .rules-card {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    background: none; border: none; box-shadow: none; padding: 0;
    max-width: 920px; margin: 0 auto 14px;
  }
  html.web .rules-card .frow {
    padding: 20px 22px; border-bottom: none; border: 1px solid var(--card-border);
    background: var(--card); border-radius: 16px; box-shadow: var(--card-shadow);
  }
  html.web .author-card { max-width: 920px; margin-left: auto; margin-right: auto; }

  /* карточка-шторка → центрированное модальное окно */
  html.web .overlay { align-items: center; padding: 20px; }
  html.web .sheet { max-width: 620px; border-radius: 20px; max-height: 88vh; }
  html.web .gallery img { height: 300px; }
}

/* ---- приветственный экран на «Доске» (сайт, Tilda-подобный, адаптивно) ---- */
html.web .web-hero {
  text-align: center; margin: -8px 0 24px; padding: 44px 20px 38px;
  background: linear-gradient(180deg, var(--blue-tint), transparent 80%);
  border-radius: 22px;
}
html.web .wh-title {
  font-family: var(--f-display); font-size: 29px; line-height: 1.12;
  color: var(--ink); letter-spacing: .3px;
}
html.web .wh-sub {
  font-size: 15.5px; color: var(--muted); margin: 14px auto 0;
  max-width: 600px; line-height: 1.55;
}
/* триггер-фраза «Без посредников и переплат» — акцент */
.trigger {
  color: var(--blue); font-weight: 700; white-space: nowrap;
  text-decoration: underline; text-decoration-thickness: 2.5px; text-underline-offset: 4px;
}
html.web .wh-cta-row {
  display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap;
}
html.web .wh-cta-row .btn { width: auto; margin: 0; padding: 14px 26px; }
/* hero — первый экран-лендинг; доска раскрывается по «Смотреть объявления» */
html.web .board-collapsed { display: none; }
html.web .web-hero {
  min-height: calc(100vh - 40px);
  display: flex; flex-direction: column; justify-content: center;
}
@media (min-width: 880px) {
  html.web .web-hero { min-height: calc(100vh - 66px); }
  html.web .web-hero .wh-steps { flex-wrap: nowrap; max-width: 740px; }  /* 3 шага в один ряд */
  html.web .web-hero .wh-step { max-width: none; }
}
/* мобильная вёрстка сайта (узкий экран) */
@media (max-width: 879px) {
  html.web .web-hero {
    margin: 0 -12px 18px; padding: 26px 16px 30px; border-radius: 0;
    min-height: calc(100vh - 16px);
  }
  html.web .web-hero .wh-title { font-size: 24px; line-height: 1.15; }
  html.web .web-hero .wh-sub { font-size: 14.5px; }
  html.web .web-hero .wh-cta-row { flex-direction: column; align-items: stretch; gap: 10px; }
  html.web .web-hero .wh-cta-row .btn { width: 100%; }
  html.web .web-hero .wh-steps { max-width: 360px; margin-top: 20px; gap: 10px; }
  html.web .web-hero .wh-step { flex-basis: 100%; max-width: none; padding: 12px 16px; }
  html.web .web-hero .wh-step-n { margin-bottom: 5px; }
  html.web .web-hero .wh-step b { font-size: 14.5px; }
}
html.web .wh-steps {
  display: flex; gap: 12px; justify-content: center; margin: 28px auto 0;
  max-width: 720px; flex-wrap: wrap;
}
html.web .wh-step {
  flex: 1 1 190px; max-width: 230px; background: var(--card);
  border: 1px solid var(--card-border); border-radius: 14px;
  box-shadow: var(--card-shadow); padding: 15px 14px;
}
html.web .wh-step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--blue-tint); color: var(--blue); font-weight: 800; margin-bottom: 7px;
}
html.web .wh-step b { display: block; font-size: 14px; color: var(--ink); }
html.web .wh-step > span:last-child {
  display: block; font-size: 12px; color: var(--muted); margin-top: 3px;
}
/* анимация шагов: появляются по очереди 1→2→3 (показываем порядок действий) */
@keyframes stepIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
html.web .wh-step { opacity: 0; animation: stepIn .5s ease forwards; }
html.web .wh-step:nth-child(1) { animation-delay: .15s; }
html.web .wh-step:nth-child(2) { animation-delay: .40s; }
html.web .wh-step:nth-child(3) { animation-delay: .65s; }
/* и номера мягко пульсируют по кругу 1→2→3 — ведут взгляд по шагам */
@keyframes stepPulse {
  0%, 22%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239,86,54,0); }
  8%  { transform: scale(1.16); box-shadow: 0 0 0 7px rgba(239,86,54,.16); }
}
html.web .wh-step-n { animation: stepPulse 3.6s ease-in-out infinite; }
html.web .wh-step:nth-child(1) .wh-step-n { animation-delay: 1.0s; }
html.web .wh-step:nth-child(2) .wh-step-n { animation-delay: 1.6s; }
html.web .wh-step:nth-child(3) .wh-step-n { animation-delay: 2.2s; }
@media (prefers-reduced-motion: reduce) {
  html.web .wh-step { opacity: 1; animation: none; }
  html.web .wh-step-n { animation: none; }
}

/* --- единый фирменный стиль страниц сайта --- */
html.web .page-head { text-align: center; max-width: 640px; margin: 4px auto 18px; }
html.web .page-head h1 {
  font-family: var(--f-display); font-size: 25px; color: var(--ink); letter-spacing: .2px;
}
html.web .page-head p { color: var(--muted); font-size: 14.5px; margin-top: 7px; line-height: 1.5; }
html.web .form {
  background: var(--card); border: 1px solid var(--card-border);
  border-radius: 18px; box-shadow: var(--card-shadow); padding: 6px 24px 24px;
}
html.web #view > .card { max-width: 640px; margin-left: auto; margin-right: auto; }

/* ---- полировка сайта на широком экране ---- */
@media (min-width: 880px) {
  html.web .web-hero {
    margin: -22px -32px 30px; padding: 66px 32px 54px; border-radius: 0 0 30px 30px;
  }
  html.web .wh-title { font-size: 42px; }
  html.web .wh-sub { font-size: 17.5px; max-width: 640px; }

  html.web .topbar { box-shadow: 0 1px 0 var(--line); }
  html.web .chip { transition: border-color .15s, background .15s; }
  html.web .chip:hover:not(.active) { border-color: var(--blue); }
  html.web .topbar-in .tab:hover:not(.active) { background: var(--line); color: var(--muted); }
  html.web .btn { transition: transform .1s, box-shadow .15s, opacity .15s; }
  html.web .btn:hover:not([disabled]) { transform: translateY(-1px); }
  html.web .mini-btn:hover, html.web .report-opt:hover,
  html.web .mod-seg-btn:hover:not(.active) { border-color: var(--blue); }
  html.web .empty { padding: 64px 20px; }
  html.web .sheet-close:hover { border-color: var(--blue); color: var(--blue); }
  html.web .page-head { margin: 8px auto 26px; }
  html.web .page-head h1 { font-size: 30px; }
}
