/* БороЧат — тёмный дашборд в духе «Боровичи Онлайн» */

:root {
  --bg: #070b12;
  --bg-elev: #0d131d;
  --panel: #121a27;
  --panel-2: #171f2e;
  --ink: #f3f6fb;
  --muted: #8b97ab;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --accent-deep: #1d4ed8;
  --green: #10b981;
  --pink: #ec4899;
  --purple: #8b5cf6;
  --amber: #f59e0b;
  --danger: #f87171;
  --vk: #0077ff;
  --radius: 18px;
  --radius-lg: 24px;
  --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", system-ui, sans-serif;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

* { 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;
}

body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(37, 99, 235, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(139, 92, 246, 0.12), transparent 50%),
    radial-gradient(ellipse 50% 40% at 70% 100%, rgba(16, 185, 129, 0.08), transparent 55%);
}

.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: rgba(10, 14, 22, 0.92);
  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 {
  width: 42px; height: 42px; border-radius: 14px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}
.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: rgba(255, 255, 255, 0.04); color: var(--ink); }
.nav-item.active {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.35);
}
.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, #4c1d95, #1d4ed8 60%, #0ea5e9);
  box-shadow: 0 14px 36px rgba(76, 29, 149, 0.4);
}
.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: rgba(255,255,255,0.95); color: #1e3a8a; 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: rgba(7, 11, 18, 0.75);
  backdrop-filter: blur(12px);
}
.top-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.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: 8px; flex-shrink: 0; }
.online {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 999px;
  background: rgba(16, 185, 129, 0.12); color: #6ee7b7;
  font-size: 0.8rem; font-weight: 800;
}
.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);
}
.avatar { overflow: hidden; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar span { font-weight: 800; color: var(--accent); }

.guest {
  margin: 10px 16px 0; padding: 10px 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.guest-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; justify-content: space-between;
}
.guest-hint { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.guest-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.vk-onetap { min-width: min(100%, 280px); max-width: 100%; }
.vk-onetap iframe, .vk-onetap > * { max-width: 100%; }

.install-tip {
  margin: 10px 16px 0; padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(120deg, #1d4ed8, #3b82f6);
  color: #fff;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.install-tip strong { display: block; font-size: 0.92rem; }
.install-tip p { font-size: 0.78rem; opacity: 0.92; margin-top: 2px; max-width: 42ch; }
.install-tip .btn-primary { background: #fff; color: #1d4ed8; box-shadow: none; }
.tip-close { margin-left: auto; background: rgba(255,255,255,0.18); border-color: transparent; color: #fff; }

.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: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}
.btn-soft {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  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));
}
.view { display: none; height: 100%; min-height: 0; overflow: auto; }
.view.active { display: block; animation: in 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
#panel-chats.active { display: flex; flex-direction: column; overflow: hidden; }
@keyframes in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ——— Hero ——— */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  min-height: 280px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px 16px 16px;
  box-shadow: var(--shadow);
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 11, 18, 0.25) 0%, rgba(7, 11, 18, 0.55) 45%, rgba(7, 11, 18, 0.92) 100%),
    radial-gradient(ellipse at 30% 40%, rgba(37, 99, 235, 0.35), transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(236, 72, 153, 0.2), transparent 40%),
    linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #0b1220 100%);
}
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}
.hero-content { position: relative; z-index: 1; margin-bottom: 14px; padding: 4px 4px 0; }
.eyebrow {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em;
  text-transform: uppercase; color: #93c5fd; margin-bottom: 8px;
}
.hero h1 {
  font-size: clamp(1.55rem, 5vw, 2.35rem);
  font-weight: 800; letter-spacing: -0.7px; line-height: 1.08;
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.lead {
  margin-top: 8px; max-width: 40ch;
  color: #cbd5e1; font-size: 0.92rem; line-height: 1.45; font-weight: 500;
}

.quick-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.q-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 14px 12px;
  text-align: left; cursor: pointer;
  color: #fff; font: inherit;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, filter 0.15s;
}
.q-card:hover { filter: brightness(1.08); }
.q-card:active { transform: scale(0.98); }
.q-card .ico {
  width: 36px; height: 36px; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.05rem;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.14);
}
.q-card strong { display: block; font-size: 0.92rem; font-weight: 800; }
.q-card span { display: block; margin-top: 4px; font-size: 0.75rem; opacity: 0.85; font-weight: 600; }
.tone-blue { background: linear-gradient(145deg, rgba(37, 99, 235, 0.95), rgba(59, 130, 246, 0.75)); }
.tone-green { background: linear-gradient(145deg, rgba(5, 150, 105, 0.95), rgba(16, 185, 129, 0.75)); }
.tone-pink { background: linear-gradient(145deg, rgba(219, 39, 119, 0.95), rgba(236, 72, 153, 0.75)); }
.tone-purple { background: linear-gradient(145deg, rgba(109, 40, 217, 0.95), rgba(139, 92, 246, 0.75)); }

