/* БороЧат — светлый / тёмный iOS-стиль */

:root {
  color-scheme: light;
  --bg: #f2f2f7;
  --bg-elev: #ffffff;
  --panel: #ffffff;
  --panel-2: #f2f2f7;
  --ink: #1c1c1e;
  --muted: #8e8e93;
  --line: rgba(60, 60, 67, 0.12);
  --accent: #007aff;
  --accent-2: #0a84ff;
  --accent-deep: #0062cc;
  --green: #34c759;
  --pink: #ff2d55;
  --purple: #5856d6;
  --amber: #ff9500;
  --danger: #ff3b30;
  --vk: #0077ff;
  --bubble: #e9f0ff;
  --bubble-own: #007aff;
  --radius: 16px;
  --radius-lg: 20px;
  --dock: 68px;
  --side-w: 248px;
  --rail-w: 280px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  --top-bg: rgba(242, 242, 247, 0.86);
  --side-bg: rgba(255, 255, 255, 0.92);
  --hover: rgba(0, 0, 0, 0.045);
  --price: #00a046;
  --price-strong: #248a3d;
  --online-bg: rgba(52, 199, 89, 0.14);
  --online-ink: #248a3d;
  --msg-vk: #eef1f6;
  --dm-bg: #f7f7fa;
  --dm-bubble: #ffffff;
  --placeholder: #e8ecf2;
  --soft-green-bg: #e8f8ef;
  --soft-green-ink: #0a7a3e;
  --hero-grad: linear-gradient(160deg, #ffffff 0%, #f4f7ff 55%, #eef6ff 100%);
  --sheet-handle: #e5e5ea;
  --card-media: linear-gradient(145deg, #ececf1, #f6f6f8);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0f;
  --bg-elev: #141418;
  --panel: #1c1c1e;
  --panel-2: #2c2c2e;
  --ink: #f2f2f7;
  --muted: #98989f;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #0a84ff;
  --accent-2: #409cff;
  --accent-deep: #0071e3;
  --green: #30d158;
  --pink: #ff375f;
  --purple: #5e5ce6;
  --amber: #ff9f0a;
  --danger: #ff453a;
  --vk: #0a84ff;
  --bubble: #1a2740;
  --bubble-own: #0a84ff;
  --shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
  --top-bg: rgba(20, 20, 24, 0.9);
  --side-bg: rgba(20, 20, 24, 0.94);
  --hover: rgba(255, 255, 255, 0.06);
  --price: #30d158;
  --price-strong: #32d74b;
  --online-bg: rgba(48, 209, 88, 0.16);
  --online-ink: #32d74b;
  --msg-vk: #2c2c2e;
  --dm-bg: #121214;
  --dm-bubble: #2c2c2e;
  --placeholder: #2c2c2e;
  --soft-green-bg: rgba(48, 209, 88, 0.14);
  --soft-green-ink: #30d158;
  --hero-grad: linear-gradient(160deg, #1c1c1e 0%, #1a2233 55%, #141820 100%);
  --sheet-handle: #3a3a3c;
  --card-media: linear-gradient(145deg, #2a2a2e, #1c1c1e);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  forced-color-adjust: none;
}

body::before { display: none; }

.app {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

/* ——— Left sidebar (desktop) ——— */
.side {
  display: none;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px 16px;
  background: var(--side-bg);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  min-height: 0;
}
.side-brand {
  display: flex; gap: 12px; align-items: center;
  border: none; background: transparent; color: inherit;
  cursor: pointer; text-align: left; padding: 4px 6px;
}
.side-brand img {
  display: none !important;
}
.side-brand strong {
  display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -0.3px;
}
.side-brand small {
  color: var(--muted); font-size: 0.72rem; font-weight: 600;
}
.side-nav { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.nav-label {
  margin: 14px 10px 6px;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: none; background: transparent;
  color: var(--muted); font: inherit; font-weight: 700; font-size: 0.9rem;
  padding: 11px 12px; border-radius: 14px; cursor: pointer; text-align: left;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.28);
}
.nav-item .ni { width: 1.25rem; text-align: center; opacity: 0.95; }
.nav-item .badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 0.65rem; display: grid; place-items: center;
}
.side-chat {
  display: flex; align-items: center; gap: 10px;
  width: 100%; border: none; background: transparent;
  color: var(--muted); font: inherit; font-weight: 700; font-size: 0.86rem;
  padding: 10px 12px; border-radius: 14px; cursor: pointer; text-align: left;
}
.side-chat:hover, .side-chat.active { background: var(--panel); color: var(--ink); }
.side-chat .dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.side-pro {
  margin-top: auto;
  padding: 16px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #007aff, #5ac8fa);
  box-shadow: 0 10px 24px rgba(0, 122, 255, 0.25);
}
.side-pro strong { display: block; font-size: 0.95rem; margin-bottom: 4px; }
.side-pro p { font-size: 0.78rem; opacity: 0.9; margin-bottom: 12px; line-height: 1.35; }
.side-pro .btn { width: 100%; background: #fff; color: #007aff; box-shadow: none; }

.shell {
  min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* ——— Top bar ——— */
.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--top-bg);
  backdrop-filter: blur(12px);
  overflow: hidden;
  min-width: 0;
}
.top-left {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 0; min-width: 0; overflow: hidden;
}
.brand-mini {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; background: transparent; color: var(--ink);
  font: inherit; font-weight: 800; padding: 0; cursor: default;
  min-width: 0; max-width: 100%;
  overflow: hidden;
}
.brand-mini img { display: none; }
.loc-pill span { display: none; }
.brand-mini b, .loc-pill b {
  font-size: 1rem; letter-spacing: -0.3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: block; max-width: 100%;
}
.loc-pill {
  display: none; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--ink); padding: 8px 12px; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 0.85rem; white-space: nowrap;
}
.search {
  display: none; align-items: center; gap: 8px; flex: 1; max-width: 420px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 14px; color: var(--muted);
}
.search input {
  flex: 1; border: none; background: transparent; color: var(--ink);
  font: inherit; font-size: 0.9rem; padding: 11px 0; outline: none;
}
.top-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.online {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 999px;
  background: var(--online-bg); color: var(--online-ink);
  font-size: 0.8rem; font-weight: 800;
}
.visits {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px; border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.8rem; font-weight: 800;
}
.visits-label {
  font-style: normal;
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: lowercase;
}
.visits b::before {
  content: "";
  display: none;
}
.online i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.icon, .avatar {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.icon.on {
  border-color: rgba(0, 122, 255, 0.45);
  background: rgba(0, 122, 255, 0.12);
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.12);
}
.avatar { overflow: hidden; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar span { font-weight: 800; color: var(--accent); }

.guest { display: none !important; }
.vk-onetap { display: none !important; }
#btn-login[hidden],
.btn-vk.top-login[hidden],
#btn-login.is-gone,
body.is-authed #btn-login {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}
.btn-vk.top-login {
  padding: 8px 12px; min-height: 36px; font-size: 0.78rem;
  white-space: nowrap;
}
.btn-vk.top-login .login-short { display: none; }
.btn.btn-vk {
  background: var(--vk); color: #fff; border: none;
  box-shadow: 0 8px 20px rgba(0, 119, 255, 0.28);
}
.btn.btn-vk:hover { filter: brightness(1.06); }

.install-link {
  margin-top: 14px; width: 100%;
  border: 1px dashed var(--line); background: transparent;
  color: var(--muted); border-radius: 14px; padding: 12px;
  font: inherit; font-weight: 700; font-size: 0.85rem; cursor: pointer;
}
.install-link:hover { color: var(--ink); border-color: rgba(0,122,255,0.4); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--panel-2);
  color: var(--ink); font: inherit; font-weight: 800; font-size: 0.9rem;
  cursor: pointer; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-sm { padding: 9px 14px; font-size: 0.82rem; border-radius: 12px; }
.btn-primary {
  border: none; color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.28);
}
.btn-soft {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent);
  border-color: rgba(59, 130, 246, 0.25);
}
.btn-vk { border: none; background: var(--vk); color: #fff; }
.btn-danger {
  background: rgba(248, 113, 113, 0.12); color: var(--danger);
  border-color: rgba(248, 113, 113, 0.28);
}

.workspace {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}

.stage {
  min-height: 0; overflow: hidden;
  padding: 14px 14px calc(14px + var(--dock) + var(--safe-b));
  overscroll-behavior: contain;
}
.view {
  display: none; height: 100%; min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.view.active { display: block; }
#panel-chats.active { display: flex; flex-direction: column; overflow: hidden; }
@keyframes in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ——— Home ——— */
.home-hero {
  position: relative;
  margin: 0 0 22px;
  padding: 28px 22px 26px;
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    var(--hero-grad);
  border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--ink) 6%, transparent);
  overflow: hidden;
}
.home-hero::after {
  content: "";
  position: absolute; right: -40px; top: -50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(0,122,255,0.06);
  pointer-events: none;
}
.home-hero h1 {
  font-size: clamp(1.7rem, 5vw, 2.35rem);
  font-weight: 800; letter-spacing: -0.7px; line-height: 1.1;
  margin: 0 0 8px;
}
.home-lead {
  color: var(--muted); font-size: 0.95rem; font-weight: 500;
  margin: 0 0 18px; max-width: 28rem; line-height: 1.45;
}
.home-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.eyebrow {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.home-block { margin-bottom: 22px; }
.home-block-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.home-block-head h2 {
  font-size: 1.05rem; font-weight: 800; letter-spacing: -0.2px; margin: 0;
}
.home-chats, .home-feed {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15,23,42,0.03);
}
.home-more {
  display: block; width: 100%; margin-top: 12px;
  border: none; background: transparent;
  color: var(--accent); font: inherit; font-weight: 700;
  padding: 10px; cursor: pointer; text-align: center;
}
.home-ads-grid { margin-top: 2px; }

.chat-list {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}
.chat-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px; align-items: center;
  width: 100%; border: none; background: transparent;
  color: var(--ink); font: inherit; text-align: left;
  padding: 12px 14px; cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.chat-row:last-child { border-bottom: none; }
.chat-row:active { background: var(--hover); }
.chat-row .ico {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.1rem;
  background: rgba(0, 122, 255, 0.12);
}
.chat-row .ico.g { background: rgba(52, 199, 89, 0.14); }
.chat-row .ico.p { background: rgba(255, 45, 85, 0.12); }
.chat-row .ico.v { background: rgba(88, 86, 214, 0.12); }
.chat-row .ico.a { background: rgba(255, 149, 0, 0.14); }
.chat-row strong {
  display: block; font-size: 0.92rem; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-row span {
  display: block; margin-top: 2px;
  color: var(--muted); font-size: 0.75rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-row img, .chat-row .avatar-fallback {
  width: 44px; height: 44px; border-radius: 14px; object-fit: cover;
}

.feed-list {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  min-height: 48px;
}

/* legacy tones kept for rail */
.tone-blue, .tone-green, .tone-pink, .tone-purple, .tone-amber { }

.block { margin-bottom: 18px; }
.block.tight { margin-bottom: 14px; }
.block-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.block-head h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.3px; }
.block-sub { color: var(--muted); font-size: 0.8rem; font-weight: 500; margin-top: 2px; }
.linkish {
  border: none; background: transparent; color: var(--accent);
  font: inherit; font-weight: 800; font-size: 0.82rem; cursor: pointer;
}
.linkish.more { display: block; margin: 12px auto 0; }

.activity {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.act-col {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 160px;
}
.act-col h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.92rem; font-weight: 800; margin-bottom: 12px;
}
.act-col h3 i {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.feed-item, .ad-mini, .topic-row {
  display: grid; grid-template-columns: 40px 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px; border-radius: 12px;
  margin-bottom: 4px;
}
.feed-item:hover, .ad-mini:hover, .topic-row:hover {
  background: rgba(0, 0, 0, 0.03);
}
.feed-item img, .ad-mini img, .avatar-fallback {
  width: 40px; height: 40px; border-radius: 12px; object-fit: cover;
}
.avatar-fallback {
  display: grid; place-items: center;
  background: rgba(0, 122, 255, 0.12); color: var(--accent); font-weight: 800;
}
.feed-item .who, .ad-mini .ttl, .topic-row .ttl {
  font-weight: 800; font-size: 0.84rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-item .txt, .ad-mini .sub, .topic-row .sub {
  color: var(--muted); font-size: 0.75rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feed-item .when, .ad-mini .price {
  font-size: 0.72rem; color: var(--muted); font-weight: 700; white-space: nowrap;
}
.ad-mini .price { color: var(--price-strong); }
.empty-mini {
  color: var(--muted); font-size: 0.85rem; padding: 24px 8px;
  text-align: center; font-weight: 500;
}

.is-guest .requires-auth {
  display: none !important;
}

.boot-error {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: rgba(242, 242, 247, 0.96);
  padding: 24px;
}
.boot-error[hidden] { display: none !important; }
.boot-error-box {
  max-width: 360px; text-align: center;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 24px 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}
.boot-error-box h2 { margin: 0 0 8px; font-size: 1.15rem; }
.boot-error-box p { margin: 0 0 16px; color: var(--muted); line-height: 1.45; }
.boot-failed { opacity: 0.35; pointer-events: none; }

.chats-auth-gate {
  min-height: min(70vh, 560px);
  display: grid; place-items: center; padding: 24px 16px;
}
.chats-auth-gate[hidden] { display: none !important; }
.chats-auth-card {
  max-width: 420px; width: 100%;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 24px 20px; text-align: center;
}
.chats-auth-card h2 { margin: 0 0 8px; }
.chats-auth-card p { margin: 0 0 16px; color: var(--muted); line-height: 1.45; }
.chats-auth-card .btn { width: 100%; margin-top: 8px; }
.home-block-guest-chats .btn { margin-top: 4px; }

.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.ads-grid.wide {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.ad-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.ad-card:hover {
  border-color: rgba(0, 122, 255, 0.28);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.07);
}
.ad-card-media {
  position: relative;
  aspect-ratio: 1;
  background: var(--card-media);
  overflow: hidden;
}
.ad-card img.cover {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: var(--panel-2);
}
.ad-hot {
  position: absolute; right: 8px; bottom: 8px; top: auto; left: auto;
  z-index: 2;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(255, 149, 0, 0.95); color: #fff;
  font-size: 0.65rem; font-weight: 800;
  max-width: calc(100% - 16px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.ad-price-tag { display: none; }
.ad-cat-tag { display: none; }
.ad-ph {
  width: 100%; height: 100%;
  display: grid; place-items: center; color: var(--muted); font-weight: 700;
}
.ad-body {
  padding: 10px 12px 12px;
  display: flex; flex-direction: column; flex: 1;
  min-width: 0;
}
.ad-price-line {
  display: block;
  color: var(--price);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.ad-price { display: none; }
.ad-cat { display: none; }
.ad-body h3 {
  font-size: 0.88rem; font-weight: 700; margin: 0 0 4px;
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word; overflow-wrap: anywhere;
}
.ad-snippet {
  color: var(--muted); font-size: 0.74rem; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word; overflow-wrap: anywhere;
  flex: 1; margin: 0 0 8px;
}
.ad-card { cursor: pointer; }
.ad-shop-badge {
  display: block;
  font-size: 0.68rem; font-weight: 800; margin-bottom: 2px;
  color: color-mix(in srgb, var(--shop-accent, #007aff) 80%, #000);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.ad-cat-inline {
  display: block; font-size: 0.68rem; font-weight: 700;
  color: var(--muted); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ad-city-inline {
  display: block; font-size: 0.72rem; font-weight: 700;
  color: var(--accent); margin: 0 0 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ad-deal-badge {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  padding: 4px 8px; border-radius: 8px;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.01em;
  color: #fff; line-height: 1;
}
.ad-deal-badge.sell { background: rgba(0, 160, 70, 0.92); }
.ad-deal-badge.buy { background: rgba(0, 122, 255, 0.92); }

.deal-bar {
  display: flex; gap: 8px; margin: 0 0 10px; flex-wrap: wrap;
}
.deal-chip {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit; font-size: 0.82rem; font-weight: 700;
  cursor: pointer;
}
.deal-chip.active {
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent);
}

.deal-group { padding: 10px 12px !important; }
.deal-seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 4px; border-radius: 12px;
  background: var(--panel-2);
}
.deal-seg-btn {
  border: none; background: transparent; color: var(--muted);
  border-radius: 10px; padding: 11px 10px;
  font: inherit; font-size: 0.95rem; font-weight: 800;
  cursor: pointer;
}
.deal-seg-btn.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.cat-bar {
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 12px; margin-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.cat-bar-wrap {
  position: relative;
  margin-bottom: 4px;
}
.cat-bar-wrap .cat-bar {
  padding-right: 36px;
  margin-bottom: 0;
  padding-bottom: 10px;
}
.cat-bar-fade {
  pointer-events: none;
  position: absolute; top: 0; right: 0; bottom: 10px; width: 48px;
  background: linear-gradient(90deg, transparent, var(--bg));
}
.cat-bar-hint {
  pointer-events: none;
  position: absolute; right: 4px; top: 6px;
  width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 1.1rem; font-weight: 300;
  animation: catHintPulse 1.8s ease-in-out infinite;
}
@keyframes catHintPulse {
  0%, 100% { transform: translateX(0); opacity: 0.7; }
  50% { transform: translateX(3px); opacity: 1; }
}
.cat-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit; font-weight: 800; font-size: 0.78rem;
  cursor: pointer;
}
.cat-chip.active {
  color: #fff;
  border-color: transparent;
  background: var(--accent);
}

.file-lab input[type="file"] {
  display: block; margin-top: 6px;
  color: var(--muted); font-size: 0.85rem;
}
.ad-preview {
  display: grid; grid-template-columns: 88px 1fr; gap: 12px;
  padding: 12px; border-radius: 14px;
  background: var(--bg-elev); border: 1px solid var(--line);
}
.ad-preview img {
  width: 88px; height: 88px; object-fit: cover; border-radius: 12px;
  background: var(--panel-2);
}
.ad-preview strong { display: block; font-size: 0.95rem; font-weight: 800; }
.ad-preview span { display: block; color: var(--accent); font-size: 0.75rem; font-weight: 700; margin-top: 2px; }
.ad-preview b { display: block; color: var(--price-strong); font-size: 0.88rem; margin-top: 4px; }
.ad-preview p {
  color: var(--muted); font-size: 0.78rem; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sheet select {
  padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-elev); color: var(--ink); font: inherit; font-size: 0.92rem; font-weight: 500;
}
.ad-view img {
  width: 100%; max-height: 260px; object-fit: cover;
  border-radius: 14px; margin-bottom: 12px;
}
.ad-view-meta { color: var(--muted); font-size: 0.8rem; margin: 12px 0; font-weight: 600; }
.ad-view .btn { width: 100%; }

/* ——— Ad detail sheet ——— */
.ad-sheet {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: end center;
  pointer-events: none;
}
.ad-sheet[hidden] { display: none !important; }
.ad-sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: auto;
}
.ad-sheet.open .ad-sheet-backdrop { opacity: 1; }
.ad-sheet-panel {
  position: relative; z-index: 2;
  width: min(520px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
}
.ad-sheet.open .ad-sheet-panel { transform: translateY(0); }
.ad-sheet-close {
  position: absolute; top: 12px; right: 12px; z-index: 6;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0;
  background: #111;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.ad-sheet-hero {
  position: relative;
  width: 100%;
  display: block;
  overflow: hidden;
  background: var(--card-media);
  max-height: 48vh; min-height: 180px;
}
.ad-sheet-hero img,
.ad-sheet-hero .ad-hero-static {
  width: 100%; height: 100%; max-height: 48vh;
  min-height: 180px;
  object-fit: cover; display: block; cursor: zoom-in;
  aspect-ratio: 4 / 3;
}
.ad-sheet-hero .ad-ph {
  width: 100%; height: 100%;
  display: grid; place-items: center; color: var(--muted); font-weight: 700;
}
.ad-sheet-body { padding: 18px 18px 28px; }
.ad-sheet-cat {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.72rem; font-weight: 800;
  color: var(--accent);
  background: rgba(59, 130, 246, 0.18);
  padding: 5px 10px; border-radius: 999px;
}
.ad-sheet-body h2 {
  font-size: 1.35rem; font-weight: 800; letter-spacing: -0.3px;
  margin-bottom: 10px; line-height: 1.2;
}
.ad-sheet-price-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.ad-sheet-price-row b {
  font-size: 1.2rem; color: var(--price-strong); font-weight: 800;
}
.ad-sheet-price-row time {
  color: var(--muted); font-size: 0.78rem; font-weight: 600;
}
.ad-sheet-text {
  color: var(--ink);
  font-size: 0.95rem; line-height: 1.55;
  white-space: pre-wrap;
  margin-bottom: 16px;
}
.ad-sheet-author {
  display: flex; align-items: center; gap: 10px;
  padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.82rem; font-weight: 600;
}
.ad-sheet-author img {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover;
}
.ad-foot {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 8px;
  align-items: center; font-size: 0.72rem; color: var(--muted); font-weight: 600;
}
.ad-author { display: flex; gap: 8px; align-items: center; min-width: 0; }
.ad-author img { width: 22px; height: 22px; border-radius: 50%; }
.ad-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ad-actions .btn { min-height: 36px; font-size: 0.78rem; padding: 8px 10px; }

.ads-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.ads-toolbar h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.3px; }
.ads-toolbar p { color: var(--muted); font-size: 0.8rem; font-weight: 500; }

/* ——— Chats ——— */
.chats-layout {
  display: flex; flex-direction: column;
  height: 100%; min-height: 0; flex: 1; gap: 0;
}
.chat-menu {
  display: flex; flex-direction: row; flex-wrap: nowrap;
  gap: 6px; overflow-x: auto; overflow-y: hidden;
  padding: 0 0 10px; max-height: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.chat-menu::-webkit-scrollbar { display: none; }
.chat-group-label { display: none; }
.chat-menu .chat-pick {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer; text-align: center;
  min-width: 0;
  font-family: inherit; color: var(--ink);
}
.chat-menu .chat-pick strong {
  display: block; font-size: 0.82rem; font-weight: 800;
  white-space: nowrap;
}
.chat-menu .chat-pick small { display: none; }
.chat-menu .chat-pick.active {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.25);
}
.chat-menu .chat-pick.active small { color: rgba(255, 255, 255, 0.85); }
.chat-menu button.active {
  border-color: transparent;
  background: var(--accent);
  color: #fff;
}
.chat-menu button.active small { color: rgba(255, 255, 255, 0.85); }

.chat-room {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  min-height: 0; flex: 1;
  overflow: hidden;
}
.chat-room-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-room-head h3 { font-size: 0.98rem; font-weight: 800; }
.chat-room-head p { color: var(--muted); font-size: 0.72rem; font-weight: 500; }
.pill {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em;
  color: #248a3d; background: rgba(52, 199, 89, 0.15);
  padding: 7px 10px; border-radius: 999px;
}

.messages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.msg { max-width: min(90%, 520px); }
.msg.own { align-self: flex-end; }
.msg-head {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 4px; font-size: 0.7rem; color: var(--muted); font-weight: 600;
}
.msg-head img { width: 20px; height: 20px; border-radius: 50%; }
.msg-head .badge {
  font-size: 0.58rem; font-weight: 800; padding: 2px 6px; border-radius: 999px;
  background: rgba(0, 122, 255, 0.12); color: var(--accent);
}
.msg.own .msg-head { justify-content: flex-end; }
.msg-body {
  padding: 10px 14px; border-radius: 18px 18px 18px 6px;
  background: var(--bubble); border: none;
  font-size: 0.95rem; line-height: 1.4; font-weight: 500;
  white-space: pre-wrap; word-break: break-word;
  color: var(--ink);
}
.msg.own .msg-body {
  background: var(--bubble-own);
  color: #fff;
  border-radius: 18px 18px 6px 18px;
}
.msg.own .msg-body a { color: #fff; }
.msg.vk-src .msg-body { background: var(--msg-vk); }

/* Photo carousel */
.carousel {
  position: relative;
  margin-top: 8px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--placeholder);
  aspect-ratio: 4/3;
  max-height: 280px;
}
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.28s ease;
  touch-action: pan-y;
}
.carousel-track a {
  flex: 0 0 100%;
  height: 100%;
  display: block;
}
.carousel-track img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 1.1rem; cursor: pointer; z-index: 2;
  display: grid; place-items: center;
}
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }
.carousel-dots {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; gap: 5px; justify-content: center; z-index: 2;
}
.carousel-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.35);
}
.carousel-dots i.on { background: #fff; }
.carousel-count {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-size: 0.7rem; font-weight: 800;
  background: rgba(0,0,0,0.55); color: #fff;
  padding: 4px 8px; border-radius: 999px;
}

.composer {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid var(--line);
}
.composer input {
  flex: 1; min-width: 0; padding: 14px 15px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--bg-elev);
  color: var(--ink); font: inherit; font-size: 16px; font-weight: 500; outline: none;
}
.composer input:focus {
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.18);
}
.send {
  width: 50px; height: 50px; border: none; border-radius: 14px;
  background: var(--accent);
  color: #fff; cursor: pointer; font-size: 1rem;
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.25);
}

.profile-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px 18px; text-align: center;
}
.profile-guest p { color: var(--muted); margin: 10px 0 16px; font-weight: 500; }
.profile-user img {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover;
  margin-bottom: 10px; border: 3px solid rgba(0, 122, 255, 0.25);
}
.profile-user a { color: var(--accent); font-weight: 800; }
.profile-user .btn { margin-top: 14px; width: 100%; }
.stats-row {
  margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.stats-row div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 10px; text-align: center;
}
.stats-row span { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 4px; font-weight: 700; }
.stats-row b { font-size: 1.15rem; font-weight: 800; color: var(--accent); }

.notify-card {
  margin-top: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
}
.notify-card strong { display: block; font-size: 0.92rem; font-weight: 800; }
.notify-card p { margin-top: 4px; color: var(--muted); font-size: 0.78rem; font-weight: 600; }

/* ——— Right rail ——— */
.rail {
  display: none;
  flex-direction: column; gap: 12px;
  padding: 14px 14px calc(14px + var(--safe-b));
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--bg);
}
.rail-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.rail-card h3 {
  font-size: 0.95rem; font-weight: 800; margin-bottom: 12px;
}
.rail-ad {
  display: grid; grid-template-columns: 52px 1fr; gap: 10px;
  align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.rail-ad:last-child { border-bottom: none; }
.rail-ad img, .rail-ad .ph {
  width: 52px; height: 52px; border-radius: 12px; object-fit: cover;
}
.rail-ad .ph {
  background: var(--panel-2); display: grid; place-items: center;
  color: var(--muted); font-size: 0.7rem; font-weight: 700;
}
.rail-ad .ttl { font-weight: 800; font-size: 0.84rem; line-height: 1.25; }
.rail-ad .price { color: var(--price-strong); font-weight: 800; font-size: 0.8rem; margin-top: 2px; }
.topic-pill {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem; font-weight: 700;
}
.topic-pill:last-child { border-bottom: none; }
.topic-pill button {
  border: none; background: transparent; color: var(--ink);
  font: inherit; font-weight: 700; cursor: pointer; text-align: left;
  padding: 0;
}
.topic-pill button:hover { color: var(--accent); }
.topic-pill em {
  font-style: normal; color: var(--muted); font-size: 0.75rem; font-weight: 700;
}

/* ——— Dock (mobile) ——— */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px color-mix(in srgb, var(--ink) 6%, transparent);
  padding: 6px 4px calc(8px + var(--safe-b));
  z-index: 40;
}
.dock-btn {
  position: relative; border: none; background: transparent;
  color: var(--muted); font: inherit; font-weight: 800; font-size: 0.62rem;
  padding: 8px 2px; cursor: pointer; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  transition: color 0.18s ease, background-color 0.18s ease, transform 0.15s ease;
}
.dock-btn:active { transform: scale(0.93); }
.dock-btn span { font-size: 1.15rem; line-height: 1.2; transition: transform 0.18s ease; }
.dock-btn.active {
  color: var(--accent);
  background: rgba(0, 122, 255, 0.12);
}
.dock-btn.active span { transform: translateY(-1px) scale(1.08); }
.dock-btn .badge {
  position: absolute; top: 4px; right: 18%;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: #ef4444; color: #fff;
  font-size: 0.6rem; display: grid; place-items: center;
}

.toast {
  position: fixed;
  left: 50%;
  top: calc(16px + var(--safe-t, 0px));
  transform: translateX(-50%);
  z-index: 2147483646;
  max-width: min(92vw, 420px);
  padding: 14px 18px;
  border-radius: 14px;
  background: #007aff;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: center;
  border: none;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.toast[hidden] { display: none !important; }
html[data-theme="dark"] .toast {
  background: #0a84ff;
  color: #fff;
}

.modal { border: none; border-radius: 20px; padding: 0; background: transparent; width: min(420px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); }
.sheet {
  background: var(--panel); border-radius: 20px; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--line); color: var(--ink);
}
.sheet h3 { font-size: 1.15rem; font-weight: 800; }
.sheet label { display: flex; flex-direction: column; gap: 5px; font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.sheet label.file-drop,
.sheet label.multi-add {
  display: block;
  gap: 0;
  font-size: inherit;
  color: inherit;
  font-weight: inherit;
}
.sheet input, .sheet textarea {
  padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-elev); color: var(--ink); font: inherit; font-size: 0.92rem; font-weight: 500;
}
.sheet input[type="file"] {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 0;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Fullscreen ad form (mobile-first) */
.ad-form-modal {
  width: 100vw; max-width: 100vw;
  height: 100dvh; max-height: 100dvh;
  margin: 0; border-radius: 0; padding: 0;
  border: none; background: var(--bg);
  overflow: hidden;
  max-width: 100vw;
}
/* Важно: без [open] dialog обязан быть display:none — иначе после close()
   остаётся невидимый слой на весь экран и «всё прозрачное / клики не идут» */
.ad-form-modal:not([open]) {
  display: none !important;
}
.ad-form-modal[open] {
  display: flex;
  flex-direction: column;
}
.ad-form-modal::backdrop { background: rgba(0, 0, 0, 0.45); }
.ad-form-modal .sheet-full,
.sheet-full {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  border-radius: 0; border: none; padding: 0;
  gap: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.sheet-top {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 2;
  flex-shrink: 0;
}
.sheet-top h3 { flex: 1; font-size: 1rem; font-weight: 800; text-align: center; }
.sheet-back { flex-shrink: 0; }
.sheet-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 16px calc(40px + var(--safe-b));
  display: flex; flex-direction: column; gap: 14px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.file-drop { position: relative; cursor: pointer; }
.file-drop input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-drop-ui {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 120px;
  border: 1.5px dashed rgba(60, 60, 67, 0.22);
  border-radius: 16px;
  background: var(--bg-elev);
  color: var(--ink);
}
.file-drop-ui b { font-size: 0.95rem; font-weight: 800; }
.file-drop-ui small { color: var(--muted); font-size: 0.75rem; font-weight: 600; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; line-height: 1.5; font-weight: 500; }

/* ——— Desktop ——— */
@media (min-width: 900px) {
  .app { grid-template-columns: var(--side-w) 1fr; }
  .side { display: flex; }
  .dock { display: none; }
  .stage { padding: 16px 18px 20px; }
  .top .brand-mini { display: none; }
  .top .loc-pill, .top .search { display: flex; }
  #btn-new-ad-top { display: inline-flex; }
  .workspace { grid-template-columns: 1fr var(--rail-w); }
  .rail { display: flex; }
  .activity { grid-template-columns: repeat(3, 1fr); }
  .ads-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .ads-grid.wide { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .chats-layout { flex-direction: row; gap: 12px; }
  .chat-menu {
    flex-direction: column; overflow: auto; width: 200px; flex-shrink: 0;
    max-height: none; padding: 0;
  }
  .chat-group-label { display: block; margin: 8px 4px 4px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
  .chat-menu .chat-pick {
    border-radius: 14px; padding: 10px 12px; text-align: left; width: 100%;
  }
  .chat-menu .chat-pick small {
    display: block; color: var(--muted); font-size: 0.7rem; font-weight: 600; margin-top: 2px;
  }
  .chat-menu .chat-pick.active small { color: rgba(255,255,255,0.85); }
  .ad-form-modal {
    width: min(480px, calc(100vw - 32px));
    height: auto; max-height: min(90dvh, 860px);
    margin: auto; border-radius: 20px;
    overflow: hidden;
  }
  .ad-form-modal .sheet-full,
  .sheet-full {
    height: auto; max-height: min(90dvh, 860px);
    border-radius: 20px; border: 1px solid var(--line);
  }
  .sheet-top { border-radius: 20px 20px 0 0; padding: 12px 14px; }
}

@media (min-width: 1200px) {
  .ads-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .ads-grid.wide { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}

@media (max-width: 899px) {
  #btn-new-ad-top { display: none; }
  .top {
    padding: calc(8px + var(--safe-t)) 8px 8px;
    gap: 8px;
  }
  .top-actions { gap: 3px; flex: 0 0 auto; max-width: 72%; }
  .top-actions .online { padding: 5px 7px; font-size: 0.68rem; }
  .top-actions .visits { padding: 5px 7px; font-size: 0.68rem; }
  .btn-vk.top-login {
    padding: 6px 10px;
    min-height: 32px;
    font-size: 0.72rem;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .btn-vk.top-login .login-full { display: none; }
  .btn-vk.top-login .login-short { display: inline; }
  .brand-mini { max-width: 100%; }
  .brand-mini b { font-size: 0.95rem; }
  .top-actions .icon { width: 34px; height: 34px; flex-shrink: 0; }
  .top-actions .avatar { width: 32px; height: 32px; flex-shrink: 0; }
  /* гость: ?-аватар только мешает и давит «Войти» на название */
  body:not(.is-authed) .top-actions .avatar { display: none !important; }
  .search { display: none !important; }
  .loc-pill { display: none !important; }
  .stage { padding: 10px 12px calc(12px + var(--dock) + var(--safe-b)); }
  .home-hero { padding: 22px 18px 20px; border-radius: 20px; }
  .home-hero h1 { font-size: 1.55rem; }
  .ads-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .ads-toolbar .btn { width: 100%; }
  .ads-grid, .ads-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ad-card { border-radius: 14px; }
  .ad-card-media { aspect-ratio: 1; }
  .ads-toolbar h2 { font-size: 1.35rem; }
  .ad-sheet-panel {
    width: 100%;
    max-height: 94dvh;
    border-radius: 18px 18px 0 0;
  }
  .ad-sheet.no-photo .ad-sheet-hero { display: none; }
  .ad-sheet-body { padding-top: 8px; }
  .chat-room { border-radius: 16px; }
  .chat-room-head p { display: none; }
  .dock { padding-bottom: calc(6px + var(--safe-b)); }
}

.file-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, 0.92);
  display: grid;
  place-items: center;
  padding: 48px 16px 56px;
  touch-action: none;
}
.lightbox[hidden] { display: none !important; }
.lightbox img {
  max-width: min(96vw, 1100px);
  max-height: min(82dvh, 900px);
  object-fit: contain;
  border-radius: 12px;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-close {
  position: absolute; top: calc(10px + var(--safe-t)); right: 12px;
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.08); color: #fff;
  font-size: 1.1rem; cursor: pointer; z-index: 2;
}
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.12); color: #fff;
  font-size: 1.6rem; cursor: pointer; z-index: 2;
}
.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }
.lightbox-meta {
  position: absolute; bottom: calc(14px + var(--safe-b));
  left: 0; right: 0; text-align: center;
  color: rgba(255,255,255,0.8); font-weight: 700; font-size: 0.85rem;
}
.carousel-track .slide {
  flex: 0 0 100%;
  height: 100%;
  display: block;
  cursor: zoom-in;
  border: none; padding: 0; background: transparent;
}
.carousel-track .slide img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  pointer-events: none;
}
.ad-card .cover { cursor: pointer; }

/* Chat avatars from VK */
.chat-ava, .side-ava, .pick-ava {
  width: 44px; height: 44px; border-radius: 14px;
  object-fit: cover; display: block; background: var(--panel-2);
}
.side-ava { width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0; }
.side-ico {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1rem;
  background: rgba(0,122,255,0.1);
}
.chat-menu .chat-pick {
  display: flex; align-items: center; gap: 10px;
}
.chat-menu .pick-ava, .chat-menu .pick-ico {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
}
.chat-menu .pick-ico {
  display: grid; place-items: center; font-size: 0.95rem;
  background: rgba(0,122,255,0.1);
}
.chat-menu .chat-pick.active .pick-ico { background: rgba(255,255,255,0.2); }
.chat-menu .chat-pick.active .pick-ava {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.7);
}
.chat-menu .pick-text {
  display: flex; flex-direction: column; min-width: 0; gap: 1px;
}
.chat-menu .pick-text strong, .chat-menu .pick-text small {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}

