/* ==========================================================================
   UGURSPORTS SOHBET - STYLESHEET (V5)
   Full Live Chat styling matching user interface design with auth modal,
   moderator pinned bar, real-time message stream, and emoji keyboard.
   ========================================================================== */

.chat-fab {
  position: fixed;
  right: 19px;
  bottom: 18px;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(122, 207, 255, 0.35);
  background: linear-gradient(135deg, #1d3441, #14242f);
  color: #e6f6ff;
  border-radius: 50px;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.6), inset 0 1px rgba(255, 255, 255, 0.12);
  letter-spacing: 0.03em;
  padding: 11px 18px;
  min-height: 44px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-fab:hover {
  border-color: #93cbe9;
  background: linear-gradient(135deg, #254658, #19303c);
  transform: translateY(-2px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.7);
}

/* Green Live Signal Indicator on Chat FAB (pulsing live beacon) */
.chat-live-indicator {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-right: 2px;
}

.chat-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 8px #00ff88, 0 0 16px rgba(0, 255, 136, 0.75);
  z-index: 2;
  animation: liveDotHeartbeat 2s infinite ease-in-out;
}

.chat-live-pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #00ff88;
  animation: liveSignalPulse 2s cubic-bezier(0, 0, 0.2, 1) infinite;
  pointer-events: none;
}

@keyframes liveSignalPulse {
  0% {
    transform: scale(0.6);
    opacity: 1;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.9);
  }
  60% {
    opacity: 0.5;
  }
  100% {
    transform: scale(2.6);
    opacity: 0;
    box-shadow: 0 0 18px rgba(0, 255, 136, 0);
  }
}

@keyframes liveDotHeartbeat {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
    box-shadow: 0 0 8px #00ff88, 0 0 16px rgba(0, 255, 136, 0.75);
  }
  20% {
    transform: scale(1.3);
    filter: brightness(1.35);
    box-shadow: 0 0 14px #00ff88, 0 0 24px rgba(0, 255, 136, 0.95);
  }
  35% {
    transform: scale(0.95);
    filter: brightness(0.9);
  }
  50% {
    transform: scale(1.2);
    filter: brightness(1.25);
    box-shadow: 0 0 12px #00ff88, 0 0 20px rgba(0, 255, 136, 0.85);
  }
  70% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.chat-live-tag {
  background: rgba(0, 255, 136, 0.16);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 136, 0.55);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
  box-shadow: inset 0 0 8px rgba(0, 255, 136, 0.2);
  animation: liveBadgeGlow 2s infinite ease-in-out;
}

@keyframes liveBadgeGlow {
  0%, 100% {
    border-color: rgba(0, 255, 136, 0.45);
    box-shadow: 0 0 4px rgba(0, 255, 136, 0.2);
  }
  50% {
    border-color: rgba(0, 255, 136, 0.95);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.6), inset 0 0 10px rgba(0, 255, 136, 0.35);
  }
}

.chat-fab-text {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #e6f6ff;
}

/* Flash animation on incoming message surge */
.chat-fab.message-flare {
  animation: fabFlare 0.8s ease;
}

@keyframes fabFlare {
  0% {
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(0, 255, 136, 0.85);
    border-color: rgba(0, 255, 136, 0.85);
  }
  50% {
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.6), 0 0 0 14px rgba(0, 255, 136, 0);
    border-color: #00ff88;
  }
  100% {
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(0, 255, 136, 0);
  }
}

.chat-fab .unread {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 19px !important;
  height: 19px !important;
  padding: 0 5px !important;
  background: #ff3b30 !important;
  color: #ffffff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  border-radius: 10px !important;
  box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.4), 0 2px 6px rgba(0, 0, 0, 0.45) !important;
  flex: none !important;
  box-sizing: border-box !important;
  text-align: center !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
  animation: unreadBadgePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes unreadBadgePop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.chat-fab svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  stroke: #a9e6ff;
}

/* Chat Main Box */
.chat-box {
  display: none;
  flex-direction: column;
  position: fixed;
  z-index: 40;
  right: 16px;
  bottom: 17px;
  width: 375px;
  max-width: calc(100vw - 24px);
  height: min(580px, calc(100dvh - 32px));
  background: #333d47;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 28px 82px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.chat-box.open {
  display: flex;
}

