/* Site chat — composer & empty state */
.site-chat-footer {
  padding: 0.75rem 1rem  max(0.875rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(22, 119, 255, 0.14);
  background: linear-gradient(0deg, rgba(15, 20, 32, 0.98) 0%, rgba(24, 31, 46, 0.92) 100%);
  box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, 0.45);
}

.site-chat-empty {
  margin: 0 1rem 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: #94a3b8;
  background: rgba(22, 119, 255, 0.06);
  border: 1px dashed rgba(22, 119, 255, 0.18);
}

.site-chat-composer {
  width: 100%;
}

.site-chat-composer__bar {
  display: flex;
  align-items: flex-end;
  gap: 0.375rem;
  padding: 0.375rem;
  border-radius: 1rem;
  border: 1px solid rgba(22, 119, 255, 0.22);
  background: rgba(10, 15, 24, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 4px 16px -8px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-chat-composer__bar:focus-within {
  border-color: rgba(22, 119, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 3px rgba(22, 119, 255, 0.12),
    0 4px 16px -8px rgba(0, 0, 0, 0.35);
}

.site-chat-composer__emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.125rem;
  border: none;
  border-radius: 0.65rem;
  color: #94a3b8;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.site-chat-composer__emoji:hover:not(:disabled) {
  color: #cbd5e1;
  background: rgba(22, 119, 255, 0.1);
}

.site-chat-composer__emoji:active:not(:disabled) {
  background: rgba(22, 119, 255, 0.16);
}

.site-chat-composer__emoji:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.site-chat-composer__emoji[aria-expanded="true"] {
  color: #69b1ff;
  background: rgba(22, 119, 255, 0.14);
}

.site-chat-composer__input-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 0.125rem;
}

.site-chat-composer__input,
.site-chat-input.site-chat-composer__input {
  width: 100%;
  min-height: 2.5rem;
  max-height: 7rem;
  margin: 0;
  padding: 0.5rem 0.25rem;
  border: none !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #f1f5f9;
  font-size: 0.9375rem;
  line-height: 1.45;
  resize: none;
  outline: none;
}

.site-chat-composer__input::placeholder,
.site-chat-input.site-chat-composer__input::placeholder {
  color: #64748b;
}

.site-chat-composer__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.site-chat-composer__send,
.site-chat-send.site-chat-composer__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 0.125rem;
  padding: 0 !important;
  min-width: 0;
  border: none;
  border-radius: 0.65rem;
  color: #fff !important;
  background: var(--site-accent) !important;
  background-image: none !important;
  box-shadow: 0 2px 10px -2px rgba(22, 119, 255, 0.45);
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.site-chat-composer__send:hover:not(:disabled),
.site-chat-send.site-chat-composer__send:hover:not(:disabled) {
  background: var(--site-accent-hover) !important;
  box-shadow: 0 4px 14px -4px rgba(22, 119, 255, 0.5);
}

.site-chat-composer__send:active:not(:disabled) {
  background: var(--site-accent-active) !important;
  transform: scale(0.96);
}

.site-chat-composer__send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.site-chat-composer__send svg {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

.site-chat-guest-bar {
  padding: 0.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(22, 119, 255, 0.16);
  background: rgba(10, 15, 24, 0.5);
}

.site-chat-guest-bar__text {
  color: #cbd5e1;
  font-size: 0.8125rem;
}

/* Emoji picker */
.site-chat-emoji-pop {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 -8px 28px rgba(0, 0, 0, 0.45));
}

.site-chat-emoji-pop__panel {
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(22, 119, 255, 0.24);
  background: linear-gradient(180deg, #232d42 0%, #181f2e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 -4px 24px -4px rgba(0, 0, 0, 0.35);
}

.site-chat-emoji-pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid rgba(22, 119, 255, 0.14);
  background: rgba(0, 0, 0, 0.12);
}

.site-chat-emoji-pop__title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #94a3b8;
}

.site-chat-emoji-grid {
  max-height: min(42vh, 15.5rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.5rem 0.625rem 0.625rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(22, 119, 255, 0.35) transparent;
}

.site-chat-emoji-grid::-webkit-scrollbar {
  width: 5px;
}

.site-chat-emoji-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(22, 119, 255, 0.35);
}

.site-chat-emoji-section + .site-chat-emoji-section {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.site-chat-emoji-section__label {
  margin: 0 0 0.375rem;
  padding: 0 0.125rem;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.site-chat-emoji-section__grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.125rem;
}

.site-chat-emoji-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  min-height: 2.25rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  font-size: 1.3125rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  transition:
    background 0.12s ease,
    transform 0.12s ease;
}

.site-chat-emoji-btn:hover {
  background: rgba(22, 119, 255, 0.14);
}

.site-chat-emoji-btn:active {
  transform: scale(0.92);
  background: rgba(22, 119, 255, 0.22);
}

.site-chat-emoji-btn:focus-visible {
  outline: 2px solid rgba(22, 119, 255, 0.45);
  outline-offset: 1px;
}

@media (max-width: 380px) {
  .site-chat-emoji-section__grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

[data-theme="light"] .site-chat-footer {
  background: linear-gradient(0deg, #eef2f8 0%, #fff 100%);
  border-top-color: rgba(22, 119, 255, 0.12);
  box-shadow: 0 -6px 20px -10px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .site-chat-empty {
  color: #64748b;
  background: rgba(22, 119, 255, 0.05);
  border-color: rgba(22, 119, 255, 0.14);
}

[data-theme="light"] .site-chat-composer__bar {
  border-color: rgba(22, 119, 255, 0.2);
  background: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 12px -4px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .site-chat-composer__bar:focus-within {
  border-color: rgba(22, 119, 255, 0.38);
  box-shadow:
    0 0 0 3px rgba(22, 119, 255, 0.1),
    0 2px 12px -4px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .site-chat-composer__input,
[data-theme="light"] .site-chat-input.site-chat-composer__input {
  color: #0f172a;
}

[data-theme="light"] .site-chat-composer__input::placeholder {
  color: #94a3b8;
}

[data-theme="light"] .site-chat-composer__emoji {
  color: #64748b;
}

[data-theme="light"] .site-chat-composer__emoji:hover:not(:disabled) {
  color: #334155;
  background: rgba(22, 119, 255, 0.08);
}

[data-theme="light"] .site-chat-guest-bar {
  background: #f8fafc;
  border-color: rgba(22, 119, 255, 0.14);
}

[data-theme="light"] .site-chat-guest-bar__text {
  color: #475569;
}

[data-theme="light"] .site-chat-emoji-pop {
  filter: drop-shadow(0 -6px 24px rgba(15, 23, 42, 0.12));
}

[data-theme="light"] .site-chat-emoji-pop__panel {
  border-color: rgba(22, 119, 255, 0.18);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 -2px 16px -4px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .site-chat-emoji-pop__head {
  border-bottom-color: rgba(22, 119, 255, 0.1);
  background: rgba(22, 119, 255, 0.04);
}

[data-theme="light"] .site-chat-emoji-pop__title {
  color: #64748b;
}

[data-theme="light"] .site-chat-emoji-section + .site-chat-emoji-section {
  border-top-color: rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .site-chat-emoji-section__label {
  color: #94a3b8;
}

[data-theme="light"] .site-chat-emoji-grid {
  scrollbar-color: rgba(22, 119, 255, 0.28) transparent;
}

[data-theme="light"] .site-chat-emoji-btn:hover {
  background: rgba(22, 119, 255, 0.1);
}

[data-theme="light"] .site-chat-emoji-btn:active {
  background: rgba(22, 119, 255, 0.16);
}
