/* Shared support widget. Kept separate so the globe homepage can load it without
   importing the layout styles used by the other pages. */
.support-chat-btn {
  position: fixed; right: max(24px, 6vw, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 9999;
  min-width: 98px; height: 54px; padding: 0 16px; border: 1px solid rgba(148, 197, 255, .35); border-radius: 999px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, #0b8bd3, #075a98); color: #fff;
  box-shadow: 0 14px 34px rgba(2,132,199,.32), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .2s ease, filter .2s ease, box-shadow .2s ease;
}
.support-chat-btn svg { width: 23px; height: 23px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.support-chat-label { font-size: 13px; font-weight: 750; letter-spacing: .01em; }
.support-chat-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.support-chat-btn[aria-expanded="true"] { box-shadow: 0 0 0 4px rgba(56,189,248,.16), 0 14px 34px rgba(2,132,199,.32); }
.support-chat-btn:focus-visible, .support-chat-close:focus-visible, .support-chat-send:focus-visible, .support-chat-input:focus-visible {
  outline: 2px solid #55c9ff; outline-offset: 3px;
}

.support-chat-panel {
  position: fixed; right: max(24px, 6vw, env(safe-area-inset-right)); bottom: calc(max(20px, env(safe-area-inset-bottom)) + 68px); z-index: 9999;
  width: min(360px, calc(100vw - 32px)); height: min(470px, calc(100dvh - 132px)); min-height: 270px;
  display: flex; flex-direction: column;
  background: rgba(14, 23, 42, .97); border: 1px solid rgba(148, 197, 255, .2); border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.035);
  backdrop-filter: blur(22px); overflow: hidden;
  animation: support-chat-in .22s ease-out both;
}
.support-chat-panel.support-chat-hidden { display: none; }
@keyframes support-chat-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

.support-chat-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid rgba(148, 197, 255, .18);
}
.support-chat-header-title { font-size: 13.5px; font-weight: 800; color: #fff; }
.support-chat-header-sub { font-size: 10.5px; color: #9cabc0; margin-top: 2px; }
.support-chat-close {
  background: rgba(255,255,255,.06); border: 1px solid rgba(148, 197, 255, .2); color: #fff;
  width: 32px; height: 32px; flex: none; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1;
}
.support-chat-close:hover { background: rgba(255,255,255,.12); }

.support-chat-messages {
  flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px;
  overscroll-behavior: contain;
}
.support-msg { font-size: 12.5px; line-height: 1.5; padding: 10px 12px; border-radius: 13px; background: rgba(255,255,255,.06); max-width: 88%; color: #e2e8f0; overflow-wrap: anywhere; }
.support-msg.user { align-self: flex-end; background: rgba(2, 132, 199, .3); border-bottom-right-radius: 4px; }
.support-msg.stub { align-self: flex-start; border: 1px solid rgba(148, 197, 255, .18); border-bottom-left-radius: 4px; }
.support-msg-empty { font-size: 12px; line-height: 1.5; color: #9cabc0; text-align: center; padding: 24px 12px; margin: auto 0; }

.support-chat-input-row { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid rgba(148, 197, 255, .18); }
.support-chat-input {
  flex: 1; min-width: 0; background: rgba(255,255,255,.05); border: 1px solid rgba(148, 197, 255, .22);
  border-radius: 11px; padding: 10px 12px; color: #fff; font-size: 12.5px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.support-chat-input::placeholder { color: #9cabc0; }
.support-chat-input:focus { border-color: #55c9ff; box-shadow: 0 0 0 3px rgba(56,189,248,.12); }
.support-chat-send {
  min-width: 60px; background: linear-gradient(135deg, #0284c7, #0369a1); color: #fff; border: none;
  padding: 0 14px; border-radius: 11px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.support-chat-send:hover { filter: brightness(1.1); }
.support-chat-send:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 480px) {
  .support-chat-btn { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); min-width: 56px; width: 56px; height: 56px; padding: 0; }
  .support-chat-label { display: none; }
  .support-chat-panel {
    right: max(16px, env(safe-area-inset-right)); left: max(16px, env(safe-area-inset-left)); width: auto;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 68px);
    height: min(460px, calc(100dvh - 108px)); min-height: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .support-chat-panel { animation: none; }
  .support-chat-btn { transition: none; }
}
