:root {
  --bg: #fff; --fg: #000; --muted: #737373; --line: #dbdbdb; --soft: #efefef; --card: #fff;
  --blue: #0095f6; --red: #ed4956; --green: #1a9e55;
  --ring: linear-gradient(45deg, #f9ce34, #ee2a7b 55%, #6228d7);
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #000; --fg: #f5f5f5; --muted: #a8a8a8; --line: #363636; --soft: #262626; --card: #121212; }
}
:root[data-theme="dark"] { --bg: #000; --fg: #f5f5f5; --muted: #a8a8a8; --line: #363636; --soft: #262626; --card: #121212; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font: 14px/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; padding-bottom: 64px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  height: 54px; padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.logo { font-family: "Lobster", cursive; font-size: 28px; }
.top-act { display: flex; gap: 16px; }
main { max-width: 630px; margin: 0 auto; min-height: calc(100vh - 120px); }

.bottom { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; height: 56px; display: flex; justify-content: space-around;
  align-items: center; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottom a { padding: 4px 6px; opacity: .9; display: flex; flex-direction: column; align-items: center; min-width: 56px; }
.bottom a small { font-size: 10px; margin-top: 1px; }
.bottom a.on small { font-weight: 700; }
.bottom .ic { width: 24px; height: 24px; }
.switch { border: 1px solid var(--line); background: var(--soft); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13px; cursor: pointer; }
body.biz-mode .top { background: #111; color: #fff; border-color: #111; }
body.biz-mode .top .switch { background: #fff; color: #111; border-color: #fff; }
body.biz-mode .logo { font-size: 24px; }
.mapbox { height: calc(100vh - 54px - 56px - 60px); min-height: 320px; }
.minimap { height: 180px; border-radius: var(--r); overflow: hidden; margin-top: 12px; }
.pinmark { width: 36px; height: 36px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--ring); border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.3); display: grid; place-items: center; }
.pinmark span { transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 14px; }
.pinmark.master { background: #737373; width: 28px; height: 28px; }
.leaflet-container { font: inherit; }
.scan video { width: 100%; border-radius: var(--r); background: #000; aspect-ratio: 1; object-fit: cover; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 80px; margin-top: 8px; }
.bars i { flex: 1; background: var(--ring); border-radius: 2px 2px 0 0; min-height: 2px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t td, table.t th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.scroll-x { overflow-x: auto; }
.rate-big { display: flex; gap: 16px; align-items: center; padding: 16px; }
.rate-big .n { font-size: 44px; font-weight: 800; line-height: 1; }
.rate-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.rate-row div { flex: 1; height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.rate-row div i { display: block; height: 100%; background: #f5a623; }
.bottom a.on svg { stroke-width: 2.6; }
.ic { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.ic.fill { fill: currentColor; }

/* истории */
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 14px 16px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.story { flex: 0 0 auto; width: 70px; text-align: center; font-size: 12px; }
.story span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.ring { padding: 3px; border-radius: 50%; background: var(--line); display: inline-block; }
.ring.on { background: var(--ring); }
.ring > .av { border: 3px solid var(--bg); }

.av { border-radius: 50%; object-fit: cover; background: var(--soft); display: grid; place-items: center; font-weight: 600;
  color: #fff; overflow: hidden; flex: 0 0 auto; }
.av-64 { width: 64px; height: 64px; font-size: 24px; }
.av-32 { width: 32px; height: 32px; font-size: 13px; }
.av-86 { width: 86px; height: 86px; font-size: 32px; }

/* пост */
.post { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 8px; }
.post-h { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.post-h b { font-weight: 600; }
.post-h small { color: var(--muted); display: block; font-size: 12px; }
.post-img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--soft); }
.post-txt { width: 100%; aspect-ratio: 1; display: grid; place-items: center; padding: 32px; text-align: center; font-size: 22px;
  font-weight: 600; color: #fff; line-height: 1.3; }
.post-act { display: flex; gap: 16px; padding: 10px 16px 4px; align-items: center; }
.post-act button { background: none; border: 0; padding: 0; cursor: pointer; }
.post-act .liked { color: var(--red); }
.post-b { padding: 0 16px; }
.post-b .muted { font-size: 12px; margin-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--soft); }
.badge.hot { background: var(--ring); color: #fff; }

/* профиль */
.prof { padding: 16px; }
.prof-top { display: flex; align-items: center; gap: 24px; }
.prof-stats { display: flex; flex: 1; justify-content: space-around; text-align: center; }
.prof-stats b { display: block; font-size: 17px; }
.prof-stats small { color: var(--muted); }
.prof-name { margin-top: 12px; font-weight: 600; }
.prof-cat { color: var(--muted); }
.prof-about { white-space: pre-line; margin-top: 4px; }
.prof-btns { display: flex; gap: 8px; margin-top: 14px; }
.prof-btns > * { flex: 1; }
.offer { margin-top: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--ring); color: #fff; }
.offer b { font-size: 16px; }
.facts { margin: 10px 0 0; padding: 0; list-style: none; color: var(--muted); }
.facts li { margin: 2px 0; }

.tabs { display: flex; border-top: 1px solid var(--line); }
.tabs a { flex: 1; text-align: center; padding: 12px 0; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .5px;
  text-transform: uppercase; border-top: 1px solid transparent; margin-top: -1px; }
.tabs a.on { color: var(--fg); border-color: var(--fg); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.grid > * { aspect-ratio: 1; overflow: hidden; background: var(--soft); }
.grid img { width: 100%; height: 100%; object-fit: cover; }
.grid .post-txt { font-size: 12px; padding: 8px; height: 100%; }

/* кнопки и формы */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; height: 34px; padding: 0 16px; border-radius: 8px;
  border: 0; background: var(--soft); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.grad { background: var(--ring); color: #fff; }
.btn.big { height: 44px; width: 100%; font-size: 15px; }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; color: var(--blue); font-weight: 600; cursor: pointer; padding: 0; }
.pad { padding: 16px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.inp { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
textarea.inp { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 12px; scrollbar-width: none; }
.chip { flex: 0 0 auto; padding: 6px 12px; border-radius: 8px; background: var(--soft); font-weight: 600; font-size: 13px; cursor: pointer; border: 0; }
.chip.on { background: var(--fg); color: var(--bg); }

/* списки и карточки */
.item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.item .grow { flex: 1; min-width: 0; }
.item .grow > * { overflow: hidden; text-overflow: ellipsis; }
.card { margin: 10px 16px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 16px; }
.sum div { padding: 12px; border-radius: var(--r); background: var(--soft); }
.sum b { display: block; font-size: 18px; }
.st { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--soft); }
.st.owed { background: #fff2cc; color: #8a6100; }
.st.paid { background: #dbeeff; color: #0861a8; }
.st.received { background: #d9f3e3; color: #13703d; }
.st.disputed { background: #fde0e2; color: #b4232f; }
.code { font: 700 26px/1 ui-monospace, Consolas, monospace; letter-spacing: 3px; }
.qr { display: grid; place-items: center; margin: 12px auto; width: 180px; background: #fff; padding: 8px; border-radius: 8px; }
.qr svg, .qr img { width: 164px; height: 164px; }
.stars { color: #f5a623; letter-spacing: 1px; }
.review { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.reply { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--line); color: var(--muted); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--fg); font-size: 18px; margin-bottom: 6px; }

.hero { padding: 32px 20px; text-align: center; }
.hero .av { margin: 0 auto 12px; }
.hero .big { font-size: 34px; font-weight: 800; background: var(--ring); -webkit-background-clip: text; background-clip: text; color: transparent; }

#toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); background: #262626; color: #fff; padding: 10px 16px;
  border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; max-width: calc(100% - 32px); }
#toast.on { opacity: 1; }
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden], [hidden] { display: none !important; }
html, body { overflow-x: hidden; }
.sheet > div { width: 100%; max-width: 630px; max-height: 90vh; overflow: auto; background: var(--bg); border-radius: 16px 16px 0 0; padding: 8px 0 24px; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 8px; }
@media (min-width: 700px) { .post { border: 1px solid var(--line); border-radius: 8px; margin: 16px 0; } }
.legal h1 { font-size: 20px; } .legal h2 { font-size: 15px; margin-top: 18px; } .legal li { margin: 4px 0; } .legal ul, .legal ol { padding-left: 20px; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 4px 0 12px; }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; }
.adlabel { font-size: 11px; color: var(--muted); padding: 0 16px 6px; }

.sug{border-radius:8px;overflow:hidden;margin-top:4px;border:1px solid var(--line);background:var(--card)}.sug:empty{display:none}
.sug button{display:block;width:100%;text-align:left;padding:8px 10px;border:0;border-bottom:1px solid var(--line);background:none;cursor:pointer;color:var(--fg)}
.sug button:hover{background:var(--soft)}.sug small{display:block;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
