/* Голубь — стили */

:root {
  --bg: #ebe8e0;
  --panel: #f6f4ef;
  --surface: #ffffff;
  --raised: #ffffff;
  --ink: #1b1a17;
  --ink-2: #4a4740;
  --muted: #8a857a;
  --line: #d9d4c8;
  --line-soft: #e6e2d8;
  --hover: rgba(27, 26, 23, 0.05);
  --press: rgba(27, 26, 23, 0.09);
  --accent: #d9472b;
  --accent-hover: #c63d23;
  --accent-ink: #ffffff;
  --accent-soft: rgba(217, 71, 43, 0.1);
  --out-bg: #1f1e1b;
  --out-ink: #f3f0e8;
  --out-muted: #9e998d;
  --out-quote: rgba(243, 240, 232, 0.08);
  --sel-bg: #1f1e1b;
  --sel-ink: #f3f0e8;
  --sel-muted: #a19c90;
  --dot: rgba(27, 26, 23, 0.07);
  --ok: #3e7c5a;
  --scrim: rgba(20, 19, 17, 0.42);
  --shadow: 0 1px 0 rgba(27, 26, 23, 0.04), 0 12px 32px -12px rgba(27, 26, 23, 0.22);

  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --sidebar: 368px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #121210;
    --panel: #181816;
    --surface: #22211e;
    --raised: #24231f;
    --ink: #ece8df;
    --ink-2: #bdb8ac;
    --muted: #7f7a70;
    --line: #2e2d29;
    --line-soft: #262521;
    --hover: rgba(236, 232, 223, 0.05);
    --press: rgba(236, 232, 223, 0.09);
    --accent: #e8583a;
    --accent-hover: #f06a4d;
    --accent-soft: rgba(232, 88, 58, 0.14);
    --out-bg: #ece8df;
    --out-ink: #1b1a17;
    --out-muted: #6e695f;
    --out-quote: rgba(27, 26, 23, 0.07);
    --sel-bg: #ece8df;
    --sel-ink: #141412;
    --sel-muted: #6e695f;
    --dot: rgba(236, 232, 223, 0.05);
    --ok: #6fae86;
    --scrim: rgba(0, 0, 0, 0.6);
    --shadow: 0 0 0 1px rgba(236, 232, 223, 0.04), 0 16px 40px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #121210;
  --panel: #181816;
  --surface: #22211e;
  --raised: #24231f;
  --ink: #ece8df;
  --ink-2: #bdb8ac;
  --muted: #7f7a70;
  --line: #2e2d29;
  --line-soft: #262521;
  --hover: rgba(236, 232, 223, 0.05);
  --press: rgba(236, 232, 223, 0.09);
  --accent: #e8583a;
  --accent-hover: #f06a4d;
  --accent-soft: rgba(232, 88, 58, 0.14);
  --out-bg: #ece8df;
  --out-ink: #1b1a17;
  --out-muted: #6e695f;
  --out-quote: rgba(27, 26, 23, 0.07);
  --sel-bg: #ece8df;
  --sel-ink: #141412;
  --sel-muted: #6e695f;
  --dot: rgba(236, 232, 223, 0.05);
  --ok: #6fae86;
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow: 0 0 0 1px rgba(236, 232, 223, 0.04), 0 16px 40px -12px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: 0.5; }
a { color: inherit; }
svg { display: block; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

.mono { font-family: var(--mono); }
.label {
  font: 500 11px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.hidden { display: none !important; }

/* ───────── кнопки и поля ───────── */

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--ink-2);
  transition: background 0.12s, color 0.12s;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn:active { background: var(--press); }
.icon-btn.on { color: var(--accent); }

.btn {
  height: 44px;
  padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r);
  font-weight: 600;
  transition: background 0.12s, transform 0.06s;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--panel); }