.icon svg { display: block; }
.icon.on { color: var(--accent); }

.ad-mine {
  font-size: 0.68rem; font-weight: 800; color: var(--accent);
  background: rgba(0,122,255,0.1); padding: 4px 8px; border-radius: 999px;
}
.ad-status {
  font-size: 0.68rem; font-weight: 800; padding: 4px 8px; border-radius: 999px;
}
.ad-status.pending { color: #9a6700; background: rgba(255, 196, 0, 0.18); }
.ad-status.rejected { color: #b42318; background: rgba(240, 68, 56, 0.12); }
.ad-status.top { color: #fff; background: linear-gradient(135deg, #ff9500, #ff3b30); }
.ad-st-pending { opacity: 0.92; }
.ad-st-rejected { opacity: 0.75; }
.ad-card.is-top { box-shadow: 0 0 0 2px rgba(255,149,0,0.35); }
.ad-photo-count {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0,0,0,0.55); color: #fff;
  font-size: 0.68rem; font-weight: 800;
  padding: 3px 7px; border-radius: 999px;
}
.ad-card-media:has(.ad-hot) .ad-photo-count {
  right: auto;
  left: 8px;
}
.ad-card-media { position: relative; }

.board-controls {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 10px;
}
.board-controls .view-toggle { margin-left: auto; }
.board-price-pair {
  display: inline-flex; gap: 6px; align-items: center;
}
.board-search {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px;
}
.board-search span { color: var(--muted); font-size: 1rem; }
.board-search input {
  flex: 1; border: none; background: transparent; font: inherit;
  outline: none; min-width: 0;
}
@media (min-width: 900px) {
  .board-search { display: none; }
}
.view-toggle {
  display: inline-flex; background: var(--panel-2); border-radius: 10px; padding: 3px;
}
.view-tog {
  border: none; background: transparent; width: 36px; height: 32px;
  border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 1rem;
}
.view-tog.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.board-select, .board-input {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 0.82rem;
  color: var(--ink); min-width: 0;
}
.board-input { width: 88px; }
.ads-list-mode {
  display: flex !important; flex-direction: column; gap: 10px;
}
.ads-list-mode .ad-card {
  display: grid; grid-template-columns: 112px 1fr; gap: 0;
}
.ads-list-mode .ad-card-media {
  aspect-ratio: auto; height: 100%; min-height: 112px;
}
.ads-list-mode .ad-body { padding: 12px 14px; }

.multi-photos { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.multi-photos-row { display: flex; flex-wrap: wrap; gap: 8px; }
.multi-thumb {
  position: relative; width: 76px; height: 76px; border-radius: 14px; overflow: hidden;
  background: var(--panel-2);
}
.multi-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.multi-thumb button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border: none; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff;
  font-size: 14px; cursor: pointer; line-height: 1;
}
.multi-add {
  position: relative;
  width: 76px; height: 76px; border-radius: 14px; border: 1.5px dashed var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; cursor: pointer; color: var(--muted); text-align: center;
  background: var(--panel-2);
  overflow: hidden;
}
/* Не display:none — на iOS label[for] тогда часто не открывает камеру/галерею */
.multi-add input[type="file"] {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  cursor: pointer;
  font-size: 0 !important;
  z-index: 3;
}

.ad-live-preview {
  display: grid; grid-template-columns: 88px 1fr; gap: 12px;
  padding: 12px; border-radius: 16px; margin: 0 0 12px;
  background: linear-gradient(160deg, #fff, #f2f5fa);
  border: 1px solid var(--line);
}
.ad-live-media {
  aspect-ratio: 1; border-radius: 12px; overflow: hidden;
  background: var(--placeholder); display: grid; place-items: center;
  color: var(--accent); font-size: 0.78rem; font-weight: 800;
  cursor: pointer;
}
.ad-live-media img { width: 100%; height: 100%; object-fit: cover; }
.ad-live-body strong { display: block; font-size: 0.95rem; margin-top: 2px; }
.ad-live-body b { color: var(--accent); font-size: 0.92rem; }
.ad-live-body span { color: var(--muted); font-size: 0.75rem; }

.ad-sheet-hero {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--placeholder);
}
.ad-sheet-hero img,
.ad-sheet-hero .ad-hero-static {
  width: 100%; max-height: 48vh; height: auto;
  object-fit: cover; display: block;
  aspect-ratio: 4 / 3;
}
.ad-sheet-hero .ad-photo-count {
  position: absolute; right: 10px; bottom: 10px;
}
.ad-sheet-phone {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 12px 0; padding: 12px 14px; border-radius: 14px;
  background: rgba(0,122,255,0.1); color: var(--accent);
  font-weight: 800; text-decoration: none; width: 100%;
  box-sizing: border-box;
}

/* cover/photo-pick styles — see .photo-group block below */

/* Shop as VK-like mini community — фиксированная максимальная ширина карточки,
   чтобы 1-2 магазина не растягивались на всю доску (auto-fill, не auto-fit/1fr) */
.shops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 220px));
  justify-content: start;
  gap: 14px;
}
.shop-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 16px rgba(15,23,42,0.04);
}
.shop-card:active { transform: scale(0.985); }
.shop-card-media {
  aspect-ratio: 4/3;
  max-height: 180px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--shop-accent, var(--accent)) 22%, var(--panel)), var(--panel-2));
  overflow: hidden;
}
.shop-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-card-body { padding: 12px 14px 14px; }
.shop-card-body strong { display: block; font-size: 1rem; font-weight: 800; line-height: 1.25; }
.shop-card-body > span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.shop-card-thumbs { display: flex; gap: 4px; margin-top: 10px; }
.shop-card-thumbs img, .shop-card-thumbs span {
  width: 28px; height: 28px; border-radius: 8px; object-fit: cover; background: var(--placeholder);
}

