/* Палитра «консоль будущего»: почти чёрный сине-зелёный фон, один
   бирюзовый акцент, янтарный для предупреждений, красный для ошибок.
   Имена переменных прежние — их использует остальной код. */
:root {
  --ink:        #04070a;
  --panel:      rgba(6, 16, 19, 0.9);
  --canvas:     #050a0c;
  --raised:     rgba(255, 255, 255, 0.035);
  --line:       rgba(77, 255, 240, 0.18);
  --bubble-in:  rgba(255, 255, 255, 0.025);
  --bubble-out: rgba(77, 255, 240, 0.07);
  --brass:      #4dfff0;   /* основной акцент */
  --pink:       #7fb5b0;   /* вторичный, приглушённый */
  --jade:       #4dfff0;   /* онлайн / прочитано */
  --text:       #cfe9e6;
  --bright:     #eafffb;
  --muted:      #3f6f6a;
  --warn:       #ffb020;
  --danger:     #ff3860;
  --radius:     0px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  position: relative;
  background:
    radial-gradient(1200px 700px at 50% -10%, #08222a 0%, transparent 60%),
    var(--ink);
  color: var(--text);
  font: 14px/1.55 "IBM Plex Mono", ui-monospace, monospace;
  -webkit-font-smoothing: antialiased;
  animation: flick 7s linear infinite;
}

/* Развёртка ЭЛТ: строки и виньетка поверх всего интерфейса. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.28) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.75) 100%);
}

button, input, textarea { font: inherit; color: inherit; }

::selection { background: var(--brass); color: #04120f; }

* { scrollbar-width: thin; scrollbar-color: rgba(77, 255, 240, 0.25) transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(77, 255, 240, 0.25); }
*::-webkit-scrollbar-thumb:hover { background: var(--brass); }

[hidden] { display: none !important; }

.stamp-font { font-family: "Chakra Petch", "IBM Plex Mono", ui-monospace, monospace; }

/* ── Анимации ───────────────────────────────────────── */

@keyframes flick { 0%, 96%, 100% { opacity: 1; } 97% { opacity: 0.85; } 98.5% { opacity: 1; } }
@keyframes sweep { 0% { transform: translateY(-20vh); } 100% { transform: translateY(120vh); } }
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slide-l { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes slide-r { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(77, 255, 240, 0.5); } 100% { box-shadow: 0 0 0 12px rgba(77, 255, 240, 0); } }
@keyframes drift { from { background-position: 0 0; } to { background-position: 0 -240px; } }
@keyframes boot-in { from { opacity: 0; filter: blur(6px); transform: scale(0.985); } to { opacity: 1; filter: none; transform: none; } }
@keyframes bar-pulse { 0%, 100% { opacity: 0.35; transform: scaleY(0.5); } 50% { opacity: 1; transform: scaleY(1); } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(280%); } }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

/* ── Вход ───────────────────────────────────────────── */

.gate {
  position: relative;
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr minmax(380px, 460px) 1fr;
  align-items: center;
  gap: 40px;
  padding: 0 56px;
  overflow: hidden;
}

.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(77, 255, 240, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 255, 240, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: drift 24s linear infinite;
}

.gate::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(77, 255, 240, 0.06) 60%, transparent);
  animation: sweep 6s linear infinite;
}

.gate__matrix {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.18;
  pointer-events: none;
}

/* Системный журнал слева и телеметрия справа. */
.hud {
  position: relative;
  z-index: 2;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hud--right { align-items: flex-end; gap: 14px; }

.hud__title {
  margin: 0 0 10px;
  font-family: "Chakra Petch", monospace;
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--brass);
}

.hud__line {
  display: flex;
  gap: 10px;
  animation: slide-l 0.28s ease both;
}

.hud__tag { flex: 0 0 auto; color: var(--brass); }
.hud__tag--wait { color: var(--pink); }
.hud__tag--warn { color: var(--warn); }
.hud__line--warn .hud__text { color: #c8a06a; }
.hud__text { color: #4a6f6c; }

.hud__caret {
  display: inline-block;
  width: 7px;
  background: var(--brass);
  animation: caret 1s steps(1) infinite;
}

.metric {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slide-r 0.3s ease both;
}

.metric__value { color: var(--bright); min-width: 62px; text-align: right; }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 14px; }

.bars i {
  width: 3px;
  height: 14px;
  background: var(--brass);
  animation: bar-pulse 1.1s ease-in-out infinite;
}

.bars i:nth-child(2) { animation-delay: 0.15s; }
.bars i:nth-child(3) { animation-delay: 0.3s; }

.gate__card {
  position: relative;
  z-index: 2;
  width: min(460px, 100%);
  background: linear-gradient(180deg, rgba(8, 22, 26, 0.92), rgba(4, 10, 12, 0.94));
  border: 1px solid rgba(77, 255, 240, 0.22);
  border-radius: var(--radius);
  padding: 34px 32px 30px;
  box-shadow: 0 0 60px rgba(77, 255, 240, 0.08), inset 0 0 60px rgba(77, 255, 240, 0.03);
  animation: boot-in 0.5s ease both;
}

/* Уголки-скобки как на прицельной рамке. */
.gate__card::before,
.gate__card::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--brass);
}

