/* Vikadra — светлый интерфейс в стиле логотипа.
   Белый — основной цвет, оранжевый из знака — единственный акцент,
   нейтральные тона слегка тёплые, чтобы оранжевый смотрелся родным. Линии вместо теней. Вопросы набраны книжным шрифтом,
   всё остальное — гротеском. */

:root {
  --bg: #ffffff;
  --ink: #1f1a17;
  --muted: #6f6762;
  --faint: #a39b96;
  --line: #ece7e3;
  --soft: #f7f4f2;
  --brand: #ff6a3d;            /* цвет знака Vikadra: для логотипа и крупных элементов */
  --accent: #d44516;           /* кнопки и ссылки: белый текст на нём читается (4,5:1) */
  --accent-soft: #fff1eb;
  --verified: #0095f6;         /* синяя галочка, как в Instagram */
  --like: #ff3040;
  --close: #1a9e55;            /* «Близкие друзья» */
  --on-accent: #ffffff;
  --danger: #b4232a;
  --ok: #1f7a4d;

  --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Literata', Georgia, 'Times New Roman', serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-full: 999px;

  --nav-w: 232px;
  --main-w: 600px;
  --aside-w: 300px;
  --tabbar-h: 68px;
  --tabbar-gap: 10px;          /* отступ плавающей панели от низа экрана */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161312;
    --ink: #f3eeeb;
    --muted: #a79f9a;
    --faint: #766e69;
    --line: #2f2825;
    --soft: #201b19;
    --brand: #ff6a3d;
    --accent: #ff7a50;
    --accent-soft: #3a2219;
    --verified: #1a9df8;
    --like: #ff3b55;
    --on-accent: #1a0f0a;
    --danger: #ff7b72;
    --ok: #5cc48f;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 19px; line-height: 1.3; }
h3 { font-size: 16px; line-height: 1.35; }
p { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ───────── Каркас ───────── */
.shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, var(--main-w)) var(--aside-w);
  gap: 0 40px;
  justify-content: center;
  min-height: 100vh;
}
.nav {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 28px 16px 24px 8px;
  border-right: 1px solid var(--line);
}
.main { padding: 0 0 80px; min-width: 0; }
.aside { position: sticky; top: 0; height: 100vh; padding: 32px 0; overflow-y: auto; }

.logo { display: flex; align-items: center; gap: 10px; padding: 0 12px 28px; font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
.logo svg { width: 26px; height: 26px; flex: none; }

.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: var(--muted); font-weight: 500;
}
.nav-link:hover { background: var(--soft); color: var(--ink); }
.nav-link.active { color: var(--ink); }
.nav-link.active::before { content: ''; position: absolute; left: -2px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--brand); }
.nav-link.active svg { stroke-width: 2.1; }
.nav-link svg { width: 22px; height: 22px; flex: none; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}
.nav-link .badge { margin-left: auto; }

.nav-create {
  margin-top: 16px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border-radius: var(--r-full);
  background: var(--accent); color: var(--on-accent); font-weight: 600;
}
.nav-create svg { width: 18px; height: 18px; }

.topbar, .tabbar { display: none; }

/* Заголовок страницы, прилипает сверху */
.page-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.page-head h1 { font-size: 20px; }
.page-head .spacer { flex: 1; }
.back { display: grid; place-items: center; width: 36px; height: 36px; margin-left: -8px; border-radius: var(--r-full); }
.back:hover { background: var(--soft); }
.back svg { width: 20px; height: 20px; }

/* ───────── Иконки, аватары, кнопки ───────── */
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.avatar {
  flex: none; width: 36px; height: 36px; border-radius: var(--r-full);
  background: var(--soft); object-fit: cover; overflow: hidden;
  display: grid; place-items: center;
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.avatar.sm { width: 28px; height: 28px; font-size: 12px; }
.avatar.lg { width: 96px; height: 96px; font-size: 34px; }
.avatar.xl { width: 120px; height: 120px; font-size: 40px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--r-full);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, opacity .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-line { border-color: var(--line); background: var(--bg); }
.btn-line:hover { background: var(--soft); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--ink); background: var(--soft); }
.btn-danger { color: var(--danger); border-color: var(--line); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-full); color: var(--muted); }
.icon-btn:hover { background: var(--soft); color: var(--ink); }

/* ───────── Формы ───────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.input, .textarea, .select {
  width: 100%; padding: 10px 14px;
  background: var(--soft); border: 1px solid transparent; border-radius: var(--r-md);
  outline: none; transition: border-color .15s, background-color .15s;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); background: var(--bg); }
.textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.hint { font-size: 13px; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 16px; }
.form-error { color: var(--danger); font-size: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 36px; height: 22px; border-radius: var(--r-full); background: var(--line); transition: background-color .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: var(--r-full); background: var(--bg); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  height: 36px; padding: 0 14px; border-radius: var(--r-full);
  border: 1px solid var(--line); font-weight: 500; font-size: 14px;
}
.chip:hover { border-color: var(--muted); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* ───────── Вкладки ───────── */
.tabs { display: flex; gap: 24px; padding: 0 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab { position: relative; padding: 14px 0; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.tab .badge { display: inline-block; margin-left: 6px; vertical-align: 1px; }

/* ───────── Лента ───────── */
.feed { display: flex; flex-direction: column; }
.item { padding: 20px; border-bottom: 1px solid var(--line); }
.item-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who b { font-weight: 600; }
.who b:hover { text-decoration: underline; text-underline-offset: 2px; }
.who small { color: var(--muted); font-size: 13px; }
.item-head .icon-btn { margin-left: auto; }
.marker { font-size: 13px; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.marker svg { width: 14px; height: 14px; }

.photo { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--soft); }
.photo img { width: 100%; max-height: 680px; object-fit: cover; }
.caption { position: relative; margin-top: 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; --lines: 2; }
.caption-name { font-weight: 600; margin-right: .4em; }
.caption-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.caption-answer { font-size: 16px; line-height: 1.6; --lines: 4; }
.question + .caption { margin-top: 0; }
.caption.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines); line-clamp: var(--lines); overflow: hidden; }
/* «ещё» — поверх конца последней строки, текст под ним плавно растворяется. */
.caption-more { position: absolute; right: 0; bottom: 0; padding-left: 56px; color: var(--muted); font: inherit; font-weight: 500;
  background: linear-gradient(90deg, transparent, var(--bg) 46px); }
