:root {
  --bg: #08080a;
  --bg-2: #101013;
  --card: #141417;
  --card-2: #1b1b1f;
  --border: rgba(255, 255, 255, 0.09);
  --accent: #ffffff;
  --accent-2: #d7d7dc;
  --accent-soft: rgba(255, 255, 255, 0.09);
  --text: #f2f2f3;
  --muted: #8b8b91;
  --ok: #e8e8ea;
  --warn: #a3a3a8;
  --danger: #ffffff;
  --radius: 16px;

  /* типографика: Unbounded для заголовков, Manrope для текста */
  --font-display: 'Unbounded', Georgia, 'Times New Roman', serif;
  --font-body: 'Manrope', -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* фон: «маяк» — кольца сигнала + звёздная пыль (SVG data-URI, монохром) */
  --bg-rings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='1000'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.075)'%3E%3Cellipse cx='700' cy='480' rx='140' ry='140'/%3E%3Cellipse cx='700' cy='480' rx='300' ry='300' stroke-dasharray='4 7'/%3E%3Cellipse cx='700' cy='480' rx='480' ry='480'/%3E%3Cellipse cx='700' cy='480' rx='680' ry='680' stroke-dasharray='4 7'/%3E%3Cellipse cx='700' cy='480' rx='900' ry='900'/%3E%3C/g%3E%3Ccircle cx='700' cy='480' r='2.5' fill='rgba(255,255,255,0.7)'/%3E%3Ccircle cx='700' cy='480' r='12' fill='none' stroke='rgba(255,255,255,0.28)'/%3E%3Ccircle cx='700' cy='480' r='26' fill='none' stroke='rgba(255,255,255,0.12)'/%3E%3C/svg%3E");
  --bg-stars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='460' height='460'%3E%3Cg fill='rgba(255,255,255,0.55)'%3E%3Ccircle cx='31' cy='59' r='1.1'/%3E%3Ccircle cx='118' cy='17' r='1.4'/%3E%3Ccircle cx='207' cy='83' r='0.8'/%3E%3Ccircle cx='289' cy='31' r='1.1'/%3E%3Ccircle cx='376' cy='71' r='1.5'/%3E%3Ccircle cx='441' cy='23' r='0.7'/%3E%3Ccircle cx='77' cy='151' r='0.9'/%3E%3Ccircle cx='173' cy='127' r='1.2'/%3E%3Ccircle cx='263' cy='169' r='0.8'/%3E%3Ccircle cx='352' cy='147' r='1.1'/%3E%3Ccircle cx='427' cy='187' r='0.8'/%3E%3Ccircle cx='19' cy='233' r='1.2'/%3E%3Ccircle cx='109' cy='261' r='0.8'/%3E%3Ccircle cx='199' cy='243' r='1.3'/%3E%3Ccircle cx='297' cy='283' r='0.7'/%3E%3Ccircle cx='389' cy='259' r='1.1'/%3E%3Ccircle cx='451' cy='311' r='0.9'/%3E%3Ccircle cx='53' cy='339' r='1.3'/%3E%3Ccircle cx='143' cy='357' r='0.8'/%3E%3Ccircle cx='233' cy='337' r='1.1'/%3E%3Ccircle cx='323' cy='379' r='0.9'/%3E%3Ccircle cx='409' cy='407' r='1.2'/%3E%3Ccircle cx='91' cy='429' r='0.8'/%3E%3Ccircle cx='181' cy='447' r='1.1'/%3E%3Ccircle cx='277' cy='423' r='0.8'/%3E%3Ccircle cx='367' cy='449' r='0.9'/%3E%3C/g%3E%3Cg fill='none' stroke='rgba(255,255,255,0.22)'%3E%3Cpath d='M118 17l26 26M376 71l-20 20'/%3E%3C/g%3E%3C/svg%3E");
}

