/* LC · PHASE 13.2/14 (DR-25/DR-26) · «неизвестный тёмный канал».
   Чистый чёрный фон (без шум-эффектов), логотип крупно + глитч, плоский UI
   (без обводок). Доступность: видимый фокус, потери — тики + точные
   проценты (не только цвет), prefers-reduced-motion отключает все эффекты. */

:root {
  --bg: #000000;
  --bg-2: #0c0e11;
  --ink: #aeb6bf;
  --ink-dim: #5c6670;
  --ink-soft: #7d8791;
  --mark: #c8d0d9;
  --accent: #9fb2c8;
  --ok: #5aa9e6;        /* «стабильно» + свой позывной (голубой) */
  --own: #9cc3e8;       /* текст собственных сообщений */
  --warn: #e0982f;      /* «помехи» */
  --entity: #b18cff;    /* PHASE 16 (DR-33): Сущность — подпись и текст шёпота (фиолетовый) */
  --dead: #454e59;      /* «нет сигнала» */
  --risk-1: #6d5a3a;
  --risk-2: #8a4a3a;
  --risk-3: #a03434;
  --font: ui-monospace, "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
}

/* The root keeps the browser size, so the rem steps of tokens.css are the Daymohk sizes and follow
   a person who made the text larger. The page text itself starts at 15 px, as before. */
html { font-size: 100%; }
body { font-size: var(--ds-fs-title); }

/* The shell is as tall as what is actually seen. `100dvh` counts the browser's own chrome away, but
   on a phone it still describes the tallest state of it, so the shell ran past the bottom of the
   screen and the page could stretch upwards while a strip below stayed empty (owner, 2026-11-15).
   `--app-height` is written from `visualViewport` by hub.js; the two declarations under it are the
   fallback for the moment before it is measured and for a browser without it. */