.btn-primary:hover:not(:disabled) { background: var(--ink-2); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.btn-danger { color: var(--accent); }
.btn-danger:hover { background: var(--accent-soft); }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field + .field { margin-top: 16px; }
.input {
  height: 48px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea.input { height: auto; padding: 12px 14px; resize: none; line-height: 1.4; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--hover); }
.input::placeholder { color: var(--muted); }
.input-prefix { position: relative; }
.input-prefix > span {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.input-prefix > .input { padding-left: 30px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.45; }
.error { font-size: 13px; color: var(--accent); min-height: 18px; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── аватары ───────── */

.avatar {
  --s: 48px;
  width: var(--s); height: var(--s);
  flex: none;
  border-radius: calc(var(--s) * 0.3);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: calc(var(--s) * 0.36);
  letter-spacing: 0.01em;
  background: var(--c, #8a857a) center / cover no-repeat;
  position: relative;
  user-select: none;
}
.avatar.saved { background: var(--ink); color: var(--panel); }
.avatar .dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ok);
  border: 3px solid var(--panel);
}

/* ───────── экран входа ───────── */

.auth {
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.auth-art {
  background: var(--sel-bg);
  color: var(--sel-ink);
  padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-art .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.01em; }
.auth-art h1 {
  font-size: clamp(44px, 6vw, 84px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0;
  max-width: 9ch;
}
.auth-art h1 em { font-style: normal; color: var(--accent); }
.auth-art .spec {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 24px;
  font: 12px/1.3 var(--mono);
  color: var(--sel-muted);
  border-top: 1px solid color-mix(in srgb, var(--sel-ink) 18%, transparent);
  padding-top: 20px;
  max-width: 420px;
}
.auth-art .spec b { color: var(--sel-ink); font-weight: 500; }
.auth-art .lines {
  position: absolute; right: -60px; top: 50%;
  width: 420px; height: 420px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 22px, color-mix(in srgb, var(--sel-ink) 10%, transparent) 22px 23px);
  pointer-events: none;
}
.auth-form {
  display: grid; place-items: center;
  padding: 32px 24px;
  background: var(--panel);
  overflow-y: auto;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 28px; letter-spacing: -0.02em; margin: 14px 0 8px; font-weight: 700; }
.auth-card .lead { color: var(--ink-2); margin: 0 0 28px; line-height: 1.5; }
.auth-card .lead b { color: var(--ink); font-weight: 600; }
.auth-card form { display: flex; flex-direction: column; }
.auth-card .btn-block { margin-top: 20px; }
.auth-card .row-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 14px; }
.link { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.link:hover { color: var(--ink); text-decoration-color: currentColor; }
.link:disabled { text-decoration: none; }

.code-input {
  height: 64px;
  font: 500 30px/1 var(--mono);
  letter-spacing: 0.45em;
  text-align: center;
  padding: 0 0 0 0.45em;
}
.avatar-pick { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.avatar-pick .avatar { cursor: pointer; }
.avatar-pick .avatar::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: rgba(0, 0, 0, 0.35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E") center / 28px no-repeat;
  opacity: 0; transition: opacity 0.15s;
}
.avatar-pick .avatar:hover::after { opacity: 1; }

/* ───────── каркас ───────── */

.app {
  height: 100dvh;
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) auto;
}
.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  position: relative;
}
.side-head {
  height: 60px;
  padding: 0 10px 0 16px;
  display: flex; align-items: center; gap: 4px;
  flex: none;
}
.side-head .brand { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.side-head .brand small { font: 500 10px/1 var(--mono); letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; padding-top: 2px; }
.conn { font: 500 11px/1 var(--mono); color: var(--accent); display: flex; align-items: center; gap: 6px; }

.search { padding: 0 12px 10px; flex: none; position: relative; }
.search .input { height: 40px; padding-left: 38px; background: var(--bg); border-color: transparent; border-radius: 10px; }
.search .input:focus { background: var(--surface); border-color: var(--line); box-shadow: none; }
.search svg { position: absolute; left: 24px; top: 11px; color: var(--muted); pointer-events: none; }
.search .clear { position: absolute; right: 16px; top: 2px; width: 36px; height: 36px; }

.chat-list { flex: 1; overflow-y: auto; padding: 0 8px 8px; min-height: 0; }
.section-label { padding: 14px 10px 8px; }
.chat-item {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px;
  border-radius: var(--r);
  text-align: left;
  transition: background 0.1s;
}
.chat-item:hover { background: var(--hover); }
.chat-item.active { background: var(--sel-bg); color: var(--sel-ink); }
.chat-item.active .avatar .dot { border-color: var(--sel-bg); }
.chat-item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-item .row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-item .name { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.chat-item .name svg { color: var(--muted); }
.chat-item .time { font: 11px/1 var(--mono); color: var(--muted); flex: none; display: flex; align-items: center; gap: 3px; }
.chat-item .preview { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .preview .who { color: var(--ink-2); }
.chat-item .preview.typing { color: var(--accent); }
.chat-item.active .time, .chat-item.active .preview, .chat-item.active .name svg { color: var(--sel-muted); }
.chat-item.active .preview .who { color: var(--sel-ink); }
.chat-item.active .time .read { color: var(--sel-ink); }
.badge {
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px;
  background: var(--accent); color: var(--accent-ink);
  font: 500 11px/22px var(--mono);
  text-align: center;
  flex: none;
}
.chat-item .time .read { color: var(--ok); }
.empty-list { padding: 40px 24px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; }
.empty-list b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 6px; }

/* меню */
.menu {
  position: fixed;
  min-width: 220px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 60;
  animation: pop 0.12s ease-out;
}
@keyframes pop { from { opacity: 0; transform: scale(0.97); } }
.menu button {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  text-align: left;
  font-size: 14px;
}
.menu button:hover { background: var(--hover); }
.menu button svg { color: var(--muted); }
.menu button.danger, .menu button.danger svg { color: var(--accent); }
.menu hr { border: 0; border-top: 1px solid var(--line-soft); margin: 6px 4px; }

/* ───────── чат ───────── */

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.chat-head {
  height: 60px;
  padding: 0 10px 0 16px;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
}
.chat-head .back { display: none; margin-left: -8px; }
.chat-head .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; border-radius: var(--r-sm); }
.chat-head .who > div { min-width: 0; }
.chat-head .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .status { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .status.on { color: var(--ok); }
.chat-head .status.typing { color: var(--accent); }

.messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 20px 20px;
  min-height: 0;
  overscroll-behavior: contain;
}
.messages-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 20px 8px;
  display: flex; flex-direction: column;
  min-height: 100%;
  justify-content: flex-end;
}
.e2e-note {
  align-self: center;
  max-width: 360px;
  margin: 24px 0 18px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 13px; line-height: 1.5; color: var(--ink-2);
  display: flex; gap: 12px;
}
.e2e-note svg { color: var(--accent); margin-top: 2px; }
.day {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 10px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.day::before, .day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.day span { background: var(--bg); padding: 4px 2px; }
.sys { align-self: center; text-align: center; color: var(--muted); font-size: 13px; padding: 6px 12px; max-width: 80%; }
.sys b { color: var(--ink-2); font-weight: 500; }

.msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; max-width: 100%; }
.msg.gap { margin-top: 10px; }
.msg.out { flex-direction: row-reverse; }
.msg .avatar { --s: 34px; visibility: hidden; }
.msg.tail .avatar { visibility: visible; }
.bubble {
  position: relative;
  max-width: min(78%, 540px);
  padding: 7px 11px 6px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  overflow-wrap: anywhere;
  min-width: 0;
}
.msg.in.tail .bubble { border-bottom-left-radius: 5px; }
.msg.out .bubble { background: var(--out-bg); color: var(--out-ink); border-color: transparent; }
.msg.out.tail .bubble { border-bottom-right-radius: 5px; }
.msg.pending .bubble { opacity: 0.7; }
.msg.flash .bubble { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.bubble .author { font-size: 13px; font-weight: 600; margin-bottom: 2px; color: var(--c); }
.bubble .text { white-space: pre-wrap; }
.bubble .text a { text-decoration: underline; text-underline-offset: 2px; }
.bubble .text.big { font-size: 34px; line-height: 1.15; }
.bubble .meta {
  float: right;
  margin: 6px 0 -2px 12px;
  font: 11px/1 var(--mono);
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 3px;
  position: relative; top: 2px;
  user-select: none;
}
.msg.out .bubble .meta { color: var(--out-muted); }
.msg.out .bubble .meta .read { color: var(--out-ink); }
.bubble .locked { color: var(--muted); font-style: italic; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.msg.out .bubble .locked { color: var(--out-muted); }

.quote {
  display: block; width: 100%;
  margin: 2px 0 6px;
  padding: 4px 10px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 4px 8px 8px 4px;
  text-align: left;
  font-size: 13px; line-height: 1.35;
  min-width: 0;
}
.msg.out .quote { background: var(--out-quote); }
.quote b { display: block; font-weight: 600; color: var(--accent); }
.quote span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0.85; }

.media {
  display: block;
  margin: -3px -7px 4px;
  border-radius: 11px;
  overflow: hidden;
  background: var(--line-soft);
  cursor: zoom-in;
  max-width: 340px;
}
.msg.out .media { background: rgba(127, 127, 127, 0.2); }
.media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bubble.only-media { padding: 4px; }
.bubble.only-media .media { margin: 0; }
.bubble.only-media .meta {
  position: absolute; right: 10px; bottom: 10px; margin: 0; float: none; top: auto;
  background: rgba(20, 19, 17, 0.55); color: #f3f0e8; padding: 4px 6px; border-radius: 6px;
}
.bubble.only-media .meta .read { color: #fff; }

.file-card { display: flex; align-items: center; gap: 12px; padding: 4px 0; min-width: 220px; text-align: left; }
.file-card .ic {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  flex: none;
}
.file-card .fn { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.file-card .fs { font: 12px/1.3 var(--mono); color: var(--muted); }
.msg.out .file-card .fs { color: var(--out-muted); }

.voice { display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 2px 0; }
.voice .play {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); flex: none;
}
.voice .wave { flex: 1; display: flex; align-items: center; gap: 2px; height: 28px; cursor: pointer; }
.voice .wave i { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: currentColor; opacity: 0.3; }
.voice .wave i.on { opacity: 1; background: var(--accent); }
.msg.out .voice .wave i.on { background: var(--out-ink); }
.voice .dur { font: 11px/1 var(--mono); color: var(--muted); min-width: 34px; }
.msg.out .voice .dur { color: var(--out-muted); }

.call-line { display: flex; align-items: center; gap: 10px; padding: 2px 0; min-width: 180px; }
.call-line .ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); flex: none; }
.msg.out .call-line .ic { background: var(--out-quote); }
.call-line .ic.missed { color: var(--accent); }
.call-line small { display: block; font: 12px/1.3 var(--mono); color: var(--muted); }
.msg.out .call-line small { color: var(--out-muted); }

.jump {
  position: absolute; right: 24px; bottom: 96px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--raised); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: grid; place-items: center; color: var(--ink-2);
}
.jump .badge { position: absolute; top: -8px; right: -4px; min-width: 20px; height: 20px; line-height: 20px; padding: 0 5px; }

/* композер */
.composer-wrap { padding: 8px 20px 16px; background: var(--bg); flex: none; }
.composer-wrap > * { max-width: 740px; margin-left: auto; margin-right: auto; }
.composer-ctx {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 14px;
  background: var(--panel);
  border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--r) var(--r) 0 0;
  font-size: 13px;
}
.composer-ctx svg.lead { color: var(--accent); }
.composer-ctx > div { flex: 1; min-width: 0; border-left: 2px solid var(--accent); padding-left: 10px; }
.composer-ctx b { display: block; color: var(--accent); font-weight: 600; }
.composer-ctx span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.composer-ctx .icon-btn { width: 32px; height: 32px; }
.composer {
  display: flex; align-items: flex-end; gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.composer-ctx + .composer { border-top-left-radius: 0; border-top-right-radius: 0; }
.composer textarea {
  flex: 1;
  border: 0; outline: none; background: none; resize: none;
  padding: 9px 6px;
  max-height: 200px;
  line-height: 1.4;
  min-height: 40px;
}
.composer textarea::placeholder { color: var(--muted); }
.send-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--panel); flex: none;
  transition: background 0.12s, transform 0.08s;
}
.send-btn:hover { background: var(--ink-2); }
.send-btn:active { transform: scale(0.94); }
.send-btn.rec { background: var(--accent); color: var(--accent-ink); }
.recording { display: flex; align-items: center; gap: 12px; flex: 1; padding: 0 8px; height: 40px; }
.recording .rdot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
.recording .rtime { font: 500 14px/1 var(--mono); }
.recording .rlevel { flex: 1; height: 24px; display: flex; align-items: center; gap: 2px; overflow: hidden; justify-content: flex-end; }
.recording .rlevel i { width: 3px; border-radius: 2px; background: var(--ink-2); flex: none; }