.shop-cover {
  position: relative;
  aspect-ratio: 16/7;
  max-height: min(280px, 32vh);
  background: var(--panel-2);
  overflow: hidden;
}
.shop-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-cover-edit {
  position: absolute; left: 12px; right: auto; top: 12px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 999px; padding: 8px 14px;
  background: rgba(0,0,0,0.55); color: #fff;
  font: inherit; font-weight: 700; font-size: 0.78rem; cursor: pointer;
  backdrop-filter: blur(6px);
}
.shop-cover-edit:active { transform: scale(0.96); }
.shop-head {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px 0;
  margin-top: 0;
  position: relative; z-index: 2;
  background: var(--panel);
}
.shop-avatar {
  width: 64px; height: 64px; border-radius: 18px; overflow: hidden;
  border: 3px solid var(--panel); background: var(--panel-2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12); flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; font-size: 1.4rem;
  margin-top: -36px;
}
.shop-avatar img { width: 100%; height: 100%; object-fit: cover; }
.shop-head-text { padding-bottom: 4px; min-width: 0; padding-top: 4px; }
.shop-head-text h2 {
  font-size: 1.2rem; font-weight: 800; margin: 0;
  color: var(--ink);
  text-shadow: none;
  background: transparent;
}
.shop-head-text p { margin: 2px 0 0; color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.shop-view-cat {
  display: inline-block; margin-top: 8px;
  padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); font-size: 0.72rem; font-weight: 800;
}
.shop-body { padding-top: 12px !important; }
.shop-products-title {
  margin: 18px 0 12px;
  font-size: 1rem; font-weight: 800;
}
.shop-products-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.product-tile {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
}
.product-tile:active { transform: scale(0.98); }
.product-tile-media {
  position: relative; aspect-ratio: 1;
  background: var(--placeholder); overflow: hidden;
}
.product-tile-media img, .product-tile-media .product-ph {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.product-tile-media .product-ph { display: grid; place-items: center; font-size: 1.8rem; }
.product-tile-price { display: none; }
.product-tile-price-line {
  display: block; padding: 8px 10px 0;
  color: var(--price); font-size: 0.88rem; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-tile strong {
  padding: 4px 10px 12px;
  font-size: 0.82rem; font-weight: 700;
  line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word; overflow-wrap: anywhere;
}

.shop-ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 2rem; background: var(--card-media);
}
.shop-ph.big { min-height: 160px; font-size: 3rem; }
.shop-owner-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 14px 0 6px;
}