#app {
  height: 100vh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.screen {
  position: relative; /* PHASE 16.1 (DR-34): ::before-оверлей вторжения */
  width: min(680px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 20px;
  position: relative;
}
.screen[hidden] { display: none; }

/* ---------- landing: логотип крупно + глитч (чёрный фон, без шума) ---------- */
#screen-landing { align-items: center; justify-content: center; gap: 22px; text-align: center; }

/* PHASE 16.2 (DR-35, owner п.2): логотип БЕЗ подсветки — вместо неё
   анимированный глитч: RGB-срезы вспыхивают каждые ~2 s, плюс редкие
   подёргивания самой картинки. */
.logo {
  width: min(400px, 86%);
  height: auto;
  display: block;
  position: relative;
  z-index: 1;
  animation: logo-jitter 7s infinite steps(1);
}
.logo.glitch::before,
.logo.glitch::after {
  content: url("logo.png");
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  pointer-events: none;
}
.logo.glitch::before { filter: sepia(1) saturate(4) hue-rotate(-50deg); animation: glitch-a 2.2s infinite steps(1); }
.logo.glitch::after { filter: sepia(1) saturate(4) hue-rotate(150deg); animation: glitch-b 2.2s infinite steps(1); }
@keyframes logo-jitter {
  0%, 100% { transform: none; }
  41% { transform: translateX(1px) skewX(0.4deg); }
  42% { transform: translateX(-1px); }
  43% { transform: none; }
  78% { transform: translateY(1px); }
  79% { transform: none; }
}
@keyframes glitch-a {
  0%, 7% { opacity: 0; transform: none; clip-path: none; }
  8% { opacity: 0.85; transform: translate(-4px, 2px); clip-path: inset(12% 0 58% 0); }
  10% { opacity: 0.85; transform: translate(3px, -2px); clip-path: inset(62% 0 8% 0); }
  12%, 46% { opacity: 0; transform: none; clip-path: none; }
  47% { opacity: 0.85; transform: translate(-3px, 0); clip-path: inset(30% 0 44% 0); }
  49%, 100% { opacity: 0; transform: none; clip-path: none; }
}
@keyframes glitch-b {
  0%, 7% { opacity: 0; transform: none; clip-path: none; }
  9% { opacity: 0.85; transform: translate(4px, -2px); clip-path: inset(48% 0 26% 0); }
  11% { opacity: 0.85; transform: translate(-3px, 2px); clip-path: inset(6% 0 74% 0); }
  13%, 46% { opacity: 0; transform: none; clip-path: none; }
  48% { opacity: 0.85; transform: translate(3px, 0); clip-path: inset(70% 0 4% 0); }
  50%, 100% { opacity: 0; transform: none; clip-path: none; }
}

.stack { display: flex; flex-direction: column; gap: 14px; align-items: center; width: min(340px, 84%); position: relative; z-index: 1; }

/* PHASE 15.2 (DR-31): только хинты + таймер (слова «разлом открыт/закроется через» — убраны) */
.rift { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 4.2em; justify-content: center; }
.rift-count { font-size: var(--ds-fs-hero); letter-spacing: 0.2em; color: var(--mark); font-variant-numeric: tabular-nums; }
.rift-hint { margin: 0; color: var(--ink-dim); font-size: var(--ds-fs-label); letter-spacing: 0.06em; max-width: 44ch; min-height: 1.5em; }
.rift.open .rift-hint { color: var(--ink-soft); }
/* PHASE 15.3 (DR-32): текст задания Сущности в карточке испытания. */
.task-prompt { margin: 0 0 10px; color: var(--mark); font-size: var(--ds-fs-control); letter-spacing: 0.04em; }
/* PHASE 16 (DR-33): живые отсчёты (окно задания, старт в лобби, финал). */
.cd { font-variant-numeric: tabular-nums; letter-spacing: 0.12em; color: var(--mark); }
.cd-big { font-size: var(--ds-fs-input); letter-spacing: 0.18em; color: var(--ink-soft); margin: 10px 0 0; min-height: 1.2em; font-variant-numeric: tabular-nums; }
/* PHASE 15.3 (DR-32): закрытый разлом — подсказки КРАСНЫЕ (вход скрыт). */
.rift:not(.open) .rift-hint { color: var(--risk-3); }
/* Попытка входа в закрытый разлом — красный статус. */
.landing-status.err { color: var(--risk-3); }

/* PHASE 15.2: модалки (язык, письмо) */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.72); display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-card { background: var(--bg-2); padding: 18px 20px; width: min(440px, 92%); box-shadow: 0 0 0 1px rgba(159, 178, 200, 0.12); }
.modal-card .card-title { margin: 0 0 12px; }
.fb-intro { margin: 0 0 12px; color: var(--ink-soft); font-size: var(--ds-fs-body); letter-spacing: 0.04em; }
.fb-intro::before { content: '«'; }
.fb-intro::after { content: '»'; }
.modal-card textarea {
  width: 100%; min-height: 96px; resize: vertical;
  background: var(--bg); color: var(--ink); border: none;
  font-family: var(--font); font-size: var(--ds-fs-control); padding: 9px 12px;
}
.fb-status {
  min-height: 1.5em;
  margin: var(--ds-space-2) 0 0;
  font-size: var(--ds-fs-body);
  line-height: 1.45;
  color: var(--lc-text, var(--ink));
}
.fb-status:is(.ok, .err) {
  border-inline-start: 2px solid var(--ok);
  padding-inline-start: var(--ds-space-2);
}
.fb-status.err { border-inline-start-color: var(--ds-danger); }

