* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: #0b141a;
  color: #e9edef;
  display: flex;
  justify-content: center;
}
.chat-shell {
  width: 100%;
  max-width: 520px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #0b141a;
  border-inline: 1px solid #1f2c34;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(120deg, #b3222e, #e25822);
  flex: none;
}
.watch-header { background: linear-gradient(120deg, #3a1c71, #b3222e); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(255,255,255,.16);
  display: grid; place-items: center;
  font-size: 22px; flex: none;
}
.peer { display: flex; flex-direction: column; line-height: 1.3; }
.peer strong { font-size: 17px; }
.peer small { font-size: 12px; opacity: .85; }
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bubble {
  max-width: 82%;
  padding: 8px 12px 6px;
  border-radius: 14px;
  font-size: 15.5px;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 1px rgba(0,0,0,.3);
}
.bubble .time {
  display: block;
  font-size: 10.5px;
  opacity: .55;
  text-align: left;
  margin-top: 2px;
  direction: ltr;
}
.bubble .who {
  display: block;
  font-size: 11px;
  font-weight: 700;
  opacity: .7;
  margin-bottom: 1px;
}
.bubble.bot {
  align-self: flex-start;
  background: #202c33;
  border-start-start-radius: 4px;
}
.bubble.friend {
  align-self: flex-end;
  background: #005c4b;
  border-start-end-radius: 4px;
}
.watch .bubble.friend { background: #6b3fa0; }
.typing {
  align-self: flex-start;
  background: #202c33;
  border-radius: 14px;
  border-start-start-radius: 4px;
  padding: 10px 14px;
  display: flex;
  gap: 4px;
}
.typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #8696a0;
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.composer {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 10px;
  background: #1f2c34;
}
.composer input {
  flex: 1;
  border: none;
  outline: none;
  border-radius: 22px;
  padding: 11px 16px;
  font-size: 15.5px;
  background: #2a3942;
  color: #e9edef;
}
.composer input::placeholder { color: #8696a0; }
.composer button {
  flex: none;
  width: 46px; height: 46px;
  border: none;
  border-radius: 50%;
  background: #e25822;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transform: scaleX(-1);
}
.watch-footer {
  flex: none;
  padding: 12px;
  text-align: center;
  font-size: 13px;
  color: #8696a0;
  background: #1f2c34;
}