.gate__card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.gate__card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.gate__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-family: "Chakra Petch", "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.18em;
  color: var(--bright);
}

.gate__mark {
  width: 10px;
  height: 10px;
  background: var(--brass);
  transform: rotate(45deg);
  animation: ring 2.2s ease-out infinite;
}

.gate__node {
  margin-left: auto;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.glitch { position: relative; }

.gate__lede {
  margin: 0 0 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(77, 255, 240, 0.15);
  color: var(--muted);
  font-size: 12px;
}

.switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 24px;
  background: transparent;
  border: 1px solid rgba(77, 255, 240, 0.16);
  border-radius: var(--radius);
}

.switch__btn {
  flex: 1;
  padding: 9px;
  background: none;
  border: 0;
  color: var(--muted);
  font-family: "Chakra Petch", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.switch__btn.is-on { background: rgba(77, 255, 240, 0.14); color: var(--brass); }

.field { display: block; margin-bottom: 16px; }

.field__label {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.rail__search input,
#draft {
  width: 100%;
  padding: 11px 13px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(77, 255, 240, 0.2);
  border-radius: var(--radius);
  outline: none;
  color: var(--bright);
  letter-spacing: 0.04em;
  caret-color: var(--brass);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.field input:focus,
.rail__search input:focus,
#draft:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 1px rgba(77, 255, 240, 0.35), 0 0 22px rgba(77, 255, 240, 0.18);
}

.gate__seal {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 18px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.gate__seal::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 10px var(--brass);
}

.notice {
  margin: 0 0 12px;
  padding: 9px 11px;
  background: rgba(255, 56, 96, 0.1);
  border: 1px solid rgba(255, 56, 96, 0.4);
  border-left-width: 3px;
  font-size: 12.5px;
  color: #ff9aab;
}

.btn {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  padding: 9px 14px;
  font-family: "Chakra Petch", "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.1s, background 0.2s;
}

.btn:hover { border-color: var(--brass); box-shadow: 0 0 18px rgba(77, 255, 240, 0.22); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 1px solid var(--brass); outline-offset: 2px; }

.btn--primary {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 14px;
  background: var(--brass);
  border-color: var(--brass);
  color: #04120f;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.btn--primary:hover { box-shadow: 0 0 28px rgba(77, 255, 240, 0.45); }

/* Блик, пробегающий по кнопке входа. */
.btn--primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 2.6s linear infinite;
}

.btn--primary:disabled { opacity: 0.6; cursor: progress; }

.btn--ghost {
  background: none;
  border-color: rgba(77, 255, 240, 0.25);
  color: var(--brass);
  padding: 5px 10px;
  font-size: 10px;
  text-transform: uppercase;
}

.btn--icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 17px;
  color: var(--brass);
  flex: 0 0 auto;
}

.btn--send {
  width: auto;
  flex: 0 0 auto;
  padding: 12px 20px;
  font-size: 12px;
  letter-spacing: 0.2em;
}

.btn--send::after { display: none; }

/* ── Экран «доступ разрешён» ────────────────────────── */

.grant {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 26px;
  background: rgba(4, 7, 10, 0.86);
  backdrop-filter: blur(3px);
}

.grant__text {
  font-family: "Chakra Petch", monospace;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--brass);
  text-shadow: 0 0 32px rgba(77, 255, 240, 0.6);
}

.grant__track { width: min(420px, 70vw); height: 3px; background: rgba(77, 255, 240, 0.15); }

.grant__bar {
  height: 100%;
  width: 0;
  background: var(--brass);
  box-shadow: 0 0 18px var(--brass);
  transition: width 0.12s linear;
}

.grant__note { font-size: 11px; letter-spacing: 0.18em; color: var(--muted); }

/* ── Каркас приложения ──────────────────────────────── */

.app {
  height: 100%;
  display: grid;
  grid-template-columns: 300px 1fr;
  animation: boot-in 0.6s ease both;
}

.rail {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(180deg, rgba(6, 16, 19, 0.9), rgba(4, 8, 10, 0.9));
  border-right: 1px solid rgba(77, 255, 240, 0.18);
}