/* PHASE 16.2 (DR-35, п.5): итог испытания — упущен (warn) / принят. */
.toast.warn { color: #ff8d8d; text-shadow: 0 0 10px rgba(255, 92, 92, 0.35); }
/* Пульс шкалы потерянности при росте. */
.band.pulse { animation: band-pulse 1.3s ease-out; }
.band.pulse .cubes, .band.pulse .band-pct { animation: band-pulse 1.3s ease-out; }
@keyframes band-pulse {
  0% { color: var(--risk-3); text-shadow: 0 0 14px rgba(255, 92, 92, 0.6); transform: scale(1.06); }
  60% { color: var(--risk-3); }
  100% { color: inherit; text-shadow: none; transform: none; }
}

/* ---------- PHASE 16.1 (DR-34): чужой сигнал — модалка (размытый фон) ---------- */
.intrusion-modal {
  background: rgba(4, 6, 10, 0.55);
  z-index: 30;
}
.intrusion-card {
  border: 1px solid rgba(255, 92, 92, 0.35);
  box-shadow: 0 0 24px rgba(255, 92, 92, 0.14), 0 0 0 1px rgba(159, 178, 200, 0.08);
  animation: intrusion-in 0.18s steps(2, end) 2;
}
.intrusion-card .card-title { color: #ff7a7a; letter-spacing: 0.3em; }
.intrusion-note { margin: 0 0 10px; color: var(--ink-dim); font-size: var(--ds-fs-label); letter-spacing: 0.06em; }
.intrusion-text {
  margin: 0 0 14px; color: var(--ink); font-size: var(--ds-fs-control); letter-spacing: 0.08em;
  animation: glitch-flicker 1.7s steps(2, end) infinite;
}
@keyframes intrusion-in {
  0% { transform: translateX(-3px) skewX(-2deg); opacity: 0.4; }
  50% { transform: translateX(3px) skewX(1.5deg); opacity: 0.85; }
  100% { transform: none; opacity: 1; }
}

/* ---------- PHASE 16.1 (DR-34): чужой сигнал — глитч ВСЕГО приложения ---------- */
/* Не только сообщение: искажается весь канал — шапка, чат, поле ввода. */
body.intrusion #screen-channel { animation: intrusion-shake 1.6s steps(4, end) infinite; }
/* Редкая полноэкранная вспышка-инверсия — «сайт в помехах». */
body.intrusion #app { animation: intrusion-flash 5.2s steps(1) infinite; }
body.intrusion #screen-channel::before {
  content: '';
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 92, 92, 0.07) 0 1px, transparent 1px 3px),
              repeating-linear-gradient(90deg, rgba(60, 160, 255, 0.03) 0 2px, transparent 2px 9px);
  animation: intrusion-scan 0.9s steps(5, end) infinite;
}
body.intrusion .chan-head { animation: intrusion-jitter 1.9s steps(2, end) infinite; }
body.intrusion .msgs .msg .text {
  text-shadow: 0.6px 0 rgba(255, 60, 60, 0.55), -0.6px 0 rgba(60, 160, 255, 0.45);
}
body.intrusion .msgs .msg.special .text {
  text-shadow: 1.2px 0 rgba(255, 60, 60, 0.7), -1.2px 0 rgba(60, 160, 255, 0.6);
  animation-duration: 0.9s;
}
body.intrusion .compose { animation: intrusion-jitter 2.3s steps(2, end) infinite; }
body.intrusion .notice { opacity: 0.55; filter: contrast(1.15); }
@keyframes intrusion-shake {
  0%, 100% { transform: none; }
  22% { transform: translateX(-3px) skewX(-0.6deg); }
  23% { transform: translateX(3px) skewX(0.5deg); }
  24% { transform: translateX(-2px); }
  58% { transform: translateX(2px) skewX(0.4deg); }
  59% { transform: translateX(-3px) skewX(-0.5deg); }
  60% { transform: translateX(1px); }
}
@keyframes intrusion-flash {
  0%, 96% { filter: none; }
  96.5% { filter: invert(0.08) hue-rotate(-12deg) contrast(1.12); }
  97.5% { filter: none; }
  98.5% { filter: invert(0.05) saturate(1.3); }
  99.5% { filter: none; }
}
@keyframes intrusion-scan {
  0% { background-position: 0 0; opacity: 0.9; }
  50% { background-position: 0 7px; opacity: 0.35; }
  100% { background-position: 0 3px; opacity: 0.75; }
}
@keyframes intrusion-jitter {
  0%, 100% { transform: none; }
  47% { transform: translateX(1px); }
  48% { transform: translateX(-1px) skewX(-0.4deg); }
}
.landing-status {
  min-height: 1.5em;
  margin: 4px 0 0;
  color: var(--risk-2);
  font-size: var(--ds-fs-label);
  letter-spacing: 0.08em;
  text-align: center;
  max-width: 44ch;
  position: relative; z-index: 1;
}