@media (max-width: 899px) {
  .ads-toolbar-actions { width: 100%; }
  .ads-toolbar-actions .btn { flex: 1; }
  .shops-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 200px)); }
  .board-input { width: 72px; }
}

@media (max-width: 420px) {
  .shops-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: initial; gap: 10px; }
  .shop-card-media { max-height: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.sheet-link {
  border: none; background: transparent !important;
  color: var(--accent); font: inherit; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; padding: 8px 4px; min-width: 64px;
  appearance: none; -webkit-appearance: none;
}
.sheet-link.primary { font-weight: 800; }
.sheet-link:disabled { opacity: 0.45; }
.sheet-top h3 { font-weight: 700; font-size: 1rem; letter-spacing: -0.2px; }
.ios-form { background: var(--bg); gap: 16px; }
.ios-group {
  background: var(--panel);
  border-radius: 14px;
  overflow: visible;
  border: 1px solid var(--line);
}
.ios-group > .ios-field:first-child { border-radius: 14px 14px 0 0; }
.ios-group > .ios-field:last-child { border-radius: 0 0 14px 14px; border-bottom: none; }
.ios-group > .ios-field:only-child { border-radius: 14px; }
.ios-field {
  display: grid !important;
  grid-template-columns: minmax(88px, 108px) minmax(0, 1fr);
  align-items: center;
  gap: 8px !important;
  padding: 14px !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem !important;
  color: var(--ink) !important;
  font-weight: 500 !important;
  background: var(--panel);
  min-height: 52px;
}
.ios-field:last-child { border-bottom: none; }
.ios-field.tall {
  grid-template-columns: 1fr;
  align-items: stretch;
}
.ios-field.tall textarea { min-height: 96px; }
.ios-field span {
  color: var(--muted); font-size: 0.82rem; font-weight: 600;
}
.ios-field input,
.ios-field select,
.ios-field textarea {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  outline: none;
  appearance: none;
  resize: vertical;
}
.ios-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238e8e93' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 2px center !important;
  padding-right: 18px !important;
}
.photo-group {
  padding: 0;
  overflow: visible;
  isolation: isolate;
}
.photo-group:has(.cover-pick),
.photo-group:has(.photo-pick) {
  overflow: hidden !important;
}
.photo-group .file-drop {
  margin: 0;
  display: block;
  width: 100%;
  position: relative;
  z-index: 0;
}
.photo-pick {
  position: relative;
  width: 100%;
  min-height: 180px;
  background: var(--placeholder);
  overflow: hidden;
  border-radius: 14px;
  box-sizing: border-box;
}
.photo-pick img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}
.photo-pick-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  padding: 16px;
  text-align: center;
  box-sizing: border-box;
  pointer-events: none;
}
.photo-pick-empty[hidden] { display: none !important; }
.photo-pick-empty b {
  color: var(--accent);
  font-size: 0.92rem;
  line-height: 1.3;
  max-width: 16em;
}
.photo-pick-empty small {
  display: block;
  font-size: 0.72rem;
  opacity: 0.8;
  line-height: 1.3;
  max-width: 18em;
}
.photo-cam { font-size: 1.8rem; line-height: 1; }
.file-drop-ui { display: none; }
.photo-pick:not(.cover-pick) {
  aspect-ratio: 1 / 1;
  max-width: 220px;
  margin: 12px auto;
}
.cover-pick {
  min-height: 0;
  aspect-ratio: 16 / 9;
  max-height: 220px;
  border: 2px dashed color-mix(in srgb, var(--accent) 40%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-2));
}
.cover-pick img { border-radius: 12px; }
.photo-hint {
  position: relative;
  z-index: 0;
  margin: 10px 14px 12px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

/* Ad detail sheet polish */
.ad-sheet-grab {
  width: 36px; height: 5px; border-radius: 999px;
  background: rgba(60,60,67,0.18);
  margin: 8px auto 0;
  flex-shrink: 0;
  touch-action: none;
}
.ad-sheet-panel.sheet-dragging {
  transition: none !important;
}
.ad-sheet.no-photo .ad-sheet-hero { display: none; }
.ad-sheet-hero { max-height: 42vh; aspect-ratio: auto; min-height: 180px; }
.ad-sheet-hero:empty { display: none; }
.ad-sheet-body h2 { font-size: 1.4rem; margin: 6px 0 10px; }
.ad-sheet-price-row { margin-bottom: 4px; }
.ad-sheet-price-row b { font-size: 1.35rem; color: var(--price); }
.ad-sheet-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 18px;
}
.ad-sheet-actions .btn { width: 100%; }