/* Chat Header (matches screenshot: hamburger menu + title + close) */
.chat-head {
  flex: none;
  height: 52px;
  background: #424c56;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.chat-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-menu-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  padding: 0;
}

.chat-menu-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.chat-menu-btn svg {
  width: 19px;
  height: 19px;
}

.chat-identity {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.chat-identity b {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.chat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  margin-left: 8px;
}

#closeChat {
  background: transparent;
  border: none;
  color: #d1dde6;
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  flex: none;
}

#closeChat:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.chat-admin-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  height: 28px;
  width: auto !important;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  white-space: nowrap;
  flex: none;
  box-sizing: border-box;
}

.chat-admin-clear-btn:hover {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

.chat-admin-clear-btn svg {
  width: 12px;
  height: 12px;
  flex: none;
  stroke: currentColor;
}

/* Non-dismissible Live Scrolling Announcement Ticker (TV / Live Banner Style) */
.chat-pinned-ticker {
  flex: none;
  margin: 6px 8px 4px;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.16), rgba(245, 158, 11, 0.14));
  border: 1px solid rgba(239, 68, 68, 0.38);
  border-radius: 6px;
  display: flex;
  align-items: center;
  height: 28px;
  overflow: hidden;
  user-select: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: default;
}

.chat-ticker-tag {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #dc2626;
  color: #ffffff;
  padding: 0 8px;
  height: 100%;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.25);
}

.chat-ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  animation: liveTickerPulse 1.2s infinite ease-in-out;
}

@keyframes liveTickerPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.chat-ticker-viewport {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(to right, transparent, black 8px, black calc(100% - 8px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8px, black calc(100% - 8px), transparent);
}

.chat-ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
  animation: chatTickerMarquee 24s linear infinite;
  padding-left: 100%;
}

.chat-pinned-ticker:hover .chat-ticker-track {
  animation-play-state: paused;
}

.chat-ticker-item {
  font-size: 11px;
  font-weight: 700;
  color: #fecaca;
  letter-spacing: 0.01em;
}

.chat-ticker-sep {
  color: #f59e0b;
  font-size: 10px;
  margin: 0 14px;
}

@keyframes chatTickerMarquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Active User Information Bar */
.chat-user-bar {
  flex: none;
  padding: 5px 12px;
  background: #2b333b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-provider-badge {
  font-size: 11px;
}

.chat-user-name {
  color: #ffffff;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.chat-switch-user {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #c0d1de;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.chat-switch-user:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Messages Scrollable List */
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 4px;
  background: #333d47;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.chat-loading {
  text-align: center;
  padding: 24px 10px;
  color: #92a4b3;
  font-size: 12px;
}

/* Chat Message Row */
.chat-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 9px;
  align-items: flex-start;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.12s ease;
}

.chat-msg:hover {
  background: rgba(255, 255, 255, 0.04);
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  user-select: none;
}