/* светлая тема — данные-theme="light" на html */
[data-theme="light"] {
  --bg: #f4f4f5;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #ececee;
  --border: rgba(0, 0, 0, 0.09);
  --accent: #0a0a0b;
  --accent-2: #3f3f46;
  --accent-soft: rgba(0, 0, 0, 0.06);
  --text: #0f0f10;
  --muted: #6b6b70;
  --ok: #17171a;
  --warn: #71717a;
  --danger: #0f0f10;
  --bg-rings: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1400' height='1000'%3E%3Cg fill='none' stroke='rgba(0,0,0,0.05)'%3E%3Cellipse cx='700' cy='480' rx='140' ry='140'/%3E%3Cellipse cx='700' cy='480' rx='300' ry='300'/%3E%3Cellipse cx='700' cy='480' rx='480' ry='480'/%3E%3Cellipse cx='700' cy='480' rx='680' ry='680'/%3E%3Cellipse cx='700' cy='480' rx='900' ry='900'/%3E%3C/g%3E%3Ccircle cx='700' cy='480' r='2.5' fill='rgba(0,0,0,0.5)'/%3E%3Ccircle cx='700' cy='480' r='10' fill='none' stroke='rgba(0,0,0,0.15)'/%3E%3C/svg%3E");
  --bg-stars: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='460' height='460'%3E%3Cg fill='rgba(0,0,0,0.3)'%3E%3Ccircle cx='31' cy='59' r='1'/%3E%3Ccircle cx='118' cy='17' r='1.2'/%3E%3Ccircle cx='207' cy='83' r='0.8'/%3E%3Ccircle cx='289' cy='31' r='1'/%3E%3Ccircle cx='376' cy='71' r='1.3'/%3E%3Ccircle cx='441' cy='23' r='0.7'/%3E%3Ccircle cx='77' cy='151' r='0.9'/%3E%3Ccircle cx='173' cy='127' r='1.1'/%3E%3Ccircle cx='263' cy='169' r='0.8'/%3E%3Ccircle cx='352' cy='147' r='1'/%3E%3Ccircle cx='427' cy='187' r='0.8'/%3E%3Ccircle cx='19' cy='233' r='1.1'/%3E%3Ccircle cx='109' cy='261' r='0.8'/%3E%3Ccircle cx='199' cy='243' r='1.2'/%3E%3Ccircle cx='297' cy='283' r='0.7'/%3E%3Ccircle cx='389' cy='259' r='1'/%3E%3Ccircle cx='451' cy='311' r='0.9'/%3E%3Ccircle cx='53' cy='339' r='1.2'/%3E%3Ccircle cx='143' cy='357' r='0.8'/%3E%3Ccircle cx='233' cy='337' r='1'/%3E%3Ccircle cx='323' cy='379' r='0.9'/%3E%3Ccircle cx='409' cy='407' r='1.1'/%3E%3Ccircle cx='91' cy='429' r='0.8'/%3E%3Ccircle cx='181' cy='447' r='1'/%3E%3Ccircle cx='277' cy='423' r='0.8'/%3E%3Ccircle cx='367' cy='449' r='0.9'/%3E%3C/g%3E%3C/svg%3E");
}
[data-theme="light"] body {
  background: radial-gradient(900px 400px at 50% -80px, #ffffff 0%, var(--bg) 55%) var(--bg);
}
[data-theme="light"] .btn.primary,
[data-theme="light"] .send-btn,
[data-theme="light"] .nav-item[data-tab="publish"] svg,
[data-theme="light"] .msg.mine,
[data-theme="light"] .pill.ok,
[data-theme="light"] .filter-btn.active,
[data-theme="light"] #toast,
[data-theme="light"] .switch.on { color: #f4f4f5; }
[data-theme="light"] .switch.on i { background: #f4f4f5; }
[data-theme="light"] .hero { background: linear-gradient(135deg, #2a2a2e 0%, #0a0a0b 100%); }
[data-theme="light"] .hero svg { color: #f4f4f5; }
[data-theme="light"] .avatar { color: #f4f4f5; }
[data-theme="light"] .overlay { background: rgba(0, 0, 0, 0.35); }
[data-theme="light"] .chip.active { background: var(--accent-soft); }

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  background-color: var(--bg);
  /* серебристая дымка — два мягких света поверх глубокого чёрного */
  background-image:
    radial-gradient(1000px 600px at 18% 8%, rgba(255, 255, 255, 0.035) 0%, transparent 55%),
    radial-gradient(900px 700px at 88% 88%, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* слой 1: кольца маяка (за контентом) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: var(--bg-rings);
  background-repeat: no-repeat;
  background-position: center -180px;
  background-size: 1400px auto;
  animation: beaconPulse 9s ease-in-out infinite;
}

/* слой 2: звёздная пыль, мерцает в противофазе */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-image: var(--bg-stars);
  background-repeat: repeat;
  background-size: 460px 460px;
  animation: twinkle 8s ease-in-out infinite;
}

@keyframes beaconPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.65; }
  50% { opacity: 1; }
}

.screen { display: none; height: 100dvh; }
.screen.active { display: flex; flex-direction: column; animation: screenIn 0.22s ease-out; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 19px;
  margin: 14px 0 4px;
  letter-spacing: -0.2px;
}
.sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.error { color: var(--text); font-weight: 600; font-size: 13px; margin-top: 10px; min-height: 18px; }

code {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 12px;
}

/* ---------- вход ---------- */
.login-wrap {
  margin: auto;
  width: min(420px, 100%);
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}

.hero {
  width: 72px; height: 72px;
  border-radius: 22px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #ffffff 0%, #b9b9bf 100%);
  box-shadow: 0 12px 32px rgba(255, 255, 255, 0.12);
  margin-bottom: 6px;
}
.hero svg { width: 36px; height: 36px; color: #0a0a0b; }

.steps { display: flex; flex-direction: column; gap: 10px; margin: 0 0 20px; }
.step {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--muted);
}
.step b { color: var(--text); font-weight: 600; }
.num {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}

textarea, input, select {
  width: 100%;
  margin: 4px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color 0.15s;
}
textarea:focus, input:focus, select:focus { border-color: rgba(255, 255, 255, 0.45); }
textarea { resize: vertical; }
#cookie-input { min-height: 88px; font-size: 12px; font-family: ui-monospace, Consolas, monospace; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ---------- кнопки ---------- */
.btn {
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.08s, opacity 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; }
.btn.primary {
  background: var(--accent);
  color: #0a0a0b;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.5);
}
.btn.primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 34px rgba(0, 0, 0, 0.6); }
.btn.big { width: 100%; }
.btn.danger-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--muted);
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 10px;
}
.btn.danger-ghost:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.4); }