.placeholder {
  flex: 1;
  display: grid; place-items: center;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 20px 20px;
  padding: 24px;
}
.placeholder > div { text-align: center; max-width: 320px; }
.placeholder .mark {
  width: 72px; height: 72px; margin: 0 auto 20px;
  border-radius: 22px; background: var(--ink); color: var(--panel);
  display: grid; place-items: center;
}
.placeholder h3 { margin: 0 0 8px; font-size: 18px; }
.placeholder p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ───────── боковые панели ───────── */

.pane {
  position: absolute; inset: 0;
  background: var(--panel);
  display: flex; flex-direction: column;
  z-index: 5;
  animation: slide-in 0.18s ease-out;
}
@keyframes slide-in { from { transform: translateX(-12px); opacity: 0; } }
.pane-head {
  height: 60px; flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  font-weight: 600; font-size: 16px;
}
.pane-head .t { flex: 1; }
.pane-body { flex: 1; overflow-y: auto; padding: 0 0 24px; min-height: 0; }

.info {
  width: 360px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
}
.profile-hero { padding: 8px 20px 20px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.profile-hero .avatar { --s: 112px; margin-bottom: 12px; }
.profile-hero h3 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.profile-hero .sub { color: var(--muted); font-size: 14px; }
.profile-hero .sub.on { color: var(--ok); }
.quick { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.quick button {
  width: 84px; padding: 10px 0 8px;
  border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-soft);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; color: var(--ink-2);
}
.quick button:hover { border-color: var(--line); color: var(--ink); }
.quick button svg { color: var(--accent); }

.group { margin: 0 12px 12px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r); overflow: hidden; }
.group-title { padding: 18px 24px 8px; }
.prop { padding: 12px 16px; display: flex; gap: 14px; align-items: flex-start; }
.prop + .prop { border-top: 1px solid var(--line-soft); }
.prop svg { color: var(--muted); margin-top: 1px; }
.prop .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.prop .k { font-size: 12px; color: var(--muted); margin-top: 2px; }
button.prop { width: 100%; text-align: left; }
button.prop:hover { background: var(--hover); }
button.prop.danger, button.prop.danger svg { color: var(--accent); }
.prop .fp { font: 12px/1.6 var(--mono); color: var(--ink-2); letter-spacing: 0.02em; word-spacing: 0.2em; }
.prop .tag { font: 500 10px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 1px; }

.member { display: flex; align-items: center; gap: 12px; padding: 8px 16px; width: 100%; text-align: left; }
.member:hover { background: var(--hover); }
.member .avatar { --s: 40px; }
.member .v { flex: 1; min-width: 0; }
.member .n { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member .s { font-size: 13px; color: var(--muted); }
.member .s.on { color: var(--ok); }
.member .r { font: 11px/1 var(--mono); color: var(--muted); }
.member .check {
  width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line);
  display: grid; place-items: center; color: transparent; flex: none;
}
.member.picked .check { background: var(--accent); border-color: var(--accent); color: #fff; }

.seg { display: flex; padding: 4px; gap: 4px; background: var(--bg); border-radius: 10px; margin: 12px 16px; }
.seg button { flex: 1; height: 34px; border-radius: 7px; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); font-weight: 500; }

/* ───────── модальные окна ───────── */