.caption-more:hover { color: var(--ink); }
.item-meta { margin-left: auto; padding-right: 8px; display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 14px; white-space: nowrap; min-width: 0; }
.item-time { white-space: nowrap; }
.item-views { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.item-views svg { width: 18px; height: 18px; stroke-width: 1.8; }
@media (max-width: 400px) { .item-meta { gap: 8px; font-size: 13px; } .actions .act { padding: 0 6px; } }

/* Вопрос: реплика собеседника — книжный шрифт и линия слева. */
.question {
  margin: 0 0 14px;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--accent);
}
.question .from { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.question .from a { color: var(--ink); font-weight: 500; }
.question q {
  display: block; quotes: none;
  font-family: var(--serif); font-size: 21px; line-height: 1.38; font-weight: 500;
  letter-spacing: -0.005em; overflow-wrap: anywhere;
}
.answer-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.6; }
.answer-photo { margin-top: 14px; }

.actions { display: flex; align-items: center; gap: 6px; margin: 8px -8px 0; }
.act { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: var(--r-full); color: var(--ink); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }

.act:hover { background: var(--soft); color: var(--ink); }
.act svg { width: 24px; height: 24px; flex: none; display: block; stroke-width: 1.9; }
.act > span { line-height: 24px; font-size: 15px; }
.actions .act { padding: 0 8px; gap: 7px; }
.actions .item-meta { line-height: 24px; }
.act.liked { color: var(--like); }
.act.liked svg { fill: var(--like); stroke: var(--like); }
.act.liked svg.pop { animation: pop .3s ease-out; }
@keyframes pop { 50% { transform: scale(1.25); } }
.actions .grow { flex: 1; }
.time { color: var(--faint); font-size: 13px; }

/* Реклама в ленте */
.ad-card { display: grid; grid-template-columns: 1fr; gap: 12px; }
.ad-card .photo img { max-height: 340px; }
.ad-card h3 { font-size: 17px; }
.ad-card .row { margin-top: 2px; }

.feed-note { padding: 14px 20px; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--soft); }
.more { display: flex; justify-content: center; padding: 24px; }

/* Пустые состояния и загрузка */
.empty { padding: 64px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.empty p { color: var(--muted); max-width: 36ch; }
.loader { display: flex; justify-content: center; padding: 40px; }
.loader span { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Профиль ───────── */
.profile { padding: 32px 20px 24px; display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; align-items: center; }
.profile h1 { font-size: 24px; }
.profile .handle { color: var(--muted); margin-top: 2px; }
.profile .bio { grid-column: 1 / -1; margin-top: 12px; white-space: pre-wrap; max-width: 60ch; }
.counts { grid-column: 1 / -1; display: flex; gap: 28px; margin-top: 14px; }
.counts a, .counts span { color: var(--muted); }
.counts b { color: var(--ink); font-weight: 600; margin-right: 4px; }
.profile-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 18px; }

/* Форма вопроса в профиле — главный вход в «разговор» */
.ask { margin: 0 20px 24px; padding: 18px 18px 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.ask textarea {
  width: 100%; border: 0; outline: none; resize: none; background: none; padding: 0;
  font-family: var(--serif); font-size: 19px; line-height: 1.45; min-height: 56px;
}
.ask textarea::placeholder { color: var(--faint); }
.ask .row { margin-top: 10px; }
.ask .counter { margin-left: auto; font-size: 12px; color: var(--faint); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px 0; }
.grid a { position: relative; aspect-ratio: 1; background: var(--soft); overflow: hidden; }
.grid img { width: 100%; height: 100%; object-fit: cover; transition: opacity .15s; }
.grid a:hover img { opacity: .85; }

/* ───────── Пост и комментарии ───────── */
.comments { display: flex; flex-direction: column; }
.comment { display: flex; gap: 10px; padding: 12px 20px; }
.comment .body { flex: 1; min-width: 0; }
.comment .body p { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--bg); }
.comment-form .input { border-radius: var(--r-full); }

/* ───────── Входящие вопросы ───────── */
.qcard { padding: 20px; border-bottom: 1px solid var(--line); }
.qcard .question { margin-bottom: 12px; }
.qcard .reply { display: flex; flex-direction: column; gap: 10px; }
.file-pick { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; padding: 6px 10px; border-radius: var(--r-full); }
.file-pick:hover { background: var(--soft); color: var(--ink); }
.file-pick input { display: none; }
.thumb { width: 72px; height: 72px; border-radius: var(--r-sm); object-fit: cover; }

/* ───────── Уведомления ───────── */
.notif { display: flex; gap: 12px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.notif.unread { background: var(--accent-soft); }
.notif .text { flex: 1; min-width: 0; }
.notif .text b { font-weight: 600; }
.notif img.thumb { width: 44px; height: 44px; }

/* ───────── Правая колонка ───────── */
.aside-block { margin-bottom: 32px; }
.aside-block h3 { margin-bottom: 12px; font-size: 15px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.person .who { flex: 1; }
.person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aside .person small { max-width: 170px; }
.aside-foot { font-size: 12px; color: var(--faint); line-height: 1.8; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); }
.search .input { padding-left: 40px; border-radius: var(--r-full); }

/* ───────── Создание публикации ───────── */
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 220px; border: 1.5px dashed var(--line); border-radius: var(--r-md);
  color: var(--muted); cursor: pointer; padding: 24px; overflow: hidden;
}
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); }
.drop svg { width: 36px; height: 36px; }
.drop img { width: 100%; height: 100%; object-fit: contain; }
.drop.has-image { border-style: solid; padding: 0; background: var(--soft); aspect-ratio: 4 / 3; }

