/* Chat widget (batch 2) — floating, full-screen capable, keyboard-accessible. */
#gp-chat-fab{ position: fixed; right: 18px; bottom: 20px; z-index: 2147483000; width: 60px; height: 60px;
  border-radius: 50%; border: 0; cursor: pointer; background: #06182b; color: #fff;
  font-size: 18px; box-shadow: 0 8px 22px rgba(6,24,43,.35); display: flex; align-items: center; justify-content: center; }
#gp-chat-fab:hover, #gp-chat-fab:focus-visible{ background: #133758; outline: 3px solid #ffb300; }
#gp-chat-fab[aria-expanded="true"]{ transform: rotate(180deg); }

#gp-chat-root[data-lang]{ position: fixed; z-index: 2147483001; width: min(380px, 92vw); height: min(540px, 82vh);
  right: 18px; bottom: 92px; background: #fff; border: 1px solid #d4dce6; border-radius: 16px;
  box-shadow: 0 18px 50px rgba(6,24,43,.28); display: flex; flex-direction: column; overflow: hidden;
  font-family: inherit; color: #111; font-size: 14px; }
/* full screen (manual on desktop, automatic on mobile) uses dynamic viewport + safe-area */
#gp-chat-root.gp-fullscreen{ width: 100%; height: 100dvh; max-width: none; max-height: none; inset: 0; right: 0; bottom: 0;
  border-radius: 0; border: 0; }
#gp-chat-root.gp-fullscreen .gp-head{ border-radius: 0; }
@supports (padding: max(0px)) {
  #gp-chat-root.gp-fullscreen .gp-head{ padding-top: max(10px, env(safe-area-inset-top)); }
  #gp-chat-root.gp-fullscreen #gp-chat-inputwrap{ padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}

/* chat-internal text size levels */
#gp-chat-root[data-font="small"] #gp-chat-messages{ font-size: 13px; }
#gp-chat-root[data-font="small"] #gp-chat-input{ font-size: 13px; }
#gp-chat-root[data-font="large"] #gp-chat-messages{ font-size: 17px; }
#gp-chat-root[data-font="large"] #gp-chat-input{ font-size: 17px; }

/* minimized: collapse to a compact title bar row */
#gp-chat-root.gp-minimized{ height: auto; min-height: 0; }
#gp-chat-root.gp-minimized #gp-chat-messages,
#gp-chat-root.gp-minimized #gp-chat-inputwrap,
#gp-chat-root.gp-minimized .gp-head{ display: none; }
#gp-chat-root .gp-head{ display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  background: #06182b; color: #fff; border-top-left-radius: 15px; border-top-right-radius: 15px; }
#gp-chat-root .gp-minbar{ display: flex; align-items: center; gap: 8px; width: 100%; background: #06182b; color: #fff;
  border: 0; padding: 12px 14px; cursor: pointer; font: inherit; text-align: left; }
#gp-chat-root .gp-minbar[hidden]{ display: none; }
#gp-chat-root .gp-head[hidden]{ display: none; }
#gp-chat-root .gp-fontctl{ display: inline-flex; gap: 4px; margin-right: 4px; }

#gp-chat-root header .gp-t{ font-weight: 700; }
#gp-chat-root header .gp-s{ font-size: 11px; opacity: .85; }
#gp-chat-root header .gp-sp{ flex: 1; }
#gp-chat-root header button{ background: rgba(255,255,255,.12); border: 0; color: #fff; width: 28px; height: 28px;
  border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1; }
#gp-chat-root header button:hover, #gp-chat-root header button:focus-visible{ background: rgba(255,255,255,.28); outline: 2px solid #ffb300; }

#gp-chat-messages{ flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
#gp-chat-messages .gp-msg{ max-width: 84%; padding: 8px 11px; border-radius: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
#gp-chat-messages .gp-user{ align-self: flex-end; background: #06182b; color: #fff; border-bottom-right-radius: 3px; }
#gp-chat-messages .gp-bot{ align-self: flex-start; background: #f0f4f8; color: #111; border-bottom-left-radius: 3px; }
#gp-chat-messages .gp-bot a{ color: #0b5aa0; }
.gp-src{ margin-top: 6px; font-size: 12px; }
.gp-src a{ display: block; }
.gp-note{ font-size: 11px; color: #666; margin-top: 4px; }
.gp-pos{ display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.gp-pos button, .gp-handoff button{ border: 1px solid #0b5aa0; color: #0b5aa0; background: #fff; border-radius: 16px;
  padding: 5px 12px; cursor: pointer; font-size: 12px; }
.gp-typing{ display: inline-flex; gap: 3px; }
.gp-typing i{ width: 5px; height: 5px; border-radius: 50%; background: #89a; animation: gpblink 1s infinite; }
.gp-typing i:nth-child(2){ animation-delay: .15s; } .gp-typing i:nth-child(3){ animation-delay: .3s; }
@keyframes gpblink{ 0%,80%,100%{opacity:.25} 40%{opacity:1} }

#gp-chat-inputwrap{ border-top: 1px solid #e3e9f0; padding: 10px; display: flex; gap: 8px; }
#gp-chat-input{ flex: 1; border: 1px solid #ccd6e2; border-radius: 10px; padding: 9px 11px; font: inherit; resize: none; min-height: 38px; }
#gp-chat-input:focus-visible{ outline: 2px solid #ffb300; }
#gp-send{ background: #0b5aa0; color: #fff; border: 0; border-radius: 10px; padding: 0 14px; cursor: pointer; font-weight: 600; }
#gp-send:hover, #gp-send:focus-visible{ background: #08457f; outline: 2px solid #ffb300; }

#gp-chat-root:focus-visible{ outline: 2px solid #ffb300; }
#gp-chat-root[hidden], #gp-chat-fab[hidden]{ display: none !important; }

/* single-column mobile: smaller FAB and header buttons, keep touch targets */
@media (max-width: 480px) {
  #gp-chat-fab{ width: 52px; height: 52px; right: 12px; bottom: 14px; }
  #gp-chat-root{ width: 100%; height: 100dvh; max-width: none; inset: 0 0 0 0; right: 0; bottom: 0; border-radius: 0; border: 0; }
  #gp-chat-root header button{ width: 32px; height: 32px; font-size: 15px; }
}
@media (max-width: 480px){ #gp-chat-root{ width: 100vw; height: 92vh; right: 0; bottom: 0; border-radius: 12px 12px 0 0; } }