.rail__matrix {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0.22;
  pointer-events: none;
}

.rail__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(77, 255, 240, 0.12);
}

.me { display: flex; align-items: center; gap: 11px; min-width: 0; }
.me__names { display: flex; flex-direction: column; min-width: 0; }
.me__name { font-weight: 500; color: var(--bright); }

.me__handle,
.room__status {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.me__status {
  display: block;
  margin-top: 2px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.me__status:hover { color: var(--brass); }
.me__status.is-empty { font-style: italic; }

.me__status-input {
  display: block;
  margin-top: 2px;
  width: 100%;
  max-width: 150px;
  padding: 2px 5px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--brass);
  border-radius: 0;
  font-size: 11px;
  outline: none;
  caret-color: var(--brass);
}

.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: rgba(77, 255, 240, 0.1);
  border: 1px solid rgba(77, 255, 240, 0.35);
  font-family: "Chakra Petch", monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--brass);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
  /* цвет из профиля приходит инлайном — гасим его до тонкой заливки */
  background-blend-mode: overlay;
}

.rail__search { position: relative; padding: 12px 14px; border-bottom: 1px solid rgba(77, 255, 240, 0.1); }
.rail__search input { padding: 9px 11px; font-size: 12.5px; }

.rail__scroll {
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding: 10px 0 16px;
}

.section__label {
  margin: 6px 0 8px;
  padding: 0 18px;
  font-family: "Chakra Petch", monospace;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
}

.hint { margin: 4px 18px; color: var(--muted); font-size: 12px; }

.row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 18px;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.18s;
  animation: slide-l 0.4s ease both;
}

.row:hover { background: rgba(77, 255, 240, 0.06); }
.row.is-open { background: rgba(77, 255, 240, 0.08); border-left-color: var(--brass); }
.row.is-online .avatar { box-shadow: 0 0 12px rgba(77, 255, 240, 0.45); }

.row__body { flex: 1; min-width: 0; }

.row__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.row__name {
  color: var(--bright);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__time,
.stamp {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--muted);
}

.row__preview {
  margin-top: 2px;
  font-size: 11.5px;
  color: #4a6f6c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  flex: 0 0 auto;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 0;
  background: var(--brass);
  color: #04120f;
  border: 0;
  font-family: "Chakra Petch", monospace;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 0 14px rgba(77, 255, 240, 0.5);
}

.rail__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid rgba(77, 255, 240, 0.12);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ── Комната ────────────────────────────────────────── */

.room {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--canvas);
}

.room__blank {
  position: relative;
  flex: 1;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  overflow: hidden;
}

.room__blank::before {
  content: "КВОРУМ";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "Chakra Petch", monospace;
  font-weight: 700;
  font-size: 92px;
  letter-spacing: 0.2em;
  color: rgba(77, 255, 240, 0.05);
  white-space: nowrap;
  pointer-events: none;
}

.room__blank-title {
  margin: 0 0 6px;
  font-family: "Chakra Petch", monospace;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bright);
}

.room__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.room__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: rgba(6, 16, 19, 0.75);
  border-bottom: 1px solid rgba(77, 255, 240, 0.18);
}

.room__names { display: flex; flex-direction: column; }

.room__title {
  font-family: "Chakra Petch", monospace;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bright);
}

.room__status.is-online { color: var(--brass); }
.room__export { margin-left: auto; }

.tag {
  padding: 6px 11px;
  border: 1px solid rgba(77, 255, 240, 0.2);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.pinned {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  background: rgba(6, 16, 19, 0.75);
  border-bottom: 1px solid rgba(77, 255, 240, 0.12);
  border-left: 2px solid var(--brass);
  cursor: pointer;
}

.pinned__icon { flex: 0 0 auto; font-size: 12px; }

.pinned__text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--muted);
}

.pinned__close {
  flex: 0 0 auto;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
}

.pinned__close:hover { color: var(--brass); }

.stream-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.room__matrix {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.1;
  pointer-events: none;
}

.stream {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 24px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stream.is-dragover {
  outline: 1px dashed var(--brass);
  outline-offset: -10px;
  background: rgba(77, 255, 240, 0.06);
}

.daymark {
  align-self: center;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 16px 0 10px;
  font-size: 9.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #2f5350;
}

.daymark::before,
.daymark::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(77, 255, 240, 0.14);
}

.msg {
  position: relative;
  max-width: min(600px, 74%);
  padding: 11px 15px;
  border-radius: 0;
  background: var(--bubble-in);
  border: 1px solid rgba(77, 255, 240, 0.14);
  border-left: 2px solid var(--brass);
  align-self: flex-start;
  animation: slide-l 0.32s ease both;
}