/* ---------- buttons (плоские, без обводок) ---------- */
.btn {
  font-family: var(--font);
  font-size: var(--ds-fs-control);
  letter-spacing: 0.14em;
  padding: 10px 18px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 120ms linear, text-shadow 120ms linear;
}
.btn:hover { color: var(--mark); }
.btn.primary { color: var(--accent); }
.btn.primary:hover { color: var(--mark); text-shadow: 0 0 14px rgba(159, 178, 200, 0.35); }
.btn.ghost { color: var(--ink-dim); }
.btn.small { padding: 6px 10px; font-size: var(--ds-fs-label); }
.btn:disabled { opacity: 0.45; cursor: default; }
/* Иконки-кнопки (без текста/обводок): «уйти», «выйти», «отправить» */
.btn.icon { padding: 6px; display: inline-flex; align-items: center; justify-content: center; }
.btn.icon svg { width: 22px; height: 22px; fill: currentColor; display: block; }
.btn.icon:hover { text-shadow: 0 0 12px rgba(159, 178, 200, 0.4); }
/* PHASE 15.2: выход из сессии — красная кнопка выключения */
.btn.exit { color: var(--ink-dim); }
.btn.exit:hover { color: var(--ink); }
/* PHASE 16.1 (DR-34): дверь со стрелкой налево — чуть крупнее power-точки. */
.btn.exit svg { width: 20px; height: 20px; }

button:focus-visible, select:focus-visible, .msg:focus-visible {
  outline: 2px solid var(--ok);
  outline-offset: 2px;
}
/* PHASE 15.2 (owner): у текстовых полей — без фокус-выделения */
input:focus-visible, input:focus, textarea:focus-visible, textarea:focus {
  outline: none;
}

input {
  background: var(--bg-2);
  border: none;
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--ds-fs-control);
  padding: 9px 12px;
  width: 100%;
}
input::placeholder { color: var(--ink-dim); }

/* ---------- lobby ---------- */
#screen-lobby { align-items: center; justify-content: center; gap: 16px; text-align: center; }
.lobby-col { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.word { font-size: var(--ds-fs-body); letter-spacing: 0.3em; color: var(--ink-soft); }
.word.big { font-size: var(--ds-fs-hero); letter-spacing: 0.3em; color: var(--mark); margin: 0; }
.occ { font-size: var(--ds-fs-title); color: var(--ink-soft); letter-spacing: 0.35em; min-height: 1.5em; }
.flavor { color: var(--ink-dim); font-size: var(--ds-fs-label); min-height: 1.5em; margin: 0; }

/* ---------- cards (действия сервера / personal) ---------- */
.card {
  width: 100%;
  border: none;
  background: var(--bg-2);
  padding: 14px 16px;
  text-align: left;
}
.card-title { margin: 0 0 10px; font-size: var(--ds-fs-label); letter-spacing: 0.25em; color: var(--ink-soft); }
.card.personal { box-shadow: inset 0 0 0 1px var(--risk-2); }
.reveal-content { margin: 8px 0 0; color: var(--ink); font-size: var(--ds-fs-body); }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row input { flex: 1 1 200px; }

/* ---------- канал ---------- */
.chan-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
}
.you { color: var(--ink-soft); font-size: var(--ds-fs-label); letter-spacing: 0.12em; }