.chat-avatar svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Avatar Colors Palette (matches variety in screenshot) */
.avatar-col-0 { background: #3ba89b; } /* Teal */
.avatar-col-1 { background: #8e44ad; } /* Purple */
.avatar-col-2 { background: #c0392b; } /* Carmine */
.avatar-col-3 { background: #2980b9; } /* Blue */
.avatar-col-4 { background: #d35400; } /* Orange */
.avatar-col-5 { background: #16a085; } /* Green */
.avatar-col-6 { background: #d81b60; } /* Magenta */
.avatar-col-7 { background: #34495e; } /* Slate */
.avatar-google { background: #ea4335 !important; }
.avatar-telegram { background: #29b6f6 !important; }
.avatar-vk { background: #4a76a8 !important; }
.avatar-admin { background: #f39c12 !important; }

.chat-msg,
.chat-msg.mine {
  flex-direction: row !important;
}

.chat-bubble,
.chat-msg.mine .chat-bubble {
  flex: 1;
  min-width: 0;
  max-width: 100% !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.chat-bubble-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.chat-author {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.chat-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin-left: auto;
}

.chat-time {
  font-size: 10px;
  color: #92a4b3;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.chat-text {
  font-size: 12px;
  line-height: 1.44;
  color: #e4edf4;
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-msg.mine .chat-author {
  color: #a4e5ff;
}

.chat-msg.admin .chat-author {
  color: #ffd453;
}

.chat-admin-badge {
  display: inline-block;
  background: #f39c12;
  color: #1a1a1a;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: 1px;
}

/* Admin single-message delete button (Clean vector trash icon) */
.chat-msg-del-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #8fa0af;
  opacity: 0;
  cursor: pointer;
  padding: 0;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  flex: none;
}

.chat-msg:hover .chat-msg-del-btn {
  opacity: 0.7;
  pointer-events: auto;
}

.chat-msg-del-btn:hover {
  opacity: 1 !important;
  color: #ffffff !important;
  background: #dc2626 !important;
  border-color: #ef4444 !important;
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

.chat-msg-del-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  display: block;
}

/* Chat Anti-Spam Cooldown Indicator */
.chat-compose.is-cooldown #chatInput {
  opacity: 0.65;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.4);
}

.chat-compose.is-cooldown .send-chat {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================================
   AUTHENTICATION MODAL OVERLAY (Pixel-matched with user's uploaded screenshot)
   ========================================================================== */

.chat-auth-modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 28, 35, 0.72);
  backdrop-filter: blur(2px);
}

.chat-auth-card {
  position: relative;
  z-index: 2;
  width: 280px;
  max-width: calc(100% - 32px);
  background: #ffffff;
  border-radius: 8px;
  padding: 20px 22px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  animation: chatAuthPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes chatAuthPop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.chat-auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.chat-auth-top b {
  font-size: 15px;
  font-weight: 800;
  color: #111111;
  letter-spacing: -0.01em;
}

.chat-auth-close {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #777777;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.chat-auth-close:hover {
  color: #111111;
}

/* 2 Social Login Buttons: Telegram, Google */
.chat-auth-social {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.chat-auth-social-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-social-btn {
  flex: 1;
  height: 42px;
  border-radius: 6px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
  padding: 0 12px;
}

.auth-social-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.auth-social-btn:active {
  transform: translateY(1px);
}

.auth-social-btn.btn-telegram {
  background: #2ea5db;
  color: #ffffff;
}

.auth-social-btn.btn-google {
  background: #df4a32;
  color: #ffffff;
}

.auth-social-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: none;
}

.auth-btn-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Authentication Sub-views (Google & Telegram specific screens) */
.chat-auth-back-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 700;
  color: #555555;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.chat-auth-back-btn:hover {
  background: #f0f0f0;
  color: #111111;
}

.chat-subview-desc {
  font-size: 11px;
  color: #555555;
  margin: 0 0 12px;
  line-height: 1.45;
}

.chat-field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #222222;
  margin-top: 7px;
  margin-bottom: 3px;
}

.chat-subview-input {
  width: 100%;
  height: 35px;
  border: 1.5px solid #dcdcdc;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 12px;
  color: #111111;
  outline: none;
  font-family: inherit;
  background: #fcfcfc;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}

.chat-subview-input:focus {
  border-color: #333333;
  background: #ffffff;
}

.chat-subview-btn {
  width: 100%;
  height: 38px;
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.chat-subview-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.chat-subview-btn:active {
  transform: translateY(1px);
}

.chat-subview-btn.btn-google-submit {
  background: #df4a32;
  box-shadow: 0 3px 8px rgba(223, 74, 50, 0.35);
}

.chat-subview-btn.btn-telegram-submit {
  background: #2ea5db;
  box-shadow: 0 3px 8px rgba(46, 165, 219, 0.35);
}

/* "veya misafir olarak" label */
.chat-auth-label {
  font-size: 13px;
  font-weight: 800;
  color: #111111;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

/* Temporary name input + "GİT" button form */
.chat-guest-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.chat-guest-input {
  flex: 1;
  height: 34px;
  border: none;
  border-bottom: 1.5px solid #cccccc;
  background: transparent;
  padding: 4px 2px;
  font-size: 13px;
  font-weight: 500;
  color: #111111;
  outline: none;
  border-radius: 0;
  font-family: inherit;
  transition: border-color 0.2s;
}

.chat-guest-input:focus {
  border-bottom-color: #333333;
}

.chat-guest-input::placeholder {
  color: #888888;
  font-weight: 400;
}

.chat-guest-btn {
  height: 32px;
  padding: 0 16px;
  background: #595959;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
  flex: none;
  display: grid;
  place-items: center;
}

.chat-guest-btn:hover {
  background: #333333;
}

.chat-guest-btn:active {
  transform: translateY(1px);
}

/* ==========================================================================
   COMPOSE BAR & EMOJI PICKER
   ========================================================================== */

.chat-compose {
  flex: none;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: #2c353e;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 56px;
}

.chat-compose input {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #212930;
  border-radius: 8px;
  padding: 0 12px;
  color: #f6fafb;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
}

.chat-compose input:focus {
  border-color: #79ceff;
  box-shadow: 0 0 0 2px rgba(121, 206, 255, 0.15);
}

.chat-compose .emoji-toggle,
.chat-compose .send-chat {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s;
}

.chat-compose .emoji-toggle {
  background: #37424c;
  color: #d1dde6;
}

.chat-compose .emoji-toggle:hover {
  background: #44515e;
  color: #ffffff;
}

.chat-compose .emoji-toggle[aria-expanded="true"] {
  background: #4a5c6c;
  color: #a4e5ff;
}

.chat-compose .send-chat {
  background: #495662;
  color: #ffffff;
}

.chat-compose .send-chat:hover {
  background: #5b6b7a;
}

.chat-compose .send-chat.active {
  background: #2ea5db;
  color: #ffffff;
}

.chat-compose svg {
  width: 18px;
  height: 18px;
}

/* Emoji Tray Overlay */
.chat-emoji {
  box-sizing: border-box;
  position: absolute;
  z-index: 10;
  left: 10px;
  right: 10px;
  bottom: 64px;
  width: auto;
  max-width: calc(100% - 20px);
  height: 270px;
  max-height: min(270px, calc(100dvh - 170px));
  background: #242c34;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.chat-emoji.open {
  display: flex;
}

.emoji-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 44px;
}

.emoji-toolbar strong {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #d8effb;
  white-space: nowrap;
}

.emoji-search {
  height: 28px;
  flex: 1;
  min-width: 0;
  border-radius: 6px;
  background: #181e24;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
}

.emoji-search span {
  color: #8da1b0;
  font-size: 16px;
  line-height: 1;
}

.emoji-search input {
  min-width: 0;
  width: 100%;
  height: 26px;
  border: none !important;
  background: transparent !important;
  color: #e8f7ff;
  outline: none !important;
  font-size: 11px;
  padding: 0;
}

.emoji-dismiss {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 18px;
  line-height: 1;
  background: #37424c;
  color: #d3e6f1;
  cursor: pointer;
}

.emoji-categories {
  display: flex;
  gap: 3px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
}

.emoji-categories::-webkit-scrollbar {
  display: none;
}

.emoji-categories button {
  font-size: 10px;
  white-space: nowrap;
  flex: 0 0 auto;
  color: #9cb9cb;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 7px;
  cursor: pointer;
}

.emoji-categories button[aria-selected="true"] {
  background: rgba(121, 206, 255, 0.15);
  border-color: rgba(121, 206, 255, 0.3);
  color: #e4f5ff;
}

.emoji-grid {
  display: grid;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-content: start;
  gap: 4px;
  padding: 8px 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.emoji-grid button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 32px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 19px;
  line-height: 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  transition: all 0.12s;
}

.emoji-grid button:hover {
  background: rgba(121, 206, 255, 0.2);
  border-color: rgba(121, 206, 255, 0.35);
  transform: translateY(-1px);
}

.emoji-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px 8px;
  color: #9ab5c7;
  font-size: 11px;
}

.emoji-footnote {
  flex: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 5px 10px;
  text-align: center;
  color: #7f9eaf;
  font-size: 9px;
}

/* Responsive adjustments */
@media (max-width: 520px) {
  .chat-box {
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    height: min(600px, 100dvh);
    border-radius: 16px 16px 0 0;
  }
  .chat-emoji {
    bottom: 64px;
    left: 8px;
    right: 8px;
    max-width: calc(100% - 16px);
  }
  .chat-fab {
    right: 14px;
    bottom: 14px;
  }
}