.icon-btn {
  flex: none;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); background: var(--card-2); }
.icon-btn.accent { color: var(--text); border-color: rgba(255, 255, 255, 0.35); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- шапка ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 10px;
  padding-top: calc(14px + env(safe-area-inset-top));
  flex: none;
  position: sticky;
  top: 0;
  background: linear-gradient(var(--bg) 70%, transparent);
  z-index: 5;
}
.topbar-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 16.5px;
  letter-spacing: -0.2px;
}
.topbar-sub { font-size: 12px; color: var(--muted); }
.chatbar .topbar-title { font-size: 17px; }

/* ---------- контент ---------- */
#view-tabs { display: flex; flex-direction: column; height: 100dvh; }
#tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px calc(90px + env(safe-area-inset-bottom));
}
.tab { display: none; }
.tab.active { display: block; animation: screenIn 0.18s ease-out; }

/* статистика */
.stats { display: flex; gap: 8px; margin-bottom: 12px; }
.stat {
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14.5px;
  letter-spacing: -0.2px;
}
.stat span { font-size: 11.5px; color: var(--muted); }

/* карточка объявления */
.ad-card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.2s;
}
.ad-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.ad-card:active { transform: scale(0.995); }
.ad-thumb {
  flex: none;
  width: 64px; height: 64px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--card-2), #2a2a2e);
  display: grid; place-items: center;
  color: var(--muted);
  font-size: 22px;
  font-weight: 700;
  overflow: hidden;
  border: 1px solid var(--border);
}
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.ad-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ad-title { font-weight: 600; font-size: 14.5px; }
.ad-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ad-desc {
  font-size: 12.5px; color: var(--muted);
  margin-top: 6px;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ad-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }

.pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}
.pill.ok { background: var(--accent); color: #0a0a0b; }
.pill.warn { background: transparent; border: 1px solid rgba(255, 255, 255, 0.35); color: var(--muted); }
.pill.info { background: var(--accent-soft); color: var(--text); border: 1px solid rgba(255, 255, 255, 0.25); }
.pill.dim { background: rgba(255, 255, 255, 0.06); color: var(--muted); }

/* чаты */
.chat-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-item:hover { border-color: rgba(255,255,255,0.25); }
.chat-item:active { background: var(--card-2); }
.avatar {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: #0a0a0b;
  background: #b9b9bf;
}
.chat-main { flex: 1; min-width: 0; }
.chat-name { font-weight: 600; font-size: 14.5px; }
.chat-snippet {
  font-size: 13px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.unread-dot {
  flex: none;
  min-width: 10px; height: 10px;
  border-radius: 999px;
  background: var(--accent);
  padding: 0 3px;
  font-size: 10px;
  color: #0a0a0b;
}

/* экран чата */
#view-chat { display: flex; flex-direction: column; height: 100dvh; }
#messages-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 12px;
  display: flex;
  flex-direction: column;
}
.msg {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 18px;
  margin-bottom: 7px;
  font-size: 14.5px;
  background: var(--card-2);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 6px;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.msg.mine {
  align-self: flex-end;
  background: var(--accent);
  border: none;
  color: #0a0a0b;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.1);
}
.msg.pending { opacity: 0.55; }

.composer {
  flex: none;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}
.composer textarea {
  margin: 0;
  max-height: 110px;
  border-radius: 22px;
}
.send-btn {
  flex: none;
  width: 46px; height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0b;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.14);
}
.send-btn:disabled { opacity: 0.5; }
.send-btn svg { width: 20px; height: 20px; margin-left: 2px; }

/* форма публикации */
.field { margin-bottom: 4px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }
#publish-status { margin-top: 12px; font-size: 13px; color: var(--muted); min-height: 20px; }
#publish-status .error { color: var(--text); }

/* пустые состояния */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 20px;
}
.empty .big-emoji { font-size: 40px; margin-bottom: 10px; filter: grayscale(1); }
.empty .hint { font-size: 13px; }

/* скелетоны */
.skel {
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--card) 40%, var(--card-2) 50%, var(--card) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  height: 88px;
  margin-bottom: 10px;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ---------- аккаунт-чипы ---------- */
.chips-row {
  display: flex;
  gap: 6px;
  padding: 0 16px 10px;
  overflow-x: auto;
  flex: none;
}
.chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  border-left-width: 3px;
  transition: color 0.15s, border-color 0.15s;
}
.chip.active { color: var(--text); border-color: rgba(255, 255, 255, 0.5); background: var(--accent-soft); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.chip.ok .dot { background: var(--text); }
.chip.expired .dot { background: var(--muted); border: 1px solid rgba(255,255,255,0.4); }
.chip.unknown .dot { background: transparent; border: 1px solid rgba(255,255,255,0.35); }
.chip.add { color: var(--text); font-weight: 600; border-color: rgba(255, 255, 255, 0.3); }

/* карточка аккаунта */
.acc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.2s;
}
.acc-card:hover { border-color: rgba(255,255,255,0.25); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.acc-head { display: flex; align-items: center; gap: 10px; }
.acc-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-meta { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.acc-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.plan-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13px;
}
.plan-banner b { color: var(--text); }

/* фильтр чатов */
.chat-filter { display: flex; gap: 6px; margin-bottom: 12px; }
.filter-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.filter-btn.active { background: var(--accent); border-color: transparent; color: #0a0a0b; font-weight: 600; }

/* цветовая метка на чате */
.chat-item { border-left: 3px solid transparent; }
.label-btn {
  flex: none;
  width: 30px; height: 30px;
  border: none;
  background: none;
  color: var(--muted);
  border-radius: 8px;
  display: grid; place-items: center;
  cursor: pointer;
}
.label-btn svg { width: 16px; height: 16px; }
.label-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* кнопка объявления в чате */
.listing-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  margin: 0 0 10px;
  cursor: pointer;
  font-size: 13px;
}
.listing-chip .ad-title { font-weight: 600; }

/* AI-варианты */
.ai-variant {
  text-align: left;
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 11px 13px;
  margin-bottom: 8px;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ai-variant:hover { border-color: rgba(255, 255, 255, 0.4); }
.ai-hint { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.ai-loader { display: flex; gap: 4px; justify-content: center; padding: 14px 0; }
.ai-loader i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text);
  animation: bounce 1s infinite;
}
.ai-loader i:nth-child(2) { animation-delay: 0.15s; }
.ai-loader i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-5px); } }