.scrim {
  position: fixed; inset: 0;
  background: var(--scrim);
  display: grid; place-items: center;
  z-index: 50;
  padding: 16px;
  animation: fade 0.15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 420px;
  max-height: min(680px, calc(100dvh - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  animation: pop 0.15s ease-out;
  overflow: hidden;
}
.modal-head { padding: 18px 20px 6px; display: flex; align-items: center; gap: 8px; }
.modal-head h3 { margin: 0; flex: 1; font-size: 18px; letter-spacing: -0.01em; }
.modal-body { padding: 10px 20px; overflow-y: auto; min-height: 0; }
.modal-body.flush { padding: 6px 0; }
.modal-foot { padding: 12px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 14px; background: var(--ink); color: var(--panel); font-size: 13px; }
.chip button { opacity: 0.7; }

.lightbox {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(12, 12, 11, 0.92);
  display: grid; place-items: center;
  animation: fade 0.15s;
  cursor: zoom-out;
}
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 6px; }
.lightbox .icon-btn { position: absolute; top: 16px; right: 16px; color: #f3f0e8; }
.lightbox .icon-btn.dl { right: 64px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--panel);
  padding: 11px 16px; border-radius: var(--r);
  font-size: 14px;
  z-index: 90;
  box-shadow: var(--shadow);
  animation: toast 0.2s ease-out;
  max-width: calc(100vw - 32px);
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ───────── стикеры ───────── */

.msg .bubble.sticker-bubble, .msg.out .bubble.sticker-bubble { background: none; border-color: transparent; padding: 0; color: var(--ink); }
.bubble.sticker-bubble .quote { background: var(--panel); border: 1px solid var(--line-soft); }
.sticker { display: block; width: 168px; height: 168px; cursor: pointer; }
.sticker img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform 0.15s; }
.sticker:hover img { transform: scale(1.03); }
.bubble.sticker-bubble .meta {
  float: none; position: static; display: flex; width: max-content; margin: 2px 0 0 auto;
  background: var(--panel); border: 1px solid var(--line-soft); color: var(--muted); padding: 4px 6px; border-radius: 6px;
}
.msg.out .bubble.sticker-bubble .meta { color: var(--muted); }
.msg.out .bubble.sticker-bubble .meta .read { color: var(--ok); }

.sticker-panel {
  height: 300px;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 8px;
  overflow: hidden;
  animation: pop 0.12s ease-out;
}
.sp-grid {
  flex: 1; overflow-y: auto; min-height: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 4px; padding: 10px; align-content: start;
}
.sp-item {
  aspect-ratio: 1; border-radius: 10px; padding: 6px;
  display: grid; place-items: center; position: relative;
  transition: background 0.1s;
}
.sp-item:hover { background: var(--hover); }
.sp-item img { width: 100%; height: 100%; object-fit: contain; }
.sp-tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 4px 6px; border-top: 1px solid var(--line-soft);
  overflow-x: auto; flex: none;
}
.sp-tab { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--muted); padding: 6px; }
.sp-tab:hover { background: var(--hover); color: var(--ink); }
.sp-tab.on { background: var(--bg); color: var(--ink); }
.sp-tab img { width: 28px; height: 28px; object-fit: contain; }
.sp-spacer { flex: 1; }
.sp-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 24px; text-align: center; color: var(--muted); font-size: 14px; grid-column: 1 / -1;
}
.sp-empty b { color: var(--ink); font-size: 15px; }

.pack-meta { padding: 0 20px 4px; font: 12px/1.4 var(--mono); color: var(--muted); }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
.sp-item.editable { background: var(--bg); }
.sp-emoji { position: absolute; left: 4px; bottom: 2px; font-size: 14px; }
.sp-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ink); color: var(--panel);
  opacity: 0; transition: opacity 0.12s;
}
.sp-item.editable:hover .sp-del, .sp-item.editable:focus-within .sp-del { opacity: 1; }
@media (pointer: coarse) { .sp-del { opacity: 1; } }
.sp-add { border: 1.5px dashed var(--line); color: var(--muted); }
.sp-add:hover { border-color: var(--ink); color: var(--ink); }
.emoji-input { width: 64px; height: 38px; text-align: center; font-size: 18px; padding: 0; }

.store-list { display: flex; flex-direction: column; }
.store-row { padding: 12px 20px; cursor: pointer; border-top: 1px solid var(--line-soft); }
.store-row:first-child { border-top: 0; }
.store-row:hover { background: var(--hover); }
.store-head { display: flex; align-items: center; gap: 12px; }
.store-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-sub { font: 12px/1.4 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-add { height: 34px; padding: 0 14px; font-size: 13px; flex: none; }
.store-strip { display: flex; gap: 6px; margin-top: 10px; overflow: hidden; }
.store-strip img { width: 64px; height: 64px; object-fit: contain; flex: none; }

/* ───────── боты ───────── */

.bubble-col { display: flex; flex-direction: column; gap: 4px; max-width: min(78%, 540px); min-width: 0; }
.bubble-col .bubble { max-width: 100%; align-self: flex-start; }
.msg.out .bubble-col .bubble { align-self: flex-end; }
.kb { display: flex; flex-direction: column; gap: 4px; }
.kb-row { display: flex; gap: 4px; }
.kb-btn {
  flex: 1; min-width: 0; min-height: 38px; padding: 6px 10px;
  border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 14px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background 0.1s, border-color 0.1s;
}
.kb-btn:hover { border-color: var(--ink); }
.kb-btn.busy { opacity: 0.55; }
.kb-btn svg { color: var(--muted); }
.e2e-note.bot-note svg { color: var(--ink-2); }
.bot-desc { color: var(--ink); white-space: pre-wrap; margin-bottom: 8px; font-size: 14px; }
.start-bot { height: 50px; font-size: 15px; letter-spacing: 0.02em; }

/* ───────── вкладки ───────── */

.tabbar {
  display: flex; flex: none;
  border-top: 1px solid var(--line);
  background: var(--panel);
  padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; height: 50px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 11px; color: var(--muted); border-radius: 10px;
}
.tab:hover { color: var(--ink-2); }
.tab.on { color: var(--accent); font-weight: 600; }
.tab-ic { position: relative; display: grid; }
.tab-ic .badge { position: absolute; top: -6px; left: 14px; min-width: 18px; height: 18px; line-height: 18px; font-size: 10px; padding: 0 5px; }
.tab-dot { position: absolute; top: -1px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--panel); }
.wall-tabbar { display: none; }

/* ───────── стена ───────── */

