/* Scoped adaptation of ChatWidgetClassic in oraclfund-japan.com. */
#support-chat {
  --chat-accent: #74a7ff;
  --chat-button: #0150cf;
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 9990;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  line-height: 1.5;
}
#support-chat *, #support-chat *::before, #support-chat *::after { box-sizing: border-box; }
#support-chat [hidden] { display: none !important; }
#support-chat button, #support-chat textarea, #support-chat input { font-family: inherit; }
#support-chat button { cursor: pointer; }
#support-chat button:disabled { cursor: not-allowed; opacity: .5; }
#support-chat :is(button, input, textarea, a):focus-visible { outline: 2px solid var(--chat-accent); outline-offset: 2px; }
#support-chat .support-chat__launcher {
  position: relative;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--chat-button);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 4px 12px #0003;
  transition: transform .2s, box-shadow .2s;
}
#support-chat .support-chat__launcher:hover { transform: scale(1.05); box-shadow: 0 8px 24px #0004; }
#support-chat .support-chat__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
#support-chat .support-chat__available {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #22c55e;
  border: 2px solid #111827;
  border-radius: 50%;
}
#support-chat .support-chat__preview {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 260px;
  background: #1a1a2e;
  color: #fffc;
  border: 1px solid #ffffff1a;
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  box-shadow: 0 8px 30px #0000004d;
}
#support-chat .support-chat__panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: 380px;
  max-height: min(700px, calc(100dvh - 110px));
  background: #111827;
  border: 1px solid #ffffff1a;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px #00000080;
}
#support-chat .support-chat__header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #0000004d;
  border-bottom: 1px solid #ffffff0f;
}
#support-chat .support-chat__agent { display: flex; align-items: center; gap: 10px; }
#support-chat .support-chat__avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--chat-button);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}
#support-chat .support-chat__name { display: block; font-size: 14px; font-weight: 700; color: var(--chat-accent); }
#support-chat .support-chat__role { display: block; font-size: 11px; color: #fff9; }
#support-chat .support-chat__close { background: none; border: none; color: #ffffff99; font-size: 18px; padding: 4px 8px; }
#support-chat .support-chat__body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#support-chat .support-chat__messages { display: flex; flex-direction: column; gap: 12px; padding: 16px; min-height: 100px; max-height: 240px; overflow-y: auto; }
#support-chat .support-chat__message-row { display: flex; flex-direction: column; }
#support-chat .support-chat__message-row--user { align-items: flex-end; }
#support-chat .support-chat__bubble { background: #ffffff0f; border-radius: 12px; padding: 12px 14px; color: #ffffffd9; white-space: pre-wrap; overflow-wrap: anywhere; }
#support-chat .support-chat__message-row--user .support-chat__bubble { background: var(--chat-button); color: #fff; }
#support-chat .support-chat__time { font-size: 10px; color: #ffffff80; margin-top: 4px; }
#support-chat .support-chat__typing { display: flex; gap: 4px; padding: 12px 14px; background: #ffffff0f; border-radius: 12px; width: fit-content; }
#support-chat .support-chat__typing span { width: 8px; height: 8px; border-radius: 50%; background: #ffffff4d; animation: support-chat-typing 1.2s infinite ease-in-out; }
#support-chat .support-chat__typing span:nth-child(2) { animation-delay: .2s; }
#support-chat .support-chat__typing span:nth-child(3) { animation-delay: .4s; }
#support-chat .support-chat__composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid #ffffff0f; }
#support-chat .support-chat__input {
  flex: 1;
  min-width: 0;
  width: 100%;
  background: #ffffff0f;
  border: 1px solid #ffffff1a;
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
}
#support-chat textarea.support-chat__input { resize: vertical; min-height: 42px; max-height: 120px; }
#support-chat .support-chat__input::placeholder { color: #ffffff99; opacity: 1; }
#support-chat .support-chat__input:focus { border-color: var(--chat-accent); }
#support-chat .support-chat__send { width: 40px; height: 40px; flex-shrink: 0; border: none; border-radius: 8px; background: var(--chat-button); color: #fff; font-size: 16px; font-weight: 700; }
#support-chat .support-chat__form { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; padding: 14px 16px; border-top: 1px solid #ffffff0f; position: relative; }
#support-chat .support-chat__names { display: flex; gap: 8px; min-width: 0; }
#support-chat .support-chat__submit { background: var(--chat-button); color: #fff; border: none; border-radius: 10px; padding: 12px; font-size: 14px; font-weight: 700; }
#support-chat .support-chat__privacy { font-size: 11px; color: #ffffff99; text-align: center; margin: 0; padding-bottom: 4px; }
#support-chat a { color: var(--chat-accent); text-decoration: underline; }
#support-chat .support-chat__error { color: #ffb4b4; font-size: 12px; margin: 0; }
#support-chat .support-chat__confirmation { padding: 32px 16px; text-align: center; color: #fffc; }
#support-chat .support-chat__check { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; margin: 0 auto 12px; background: linear-gradient(135deg, #22c55e, #16a34a); }
#support-chat .support-chat__confirmation p { font-size: 14px; margin: 0; color: inherit; }
#support-chat-dropdown { color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 13px; }
#support-chat-dropdown .iti--container { z-index: 10000; }
#support-chat .iti { width: 100%; color: #fff; }
#support-chat input[type="tel"] { padding-left: 95px !important; }
#support-chat .iti__selected-flag { border-radius: 8px 0 0 8px; }
#support-chat .iti__arrow { border-top-color: #ffffff99; }
#support-chat .iti__arrow--up { border-top-color: transparent; border-bottom-color: #ffffff99; }
:is(#support-chat, #support-chat-dropdown) .iti__country-list { background: #1f2937; border-color: #ffffff33; color: #fff; max-width: 340px; }
:is(#support-chat, #support-chat-dropdown) .iti__dropdown-content { background: #1f2937; border-color: #ffffff33; }
:is(#support-chat, #support-chat-dropdown) .iti__country.iti__highlight { background: #ffffff1a; }
:is(#support-chat, #support-chat-dropdown) .iti__dial-code { color: #ffffff99; }
:is(#support-chat, #support-chat-dropdown) .iti__search-input { background: #111827; color: #fff; }
@keyframes support-chat-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .3; } 30% { transform: translateY(-6px); opacity: 1; } }
@media (max-width: 480px) {
  #support-chat .support-chat__panel { width: calc(100vw - 32px); bottom: 66px; right: -4px; max-height: min(70vh, calc(100dvh - 100px)); }
  #support-chat .support-chat__preview { width: calc(100vw - 80px); }
  #support-chat .support-chat__input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #support-chat .support-chat__typing span { animation: none; }
  #support-chat .support-chat__launcher { transition: none; }
}