.contact-row { margin-top: 16px; }
.contact-main { width: 100%; }
.contact-row.dating-actions .contact-main[disabled] { opacity: 0.7; }
.contact-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.contact-choices .btn { width: 100%; justify-content: center; text-align: center; }
.contact-hint { color: var(--muted); font-size: 0.9rem; margin: 0; }
.contact-panel { max-height: 50dvh; }

.dm-panel {
  display: flex; flex-direction: column;
  max-height: 92dvh; padding: 0;
}
.dm-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px 12px; border-bottom: 1px solid var(--line);
}
.dm-head img {
  width: 42px; height: 42px; border-radius: 14px; object-fit: cover;
}
.dm-head strong { display: block; font-size: 1rem; font-weight: 800; }
.dm-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.dm-messages {
  flex: 1; overflow: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 220px; max-height: 52dvh;
  background: var(--dm-bg);
}
.dm-bubble {
  max-width: 82%;
  align-self: flex-start;
  background: var(--dm-bubble); border: 1px solid var(--line);
  border-radius: 16px 16px 16px 6px;
  padding: 10px 12px;
}
.dm-bubble.own {
  align-self: flex-end;
  background: rgba(0,122,255,0.12);
  border-color: transparent;
  border-radius: 16px 16px 6px 16px;
}
.dm-bubble p { margin: 0; font-size: 0.92rem; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.dm-bubble time { display: block; margin-top: 4px; font-size: 0.68rem; color: var(--muted); font-weight: 600; }
.dm-composer {
  display: flex; gap: 8px; padding: 10px 12px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line); background: var(--panel);
}
.dm-composer input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px;
  padding: 12px 14px; font: inherit; background: var(--bg-elev); outline: none;
}
.profile-user .btn { margin-top: 8px; width: min(100%, 240px); }