/* ───────── Кабинет ───────── */
.section { padding: 24px 20px; border-bottom: 1px solid var(--line); }
.section > h2 { margin-bottom: 4px; }
.section > .hint { margin-bottom: 18px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.stat { background: var(--bg); padding: 16px; }
.stat b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--muted); }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 8px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: stretch; height: 100%; gap: 6px; }
.chart .track { flex: 1; display: flex; align-items: flex-end; }
.chart .bar i { display: block; width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--accent); }
.chart .bar.zero i { background: var(--line); }
.chart .bar small { text-align: center; height: 14px; line-height: 14px; }
.chart .bar small { font-size: 11px; color: var(--faint); }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.amount.plus { color: var(--ok); }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.balance { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.notice { padding: 12px 14px; border-radius: var(--r-md); background: var(--soft); font-size: 14px; color: var(--muted); }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.plan { text-align: left; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.plan:hover { border-color: var(--muted); }
.plan.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan b { display: block; font-size: 15px; }
.plan span { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }

.pick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pick { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--soft); border: 2px solid transparent; }
.pick img { width: 100%; height: 100%; object-fit: cover; }
.pick.text { padding: 8px; font-family: var(--serif); font-size: 12px; line-height: 1.3; text-align: left; color: var(--ink); overflow: hidden; }
.pick.on { border-color: var(--accent); }

.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.active { color: var(--ok); }
.status.review { color: var(--accent); }
.status.rejected { color: var(--danger); }

.campaign { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 64px 1fr; gap: 14px; }
.campaign:last-child { border-bottom: 0; }
.campaign .thumb { width: 64px; height: 64px; }
.campaign .nums { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.campaign .nums b { color: var(--ink); font-weight: 600; }
.progress { height: 4px; background: var(--line); border-radius: 2px; margin-top: 10px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); }

.ad-preview { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }

/* ───────── Вход и регистрация ───────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: var(--accent-soft); color: var(--ink); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art > * { position: relative; }
.auth-art .brand-art { position: absolute; right: -60px; bottom: -40px; width: min(520px, 80%); height: auto; opacity: .9; pointer-events: none; }
.auth-art .logo { padding: 0; color: var(--ink); }
.auth-art .lines { display: flex; flex-direction: column; gap: 28px; max-width: 30ch; }
.auth-art q { quotes: none; font-family: var(--serif); font-size: 30px; line-height: 1.3; font-weight: 500; letter-spacing: -0.01em; }
.auth-art p { font-size: 17px; color: var(--muted); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-form .box { width: 100%; max-width: 360px; }
.auth-form h1 { margin-bottom: 6px; }
.auth-hero, .auth-foot { display: none; }
.btn-lg { height: 48px; font-size: 15px; }
.auth-alt { display: flex; flex-direction: column; gap: 14px; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-link { align-self: center; font-size: 14px; font-weight: 500; color: var(--muted); }
.auth-link:hover { color: var(--ink); }
.auth-form .input::placeholder { color: transparent; }  /* на компьютере есть подписи над полями */

/* Телефон: экран входа как в приложениях — крупный знак сверху, поля без подписей, две кнопки рядом. */
@media (max-width: 720px) {
  .auth { display: block; }
  .auth-art { display: none; }
  .auth-form { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
    padding: calc(env(safe-area-inset-top) + 40px) 24px calc(env(safe-area-inset-bottom) + 20px); }
  .auth-form .box { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 400px; }
  .auth-hero { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 36px; }
  .auth-hero svg { width: 76px; height: 76px; border-radius: 19px; box-shadow: 0 14px 32px -14px color-mix(in srgb, var(--brand) 75%, transparent); }
  .auth-hero b { margin-top: 16px; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
  .auth-hero p { margin-top: 4px; font-size: 15px; color: var(--muted); }
  .auth-title { display: none; }
  .auth-form .form { gap: 12px; }
  .auth-form .field { gap: 6px; }
  .auth-form .field > span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .auth-form .input { height: 54px; padding: 0 18px; font-size: 16px; border-radius: 16px; border-color: var(--line); background: var(--soft); }
  .auth-form .input:focus { border-color: var(--accent); background: var(--bg); }
  .auth-form .input::placeholder { color: var(--faint); }
  .auth-form .hint { padding: 0 6px; font-size: 12px; }
  .auth-form .btn-lg { height: 52px; font-size: 16px; }
  .auth-form .form > .btn-primary { margin-top: 6px; }
  .auth-alt { gap: 16px; margin-top: 4px; }
  .auth-alt .btn-line { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); }
  .auth-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 28px; font-size: 15px; font-weight: 600; letter-spacing: -0.02em; color: var(--muted); }
  .auth-foot svg { width: 20px; height: 20px; border-radius: 5px; }
}

/* ───────── Модальные окна и уведомления ───────── */
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgb(10 12 18 / .45); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; background: var(--bg); border-radius: 14px; padding: 22px; }
.modal h2 { margin-bottom: 14px; }
.menu { display: flex; flex-direction: column; }
.menu button { text-align: left; padding: 12px 4px; border-bottom: 1px solid var(--line); font-weight: 500; }
.menu button:last-child { border-bottom: 0; }
.menu button.danger { color: var(--danger); }
@keyframes fade { from { opacity: 0; } }

#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: var(--r-full); font-size: 14px; font-weight: 500; animation: fade .2s; }
.toast.error { background: var(--danger); color: #fff; }

/* ───────── Адаптивность ───────── */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 76px minmax(0, var(--main-w)); gap: 0 32px; }
  .aside { display: none; }
  .nav { padding: 24px 12px; align-items: center; }
  .logo { padding: 0 0 24px; }
  .logo span, .nav-link span:not(.badge), .nav-create span { display: none; }
  .nav-link { padding: 12px; }
  .nav-link .badge { position: absolute; top: 4px; right: 2px; margin: 0; }
  .nav-create { width: 44px; padding: 0; }
}

