:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e8edf5;
  background: #0d1117;
  --bg: #0d1117;
  --panel: #151b24;
  --panel2: #1b2330;
  --line: #283342;
  --muted: #8b98aa;
  --lime: #c6f36b;
  --cyan: #66d9ef;
  --red: #ff6b78;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at 80% -20%, #243349 0, #0d1117 40%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Loading & Error screens */
.loading-screen, .error-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: #0d1117;
}
.loading-content, .error-content {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 40px;
}
.loading-spinner {
  width: 32px; height: 32px; border: 3px solid #1e2633;
  border-top-color: var(--lime); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.app-shell { display: flex; min-height: 100vh; overflow: hidden; }

/* ---------------- sidebar ---------------- */
.sidebar {
  width: 250px;
  min-width: 250px;
  border-right: 1px solid var(--line);
  background: #111720;
  padding: 27px 17px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 11px; margin: 2px 10px 54px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 12px;
  background: #20204a;
  display: grid; place-items: center;
  overflow: hidden;
  box-shadow: 0 0 24px #66e6ff33, 0 0 16px #e264ff22;
}
.brand-icon img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand b { display: block; letter-spacing: .22em; font-size: 13px; }
.brand span { display: block; color: var(--muted); font-size: 8px; letter-spacing: .16em; margin-top: 5px; }
.side-label, .eyebrow { color: #66758a; letter-spacing: .17em; font-size: 10px; font-weight: 800; }
.side-label { margin: 0 10px 13px; }
nav { display: grid; gap: 5px; }
.nav-item {
  border: 0; background: none; color: #8997a9;
  text-align: left; padding: 11px 14px; border-radius: 10px;
  font-size: 14px; cursor: pointer; min-height: 52px;
}
.nav-item span {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; font-size: 19px;
  color: #76859a; vertical-align: middle;
}
.nav-item.active { color: #f5f8fc; background: #1d2733; box-shadow: inset 3px 0 var(--lime); }
.nav-item.active span { color: var(--lime); }
.side-spacer { flex: 1; }
.connection-card {
  border: 1px solid var(--line); border-radius: 13px; padding: 12px;
  display: flex; align-items: center; gap: 9px; background: #161e28;
}
.connection-card strong { display: block; font-size: 11px; }
.connection-card small { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #596678; flex: none; }
.dot.live { background: var(--lime); box-shadow: 0 0 9px var(--lime); }
.connection-card button {
  margin-left: auto; border: 0; background: none;
  color: var(--muted); font-size: 18px; cursor: pointer;
}

/* ---------------- content ---------------- */
.content {
  flex: 1;
  padding: 38px 52px;
  max-width: 1320px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}
.topbar { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 30px; }
.topbar h1 { margin: 9px 0 7px; font-size: 29px; }
.topbar p { margin: 0; color: var(--muted); }
.top-actions { display: flex; gap: 10px; align-items: flex-end; }
.api-wrap label { display: block; color: var(--muted); font-size: 10px; margin-bottom: 4px; }
.api-wrap input { width: 230px; }
.icon-btn {
  border: 1px solid var(--line); background: #202b38; color: #e8edf5;
  width: 36px; height: 36px; border-radius: 9px; cursor: pointer; font-size: 16px;
  transition: all .15s ease;
}
.icon-btn:hover { background: #28374a; }
.icon-btn:active { transform: scale(0.95); }
.avatar {
  border: 0; background: var(--cyan); color: #0d1117;
  width: 36px; height: 36px; border-radius: 50%;
  font-weight: 800; cursor: pointer;
  transition: transform .15s ease;
}
.avatar:active { transform: scale(0.95); }

/* Master Power Switch */
.power-switch-wrap {
  display: flex; align-items: center; gap: 10px;
  background: #161e28; border: 1px solid var(--line);
  border-radius: 24px; padding: 6px 14px; height: 36px;
  cursor: pointer; user-select: none;
  transition: all .2s ease;
}
.power-switch-wrap:hover { border-color: #3b4b5e; background: #1c2633; }
.power-switch-wrap.active { border-color: #3c582f; background: #162419; }
.power-switch-wrap.paused { border-color: #5a2632; background: #25161c; }
.power-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff6b78; box-shadow: 0 0 8px #ff6b78; transition: all .2s; }
.power-switch-wrap.active .power-dot { background: var(--lime); box-shadow: 0 0 10px var(--lime); }
.power-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #ff8591; transition: color .2s; }
.power-switch-wrap.active .power-label { color: var(--lime); }
.switch-toggle { width: 36px; height: 20px; background: #374151; border-radius: 12px; position: relative; transition: background .25s ease; }
.switch-knob { width: 16px; height: 16px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: transform .25s ease; box-shadow: 0 1px 4px #0006; }
.power-switch-wrap.active .switch-toggle { background: #32a852; }
.power-switch-wrap.active .switch-knob { transform: translateX(16px); }

/* Paused Banner */
.paused-banner {
  background: linear-gradient(90deg, #2d151c 0%, #1c1418 100%);
  border: 1px solid #70363f; border-radius: 10px;
  padding: 12px 18px; margin-bottom: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  box-shadow: 0 4px 16px #ff6b7815;
}

/* Chat stage widget in chat view header */
.chat-stage-widget { display: flex; align-items: center; gap: 8px; background: #161f2c; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); }
.chat-stage-widget select { background: #1c2838; color: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 12px; cursor: pointer; }

/* ---------------- cards & stats ---------------- */
.card {
  background: linear-gradient(145deg, #171f2a, #121922);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 12px 28px #0002;
  min-width: 0;
  overflow: hidden;
}
.grid { display: grid; gap: 18px; min-width: 0; }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-head { font-size: 10px; letter-spacing: .12em; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 12px; }
.stat-value small { font-size: 12px; color: var(--muted); }
.stat-accent { color: var(--lime); }
.badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.badge-primary { background: #263820; color: var(--lime); border: 1px solid #3c582f; }
.badge-success { background: #1c3529; color: #4ee09b; border: 1px solid #2d5a44; }
.badge-danger { background: #351a22; color: #ff8591; border: 1px solid #5a2632; }
.badge-neutral { background: #1a222e; color: #8fa0b5; border: 1px solid #283547; }
.badge-outline { background: transparent; color: #8fa0b5; border: 1px solid #283547; }
.danger-hover:hover { color: #ff6b78 !important; border-color: #70363f !important; background: #2b1820 !important; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 17px; }
.section-head span { color: var(--muted); font-size: 11px; }

.hero-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.hero-title { font-size: 22px; margin: 10px 0 8px; }
.hero-title em { color: var(--lime); font-style: normal; }
.hero-card p { margin: 0; color: var(--muted); }
.mood-row { display: flex; gap: 14px; align-items: center; flex: none; }
.mood-number {
  width: 64px; height: 64px; border-radius: 16px;
  background: #1d2733; border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 800; color: var(--lime);
}
.mood-meta { color: var(--muted); font-size: 11px; line-height: 1.5; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---------------- buttons & forms ---------------- */
.btn {
  border: 1px solid var(--line); background: #202b38; color: #e8edf5;
  border-radius: 8px; padding: 9px 13px; cursor: pointer; font: inherit;
  transition: all .15s ease;
}
.btn:hover { background: #28374a; }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn.primary { background: var(--lime); color: #18210f; border-color: var(--lime); font-weight: 700; }
.btn.primary:hover { background: #d4ff75; box-shadow: 0 0 14px #c6f36b44; }
.btn.danger { color: #ffb1b8; border-color: #70363f; background: #2b1820; }
.btn.danger:hover { background: #3b1d27; }

.field { display: grid; gap: 6px; margin: 14px 0; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field textarea, select {
  width: 100%; border: 1px solid var(--line); background: #0f151d;
  color: #e8edf5; border-radius: 8px; padding: 10px; font: inherit;
}
.field textarea { min-height: 90px; resize: vertical; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type="checkbox"] { accent-color: var(--lime); width: 15px; height: 15px; }
.model-row { display: flex; gap: 8px; }
.model-row select { flex: 1; min-width: 0; }
.free-toggle {
  display: flex; gap: 8px; align-items: center;
  color: var(--muted); font-size: 12px; margin: 8px 0 14px; cursor: pointer;
}

/* ---------------- rows / lists ---------------- */
.row-list { display: grid; gap: 6px; }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; background: #121a24;
}
/* ---------------- relations ---------------- */
.rel-row {
  display: grid;
  grid-template-columns: 240px 150px 1fr 160px;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: #121a24;
}
.rel-contact {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rel-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.rel-title-line b {
  color: #e8edf5;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rel-stage-badge {
  color: var(--lime, #3fb27f);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rel-metrics {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 !important;
}
.rel-select {
  padding: 5px 8px;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}

/* ---------------- chats ---------------- */
.chat-list { display: grid; gap: 8px; margin-top: 14px; }
.chat-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121a24;
  color: #e8edf5;
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.chat-row:hover { background: #16202c; border-color: #2a384c; }
.chat-row b { font-size: 14px; color: #fff; }
.chat-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #b7c0ce; font-size: 13px; }
/* ---------------- Telegram-Style Chat ---------------- */
.messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  max-height: 60vh;
  overflow-y: auto;
  padding: 20px 22px;
  background: #0e1621 url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%2317212b' fill-opacity='0.35' fill-rule='evenodd'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  border-radius: 14px;
  border: 1px solid #1c2733;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

.message {
  position: relative;
  max-width: 68%;
  min-width: 100px;
  padding: 8px 12px 6px;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  word-break: break-word;
  animation: fadeInMsg 0.15s ease-out;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.in {
  align-self: flex-start;
  background: #182533;
  color: #e4ecf5;
  border-bottom-left-radius: 3px;
  border: 1px solid #233446;
}

.message.out {
  align-self: flex-end;
  background: #2b5278;
  color: #ffffff;
  border-bottom-right-radius: 3px;
  border: 1px solid #366593;
}

.message.is-circle,
.message.is-sticker {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px !important;
}

.msg-sender {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.2;
}

.message.in .msg-sender { color: #5ca8fe; }
.message.out .msg-sender { color: #a2f074; }
.message.out.is-operator .msg-sender { color: #f6ad55; }

.msg-text {
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
  white-space: pre-wrap;
}

.msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
  user-select: none;
}

.msg-check {
  color: #4fae6f;
  font-size: 12px;
  letter-spacing: -2px;
  font-weight: 800;
  margin-left: 2px;
}

/* Telegram Media Styling */
.msg-photo-wrap {
  margin: -8px -12px 6px -12px;
  overflow: hidden;
  border-top-left-radius: 13px;
  border-top-right-radius: 13px;
}
.msg-photo {
  width: 100%;
  max-width: 380px;
  max-height: 420px;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.msg-photo:hover {
  opacity: 0.93;
}

.msg-video {
  max-width: 380px;
  max-height: 380px;
  border-radius: 10px;
  display: block;
  background: #000;
  margin-bottom: 6px;
}

.msg-circle-video {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid #5288c1;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  background: #000;
}

.msg-audio {
  max-width: 280px;
  height: 36px;
  display: block;
  margin: 4px 0;
}

.msg-sticker-img {
  max-width: 150px;
  max-height: 150px;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.45));
}

/* Telegram Style Manual Input */
.manual-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #17212b;
  border: 1px solid #242f3d;
  border-radius: 28px;
  padding: 6px 8px 6px 16px;
  margin-top: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.manual-form input {
  flex: 1;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 14px;
  padding: 8px 4px;
  outline: none;
}
.manual-form input::placeholder {
  color: #6c7883;
}
.manual-form button {
  background: #5288c1;
  color: #ffffff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.manual-form button:hover {
  background: #6296d1;
  transform: scale(1.05);
}
.manual-form button:active {
  transform: scale(0.92);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}
.lightbox-modal img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  cursor: default;
}

/* ---------------- qr ---------------- */
.qr-box {
  border: 1px dashed var(--line); border-radius: 12px; padding: 18px;
  margin: 14px 0; display: grid; place-items: center; gap: 8px;
  min-height: 120px; text-align: center;
}
.qr-box img { width: 220px; }
.qr-box small { color: var(--muted); }
.connected { color: var(--lime); font-weight: 700; }

/* ---------------- misc ---------------- */
.empty, .mono, .hint { color: var(--muted); }
.hint { font-size: 12px; margin-top: 10px; line-height: 1.5; }
pre {
  background: #0f151d; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; overflow-x: auto; overflow-y: auto; max-height: 400px;
  font-size: 12px; color: #b7c0ce; margin: 0; white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------- modal ---------------- */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 1200; } /* выше loading-screen (999) */
.modal-backdrop { position: absolute; inset: 0; background: #0009; }
.modal-card {
  position: relative; width: 440px; margin: 12vh auto;
  background: #17202b; border: 1px solid var(--line);
  border-radius: 14px; padding: 22px;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------------- toast ---------------- */
.toast {
  position: fixed; right: 24px; bottom: 24px;
  background: #233327; color: #dff6c0;
  padding: 12px 16px; border-radius: 8px;
  opacity: 0; transition: .2s; max-width: 460px;
}
.toast.show { opacity: 1; }
.toast.error { background: #49232b; color: #ffd4d8; }

@media (max-width: 1100px) {
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  .content { padding: 24px; }
  .grid.four, .grid.three, .grid.two { grid-template-columns: 1fr; }
  .sidebar { width: 210px; min-width: 210px; }
  .topbar { display: block; }
  .top-actions { margin-top: 16px; flex-wrap: wrap; }
  .hero-card { flex-direction: column; align-items: flex-start; }
  .chat-row em { display: inline-block; }
  .rel-row { grid-template-columns: 1fr; gap: 8px; }
  .api-wrap input { width: 160px; }
}

/* ---------------- mobile / Telegram miniapp ---------------- */
@media (max-width: 920px) {
  .app-shell { flex-direction: column; overflow: visible; }

  .sidebar {
    width: 100%; min-width: 0; padding: 10px 12px 6px;
    border-right: none; border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
  }
  .brand { margin: 0 2px 8px; }
  .brand b { font-size: 11px; }
  .side-label, .side-spacer { display: none; }
  .sidebar nav { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 5px; -webkit-overflow-scrolling: touch; }
  .nav-item { white-space: nowrap; padding: 8px 11px; flex: 0 0 auto; }
  .nav-item.active { box-shadow: inset 0 -3px var(--lime); }
  .connection-card { margin-top: 6px; padding: 8px 10px; }

  .content { padding: 12px 10px 34px; overflow-x: hidden; min-width: 0; }
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
  .topbar h1 { font-size: 19px; }
  .topbar p { font-size: 12px; }
  .top-actions { flex-wrap: wrap; align-items: center; gap: 8px; }
  .api-wrap { display: none; }
  .power-switch-wrap { order: -1; }

  .grid.two { grid-template-columns: 1fr; }
  .card { padding: 14px 12px; }
  .row { flex-wrap: wrap; row-gap: 6px; }
  .row span { min-width: 0; word-break: break-word; }
  pre { overflow-x: auto; font-size: 11px; }

  .chat-list { max-height: none; }
  .chat-row { padding: 10px; }
  .messages { max-height: 58vh; }
  .msg, .msg-bubble { max-width: 88%; }
  .msg-photo { max-width: 100%; }
  .msg-video, .msg-circle-video { max-width: 100%; }

  .modal-card { width: 93vw; margin: 5vh auto; max-height: 88vh; overflow-y: auto; padding: 16px 14px; }
  .quick-actions { flex-wrap: wrap; gap: 8px; }
  .rel-metrics { display: none; }
}

/* ---------------- chat list rows (переписано: без вложенных button) ---------------- */
.chat-row { display: flex; flex-direction: row; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; cursor: pointer; border: 1px solid transparent; border-radius: 10px; padding: 9px 10px; background: transparent; text-align: left; }
.chat-row:hover { background: #17202b; border-color: var(--line); }
.chat-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-row-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.chat-title { color: #e8edf5; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.badge-stage { background: #1f2937; color: #9ca3af; font-size: 10px; }
.chat-row-last { color: #94a3b8; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-last-out { color: #3fb27f; margin-right: 4px; }
.chat-row-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.chat-row-side { flex-shrink: 0; display: flex; align-items: center; gap: 7px; }
.chat-mode { font-style: normal; font-size: 11px; color: #3fb27f; }
.chat-mode.manual { color: #f85149; }
.chat-tg { color: var(--cyan, #4fc1ff); text-decoration: none; font-size: 13px; padding: 2px 7px; background: #182230; border-radius: 5px; }
.chat-del { width: 26px; height: 26px; padding: 0; font-size: 12px; line-height: 1; flex-shrink: 0; border-radius: 7px; }
.chat-pin { width: 26px; height: 26px; padding: 0; font-size: 12px; line-height: 1; flex-shrink: 0; border-radius: 7px; opacity: 0.55; }
.chat-pin:hover { opacity: 1; }
.chat-row.pinned { background: rgba(79, 193, 255, 0.06); border-color: rgba(79, 193, 255, 0.3); }
.chat-kind { margin-left: auto; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.chat-row-last { display: flex; gap: 5px; align-items: center; }
.chat-last-out { color: var(--cyan, #4fc1ff); font-size: 11px; flex-shrink: 0; }
.chat-last-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row.pinned .chat-title { color: #4fc1ff; }
.pin-icon { font-size: 12px; flex-shrink: 0; }
.sticker-fallback { font-size: 58px; line-height: 1.15; text-align: center; padding: 12px 0; user-select: none; }