/* Board tabs */
.board-tabs {
  display: flex; gap: 6px; margin-bottom: 12px;
  padding: 4px; background: var(--panel-2); border-radius: 12px;
}
.board-tab {
  flex: 1; border: none; background: transparent;
  font: inherit; font-weight: 700; font-size: 0.88rem;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  color: var(--muted);
}
.board-tab.active {
  background: #007aff; color: #fff;
  box-shadow: 0 4px 14px rgba(0,122,255,0.28);
}
.ads-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.linkish.danger { color: var(--danger); }

.btn-shop {
  background: var(--soft-green-bg) !important;
  color: var(--soft-green-ink) !important;
  border: 1px solid color-mix(in srgb, var(--soft-green-ink) 28%, transparent) !important;
  font-weight: 800;
}
.btn-shop:hover { filter: brightness(0.97); }

.home-carousel {
  position: relative;
  margin: 0 0 22px;
  border-radius: 24px;
  overflow: hidden;
  min-height: 200px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
}
.home-slides { position: relative; }
.home-slide {
  display: none;
  position: relative;
  min-height: 200px;
  padding: 28px 22px 26px;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--banner-accent, var(--accent)) 18%, transparent), transparent 55%),
    var(--hero-grad);
  border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
  background-size: cover;
  background-position: center;
}
.home-slide.active { display: block; animation: in 0.35s ease; }
.home-slide.has-image {
  color: #fff;
  background-color: #1c1c1e;
}
.home-slide.has-image::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(0,0,0,0.72) 10%, rgba(0,0,0,0.28) 70%);
  pointer-events: none;
}
.home-slide-inner { position: relative; z-index: 1; }
.home-slide h2 {
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  font-weight: 800; letter-spacing: -0.6px; line-height: 1.12;
  margin: 0 0 8px;
}
.home-slide.has-image .eyebrow { color: #fff; opacity: 0.9; }
.home-slide.has-image .home-lead { color: rgba(255,255,255,0.88); }
.home-dots {
  position: absolute; left: 0; right: 0; bottom: 10px;
  display: flex; justify-content: center; gap: 6px; z-index: 2;
}
.home-dot {
  width: 7px; height: 7px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.22); padding: 0; cursor: pointer;
}
.home-slide.has-image ~ .home-dots .home-dot,
.home-carousel:has(.home-slide.has-image.active) .home-dot {
  background: rgba(255,255,255,0.45);
}
.home-dot.active { background: var(--accent); width: 18px; border-radius: 999px; }
.home-carousel:has(.home-slide.has-image.active) .home-dot.active { background: #fff; }

.fab-ad {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(18px + var(--dock, 64px) + env(safe-area-inset-bottom));
  z-index: 80;
  display: inline-flex; align-items: center; gap: 8px;
  border: none; cursor: pointer;
  padding: 14px 18px;
  border-radius: 999px;
  background: #007aff; color: #fff;
  font: inherit; font-weight: 800; font-size: 0.92rem;
  box-shadow: 0 10px 28px rgba(0,122,255,0.4);
}
.fab-ad span {
  display: grid; place-items: center;
  width: 22px; height: 22px; font-size: 1.25rem; line-height: 1;
}
@media (min-width: 900px) {
  .fab-ad { bottom: 28px; }
}
.fab-ad:disabled { opacity: 0.55; cursor: not-allowed; }

#btn-notify { position: relative; }
.icon-dot {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: #ff3b30; color: #fff;
  font-size: 0.62rem; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--panel);
}
#avatar-btn.has-dm { box-shadow: 0 0 0 2px #ff3b30; }