@media (max-width: 720px) {
  .shell { display: block; }
  .nav { display: none; }
  .main { padding-bottom: calc(var(--tabbar-h) + var(--tabbar-gap) + 24px + env(safe-area-inset-bottom)); }
  /* Шапка на телефоне. На главной — знак и пара кнопок; на остальных страницах её заменяет заголовок страницы. */
  .topbar {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 10px 0 16px;
    position: sticky; top: 0; z-index: 6; background: var(--bg);
  }
  .shell:has(.page-head:not(.root)) .topbar { display: none; }
  .topbar .logo { padding: 0; font-size: 19px; }
  .topbar .logo svg { width: 30px; height: 30px; }
  .topbar .logo span { display: inline; }
  .topbar-actions { display: flex; gap: 2px; }
  .topbar .icon-btn, .page-head .icon-btn { position: relative; width: 42px; height: 42px; color: var(--ink); }
  .topbar .icon-btn svg, .page-head .icon-btn svg { width: 24px; height: 24px; }
  .topbar .badge, .page-head .icon-btn .badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
    font-size: 11px; line-height: 18px; box-shadow: 0 0 0 2px var(--bg); }
  /* Нижнее меню — плавающая панель: активный пункт на персиковой подложке с точкой, «+» — оранжевая плитка в цвет знака. */
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
    position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabbar-gap) + env(safe-area-inset-bottom)); z-index: 10;
    height: var(--tabbar-h); padding: 0 8px; border-radius: 34px;
    background: var(--bg);
    border: 1px solid var(--line);
    box-shadow: 0 12px 32px -14px rgb(31 26 23 / .28), 0 2px 6px -2px rgb(31 26 23 / .08);
  }
  .tabbar a {
    position: relative; justify-self: center; display: grid; place-items: center;
    width: 52px; height: 52px; border-radius: 18px; color: var(--muted);
    transition: background-color .15s, color .15s, transform .1s;
  }
  .tabbar a:active { transform: scale(.94); }
  .tabbar a.active { color: var(--accent); background: var(--accent-soft); }
  .tabbar a.active::after {
    content: ''; position: absolute; bottom: -3px; left: 50%; width: 10px; height: 5px; margin-left: -5px;
    border-radius: 3px; background: var(--accent);
  }
  .tabbar svg { width: 26px; height: 26px; stroke-width: 1.8; }
  .tabbar a.active svg { stroke-width: 2.1; }
  .tabbar a.tab-create {
    width: 60px; height: 56px; border-radius: 22px; color: #fff;
    background: linear-gradient(160deg, var(--brand), var(--accent));
    box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 70%, transparent);
  }
  .tabbar a.tab-create svg { width: 28px; height: 28px; stroke-width: 2.2; }
  .tabbar a.tab-create::after { display: none; }
  .tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
  /* Заголовок страницы: «назад» и действия — круглые мягкие кнопки, название — по центру. */
  .page-head { top: 0; min-height: 56px; padding: 0 16px; gap: 8px; background: var(--bg); backdrop-filter: none; }
  .page-head h1 { font-size: 24px; letter-spacing: -0.02em; }
  .page-head:has(.back) { padding: 0 8px; }
  .page-head:has(.back) h1 { position: absolute; left: 64px; right: 64px; text-align: center; font-size: 17px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
  .page-head .back { width: 42px; height: 42px; margin: 0; background: var(--soft); }
  .page-head .back svg { width: 22px; height: 22px; }
  .page-head:has(.back) .icon-btn { background: var(--soft); }
  .head-actions { gap: 6px; }
  .page-head.root { display: none; }
  .item, .qcard, .section { padding-left: 16px; padding-right: 16px; }
  .item { padding-top: 16px; padding-bottom: 16px; }
  .question q { font-size: 19px; }
  .profile { padding: 24px 16px 20px; gap: 6px 18px; }
  .profile .avatar.xl { width: 84px; height: 84px; font-size: 30px; }
  .ask { margin: 0 16px 20px; }
  .tabs { padding: 0 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .plans { grid-template-columns: 1fr; }
  .pick-grid { grid-template-columns: repeat(3, 1fr); }
  .modal-bg { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 16px 16px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Ответ без фото в сетке профиля */
.grid .pick.text, span.thumb.pick.text {
  display: grid; place-items: center; width: 100%; height: 100%;
  padding: 12px; border: 0; border-radius: 0;
  background: var(--accent-soft); color: var(--ink);
  font-family: var(--serif); font-size: 15px; line-height: 1.35; text-align: center;
}
span.thumb.pick.text { width: 64px; height: 64px; border-radius: var(--r-sm); padding: 6px; font-size: 20px; color: var(--accent); }
span.thumb.pick.text svg { width: 24px; height: 24px; }

/* Синяя галочка */
.name { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; vertical-align: bottom; }
.vmark { flex: none; display: inline-block; }
h1.name { display: flex; gap: 8px; }
.vmark-btn { display: inline-grid; place-items: center; border-radius: 50%; }
.vmark-btn:hover { opacity: .85; }
.verify-hero { display: flex; gap: 16px; align-items: flex-start; }
.verify-hero .vmark { margin-top: 2px; }
.checklist { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.checklist .dot { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex: none; border: 1.5px solid var(--line); }
.checklist .dot svg { width: 14px; height: 14px; stroke-width: 2.4; }
.checklist li.done .dot { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.checklist li .small { margin-left: auto; }
.doc-view { max-width: 100%; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--soft); }
.req-meta { display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; font-size: 14px; }
.req-meta dt { color: var(--muted); }
.req-meta dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) { .req-meta { grid-template-columns: 1fr; gap: 2px; } .req-meta dd { margin-bottom: 8px; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Поделиться (окно в духе Instagram) */
.modal:has(.share-sheet) { max-width: 480px; padding-bottom: 12px; }
.share-sheet { display: flex; flex-direction: column; gap: 14px; }
.share-search { border-radius: var(--r-md); }
.share-people { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 8px; max-height: 300px; overflow-y: auto; padding: 4px 2px; }
.share-person { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 4px 0; border-radius: var(--r-md); }
.share-ava { position: relative; }
.share-ava .avatar { width: 60px; height: 60px; font-size: 22px; transition: transform .12s; }
.share-person.on .share-ava .avatar { transform: scale(.92); }
.share-tick { position: absolute; right: -2px; bottom: -2px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; border: 2px solid var(--bg); opacity: 0; transform: scale(.6); transition: opacity .12s, transform .12s; }
.share-tick svg { width: 13px; height: 13px; stroke-width: 3; }
.share-person.on .share-tick { opacity: 1; transform: none; }
.share-name { font-size: 12px; max-width: 100%; text-align: center; }
.share-name .name { justify-content: center; }
.share-name .vmark { width: 12px !important; height: 12px !important; }
.share-empty { grid-column: 1 / -1; text-align: center; padding: 16px 0; }
.share-send { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; border-top: 1px solid var(--line); padding-top: 14px; }
.share-apps-row { display: flex; gap: 6px; overflow-x: auto; padding: 14px 0 4px; border-top: 1px solid var(--line); scrollbar-width: none; }
.share-app { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; text-align: center; line-height: 1.25; color: var(--ink); }
.share-app-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.share-app-icon svg { width: 24px; height: 24px; }
.share-app-icon b { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.share-app:hover .share-app-icon { filter: brightness(.95); }

/* ───────── Личные сообщения ───────── */
.thread { display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
.thread:hover { background: var(--soft); }
.thread .avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.thread-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thread-body > .name { font-weight: 500; }
.thread-last { display: flex; gap: 8px; color: var(--muted); font-size: 14px; min-width: 0; }
.thread-last .clip { min-width: 0; }
.thread.unread .thread-body > .name, .thread.unread .thread-last .clip { font-weight: 600; color: var(--ink); }
.thread .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.dm-pick { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.dm-person { width: 100%; text-align: left; padding: 8px 4px; border-radius: var(--r-md); }
.dm-person:hover { background: var(--soft); }

.chat { display: flex; flex-direction: column; min-height: 100vh; }
.chat-head { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; min-width: 0; }
.chat-intro { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px 8px; text-align: center; }
.chat-intro > .name { font-size: 18px; font-weight: 600; }
.chat-intro .btn { margin-top: 10px; }
.msgs { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 16px 20px 12px; }
.msg { display: flex; align-items: center; gap: 6px; max-width: 78%; }
.msg.mine { align-self: flex-end; }
.bubble { padding: 9px 14px; border-radius: 20px; background: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; min-width: 0; }
.msg.mine .bubble { background: var(--accent); color: #fff; }
.bubble.deleted { background: none; border: 1px solid var(--line); color: var(--muted); font-style: italic; }
.msg.mine .bubble.deleted { color: var(--muted); background: none; }
.bubble.has-post { padding: 6px; display: flex; flex-direction: column; gap: 6px; }
.bubble.has-post .msg-text { padding: 0 8px 4px; }
.msg-del { visibility: hidden; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: var(--faint); flex: none; }
.msg-del svg { width: 14px; height: 14px; }
.msg:hover .msg-del, .msg-del:focus-visible { visibility: visible; }
.msg-del:hover { background: var(--soft); color: var(--ink); }
.msg-time { align-self: center; font-size: 12px; color: var(--faint); margin: 12px 0 6px; }
.seen { align-self: flex-end; font-size: 12px; color: var(--faint); margin-top: 2px; }
.msg-post { display: flex; flex-direction: column; gap: 8px; width: 240px; max-width: 100%; border-radius: 14px; overflow: hidden; background: var(--bg); color: var(--ink); padding-bottom: 8px; }
.msg-post-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px 0; font-size: 13px; font-weight: 600; min-width: 0; }
.msg-post img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.msg-post-q { padding: 0 10px; font-family: var(--serif); font-size: 15px; line-height: 1.35; border-left: 2px solid var(--accent); margin: 0 10px; }
.msg-post-text { padding: 0 10px; font-size: 13px; color: var(--muted); }
.composer-wrap { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); z-index: 4; }
.composer { display: flex; align-items: flex-end; gap: 4px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); }
.composer-input { resize: none; border-radius: 22px; padding: 10px 16px; min-height: 44px; max-height: 140px; line-height: 1.4; }
.composer-send { height: 44px; padding: 0 6px; color: var(--accent); font-weight: 600; }
.composer-send:disabled { opacity: .4; cursor: default; }
@media (max-width: 720px) {
  .thread { padding: 10px 16px; }
  .msgs { padding: 12px 16px; }
  .msg { max-width: 85%; }
  .msg.reveal .msg-del { visibility: visible; }
  .chat { min-height: calc(100vh - 56px); }
  .composer-wrap { bottom: calc(var(--tabbar-h) + var(--tabbar-gap) + env(safe-area-inset-bottom, 0px)); }
  .composer { padding: 10px 12px; }
  .composer-tool { width: 34px; height: 34px; }
}

/* ───────── Социальные сети ───────── */
.social-icon { display: inline-grid; place-items: center; flex: none; border-radius: 30%; color: #fff; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.social-icon svg { width: 50%; height: 50%; stroke: #fff; }
.social-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.social-row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin: 0 -12px; border-radius: var(--r-md); }
.social-row:hover { background: var(--soft); }
.social-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.social-text b { font-weight: 600; }
.social-go { width: 18px; height: 18px; color: var(--faint); flex: none; }
.social-edit { display: flex; flex-direction: column; gap: 10px; }
.social-edit-row { display: grid; grid-template-columns: 36px 150px minmax(0, 1fr) 36px; gap: 10px; align-items: center; }
@media (max-width: 720px) { .social-edit-row { grid-template-columns: 36px minmax(0, 1fr) 36px; } .social-edit-row .input { grid-column: 1 / -1; grid-row: 2; } }
.grid a { position: relative; }
.tile-badge { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; display: grid; place-items: center; color: #fff; filter: drop-shadow(0 1px 2px rgb(0 0 0 / .45)); }
.tile-badge svg { width: 20px; height: 20px; }
.grid .pick.text + .tile-badge { color: var(--accent); filter: none; }

/* ───────── Вложения в сообщениях ───────── */
.composer-tool { flex: none; width: 40px; height: 44px; border-radius: 50%; color: var(--ink); }
.composer-tool svg { width: 22px; height: 22px; }
.composer-input { flex: 1; min-width: 0; margin: 0 4px; }
.composer.recording { align-items: center; gap: 10px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--like); flex: none; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 42px; }
.rec-levels { flex: 1; display: flex; align-items: center; gap: 3px; height: 28px; min-width: 0; overflow: hidden; }
.rec-levels i { flex: 1; min-width: 2px; max-width: 5px; height: 10%; border-radius: 2px; background: var(--accent); transition: height .08s; }
.rec-send { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.rec-send svg { width: 20px; height: 20px; }
.rec-cancel { color: var(--like); }

.tray { display: flex; gap: 8px; padding: 12px 20px 0; overflow-x: auto; }
.tray-item { position: relative; flex: none; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--soft); }
.tray-item img, .tray-item video { width: 100%; height: 100%; object-fit: cover; }
.tray-file { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; padding: 8px; font-size: 11px; color: var(--muted); }
.tray-file b { color: var(--ink); font-weight: 600; }
.tray-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .6); color: #fff; }
.tray-x svg { width: 12px; height: 12px; stroke-width: 2.4; }

.msg.sending { opacity: .7; }
.spinner { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }

/* Фото и видео без подписи — без «пузыря», как в Instagram */
.bubble.has-att { padding: 0; background: none; overflow: hidden; }
.msg.mine .bubble.has-att { background: none; }
.bubble.has-att.with-text, .bubble.att-file, .bubble.att-voice { padding: 6px; background: var(--soft); border-radius: 20px; }
.msg.mine .bubble.has-att.with-text, .msg.mine .bubble.att-file, .msg.mine .bubble.att-voice { background: var(--accent); }
.bubble.has-att.with-text .msg-text { display: block; padding: 6px 8px 2px; }
.att-img { display: block; border-radius: 16px; overflow: hidden; }
.bubble.has-att { width: fit-content; max-width: 100%; }
.bubble.att-image.with-text, .bubble.att-video.with-text { width: 272px; max-width: 100%; }
.att-img { width: 100%; }
.att-img img { display: block; width: 100%; max-width: 260px; max-height: 340px; object-fit: cover; }
.bubble.with-text .att-img img, .bubble.with-text .att-video { max-width: 100%; width: 100%; }
.att-video { display: block; max-width: min(280px, 100%); max-height: 360px; border-radius: 16px; background: #000; }
.att-file { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; min-width: 200px; max-width: 280px; color: inherit; }
.att-file-icon { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--bg); color: var(--accent); }
.msg.mine .att-file-icon { background: rgb(255 255 255 / .22); color: #fff; }
.att-file-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.att-file-text span { font-size: 12px; opacity: .75; }

.voice { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; width: 250px; max-width: 100%; }
.voice-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent); color: #fff; }
.msg.mine .voice-btn { background: #fff; color: var(--accent); }
.voice-btn svg { width: 18px; height: 18px; fill: currentColor; stroke: currentColor; }
.voice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.voice-wave { display: flex; align-items: center; gap: 2px; height: 26px; cursor: pointer; }
.voice-wave i { flex: 1; min-width: 2px; border-radius: 2px; background: currentColor; opacity: .35; }
.voice-wave i.on { opacity: 1; }
.msg:not(.mine) .voice-wave i { color: var(--accent); }
.voice-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.voice-time { font-variant-numeric: tabular-nums; opacity: .8; }
.voice-speed { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: rgb(127 127 127 / .2); color: inherit; }

.att-note { position: relative; display: block; width: 220px; height: 220px; border-radius: 50%; overflow: hidden; background: #000; }
.att-note video { width: 100%; height: 100%; object-fit: cover; }
.note-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.note-ring circle { fill: none; stroke: #fff; stroke-width: 3; stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; transition: stroke-dashoffset .25s linear; }
.att-note.loud .note-ring circle { opacity: .9; }
.note-time { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; background: rgb(0 0 0 / .5); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.note-mute { width: 14px; height: 14px; }
.att-note.loud .note-mute { display: none; }

.lightbox { display: flex; flex-direction: column; gap: 12px; }
.lightbox img { max-height: 75vh; width: 100%; object-fit: contain; border-radius: var(--r-md); background: var(--soft); cursor: zoom-out; }

/* Окно записи видеосообщения */
.vn { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 4px; }
.vn-circle { position: relative; width: min(280px, 70vw); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #000; }
.vn-video { width: 100%; height: 100%; object-fit: cover; }
.vn-video.mirror { transform: scaleX(-1); }
.vn-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.vn-ring circle { fill: none; stroke: var(--like); stroke-width: 3; stroke-dasharray: 100; stroke-dashoffset: 100; }
.vn-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.vn-hint { text-align: center; max-width: 34ch; }
.vn-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.vn-rec { width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--line); display: grid; place-items: center; }
.vn-rec span { width: 44px; height: 44px; border-radius: 50%; background: var(--like); transition: all .15s; }
.vn-rec.on span { width: 24px; height: 24px; border-radius: 6px; }
@media (max-width: 720px) { .tray { padding: 10px 12px 0; } .att-note { width: 190px; height: 190px; } }

/* Мотив логотипа: точки-люди, соединённые линиями */
.empty .brand-mini { width: 56px; height: 56px; margin-bottom: 4px; }
.feed-note { background: var(--accent-soft); color: var(--ink); }
.feed-note a b { color: var(--accent); }
.auth-art .logo span { display: inline; }

/* Админка: пользователи */
.user-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.user-row-main > .row > p { min-width: 0; }
.user-actions { margin-top: 6px; gap: 8px; }
.user-row.is-deleted .avatar { filter: grayscale(1); opacity: .6; }
.status.gone { color: var(--faint); }
.del-options { display: flex; flex-direction: column; gap: 8px; }
.del-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.del-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.del-option.hard:has(input:checked) { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--bg)); }
.del-option input { margin-top: 4px; accent-color: var(--accent); }
.del-option.hard input { accent-color: var(--danger); }
.del-option > span { display: flex; flex-direction: column; gap: 2px; }

.timer { font-size: 13px; color: var(--accent); }
.timer b { font-variant-numeric: tabular-nums; font-weight: 600; }
#del-until { margin-top: 2px; }

/* ── Поддержка ── */

.sup-avatar { display: inline-grid; place-items: center; padding: 0; background: none; overflow: hidden; flex: none; }
.sup-avatar svg { width: 100%; height: 100%; display: block; }
.sup-avatar.sm { width: 28px; height: 28px; }
.sup-avatar.lg { width: 56px; height: 56px; }
.sup-hero { display: flex; align-items: center; gap: 16px; padding: 24px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-soft), var(--bg)); }
.sup-hero h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin-bottom: 2px; }
.sup-list .thread { border-bottom: 1px solid var(--line); }
.sup-row { align-items: flex-start; }
.sup-row .thread-body { gap: 4px; }
.sup-row .thread-body .row.between { gap: 12px; }
.sup-row .name { font-weight: 600; min-width: 0; }
.sup-row .status { flex: none; font-size: 12px; }
.sup-row-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); flex: none; }
.sup-row-icon svg { width: 22px; height: 22px; }
.sup-row > .avatar { width: 44px; height: 44px; flex: none; }
.sup-row > .badge { align-self: center; flex: none; }
.sup-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--ink); }
.sup-row-meta .status { font-size: 12px; }
.sup-wait { color: var(--accent) !important; font-weight: 500; }
.sup-none { padding: 32px 20px; text-align: center; }
.sup-filters { gap: 12px; }