.block { margin-bottom: 22px; }
.block-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.block-head h2 { font-size: 1.15rem; 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: #93c5fd;
  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(255, 255, 255, 0.04);
}
.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(59, 130, 246, 0.2); color: #93c5fd; 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: #6ee7b7; }
.empty-mini {
  color: var(--muted); font-size: 0.85rem; padding: 24px 8px;
  text-align: center; font-weight: 500;
}

.ads-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.ads-grid.wide { grid-template-columns: 1fr; }
.ad-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s;
}
.ad-card:hover { border-color: rgba(59, 130, 246, 0.35); }
.ad-card img.cover {
  width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block;
  background: var(--panel-2);
}
.ad-ph {
  width: 100%; aspect-ratio: 16/10;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  display: grid; place-items: center; color: var(--muted); font-weight: 700;
}
.ad-body { padding: 12px 14px 14px; }
.ad-price {
  display: block; margin-bottom: 4px;
  font-weight: 800; color: #6ee7b7; font-size: 1rem;
}
.ad-body h3 { font-size: 0.98rem; font-weight: 800; margin-bottom: 6px; }
.ad-body p {
  color: var(--muted); font-size: 0.84rem; line-height: 1.4; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.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; }

.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: grid; grid-template-columns: 1fr; gap: 10px;
  height: 100%; min-height: 0;
}
.chat-menu {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px;
}
.chat-menu button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer; text-align: left;
  min-width: 148px;
  font-family: inherit; color: var(--ink);
}
.chat-menu button.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.chat-menu button.active small { color: rgba(255, 255, 255, 0.85); }
.chat-menu strong { display: block; font-size: 0.9rem; font-weight: 800; }
.chat-menu small { color: var(--muted); font-size: 0.72rem; font-weight: 600; }

.chat-room {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  min-height: 0; height: 100%;
  overflow: hidden;
}
.chat-room-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.chat-room-head h3 { font-size: 1.05rem; font-weight: 800; }
.chat-room-head p { color: var(--muted); font-size: 0.78rem; font-weight: 500; }
.pill {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em;
  color: #6ee7b7; background: rgba(16, 185, 129, 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;
}
.msg { max-width: min(90%, 520px); animation: in 0.25s ease; }
.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(59, 130, 246, 0.2); color: #93c5fd;
}
.msg.own .msg-head { justify-content: flex-end; }
.msg-body {
  padding: 11px 13px; border-radius: 18px 18px 18px 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: 0.92rem; line-height: 1.45; font-weight: 500;
  white-space: pre-wrap; word-break: break-word;
}
.msg.own .msg-body {
  border-radius: 18px 18px 6px 18px;
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(59, 130, 246, 0.3);
}
.msg.vk-src .msg-body { background: rgba(0, 119, 255, 0.12); }
.msg-photos { display: grid; gap: 6px; margin-top: 8px; }
.msg-photos img { max-width: 100%; max-height: 220px; border-radius: 14px; object-fit: cover; }

.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(37, 99, 235, 0.2);
}
.send {
  width: 50px; height: 50px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; cursor: pointer; font-size: 1rem;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.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(59, 130, 246, 0.35);
}
.profile-user a { color: #93c5fd; 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: #93c5fd; }

/* ——— 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: rgba(10, 14, 22, 0.5);
}
.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: #6ee7b7; font-weight: 800; font-size: 0.8rem; margin-top: 2px; }
.topic-pill {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 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;
}
.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(4, 1fr);
  gap: 4px;
  background: rgba(10, 14, 22, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 6px 8px 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.68rem;
  padding: 8px 4px; cursor: pointer; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.dock-btn span { font-size: 1.05rem; line-height: 1.2; }
.dock-btn.active {
  color: #fff;
  background: rgba(37, 99, 235, 0.25);
}
.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(12px + var(--safe-t));
  transform: translateX(-50%); z-index: 50;
  max-width: min(92vw, 420px);
  padding: 12px 16px; border-radius: 14px;
  background: #1e293b; color: #fff; font-weight: 700; font-size: 0.88rem;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.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 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;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.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 .loc-pill, .top .search { display: flex; }
  #btn-new-ad-top { display: inline-flex; }
  .workspace { grid-template-columns: 1fr var(--rail-w); }
  .rail { display: flex; }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .activity { grid-template-columns: repeat(3, 1fr); }
  .ads-grid { grid-template-columns: repeat(2, 1fr); }
  .ads-grid.wide { grid-template-columns: repeat(3, 1fr); }
  .chats-layout { grid-template-columns: 200px 1fr; }
  .chat-menu { flex-direction: column; overflow: visible; }
  .chat-menu button { min-width: 0; width: 100%; }
  .hero { min-height: 320px; padding: 28px 22px 18px; }
}

@media (min-width: 1200px) {
  .ads-grid { grid-template-columns: repeat(3, 1fr); }
  .ads-grid.wide { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 899px) {
  #btn-new-ad-top { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