/* эфир: три состояния (DR-25) */
.signal { display: inline-flex; align-items: center; gap: 8px; }
.sig-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--dead); }
.sig-word { font-size: var(--ds-fs-label); letter-spacing: 0.22em; color: var(--ink-dim); }
.signal.stable .sig-dot { background: var(--ok); animation: sig-pulse 2.4s ease-in-out infinite; }
.signal.stable .sig-word { color: var(--ok); }
.signal.interference .sig-dot { background: var(--warn); animation: sig-flicker 0.8s steps(2) infinite; }
.signal.interference .sig-word { color: var(--warn); }
.signal.none .sig-dot { background: var(--dead); animation: none; }
.signal.none .sig-word { color: var(--dead); }
@keyframes sig-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(90, 169, 230, 0.0); }
  50% { opacity: 0.55; box-shadow: 0 0 8px 1px rgba(90, 169, 230, 0.4); }
}
@keyframes sig-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* потери (PHASE 16/DR-33, owner): 5 КУБИКОВ с ПЛАВНЫМ заполнением + точные
   проценты (DR-26: loss 0..100 публично для себя) */
.band { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.band .cubes { display: inline-flex; gap: 3px; }
.band .cubes i {
  width: 12px; height: 10px;
  background: var(--bg-2);
  display: inline-flex;
  overflow: hidden;
}
.band .cubes i b {
  display: block;
  height: 100%;
  background: var(--ink-dim);
  transition: width 0.7s ease; /* плавное заполнение */
}
.band .band-pct { font-size: var(--ds-fs-label); letter-spacing: 0.14em; color: var(--ink-dim); min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
/* PHASE 14.2 (DR-27): штраф «шкала гаснет» — точное число скрыто (??%). */
.band .band-pct.loss-hidden { opacity: 0.6; letter-spacing: 0.35em; }

/* PHASE 18 (DR-38): панель способностей (§15) — под правилами Сущности. */
.powers-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; position: relative; z-index: 1; margin: -4px 2px 6px; }
.power-chip {
  font: inherit; font-size: var(--ds-fs-micro); letter-spacing: 0.09em; text-transform: lowercase;
  color: var(--ink-dim); background: transparent; border: 1px solid var(--ink-dim);
  border-radius: var(--ds-radius-sm); padding: 3px 8px; cursor: pointer;
}
.power-chip.armed { color: var(--bg); background: var(--ink-dim); border-color: var(--ink-dim); }
.power-chip.passive { cursor: default; font-style: italic; }
.power-chip:focus-visible { outline: 1px solid var(--ink); outline-offset: 1px; }

.band.b2 .cubes i b { background: var(--risk-2); }
.band.b2 .band-pct { color: var(--risk-2); }

.band.b4 .cubes i b { background: var(--risk-3); }
.band.b4 .band-pct { color: var(--risk-3); }

/* ---------- правила Сущности (PHASE 15.2: закреплённые, сворачиваемые) ---------- */
.notice {
  background: var(--bg-2);
  padding: 0 14px 12px;
  margin-bottom: 8px;
  font-size: var(--ds-fs-label);
}
.notice-head {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  font-family: var(--font); font-size: var(--ds-fs-micro); letter-spacing: 0.25em;
  color: var(--ink-dim); padding: 12px 0 4px;
}
.notice-head::after { content: '▾'; font-size: var(--ds-fs-micro); margin-left: auto; }
.notice.collapsed .notice-head::after { content: '▸'; }
.notice.collapsed .notice-body { display: none; }
.notice p { margin: 0 0 8px; color: var(--mark); letter-spacing: 0.04em; }
.notice ul { margin: 0; padding-left: 18px; color: var(--ink-soft); }
.notice li { margin: 2px 0; }

/* ---------- messages ---------- */
.msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.msg {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 4px 8px;
  border: none;
}
/* СВОИ сообщения — слева (как все), голубые, со своим позывным (DR-26). */
.msg .nick { font-size: var(--ds-fs-micro); color: var(--ink-dim); min-width: 72px; text-align: right; letter-spacing: 0.06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .text { color: var(--ink); word-break: break-word; flex: 1; }
.msg.own .nick { color: var(--ok); }
.msg.own .text { color: var(--own); }
.msg.redacted .text { color: var(--ink-dim); font-style: italic; }
/* PHASE 16 (DR-33): шёпот Сущности — подпись «СУЩНОСТЬ» и текст — фиолетовые. */
.msg.entity .nick { color: var(--entity); letter-spacing: 0.14em; }
.msg.entity .text { color: var(--entity); }
/* PHASE 16 (DR-33): глитч спецперсонажа — без подписи, мерцающий текст. */
.msg.special .text {
  color: var(--warn);
  text-shadow: 0 0 8px rgba(224, 152, 47, 0.3);
  animation: glitch-flicker 2.4s steps(2, end) infinite;
}
@keyframes glitch-flicker {
  0%, 100% { opacity: 1; }
  47% { opacity: 1; }
  50% { opacity: 0.55; }
  53% { opacity: 0.9; }
  71% { opacity: 0.7; }
}

/* режим выбора голоса: сообщения кликабельны (фон + курсор) */
.msgs.selectable .msg { cursor: pointer; }
.msgs.selectable .msg:hover { background: var(--bg-2); }

/* ---------- actions area ---------- */
.actions { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; }
.actions:empty { display: none; padding: 0; }

/* ---------- compose ---------- */
.compose {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 12px;
}
.compose[hidden] { display: none; }
#compose-input { flex: 1; }
#btn-exit { order: -1; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%) translateY(8px);
  background: var(--bg-2);
  border: none;
  color: var(--ink-soft);
  font-size: var(--ds-fs-label);
  letter-spacing: 0.15em;
  padding: 8px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms linear, transform 160ms linear;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- complete ---------- */
#screen-complete { align-items: center; justify-content: center; gap: 16px; text-align: center; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .logo { filter: none; }
  .logo.glitch::before, .logo.glitch::after { display: none; }
  .msgs { scroll-behavior: auto; }
  /* PHASE 16.1 (DR-34): вторжение без движения — статичная «повреждённость». */
  body.intrusion #screen-channel::before { animation: none; opacity: 0.5; }
  body.intrusion .msgs .msg .text { text-shadow: none; color: #e8b6b6; }
}

html[data-hub-motion="reduced"] :is(.logo, .band, .band .cubes, .band .band-pct, .sig-dot, .door),
html[data-hub-motion="reduced"] body.intrusion :is(#screen-channel, #app, .chan-head, .compose),
html[data-hub-motion="reduced"] body.intrusion #screen-channel::before { animation: none; }
html[data-hub-motion="reduced"] .logo.glitch::before, html[data-hub-motion="reduced"] .logo.glitch::after { display: none; }

/* ---------- узкие экраны ---------- */
@media (max-width: 520px) {
  .logo { width: min(300px, 86%); }
  .msg .nick { min-width: 56px; }
}

/* PHASE 20 (DR-40): приватная нить (§15 THREAD) — bounded-окно поверх канала. */
.thread {
  position: fixed;
  right: 16px;
  bottom: 86px;
  width: min(320px, calc(100vw - 32px));
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ink-dim);
  background: var(--bg);
  z-index: 30;
}
.thread-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ink-dim);
}
.thread-title {
  letter-spacing: 0.08em;
}
.thread-left {
  opacity: 0.7;
}
.thread-msgs {
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.thread-msg {
  margin: 0;
  word-break: break-word;
}
.thread-msg.own {
  opacity: 0.65;
}
.thread-compose {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--ink-dim);
}
.thread-compose input {
  flex: 1;
  min-width: 0;
}