/* шаблоны */
.tpl-item {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.tpl-body { flex: 1; min-width: 0; }
.tpl-name { font-weight: 600; font-size: 13.5px; }
.tpl-text { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* нижняя шторка */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: min(520px, 100%);
  max-height: 78vh;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  animation: slideUp 0.22s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.sheet-title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 13.5px; margin: 8px 0 14px; display: flex; justify-content: space-between; align-items: center; }
.sheet-close {
  border: none; background: none; color: var(--muted);
  font-size: 20px; cursor: pointer; padding: 0 4px;
}

/* командная палитра */
.overlay.center { align-items: flex-start; padding-top: 12vh; }
.palette {
  width: min(520px, 92%);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.15s ease-out;
}
.palette input {
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  padding: 14px 16px;
}
.palette-item {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.palette-item:hover, .palette-item.sel { background: var(--accent-soft); }
.palette-item .hint { margin-left: auto; font-size: 11px; color: var(--muted); }

/* прокси-строка */
.acc-proxy {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.proxy-ok { color: var(--text); font-weight: 500; }
.proxy-bad { color: var(--text); font-weight: 600; }
.proxy-none { opacity: 0.7; }

/* настройки */
.set-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0 12px;
}
.set-row.column { display: block; }
.set-name { font-weight: 600; font-size: 14px; }

.switch {
  flex: none;
  width: 46px; height: 27px;
  border: none;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.switch i {
  position: absolute;
  top: 3px; left: 3px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}
.switch.on { background: var(--accent); border-color: transparent; }
.switch.on i { transform: translateX(19px); background: #0a0a0b; }

.msg .translated {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(0, 0, 0, 0.3);
  font-size: 12.5px;
  opacity: 0.85;
  font-style: italic;
  cursor: pointer;
}
.msg.theirs .translated { color: var(--muted); border-top-color: rgba(255, 255, 255, 0.2); }

/* массовые действия + снайпер + аналитика */
.bulk-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.bulk-row .btn { padding: 8px 12px; font-size: 12.5px; }
.beta {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 0 4px;
  vertical-align: 1px;
}
.aday { margin-bottom: 10px; }
.adate { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }
.agrow { display: flex; flex-direction: column; gap: 3px; }
.abar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 14px;
}
.abar i {
  height: 100%;
  min-width: 2px;
  border-radius: 4px;
  background: var(--muted);
}
.abar span { font-size: 10px; color: var(--muted); width: 10px; }
.abar b { font-size: 11px; color: var(--text); }
.msg.theirs .abar i { background: var(--muted); }

/* нижняя навигация */
.bottomnav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: rgba(17, 17, 19, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  z-index: 10;
}
.nav-item {
  flex: 1;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 10.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 0 4px;
  cursor: pointer;
  border-radius: 12px;
  transition: color 0.15s;
}
.nav-item svg { width: 23px; height: 23px; }
.nav-item.active { color: var(--text); }
.nav-item[data-tab="publish"] svg {
  width: 30px; height: 30px;
  padding: 4px;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0a0b;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
  margin-top: -8px;
}

/* тост */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  background: var(--accent);
  color: #0a0a0b;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
  max-width: 90%;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

::-webkit-scrollbar { width: 0; height: 0; }
