.hist-chat { --hist-navy:#18266f; --hist-orange:#ef6b36; --hist-cream:#fbf8ef; --hist-border:#dfe3ef; font-family:inherit; }
.hist-chat-launcher { position:fixed; z-index:99998; right:22px; bottom:22px; display:flex; align-items:center; gap:11px; min-height:64px; padding:0 19px; border:0; border-radius:999px; background:var(--hist-navy); color:#fff; box-shadow:0 6px 22px #18266f40; cursor:pointer; font-family:inherit; font-size:15px; font-weight:600; line-height:1; }
.hist-chat-launcher:hover,.hist-chat-launcher:focus-visible { background:#24388f; }
.hist-chat-launcher svg { width:34.5px; height:34.5px; flex:0 0 34.5px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.hist-chat-launcher-label { white-space:nowrap; }
.hist-chat-panel { position:fixed; z-index:99999; right:22px; bottom:88px; display:flex; flex-direction:column; width:min(390px,calc(100vw - 28px)); height:min(570px,calc(100dvh - 115px)); overflow:hidden; border:1px solid var(--hist-border); border-radius:18px; background:#fff; color:#20264d; box-shadow:0 14px 48px #0b16432b; }
.hist-chat-panel[hidden] { display:none; }
.hist-chat-header { display:flex; align-items:center; gap:10px; padding:15px 16px; background:var(--hist-navy); color:#fff; }
.hist-chat-header strong { flex:1; font-size:16px; }
.hist-chat-header button { border:1px solid #ffffff60; border-radius:8px; background:transparent; color:#fff; cursor:pointer; }
.hist-chat-language { min-width:39px; padding:6px 8px; font-size:12px; font-weight:700; }
.hist-chat-close { width:32px; height:32px; font-size:24px; line-height:1; }
.hist-chat-messages { display:flex; flex:1; flex-direction:column; gap:11px; overflow-y:auto; padding:16px; background:var(--hist-cream); }
.hist-chat-message { max-width:88%; padding:11px 13px; border-radius:13px; white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.5; }
.hist-chat-bot { align-self:flex-start; border:1px solid var(--hist-border); background:#fff; line-height:1.6; }
.hist-chat-user { align-self:flex-end; background:#e6eef9; color:#172562; }
.hist-chat-form { display:flex; align-items:flex-end; gap:8px; padding:11px 12px 5px; background:#fff; }
.hist-chat-form textarea { flex:1; min-width:0; max-height:110px; resize:vertical; padding:10px 11px; border:1px solid var(--hist-border); border-radius:10px; color:#18234e; font:inherit; font-size:14px; }
.hist-chat-form textarea:focus { outline:2px solid #5269c744; border-color:#5269c7; }
.hist-chat-send { min-height:41px; padding:0 14px; border:0; border-radius:10px; background:var(--hist-orange); color:#fff; cursor:pointer; font-family:inherit; font-size:14px; font-weight:600; }
.hist-chat-send:disabled { opacity:.55; cursor:wait; }
.hist-chat-note { margin:0; padding:4px 13px 10px; background:#fff; color:#7c8298; font-size:11px; }
.hist-chat-embedded .hist-chat-launcher { position:relative; right:auto; bottom:auto; }
.hist-chat-embedded .hist-chat-panel { position:relative; right:auto; bottom:auto; width:min(100%,620px); height:520px; margin:0 auto 16px; }
@media (max-width:480px) { .hist-chat-launcher { right:14px; bottom:14px; min-height:60px; } .hist-chat-panel { right:10px; bottom:75px; width:calc(100vw - 20px); height:min(580px,calc(100dvh - 92px)); } }

/* v1.0.1 frontend resilience: keep the bubble above Elementor/sticky widgets. */
body > #hist-faq-chat-root.hist-chat .hist-chat-launcher {
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  z-index: 2147483000 !important;
}
body > #hist-faq-chat-root.hist-chat .hist-chat-panel {
  position: fixed !important;
  right: 22px !important;
  bottom: 88px !important;
  z-index: 2147483001 !important;
}
body > #hist-faq-chat-root.hist-chat .hist-chat-panel[hidden] { display: none !important; }
.hist-chat-debug {
  position: fixed !important;
  z-index: 2147483002 !important;
  left: 12px;
  top: 52px;
  max-width: min(420px, calc(100vw - 24px));
  white-space: pre-wrap;
  padding: 16px;
  border: 2px solid #e46427;
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 12px 26px #121b4640;
  color: #18216c;
  font: 600 12px/1.6 system-ui, sans-serif;
}
.hist-chat-debug pre { margin: 0; font: inherit; white-space: pre-wrap; }
.hist-chat-debug-close {
  display: block;
  margin-top: 10px;
  padding: 7px 10px;
  background: #18216c;
  color: #fff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
@media (max-width:480px) {
  body > #hist-faq-chat-root.hist-chat .hist-chat-launcher {
    right: 14px !important;
    bottom: 14px !important;
  }
  body > #hist-faq-chat-root.hist-chat .hist-chat-panel {
    right: 10px !important;
    bottom: 75px !important;
  }
}

/* v1.0.4: launcher icon 1.5× (23px -> 34.5px); no scaling of the entire dialog. */
#hist-faq-chat-root .hist-chat-launcher > svg { width:34.5px !important; height:34.5px !important; min-width:34.5px; flex-shrink:0; }

/* v1.0.5: scale the entire floating launcher ~1.5x (icon + frame + label). */
#hist-faq-chat-root .hist-chat-launcher {
  gap: 16px !important;
  min-height: 96px !important;
  padding: 0 28px !important;
  border-radius: 999px !important;
  font-size: 22.5px !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 28px #18266f40 !important;
}
#hist-faq-chat-root .hist-chat-launcher > svg {
  width: 34.5px !important;
  height: 34.5px !important;
  min-width: 34.5px !important;
  flex: 0 0 34.5px !important;
}
@media (max-width:480px) {
  #hist-faq-chat-root .hist-chat-launcher {
    min-height: 84px !important;
    padding: 0 24px !important;
    font-size: 20px !important;
    gap: 14px !important;
  }
}