.shop-card-desc {
  margin: 8px 0 0; color: var(--muted);
  font-size: 0.78rem; line-height: 1.35; font-weight: 500;
}
.shop-card-media { aspect-ratio: 16/10; max-height: 140px; }
.shops-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 240px));
}

/* Theme toggle in app bar */
#btn-theme {
  position: relative;
  flex-shrink: 0;
  min-width: 40px;
  color: var(--ink);
}
#btn-theme .theme-ico { display: none !important; }
html[data-theme="light"] #btn-theme .theme-ico-moon,
html:not([data-theme="dark"]) #btn-theme .theme-ico-moon { display: block !important; }
html[data-theme="dark"] #btn-theme .theme-ico-sun { display: block !important; }
html[data-theme="dark"] #btn-theme { color: #ffd60a; }

.pick-go {
  margin-left: auto;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.55;
}
.chat-row .pick-go { display: none; }
.chat-pick {
  display: flex; align-items: center; gap: 10px;
}
.chat-menu .chat-pick .pick-go { display: none; }
@media (min-width: 900px) {
  .chat-menu .chat-pick .pick-go { display: inline; }
}
.dm-pick-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #ff3b30; color: #fff;
  font-size: 0.65rem; font-weight: 800;
  display: inline-grid; place-items: center;
}
.loading-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 36px 20px !important;
}
.loading-block p {
  margin: 0; max-width: 16rem; line-height: 1.4;
  color: var(--muted); font-weight: 600; font-size: 0.9rem;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.multi-add {
  min-width: 110px; min-height: 110px;
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-2));
  color: var(--accent);
}
.multi-add .photo-cam { font-size: 1.4rem; font-weight: 800; }
.multi-add b { font-size: 0.78rem !important; }
.photo-pick-empty .photo-cam {
  display: grid; place-items: center;
  width: 44px; height: 44px; margin: 0 auto 4px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  font-size: 1.4rem; font-weight: 800; color: var(--accent);
}

.home-slide {
  --banner-blur: 0px;
  --banner-overlay: 0.45;
}
.home-slide-scrim {
  display: none;
  position: absolute; inset: 0; pointer-events: none;
  backdrop-filter: blur(var(--banner-blur));
  background: rgba(0,0,0, var(--banner-overlay));
}
.home-slide.has-image .home-slide-scrim { display: block; }
.home-slide.has-image::before { display: none; }
.home-slide.align-center .home-slide-inner { text-align: center; }
.home-slide.align-center .home-cta { justify-content: center; }
.home-slide.align-right .home-slide-inner { text-align: right; }
.home-slide.align-right .home-cta { justify-content: flex-end; }
.home-slide .banner-cta, .home-slide .banner-cta2 {
  border: none; border-radius: 12px; font-weight: 800;
}

