/* ===== Общие стили чата (кабинет + админка) ===== */

.chat-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.ava {
  position: relative; flex: none;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: .3px;
}
.ava svg { width: 22px; height: 22px; }
.ava.support { background: linear-gradient(135deg, #3b5bfd, #8b5cf6); }
.ava .online {
  position: absolute; right: 0; bottom: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: #22c55e; border: 2px solid #fff;
}
.chat-title { font-weight: 700; font-size: 15px; color: #111827; }
.chat-sub { font-size: 12.5px; color: #6b7280; margin-top: 2px; }

.chat-body {
  flex: 1; overflow-y: auto;
  padding: 16px 20px 20px;
  display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 20% 0%, rgba(59, 91, 253, .05), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(139, 92, 246, .05), transparent 40%),
    #f7f8fc;
}

.day {
  align-self: center;
  font-size: 12px; font-weight: 600; color: #6b7280;
  background: #eceef6; padding: 4px 12px; border-radius: 99px;
  margin: 14px 0 6px;
}

.msg { display: flex; flex-direction: column; max-width: 72%; margin-top: 6px; animation: pop .18s ease-out; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.them { align-self: flex-start; align-items: flex-start; }
@keyframes pop { from { opacity: 0; transform: translateY(4px); } }

.bubble {
  padding: 10px 14px; border-radius: 18px;
  font-size: 14.5px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg.me .bubble {
  background: linear-gradient(135deg, #3b5bfd, #5b74ff);
  color: #fff; border-bottom-right-radius: 6px;
  box-shadow: 0 4px 14px rgba(59, 91, 253, .22);
}
.msg.them .bubble {
  background: #fff; color: #111827;
  border: 1px solid #e8eaf2; border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px rgba(17, 24, 39, .04);
}
.meta { display: flex; gap: 4px; font-size: 11px; color: #9ca3af; margin-top: 4px; padding: 0 6px; }
.ticks { letter-spacing: -2px; }
.ticks.read { color: #3b5bfd; }

/* Поле ввода */
.chat-input {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 12px 14px; background: #fff;
  border-top: 1px solid #e5e7eb;
}
.chat-input textarea {
  flex: 1; resize: none; outline: none;
  border: 1.5px solid #e5e7eb; border-radius: 14px;
  padding: 11px 14px; max-height: 140px;
  font: inherit; font-size: 14.5px; line-height: 1.4;
  background: #f9fafb; color: #111827;
  transition: border-color .15s, background .15s;
}
.chat-input textarea:focus { border-color: #3b5bfd; background: #fff; }
.send {
  flex: none; width: 46px; height: 46px; border: 0; border-radius: 14px;
  display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(135deg, #3b5bfd, #5b74ff); color: #fff;
  box-shadow: 0 4px 14px rgba(59, 91, 253, .3);
  transition: transform .1s, opacity .15s;
}
.send:hover:not(:disabled) { transform: translateY(-1px); }
.send:disabled { opacity: .35; cursor: default; box-shadow: none; }
.send svg { width: 20px; height: 20px; }

/* Пустой чат — приветствие */
.welcome { margin: auto; text-align: center; max-width: 380px; padding: 24px 12px; }
.welcome .ava { width: 68px; height: 68px; margin: 0 auto 16px; box-shadow: 0 10px 30px rgba(59, 91, 253, .3); }
.welcome .ava svg { width: 32px; height: 32px; }
.welcome h3 { margin: 0 0 6px; font-size: 18px; color: #111827; }
.welcome p { margin: 0; color: #6b7280; font-size: 14px; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.chip {
  border: 1.5px solid #dfe3f5; background: #fff; color: #374151;
  padding: 8px 14px; border-radius: 99px; font-size: 13.5px; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: #3b5bfd; color: #3b5bfd; }

@media (max-width: 600px) {
  .msg { max-width: 86%; }
  .chat-body { padding: 12px; }
}