.sup-chat { min-height: 100vh; }
.sup-back { display: inline-flex; align-items: center; gap: 4px; padding: 16px 20px 0; color: var(--muted); }
.sup-back svg { width: 16px; height: 16px; }
.sup-back:hover { color: var(--ink); }
.sup-head { flex-wrap: wrap; gap: 6px 14px; padding-top: 10px; padding-bottom: 10px; }
.sup-head h1 { font-size: 17px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-head-main { min-width: 0; flex: 1 1 220px; }
.sup-head-main p { margin-top: 1px; }
.sup-head-side { gap: 8px 12px; }
.sup-side { padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--soft); display: flex; flex-direction: column; gap: 12px; }
.sup-card { display: flex; flex-direction: column; gap: 12px; }
.sup-card .person { gap: 12px; }
.sup-card .person .who { flex: 1; min-width: 0; }
.sup-meta { grid-template-columns: 110px 1fr; font-size: 13px; }
.sup-match { gap: 8px; margin: 8px 0; }
.sup-others summary { cursor: pointer; font-size: 14px; font-weight: 500; }
.sup-others a { padding: 8px 0; font-size: 14px; gap: 12px; border-bottom: 1px solid var(--line); }
.sup-others a:last-child { border-bottom: 0; }
.sup-link { margin: 16px 20px 0; padding: 14px 16px; border-radius: 14px; background: var(--soft); display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.sup-link.fresh { background: var(--accent-soft); }
.sup-link .input { flex: 1; min-width: 0; font-size: 13px; }

.sup-thread { flex: 1; display: flex; flex-direction: column; }
.sup-msgs { gap: 6px; }
.sup-msg { align-items: flex-end; gap: 8px; }
.sup-msg > .avatar { width: 28px; height: 28px; font-size: 12px; flex: none; }
.sup-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sup-msg.mine .sup-col { align-items: flex-end; }
.sup-who { font-size: 12px; color: var(--muted); padding: 0 12px; }
.sup-event { align-self: center; margin: 10px 0; padding: 5px 12px; border-radius: var(--r-full); background: var(--soft); color: var(--muted); font-size: 12px; text-align: center; }
.sup-quick { display: flex; gap: 6px; padding: 10px 20px 0; overflow-x: auto; scrollbar-width: none; }
.sup-quick .chip { flex: none; height: 30px; font-size: 13px; }
.sup-rate { padding: 12px 20px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: 14px; }
.sup-rate .btn svg { width: 16px; height: 16px; }
.sup-form-tray { padding: 12px 0 0; }
@media (max-width: 720px) {
  .sup-hero, .sup-side { padding-left: 16px; padding-right: 16px; }
  .sup-head-side { width: 100%; padding-left: 36px; }
  .sup-head h1 { font-size: 16px; }
  .sup-quick, .sup-rate { padding-left: 12px; padding-right: 12px; }
  .sup-link { margin: 12px 16px 0; }
  .sup-chat { min-height: calc(100vh - 56px); }
  .sup-meta { grid-template-columns: 1fr; }
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
.sup-row .thread-last .time { flex: none; white-space: nowrap; }
.sup-headbox { display: contents; }

/* ── Запросы на переписку ── */
.dm-hint { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.dm-pending { padding: 10px 20px 0; font-size: 13px; color: var(--muted); }
.dm-request { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)); text-align: center; }
.dm-request p { line-height: 1.5; }
.dm-request .row { justify-content: center; }
.dm-request .btn { min-width: 140px; }
@media (max-width: 720px) {
  .dm-hint, .dm-pending { padding-left: 16px; padding-right: 16px; }
  .dm-request .btn { flex: 1; min-width: 0; }
}
.thread-last .time { flex: none; white-space: nowrap; }
.top-stats { gap: 12px; } .top-stats .row { gap: 4px; } .top-stats svg { width: 16px; height: 16px; }
/* Последняя плитка растягивается на неполный ряд, чтобы не оставалось пустых серых ячеек. */
.stats > :last-child:nth-child(3n+1) { grid-column: span 3; }
.stats > :last-child:nth-child(3n+2) { grid-column: span 2; }
@media (max-width: 720px) {
  .stats > :last-child:nth-child(3n+1), .stats > :last-child:nth-child(3n+2) { grid-column: auto; }
  .stats > :last-child:nth-child(2n+1) { grid-column: span 2; }
}

/* ── Меню профиля ── */
.sheet-menu { display: flex; flex-direction: column; }
.sheet-user { display: flex; align-items: center; gap: 12px; padding: 4px 4px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet-item { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-radius: var(--r-md); font-weight: 500; text-align: left; }
.sheet-item:hover { background: var(--soft); }
.sheet-item svg { width: 22px; height: 22px; color: var(--muted); }
.sheet-item.danger, .sheet-item.danger svg { color: var(--danger); }
.sheet-sep { height: 1px; background: var(--line); margin: 6px 0; }
.sheet-cancel { margin-top: 8px; padding: 12px; border-radius: var(--r-full); background: var(--soft); font-weight: 600; }
.sheet-cancel:hover { background: var(--line); }

/* ── Вид публикаций в профиле ── */
.view-bar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.view-bar[hidden] { display: none; }
@media (max-width: 720px) { .view-bar { padding: 8px 16px; } }
.view-switch { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-full); background: var(--soft); flex: none; }
.view-btn { display: grid; place-items: center; width: 32px; height: 28px; border-radius: var(--r-full); color: var(--faint); }
.view-btn svg { width: 18px; height: 18px; }
.view-btn:hover { color: var(--ink); }
.view-btn.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }

/* ── Закрытый профиль и близкие друзья ── */
.private-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; font-size: 13px; color: var(--muted); vertical-align: 1px; }
.private-chip svg { width: 14px; height: 14px; }
.private-wall { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 32px 64px; text-align: center; border-top: 1px solid var(--line); }
.private-wall h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; }
.private-wall p { max-width: 36ch; }
.private-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; border: 2px solid var(--ink); }
.private-icon svg { width: 32px; height: 32px; stroke-width: 1.6; }
.close-badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px 0 7px; border-radius: var(--r-full); background: var(--close); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }
.close-badge svg { width: 13px; height: 13px; fill: currentColor; stroke: currentColor; }
.item-head .close-badge { margin-left: auto; }
.item-head .close-badge + .icon-btn { margin-left: 0; }
.aud { display: flex; flex-direction: column; gap: 8px; }
.aud-row { display: flex; gap: 8px; flex-wrap: wrap; }
.aud-opt { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--line); font-weight: 500; font-size: 14px; }
.aud-opt svg { width: 18px; height: 18px; }
.aud-opt:hover { border-color: var(--muted); }
.aud-opt.on { border-color: var(--ink); background: var(--soft); }
.aud-close.on { border-color: var(--close); background: color-mix(in srgb, var(--close) 10%, var(--bg)); color: var(--close); }
.aud-close.on svg { fill: currentColor; }
.aud-hint a { color: var(--accent); font-weight: 600; }
.reply .aud { margin: 10px 0; }
.btn-close { background: var(--close); color: #fff; }
.btn-close:hover { background: color-mix(in srgb, var(--close) 88%, var(--ink)); }
.cf-hero { display: flex; gap: 14px; align-items: flex-start; padding: 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--close) 7%, var(--bg)); }
.cf-hero p { font-size: 14px; line-height: 1.5; }
.cf-hero-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--close); color: #fff; flex: none; }
.cf-hero-icon svg { width: 22px; height: 22px; fill: currentColor; }
.cf-hero-icon.sm { width: 36px; height: 36px; }
.cf-hero-icon.sm svg { width: 18px; height: 18px; }
.cf-search { margin: 12px 0 8px; }
.cf-person { padding: 8px 0; }
.cf-person .who { flex: 1; min-width: 0; }
.cf-ava { position: relative; flex: none; }
.cf-ava.on .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--close); }
.cf-star { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--close); color: #fff; border: 2px solid var(--bg); }
.cf-star svg { width: 10px; height: 10px; fill: currentColor; }
.cf-link { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.cf-link:hover { background: var(--soft); }
.cf-link .chev { transform: rotate(180deg); color: var(--faint); }
.sheet-item.close-item svg { color: var(--close); fill: var(--close); }
.follow-reqs { padding: 16px 20px; border-bottom: 1px solid var(--line); background: var(--accent-soft); }
.follow-reqs h2 { font-size: 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.fr-row { flex-wrap: wrap; padding: 8px 0; }
.fr-row .who { flex: 1; min-width: 140px; }
.fr-actions { gap: 8px; }
.fr-done { padding: 8px 0; }
@media (max-width: 720px) { .cf-hero, .follow-reqs { padding-left: 16px; padding-right: 16px; } }
.cf-link .grow { flex: 1; min-width: 0; }

/* ── Почта в админке ── */
.mail-stats { margin: 14px 0 18px; }
.mail-preview { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 18px; background: #F7F4F2; }
.mail-preview-bar { padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.mail-preview-bar a { color: var(--accent); font-weight: 600; }
.mail-frame { display: block; width: 100%; height: 640px; border: 0; background: #F7F4F2; }
.mail-test .input { flex: 1; min-width: 200px; }
.mail-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.mail-row:last-child { border-bottom: 0; }
.mail-row .grow { flex: 1; min-width: 0; }
.mail-row .status { flex: none; font-size: 12px; }
.mail-row .time { flex: none; color: var(--faint); font-size: 12px; white-space: nowrap; }
@media (max-width: 720px) { .mail-frame { height: 560px; } .mail-row { flex-wrap: wrap; } }

/* ───────── Истории ───────── */
.stories { border-bottom: 1px solid var(--line); }
.stories-row { display: flex; gap: 14px; padding: 14px 16px 12px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.stories-row::-webkit-scrollbar { display: none; }
.story-item { flex: none; width: 74px; display: flex; flex-direction: column; align-items: center; gap: 6px; scroll-snap-align: start; }
.story-ring { position: relative; display: grid; place-items: center; width: 72px; height: 72px; padding: 3px; border-radius: 50%;
  background: var(--line); transition: transform .12s; }
.story-ring:active { transform: scale(.95); }
.story-ring.new, .story-ring.own { background: conic-gradient(from 210deg, #ffb38a, var(--brand), var(--accent), var(--brand), #ffb38a); }
.story-ring.none { background: transparent; }
.story-ring.none .avatar { box-shadow: inset 0 0 0 1px var(--line); }
.avatar.story { width: 100%; height: 100%; font-size: 24px; border: 3px solid var(--bg); }
.story-add { position: absolute; right: -1px; bottom: -1px; display: grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 3px var(--bg); cursor: pointer; }
.story-add svg { width: 14px; height: 14px; stroke-width: 2.6; }
.story-name { max-width: 100%; font-size: 12px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-ring.seen + .story-name { color: var(--muted); }

/* Просмотр: фото на размытом фоне из того же снимка, полоски прогресса сверху. */
.story-view { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #140f0d; color: #fff;
  animation: story-in .18s ease-out; }
@keyframes story-in { from { opacity: 0; transform: scale(.98); } }
.story-frame { position: relative; width: 100%; height: 100%; max-width: 480px; overflow: hidden; }
@media (min-width: 721px) { .story-frame { height: min(92vh, 860px); border-radius: 22px; box-shadow: 0 30px 80px -20px rgb(0 0 0 / .6); } }
.story-stage, .story-tap { position: absolute; inset: 0; }
.story-backdrop { position: absolute; inset: -120px; width: calc(100% + 240px); height: calc(100% + 240px); object-fit: cover;
  max-width: none; filter: blur(36px) brightness(.55) saturate(1.2); }
.story-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.story-tap { z-index: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.story-top { position: absolute; left: 0; right: 0; top: 0; z-index: 2; padding: calc(env(safe-area-inset-top) + 10px) 12px 24px;
  background: linear-gradient(rgb(0 0 0 / .45), transparent); }
.story-bars { display: flex; gap: 4px; margin-bottom: 12px; }
.story-seg { flex: 1; height: 3px; border-radius: 2px; background: rgb(255 255 255 / .32); overflow: hidden; }
.story-seg i { display: block; height: 100%; background: #fff; }
.story-head { display: flex; align-items: center; gap: 10px; }
.story-head .avatar { box-shadow: 0 0 0 2px rgb(255 255 255 / .9); }
.story-who { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; font-weight: 600; font-size: 14px; }
.story-who a, .story-who > span { color: #fff; min-width: 0; }
.story-who small { color: rgb(255 255 255 / .7); font-weight: 400; font-size: 13px; white-space: nowrap; }
.story-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; }
.story-btn:hover { background: rgb(255 255 255 / .12); }
.story-btn svg { width: 22px; height: 22px; }
.story-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; justify-content: center; gap: 10px;
  padding: 28px 16px calc(env(safe-area-inset-bottom) + 18px); background: linear-gradient(transparent, rgb(0 0 0 / .45)); }
.story-foot .btn { flex: 1; max-width: 220px; }
.story-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-full);
  background: rgb(255 255 255 / .16); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: #fff; font-weight: 600; font-size: 14px; }
.story-pill svg { width: 18px; height: 18px; }
.story-cancel { background: rgb(255 255 255 / .16); color: #fff; }
.story-viewers { padding: 0; }
.admin-item { color: var(--accent); }
.story-head .avatar { width: 34px; height: 34px; font-size: 14px; }
.admin-item svg { color: var(--accent); }