html[data-theme="dark"] .chat-row:active,
html[data-theme="dark"] .nav-item:hover { background: var(--hover); }
html[data-theme="dark"] .side-pro {
  background: linear-gradient(145deg, #0a84ff, #5e5ce6);
  box-shadow: 0 10px 24px rgba(10, 132, 255, 0.28);
}
html[data-theme="dark"] .side-pro .btn {
  background: #fff; color: #0a84ff;
}
html[data-theme="dark"] .dock {
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border-top-color: var(--line);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .rail {
  background: var(--bg);
}
html[data-theme="dark"] .ad-status.pending {
  color: #ffd60a; background: rgba(255, 214, 10, 0.14);
}
html[data-theme="dark"] .shop-card-media {
  background: linear-gradient(135deg, color-mix(in srgb, var(--shop-accent, #0a84ff) 28%, #1c1c1e), #141418);
}
html[data-theme="dark"] .msg-meta {
  color: var(--muted);
}
html[data-theme="dark"] .carousel-dots i {
  background: rgba(255,255,255,0.35);
}
html[data-theme="dark"] .home-dot {
  background: rgba(255,255,255,0.28);
}
html[data-theme="dark"] .home-dot.active {
  background: var(--accent);
}
html[data-theme="dark"] .ad-live-body,
html[data-theme="dark"] .ios-cell {
  background: var(--panel);
}
html[data-theme="dark"] .product-tile-media,
html[data-theme="dark"] .photo-pick {
  background: var(--placeholder);
}
html[data-theme="dark"] .btn-soft {
  background: var(--panel-2);
  color: var(--accent);
  border-color: var(--line);
}
html[data-theme="dark"] .board-tab:not(.active) {
  color: var(--muted);
}
html[data-theme="dark"] .view-tog.active {
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
}
html[data-theme="dark"] .ad-card:hover {
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
html[data-theme="dark"] .fab-ad {
  box-shadow: 0 10px 28px rgba(10, 132, 255, 0.45);
}
html[data-theme="dark"] .ad-sheet-close {
  background: #000;
  color: #fff;
  border: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}
html[data-theme="dark"] .file-drop-ui {
  border-color: var(--line);
}
html[data-theme="dark"] .shop-card {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .avatar-fallback,
html[data-theme="dark"] .chat-row img,
html[data-theme="dark"] .chat-row .avatar-fallback {
  background: var(--panel-2);
}
html[data-theme="dark"] .cat-bar-fade {
  background: linear-gradient(90deg, transparent, var(--bg));
}

/* Home chats click hint */
.home-chats .chat-row {
  animation: chatRowGlow 2.8s ease-in-out infinite;
}
.home-chats .chat-row:nth-child(2) { animation-delay: 0.35s; }
.home-chats .chat-row:nth-child(3) { animation-delay: 0.7s; }
.home-chats .chat-row:nth-child(4) { animation-delay: 1.05s; }
@keyframes chatRowGlow {
  0%, 100% { background: transparent; }
  50% { background: color-mix(in srgb, var(--accent) 7%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .home-chats .chat-row,
  .cat-bar-hint { animation: none; }
}

.ad-related {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.ad-related h3 {
  font-size: 0.95rem; font-weight: 800; margin-bottom: 12px;
}
.ad-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.ad-related-grid .ad-card { margin: 0; }

.home-block-ads {
  padding: 4px 0 8px;
}
.home-ads-lead {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}
.home-ads-grid {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
.home-more-accent {
  margin-top: 12px;
  width: 100%;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 14px 16px;
  box-shadow: 0 8px 20px rgba(0, 122, 255, 0.25);
}
html[data-theme="dark"] .home-more-accent {
  box-shadow: 0 8px 20px rgba(10, 132, 255, 0.28);
}
.dating-gate {
  margin: 12px 0 18px;
  padding: 18px 16px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: center;
}
.dating-gate p { color: var(--muted); font-size: 0.9rem; line-height: 1.45; margin-bottom: 14px; }
.dating-inbox { display: grid; gap: 12px; margin-bottom: 14px; }
.dating-inbox-block h3 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dating-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dating-person-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  font: inherit; font-size: 0.78rem; font-weight: 700;
  cursor: pointer;
}
.dating-person-chip img {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
}
.dating-person-chip.is-match {
  border-color: color-mix(in srgb, #e11d48 35%, var(--line));
  background: color-mix(in srgb, #e11d48 10%, var(--panel));
}
.dating-filters { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; }
.dating-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.dating-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
}
.dating-card.is-liked { border-color: color-mix(in srgb, #e11d48 40%, var(--line)); }
.dating-card.is-match { border-color: color-mix(in srgb, #e11d48 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, #e11d48 20%, transparent); }
.dating-card-media {
  aspect-ratio: 3/4;
  background: var(--card-media);
}
.dating-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dating-card-body { padding: 10px 12px 12px; position: relative; }
.dating-card-body strong { display: block; font-size: 0.92rem; font-weight: 800; padding-right: 36px; }
.dating-card-body span { display: block; margin-top: 3px; color: var(--muted); font-size: 0.74rem; font-weight: 600; }
.dating-like-mini {
  position: absolute; right: 8px; top: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: #e11d48;
  font-size: 1rem; line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.dating-card.is-liked .dating-like-mini,
.dating-like-mini:active { background: #e11d48; color: #fff; border-color: #e11d48; }
.ad-status.match { color: #be123c; background: rgba(225, 29, 72, 0.14); }
.ad-status.liked { color: #be123c; background: rgba(225, 29, 72, 0.08); }
.dating-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 8px;
}
.dating-actions .contact-like.is-on {
  background: color-mix(in srgb, #e11d48 14%, var(--panel));
  border-color: color-mix(in srgb, #e11d48 40%, var(--line));
  color: #be123c;
}
.dating-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.dating-tag {
  padding: 5px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent); font-size: 0.72rem; font-weight: 700;
}
.contact-row.dating-actions .contact-main { width: auto; }
.ios-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 12px;
  padding: 14px !important;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border-radius: 14px;
  border: 1px solid var(--line);
  line-height: 1.35;
}
.ios-check input {
  flex: 0 0 auto;
  margin-top: 2px;
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}
.ios-check span { flex: 1; min-width: 0; }
.btn-vk.pulse-attention {
  animation: loginPulse 0.7s ease 2;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.35);
}
@keyframes loginPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.home-cta { flex-wrap: wrap; }

.ad-sheet-note {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.35;
  font-weight: 650;
}
.ad-sheet-note.pending {
  background: rgba(255, 149, 0, 0.14);
  color: #c27000;
}
.ad-sheet-note.rejected {
  background: rgba(255, 59, 48, 0.12);
  color: #c62828;
}
html[data-theme="dark"] .ad-sheet-note.pending {
  background: rgba(255, 149, 0, 0.18);
  color: #ffb340;
}
html[data-theme="dark"] .ad-sheet-note.rejected {
  background: rgba(255, 59, 48, 0.18);
  color: #ff8a80;
}
.ads-load-more {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 12px 0 20px;
}

.multi-photos {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start;
  padding: 12px;
}
.multi-add {
  position: relative;
  width: auto;
  min-width: 110px;
  min-height: 110px;
  height: auto;
  padding: 12px 10px;
  box-sizing: border-box;
  border-radius: 14px;
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-2));
  color: var(--accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; text-align: center;
  overflow: hidden;
}
.multi-add b {
  font-size: 0.78rem !important; line-height: 1.2; font-weight: 800;
  position: relative; z-index: 1; pointer-events: none;
}
.multi-add small {
  font-size: 0.65rem; line-height: 1.2; opacity: 0.85; display: block;
  position: relative; z-index: 1; pointer-events: none;
}
.multi-add .photo-cam {
  position: relative; z-index: 1; pointer-events: none;
  font-size: 1.4rem; font-weight: 800;
}

.ad-live-media {
  cursor: pointer;
}

.chat-menu .pick-text {
  display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; gap: 1px;
}
.chat-menu .pick-text strong, .chat-menu .pick-text small {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%;
}
.chat-menu .chat-pick .pick-go {
  margin-left: 4px;
  opacity: 0.45;
  flex: 0 0 auto;
}