.msg.is-mine {
  align-self: flex-end;
  background: var(--bubble-out);
  border: 1px solid rgba(77, 255, 240, 0.28);
  border-right: 2px solid var(--brass);
  box-shadow: 0 0 22px rgba(77, 255, 240, 0.1);
  animation-name: slide-r;
}

.msg.is-followup { margin-top: 0; }
.msg:not(.is-followup) { margin-top: 10px; }

.msg__tools {
  position: absolute;
  top: -15px;
  right: 8px;
  display: none;
  gap: 2px;
  padding: 2px;
  background: #071316;
  border: 1px solid rgba(77, 255, 240, 0.25);
  z-index: 3;
}

.msg.is-mine .msg__tools { right: auto; left: 8px; }
.msg:hover .msg__tools,
.msg__tools.is-open { display: flex; }

.msg__tool {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 12.5px;
  padding: 2px 6px;
  color: var(--text);
}

.msg__tool:hover { background: rgba(77, 255, 240, 0.12); }
.msg__tool.is-active { color: var(--brass); }

.msg__who {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 5px;
}

.msg.is-mine .msg__who { color: var(--pink); }

/* Курсор дешифровки — пока текст входящего «расшифровывается». */
.msg__text.is-decoding::after {
  content: "▮";
  color: var(--brass);
}

.msg__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.reaction {
  border: 1px solid rgba(77, 255, 240, 0.2);
  background: rgba(0, 0, 0, 0.4);
  border-radius: 0;
  padding: 1px 7px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}

.reaction.is-mine { border-color: var(--brass); background: rgba(77, 255, 240, 0.14); }

.emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  display: flex;
  gap: 2px;
  padding: 4px;
  margin-bottom: 4px;
  background: #071316;
  border: 1px solid rgba(77, 255, 240, 0.25);
  z-index: 4;
}

.emoji-picker button {
  background: none;
  border: 0;
  font-size: 16px;
  padding: 2px 5px;
  cursor: pointer;
}

.emoji-picker button:hover { background: rgba(77, 255, 240, 0.12); }

.msg__text { white-space: pre-wrap; overflow-wrap: anywhere; color: #dff7f3; }

.msg__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 4px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
}

.msg__read { font-size: 10px; color: var(--muted); }
.msg__read.is-read { color: var(--brass); }

.msg__image {
  display: block;
  max-width: 100%;
  max-height: 340px;
  margin-bottom: 6px;
  cursor: zoom-in;
  border: 1px solid rgba(77, 255, 240, 0.25);
  filter: saturate(0.85) contrast(1.05);
}

.msg__file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(77, 255, 240, 0.2);
  color: inherit;
  text-decoration: none;
}

.msg__file:hover { border-color: var(--brass); }
.msg__file-name { font-size: 13px; word-break: break-all; }
.msg__file-size { font-size: 10.5px; letter-spacing: 0.1em; color: var(--muted); }

.composer {
  padding: 14px 24px 20px;
  background: rgba(6, 16, 19, 0.75);
  border-top: 1px solid rgba(77, 255, 240, 0.18);
}

.composer__row { display: flex; align-items: flex-end; gap: 10px; }

.composer__prompt {
  align-self: center;
  padding-bottom: 10px;
  color: var(--brass);
  font-size: 15px;
  font-weight: 600;
}

#draft {
  resize: none;
  max-height: 160px;
  line-height: 1.45;
  padding: 11px 13px;
}

.composer__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 5px 6px 5px 11px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(77, 255, 240, 0.25);
  font-size: 12.5px;
}

.composer__chip button {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.typing-line {
  height: 20px;
  margin: 0;
  padding: 0 24px 2px;
  background: var(--canvas);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--brass);
}

.room__back { display: none; }

.dots span {
  animation: blink 1.2s infinite;
  animation-delay: calc(var(--i) * 0.18s);
}

@media (prefers-reduced-motion: reduce) {
  body, .app, .gate__card, .row, .msg { animation: none !important; }
  .gate::after, .btn--primary::after, .gate__mark, .bars i, .dots span { animation: none; }
  * { transition: none !important; }
}

@media (max-width: 1100px) {
  .gate {
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    gap: 24px;
    padding: 32px 24px;
  }
  .hud { align-self: auto; width: min(460px, 100%); }
  .hud--right { display: none; }
}

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .rail { display: none; }
  .app.is-room-open .room { display: flex; }
  .app:not(.is-room-open) .rail { display: flex; }
  .app:not(.is-room-open) .room { display: none; }
  .msg { max-width: 88%; }
  .stream, .composer, .room__head { padding-left: 14px; padding-right: 14px; }
  .room__back { display: block; }
}