.wall {
  flex: 1; min-height: 0; overflow-y: auto;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.2px);
  background-size: 20px 20px;
}
.wall-inner { max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 12px; }
.post {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.post-head { display: flex; align-items: flex-start; gap: 10px; }
.post-author { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; text-align: left; }
.post-author .avatar { --s: 40px; }
.post-author b { display: block; font-weight: 600; }
.post-author span { display: block; font: 12px/1.3 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-head .icon-btn { width: 34px; height: 34px; margin: -4px -6px 0 0; }
.post-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
.post-text a { text-decoration: underline; text-underline-offset: 2px; }
.post .album { width: 100% !important; border-radius: 12px; }
.post .album.single { max-height: 560px; }
.post-foot { display: flex; gap: 6px; margin: 0 -6px -4px; }
.post-btn {
  height: 36px; padding: 0 12px; border-radius: 18px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font: 500 13px/1 var(--mono);
}
.post-btn:hover { background: var(--hover); color: var(--ink-2); }
.post-btn.on { color: var(--ink); }
.post-btn.liked { color: var(--accent); }
.post-btn.liked svg path { fill: currentColor; }
.post-comments { border-top: 1px solid var(--line-soft); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment-av .avatar { --s: 32px; }
.comment-body { flex: 1; min-width: 0; font-size: 14px; }
.comment-body b { font-weight: 600; margin-right: 8px; }
.comment-time { font: 11px/1 var(--mono); color: var(--muted); }
.comment-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.comment-del { width: 28px; height: 28px; opacity: 0.5; }
.comment-del:hover { opacity: 1; }
.comment-form { display: flex; align-items: center; gap: 8px; }
.comment-form .avatar { --s: 32px; }
.comment-form .input { height: 38px; border-radius: 19px; }
.comment-loading { display: grid; place-items: center; padding: 8px; color: var(--muted); }
.wall-compose .post-head { align-items: flex-start; }
.wall-input { flex: 1; border: 0; outline: none; background: none; resize: none; font: inherit; font-size: 16px; padding: 9px 0; min-height: 42px; }
.wall-input::placeholder { color: var(--muted); }
.wall-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.wall-thumbs:empty { display: none; }
.wall-thumbs .send-item { width: 84px; height: 84px; }
.wall-actions { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line-soft); padding-top: 10px; margin-bottom: -2px; }
.wall-actions .btn { height: 38px; font-size: 14px; }
.wall-more { text-align: center; color: var(--muted); font-size: 13px; padding: 8px; min-height: 30px; }

/* ───────── альбомы и галерея ───────── */

.album {
  display: grid; grid-template-columns: repeat(var(--cols, 2), 1fr); gap: 2px;
  border-radius: 11px; overflow: hidden;
  margin: -3px -7px 4px; max-width: 100%;
}
.bubble.only-media .album { margin: 0; }
.album.single { display: block; }
.album-cell { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--line-soft); display: block; cursor: zoom-in; }
.album.single .album-cell { aspect-ratio: auto; width: 100%; height: 100%; }
.album-cell.wide { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
.album-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-ph { width: 100%; height: 100%; background: #22211e; }
.album-play {
  position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(20, 19, 17, 0.55); color: #fff; padding-left: 3px;
}
.album-dur { position: absolute; left: 8px; top: 8px; background: rgba(20, 19, 17, 0.55); color: #f3f0e8; font: 500 11px/1 var(--mono); padding: 4px 6px; border-radius: 6px; }
.album-pending { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.25); color: #fff; }
.album-cell.broken::after { content: 'Недоступно'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); }

.gallery {
  position: fixed; inset: 0; z-index: 72;
  background: rgba(12, 12, 11, 0.95);
  display: grid; place-items: center;
  animation: fade 0.15s;
}
.gal-stage { position: absolute; inset: 56px 0 24px; display: grid; place-items: center; }
.gal-stage img, .gal-stage video { max-width: 96vw; max-height: 100%; border-radius: 6px; }
.gal-blur { filter: blur(12px); opacity: 0.6; width: 60vw; }
.gal-err { color: #a7a296; }
.gal-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 4px; padding: 8px 10px; z-index: 2; }
.gal-top .icon-btn { color: #f3f0e8; }
.gal-top .icon-btn:hover { background: rgba(255, 255, 255, 0.1); }
.gal-count { color: #a7a296; font-size: 13px; padding-left: 8px; }
.gal-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, 0.1);
}
.gal-nav:hover { background: rgba(255, 255, 255, 0.2); }
.gal-nav.prev { left: 14px; }
.gal-nav.next { right: 14px; }
@media (pointer: coarse) { .gal-nav { display: none; } }

/* окно перед отправкой файлов */
.send-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; max-height: 46vh; overflow-y: auto; }
.send-grid.as-files { grid-template-columns: 1fr; }
.send-item { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line-soft); }
.send-item.file { aspect-ratio: auto; background: var(--surface); border: 1px solid var(--line-soft); padding: 6px 36px 6px 8px; }
.send-item img, .send-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.send-del {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(20, 19, 17, 0.65); color: #fff;
}
.send-item.file .send-del { top: 50%; transform: translateY(-50%); background: var(--hover); color: var(--ink-2); }

/* ───────── истории ───────── */

.stories-bar {
  display: flex; gap: 4px;
  padding: 2px 12px 10px;
  overflow-x: auto; flex: none;
  scrollbar-width: none;
}
.stories-bar::-webkit-scrollbar { display: none; }
.story-item {
  position: relative;
  width: 68px; flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 11px; color: var(--ink-2);
}
.story-item > span:not(.story-add) { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-ring { position: relative; padding: 3px; border-radius: 19px; border: 2px solid transparent; }
.story-ring.fresh { border-color: var(--accent); }
.story-ring.seen { border-color: var(--line); }
.story-ring .avatar { --s: 52px; }
.story-plus, .story-add {
  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(--panel);
}
.story-add { right: 6px; top: 40px; bottom: auto; cursor: pointer; }

.story-preview { border-radius: var(--r); overflow: hidden; background: #000; display: grid; place-items: center; max-height: 46vh; }
.story-preview img, .story-preview video { max-width: 100%; max-height: 46vh; display: block; }

.story-viewer {
  position: fixed; inset: 0; z-index: 85;
  background: #0d0d0c;
  display: grid; place-items: center;
  animation: fade 0.15s;
  user-select: none; -webkit-user-select: none;
}
.sv-frame {
  position: relative;
  width: min(100vw, calc(100dvh * 9 / 16)); height: min(100dvh, calc(100vw * 16 / 9));
  max-height: 100dvh;
  background: #1a1a18;
  overflow: hidden;
}
@media (min-width: 761px) { .sv-frame { border-radius: 14px; height: min(92dvh, 860px); width: calc(min(92dvh, 860px) * 9 / 16); } }
.sv-stage { position: absolute; inset: 0; display: grid; place-items: center; }
.sv-stage img, .sv-stage video { width: 100%; height: 100%; object-fit: contain; }
.sv-err { color: #a7a296; font-size: 14px; }
.sv-bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.sv-bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); overflow: hidden; }
.sv-bar i { display: block; height: 100%; background: #fff; }
.sv-head {
  position: absolute; top: 20px; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px;
  color: #fff;
  background: linear-gradient(rgba(0, 0, 0, 0.45), transparent);
}
.sv-head .avatar { --s: 36px; }
.sv-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sv-who b { font-size: 14px; }
.sv-who span { font: 12px/1.3 var(--mono); color: rgba(255, 255, 255, 0.7); }
.sv-head .icon-btn { color: #fff; }
.sv-head .icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.sv-caption {
  position: absolute; left: 0; right: 0; bottom: 64px; z-index: 3;
  padding: 10px 16px; color: #fff; font-size: 15px; text-align: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
  pointer-events: none;
}
.sv-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.sv-own { display: flex; align-items: center; gap: 10px; width: 100%; }
.sv-aud { flex: 1; text-align: center; font: 11px/1 var(--mono); color: rgba(255, 255, 255, 0.6); text-transform: uppercase; letter-spacing: 0.06em; }
.sv-btn {
  height: 38px; padding: 0 14px; border-radius: 19px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 14px;
}
.sv-btn:hover { background: rgba(255, 255, 255, 0.22); }
.sv-zone { position: absolute; top: 80px; bottom: 70px; z-index: 2; width: 38%; }
.sv-zone.left { left: 0; }
.sv-zone.right { right: 0; width: 62%; }

.sv-overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.sv-rcount { margin-left: 4px; opacity: 0.85; }
.sv-reply { width: 100%; position: relative; }
.sv-reply-row { display: flex; align-items: center; gap: 6px; }
.sv-input {
  flex: 1; min-width: 0; height: 44px; padding: 0 16px;
  border-radius: 22px; border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.25); color: #fff; outline: none;
}
.sv-input::placeholder { color: rgba(255, 255, 255, 0.7); }
.sv-input:focus { border-color: #fff; background: rgba(0, 0, 0, 0.45); }
.sv-react {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; color: #fff;
  transition: transform 0.12s;
}
.sv-react:active { transform: scale(0.88); }
.sv-react.on { animation: pop-heart 0.35s ease-out; }
@keyframes pop-heart { 50% { transform: scale(1.35); } }
.sv-react.send { background: rgba(255, 255, 255, 0.16); font-size: 0; }
.sv-strip {
  position: absolute; right: 0; bottom: 54px;
  display: flex; gap: 2px; padding: 6px;
  background: rgba(20, 19, 17, 0.85); border-radius: 26px;
  animation: pop 0.15s ease-out;
}
.sv-strip button { width: 40px; height: 40px; font-size: 24px; border-radius: 50%; transition: transform 0.1s; }
.sv-strip button:hover { transform: scale(1.2); }
.sv-strip button.on { background: rgba(255, 255, 255, 0.18); }
.sv-burst {
  position: absolute; bottom: 90px; z-index: 5; font-size: 40px; pointer-events: none;
  animation: burst var(--d, 1.2s) ease-out forwards;
}
@keyframes burst {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(--dx), -420px) scale(1.25) rotate(18deg); opacity: 0; }
}
.viewer-react { font-size: 22px; margin-left: auto; }

.story-quote {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 6px; padding: 4px 10px 4px 4px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 4px 8px 8px 4px;
  text-align: left; font-size: 13px; min-width: 180px;
}
.msg.out .story-quote { background: var(--out-quote); }
.story-quote img, .story-quote .sq-ph { width: 36px; height: 64px; border-radius: 6px; object-fit: cover; flex: none; background: var(--line-soft); display: grid; place-items: center; color: var(--muted); }
.story-quote b { display: block; color: var(--accent); }
.story-quote span { opacity: 0.85; }

/* ───────── редактор историй ───────── */

.story-editor {
  position: fixed; inset: 0; z-index: 86;
  background: #0d0d0c; color: #fff;
  display: flex; flex-direction: column;
  animation: fade 0.15s;
  user-select: none; -webkit-user-select: none;
}
.se-stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; padding: 10px; }
.se-frame { position: relative; overflow: hidden; border-radius: 14px; background: #1a1a18; touch-action: none; }
.se-media, .se-draw, .se-video { position: absolute; inset: 0; width: 100%; height: 100%; }
.se-video { object-fit: contain; background: #000; }
.se-draw { pointer-events: none; }
.se-frame.drawing .se-draw { pointer-events: auto; cursor: crosshair; }
.se-items { position: absolute; inset: 0; pointer-events: none; }
.se-item { position: absolute; pointer-events: auto; cursor: grab; touch-action: none; transform-origin: center; }
.se-frame.drawing .se-item { pointer-events: none; }
.se-item.active { cursor: grabbing; }
.se-sticker img { width: calc(var(--fw) * 0.32); display: block; pointer-events: none; }
.se-text {
  font: 700 calc(var(--fw) * 0.072) / 1.22 'Golos Text', system-ui, sans-serif;
  color: var(--tc); text-align: center; white-space: pre; display: flex; flex-direction: column; align-items: center;
}
.se-text span { display: block; }
.se-text.style-plain { text-shadow: 0 0 calc(var(--fw) * 0.008) rgba(0, 0, 0, 0.35); }
.se-text.style-box { gap: 0; }
.se-text.style-box span { background: var(--tc); color: var(--ink); padding: 0 0.32em; border-radius: 0.28em; line-height: 1.3; }
.se-text.style-outline span { -webkit-text-stroke: 0.16em var(--ink); paint-order: stroke fill; }

.se-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  pointer-events: none; text-align: center; padding: 20px;
}
.se-empty span { font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.se-pick {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 20px; border-radius: 24px;
  background: rgba(0, 0, 0, 0.35); color: #fff; font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.se-trash {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.5); border: 1.5px solid rgba(255, 255, 255, 0.7);
  transition: transform 0.12s, background 0.12s; z-index: 3;
}
.se-trash.hot { transform: translateX(-50%) scale(1.25); background: var(--accent); border-color: var(--accent); }

.se-top { position: absolute; top: 18px; left: 18px; right: 18px; display: flex; align-items: center; gap: 4px; z-index: 4; pointer-events: none; }
.se-top > * { pointer-events: auto; }
.se-tools { display: flex; gap: 4px; }
.se-tool {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: rgba(0, 0, 0, 0.35);
  transition: background 0.12s;
}
.se-tool:hover, .se-tool.on { background: rgba(0, 0, 0, 0.6); }
.se-tool.on { box-shadow: inset 0 0 0 2px #fff; }
.se-aa { font: 700 17px/1 'Golos Text', sans-serif; }
.se-aa.style-box { background: #fff; color: #1b1a17; padding: 3px 6px; border-radius: 5px; }
.se-aa.style-outline { -webkit-text-stroke: 1px #fff; color: transparent; }
.se-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; display: block; }
.se-done { height: 38px; padding: 0 16px; border-radius: 19px; background: #fff; color: #1b1a17; font-weight: 600; }

.se-panel {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(440px, calc(100% - 36px));
  background: rgba(20, 19, 17, 0.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 18px; padding: 10px 12px; z-index: 4;
  display: flex; flex-direction: column; gap: 10px;
}
.se-modes, .se-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.se-modes button, .se-filters button {
  height: 32px; padding: 0 14px; border-radius: 16px; flex: none;
  color: rgba(255, 255, 255, 0.85); font-size: 13px; background: rgba(255, 255, 255, 0.08);
}
.se-modes button.on, .se-filters button.on { background: #fff; color: #1b1a17; font-weight: 600; }
.se-row { display: flex; align-items: center; gap: 12px; }
.se-size { width: 90px; accent-color: #fff; flex: none; }
.se-colors { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.se-color { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.5); }
.se-color.on { border-color: #fff; transform: scale(1.18); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4); }

.se-text-editor {
  position: absolute; inset: 0; z-index: 6;
  background: rgba(0, 0, 0, 0.55);
  display: flex; flex-direction: column; padding: 18px;
}
.se-text-top { display: flex; align-items: center; gap: 8px; }
.se-text-center { flex: 1; display: grid; place-items: center; }
.se-text-input {
  width: min(92%, 520px); resize: none; border: 0; outline: none; background: none;
  font: 700 32px/1.25 'Golos Text', system-ui, sans-serif; text-align: center;
  color: var(--tc); caret-color: #fff; overflow: hidden;
}
.se-text-input::placeholder { color: rgba(255, 255, 255, 0.5); }
.se-text-input.style-box { background: var(--tc); color: var(--ink); border-radius: 12px; padding: 6px 14px; }
.se-text-input.style-outline { -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.se-text-editor .se-colors { padding-bottom: 8px; }

.se-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 60%; z-index: 6;
  background: rgba(20, 19, 17, 0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  animation: sheet-up 0.18s ease-out;
}
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } }
.se-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 4px 18px; }
.se-sticker-grid { overflow-y: auto; padding: 8px 12px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.se-sticker-grid button { aspect-ratio: 1; padding: 6px; border-radius: 10px; }
.se-sticker-grid button:hover { background: rgba(255, 255, 255, 0.08); }
.se-sticker-grid img { width: 100%; height: 100%; object-fit: contain; }
.se-sheet-empty { grid-column: 1 / -1; text-align: center; padding: 24px; color: rgba(255, 255, 255, 0.7); font-size: 14px; }

.se-bottom {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  max-width: 640px; width: 100%; margin: 0 auto;
}
.story-editor.mode-draw .se-bottom { visibility: hidden; }
.se-caption {
  flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.06); color: #fff; outline: none;
}
.se-caption:focus { border-color: #fff; }
.se-caption::placeholder { color: rgba(255, 255, 255, 0.55); }
.se-aud {
  height: 44px; padding: 0 14px; border-radius: 22px; flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.1); color: #fff; font-size: 13px;
}
.se-publish {
  height: 44px; padding: 0 18px; border-radius: 22px; flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 600;
}
@media (max-width: 520px) {
  .se-publish { font-size: 0; padding: 0 13px; gap: 0; }
  .se-stage { padding: 0; }
  .se-frame { border-radius: 0; }
}

/* ───────── баннеры ───────── */

.banner {
  height: 120px; flex: none;
  background: var(--c, var(--accent)) center / cover no-repeat;
  position: relative;
}
.banner:not(.has-image) { background-image: linear-gradient(135deg, transparent 0 60%, rgba(255, 255, 255, 0.12) 60% 100%); }
.banner.editable { cursor: pointer; }
.banner-hint {
  position: absolute; right: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 14px;
  background: rgba(20, 19, 17, 0.55); color: #f3f0e8; font-size: 12px;
  opacity: 0; transition: opacity 0.15s;
}
.banner.editable:hover .banner-hint { opacity: 1; }
@media (pointer: coarse) { .banner-hint { opacity: 1; } }
.pane-body > .banner { margin: 0 12px; border-radius: var(--r); }
.info .pane-body > .banner { margin: 0 12px; }
.profile-hero.with-banner { margin-top: -64px; position: relative; }
.profile-hero.with-banner > .avatar { box-shadow: 0 0 0 5px var(--panel); }
.profile-card > .banner { align-self: stretch; margin: -10px -20px 0; border-radius: 0; }
.profile-card > .banner + .profile-avatar { margin-top: -64px; box-shadow: 0 0 0 5px var(--panel); }
.editable-avatar { cursor: pointer; }
.editable-avatar::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: rgba(0, 0, 0, 0.35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E") center / 30px no-repeat;
  opacity: 0; transition: opacity 0.15s;
}
.editable-avatar:hover::after { opacity: 1; }

/* ───────── профиль ───────── */

.profile-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 4px; }
.profile-card .profile-avatar { margin-bottom: 14px; border-radius: 40px; }
.profile-card .profile-avatar[role='button'] { cursor: zoom-in; }
.profile-card .avatar .dot { width: 22px; height: 22px; border-width: 4px; right: 2px; bottom: 2px; }
.profile-card h3 { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.profile-card .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.profile-card .sub.on { color: var(--ok); }
.profile-card .group { width: 100%; }
.profile-card > .label { align-self: flex-start; }
.modal:has(.profile-card) .modal-foot .btn { flex: 1; }

/* ───────── обзор ───────── */

.disc-list { padding: 0 8px 8px; }
.disc-sort { display: flex; gap: 6px; padding: 0 16px 8px; }
.disc-sort button {
  height: 28px; padding: 0 12px; border-radius: 14px;
  font-size: 13px; color: var(--ink-2); border: 1px solid var(--line);
}
.disc-sort button.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.disc-meta { font: 11px/1.3 var(--mono); color: var(--muted); }
.chat-item.active .disc-meta { color: var(--sel-muted); }
.chat-item .time { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-list .btn { margin-left: auto; margin-right: auto; }

.switch {
  position: relative; flex: none; align-self: center;
  width: 38px; height: 22px; border-radius: 11px;
  background: var(--line); transition: background 0.15s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(16px); }

/* ───────── реакции ───────── */

.menu-reacts { display: flex; gap: 2px; padding: 2px; }
.menu .menu-reacts button {
  width: 34px; height: 34px; padding: 0; justify-content: center;
  font-size: 20px; border-radius: 50%;
  transition: transform 0.1s, background 0.1s;
}
.menu .menu-reacts button:hover { transform: scale(1.18); background: var(--hover); }
.menu .menu-reacts button.on { background: var(--accent-soft); }

.reacts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.reacts .meta { float: none; position: static; margin: 0 0 0 auto; padding-left: 8px; top: 0; }
.react {
  height: 26px; padding: 0 8px 0 6px;
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid transparent;
  font-size: 13px;
  transition: transform 0.08s;
}
.react:active { transform: scale(0.94); }
.react-e { font-size: 15px; line-height: 1; }
.react-n { font: 500 12px/1 var(--mono); color: var(--accent); }
.react.mine { background: var(--accent); }
.react.mine .react-n { color: var(--accent-ink); }
.msg.out .react { background: var(--out-quote); }
.msg.out .react .react-n { color: var(--out-ink); }
.msg.out .react.mine { background: var(--accent); }
.msg.out .react.mine .react-n { color: var(--accent-ink); }
.bubble.sticker-bubble .reacts .react, .msg.out .bubble.sticker-bubble .reacts .react { background: var(--panel); border-color: var(--line-soft); }
.bubble.sticker-bubble .reacts .react .react-n { color: var(--ink-2); }
.bubble.sticker-bubble .reacts .react.mine { background: var(--accent); border-color: var(--accent); }
.bubble.sticker-bubble .reacts .react.mine .react-n { color: var(--accent-ink); }

/* ───────── закреп, группы ───────── */

.pin-bar {
  display: flex; align-items: center; gap: 4px;
  padding: 0 8px 0 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
  animation: fade 0.15s;
}
.pin-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 4px; text-align: left; }
.pin-main svg { color: var(--accent); flex: none; }
.pin-main > div { min-width: 0; border-left: 2px solid var(--accent); padding-left: 10px; }
.pin-main b { display: block; font-size: 13px; color: var(--accent); font-weight: 600; }
.pin-main span { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.pin-bar .icon-btn { width: 34px; height: 34px; }

.readonly-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; border-radius: var(--r-lg);
  background: var(--panel); border: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}

.avatar.news { background: var(--accent); }
.seg button svg { display: inline-block; vertical-align: -2px; }

/* ───────── кружки ───────── */

.round {
  position: relative;
  width: 240px; height: 240px;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  background: var(--line-soft);
  cursor: pointer;
}
.round video { width: 100%; height: 100%; object-fit: cover; display: block; }
.round .round-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.round .round-ring circle { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; opacity: 0; transition: stroke-dashoffset 0.25s linear; }
.round.loud .round-ring circle { opacity: 0.95; }
.round-dur, .round-sound {
  position: absolute; bottom: 14px;
  background: rgba(20, 19, 17, 0.55); color: #f3f0e8;
  font: 500 11px/1 var(--mono);
  padding: 4px 7px; border-radius: 10px;
}
.round-dur { left: 50%; transform: translateX(-50%); }
.round-sound { right: 30px; bottom: 36px; padding: 5px; border-radius: 50%; }
.round.loud .round-sound { display: none; }
.round.paused::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%;
  background: rgba(20, 19, 17, 0.5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.8v12.4a.8.8 0 0 0 1.2.7l10-6.2a.8.8 0 0 0 0-1.4l-10-6.2A.8.8 0 0 0 8 5.8z' fill='white'/%3E%3C/svg%3E") center / 26px no-repeat;
}
.round.broken { display: grid; place-items: center; }
.round.broken::before { content: 'Видео недоступно'; color: var(--muted); font-size: 13px; }

.round-rec {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(14, 14, 12, 0.88);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  animation: fade 0.15s;
  padding: 24px;
}
.round-stage { position: relative; width: min(78vw, 340px); aspect-ratio: 1; }
.round-live { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; transform: scaleX(-1); background: #000; }
.round-live.back { transform: none; }
.round-stage .round-ring { position: absolute; inset: -12px; width: calc(100% + 24px); height: calc(100% + 24px); transform: rotate(-90deg); }
.round-stage .round-ring circle { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; transition: stroke-dashoffset 0.1s linear; }
.round-time { color: #f3f0e8; font: 500 16px/1 var(--mono); display: flex; align-items: center; gap: 10px; }
.round-time .rdot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
.round-time .hint-dim { color: #8f8a7f; }
.round-rec .call-actions .cb { background: rgba(243, 240, 232, 0.12); color: #f3f0e8; }
.round-rec .call-actions .cb.end { background: var(--accent); }

/* ───────── звонок ───────── */

.call {
  position: fixed; inset: 0; z-index: 80;
  background: #141412;
  color: #f3f0e8;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 40px 24px calc(48px + env(safe-area-inset-bottom));
  animation: fade 0.2s;
}
.call::before {
  content: ''; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(243, 240, 232, 0.05) 1px, transparent 1.2px);
  background-size: 20px 20px;
  pointer-events: none;
}
.call-top { width: 100%; display: flex; justify-content: space-between; align-items: center; position: relative; }
.call-top .label { color: #8f8a7f; display: flex; align-items: center; gap: 8px; }
.call-top .icon-btn { color: #c9c4b8; }
.call-top .icon-btn:hover { background: rgba(243, 240, 232, 0.08); color: #fff; }
.call-who { display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; text-align: center; }
.call-who .ring {
  position: relative;
  width: 168px; height: 168px;
  display: grid; place-items: center;
  margin-bottom: 18px;
}
.call-who .ring::before, .call-who .ring::after {
  content: ''; position: absolute; inset: 0; border-radius: 52px;
  border: 1px solid rgba(243, 240, 232, 0.16);
  transform: scale(var(--lv, 1));
  transition: transform 0.08s linear;
}
.call-who .ring::after { inset: -18px; border-radius: 64px; border-color: rgba(243, 240, 232, 0.07); transform: scale(calc(1 + (var(--lv, 1) - 1) * 1.8)); }
.call.ringing .call-who .ring::before { animation: ripple 1.8s ease-out infinite; }
.call.ringing .call-who .ring::after { animation: ripple 1.8s ease-out 0.4s infinite; }
@keyframes ripple { 0% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.call-who .avatar { --s: 136px; border-radius: 42px; }
.call-who h2 { margin: 0; font-size: 30px; letter-spacing: -0.02em; font-weight: 600; }
.call-who .st { font: 14px/1 var(--mono); color: #a7a296; letter-spacing: 0.04em; }
.call-actions { display: flex; gap: 28px; position: relative; align-items: flex-start; }
.call-actions .ca { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 12px; color: #a7a296; }
.call-actions .cb {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(243, 240, 232, 0.1);
  color: #f3f0e8;
  transition: background 0.12s, transform 0.08s;
}
.call-actions .cb:hover { background: rgba(243, 240, 232, 0.18); }
.call-actions .cb:active { transform: scale(0.95); }
.call-actions .cb.on { background: #f3f0e8; color: #141412; }
.call-actions .cb.end { background: var(--accent); color: #fff; }
.call-actions .cb.end:hover { background: #f06a4d; }
.call-actions .cb.accept { background: #3e8a5c; color: #fff; }
.call-actions .cb.accept:hover { background: #46a06a; }
.call-e2e { font: 11px/1 var(--mono); color: #6f6b62; display: flex; align-items: center; gap: 6px; position: relative; letter-spacing: 0.04em; }

.call-bar {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 75;
  background: #141412; color: #f3f0e8;
  border-radius: 999px;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px 6px 16px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  cursor: pointer;
}
.call-bar .rdot { width: 8px; height: 8px; border-radius: 50%; background: #6fae86; }
.call-bar .mono { color: #a7a296; font-size: 13px; }
.call-bar .cb { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; }

/* ───────── адаптивность ───────── */

@media (max-width: 1100px) {
  .info { position: absolute; right: 0; top: 0; bottom: 0; z-index: 20; box-shadow: var(--shadow); }
}
@media (max-width: 900px) {
  :root { --sidebar: 320px; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .app .main { display: none; }
  .app.chat-open .sidebar { display: none; }
  .app.chat-open .main { display: flex; }
  .app.wall-open .sidebar { display: none; }
  .app.wall-open .main { display: flex; }
  .wall-tabbar { display: flex; }
  .wall-inner { padding: 10px 8px 24px; }
  .post { border-radius: var(--r); padding: 12px; }
  .chat-head .back { display: grid; }
  .messages-inner { padding: 12px 10px 6px; }
  .composer-wrap { padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
  .bubble { max-width: 84%; }
  .msg.group-in .avatar { --s: 30px; }
  .info { position: fixed; inset: 0; width: auto; border: 0; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .jump { right: 14px; bottom: 80px; }
  .media { max-width: 260px; }
  .sticker { width: 140px; height: 140px; }
  .round { width: 200px; height: 200px; }
  .sticker-panel { height: 260px; }
  .bubble-col { max-width: 84%; }
  .voice { min-width: 200px; }
}

/* iPhone приближает страницу, если у поля ввода шрифт меньше 16px.
   На сенсорных экранах делаем поля 16px и убираем приближение двойным тапом;
   масштаб двумя пальцами остаётся — он нужен для доступности. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* приложение с экрана «Домой» на iPhone рисуется под строкой состояния */
.app, .auth { padding-top: env(safe-area-inset-top); }
body { touch-action: manipulation; }
@media (pointer: coarse) {
  input, textarea, select, .input, .composer textarea, .search .input { font-size: 16px; }
  .emoji-input { font-size: 18px; }
  .code-input { font-size: 30px; }
}

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }
::-webkit-scrollbar-track { background: transparent; }
