.chip-widget, .dis-widget{
  max-width: 640px;
  margin: 0 auto;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0,0,0,.06);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #fff;
  overflow: visible;
  position: relative;
}
.chip-header, .dis-header{
  display:flex; align-items:center;
  padding:16px 16px 8px 16px;
  position:relative;
}
.chip-avatar, .dis-avatar{ display: none; }
.chip-titles, .dis-titles{ flex:1; }
.chip-name, .dis-name{ font-weight:700; font-size:18px; }
.chip-disclaimer{ font-size:12px; color:#555; opacity:.9; margin-top:4px; line-height:1.4; }
.chip-menu-wrap{ position:absolute; right:8px; top:8px; }
.chip-menu-btn{ background:transparent; border:0; font-size:20px; cursor:pointer; }
.chip-close-btn{
  position:absolute;
  right:10px;
  top:10px;
  width:28px;
  height:28px;
  border-radius:50%;
  border:1px solid #d9d9d9;
  background:#fff;
  color:#555;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
}
.chip-close-btn:hover{ background:#f4f4f4; }
.chip-menu-btn{ color:#555; width:28px; height:28px; display:flex; align-items:center; justify-content:center; }
.chip-menu{
  position:absolute; right:0; top:28px; background:#fff; border:1px solid #eee;
  border-radius:12px; overflow:hidden; min-width:200px; box-shadow:0 8px 24px rgba(0,0,0,.12);
}
.chip-menu-item{ display:block; padding:10px 14px; text-decoration:none; color:#222; font-size:14px; }
.chip-menu-item:hover{ background:#f6f6f6; }
.chip-terms-link{ 
  display:block !important; 
  padding:12px 16px; 
  text-align:center; 
  font-size:13px; 
  color:#2b6cb0; 
  text-decoration:none; 
  border-top:2px solid #2b6cb0; 
  background:#f0f8ff;
  font-weight:600;
  position:relative;
  z-index:10;
}
.chip-terms-link:hover{ 
  background:#e6f3ff; 
  color:#1e4a7a;
  border-top-color:#1e4a7a;
}
.chip-body{ padding:16px 16px 20px 16px; height:320px; overflow:auto; background:#fafafa; }
.chip-msg{ margin-bottom:12px; max-width: 100%; }
.chip-msg.bot .chip-text{ background:#fff; border:1px solid #eee; }
.chip-msg.user{ margin-left:auto; }
.chip-msg.user .chip-text{ background:#2b6cb0; color:#fff; }
.chip-text{ padding:10px 12px; border-radius:14px; line-height:1.5; font-size:15px; }
.chip-options{ margin-top:8px; display:flex; flex-direction:column; gap:10px; width:100%; }
.chip-opt{ border:1px solid #2b6cb0; background:#2b6cb0; color:#fff; padding:10px 14px; min-height:52px; width:100%; border-radius:999px; cursor:pointer; transition:all 0.2s ease; display:flex; align-items:center; justify-content:center; text-align:center; line-height:1.1; }
.chip-opt:hover{ background:#1e4a7a; border-color:#1e4a7a; }
.chip-top-option{ border:1px solid #2b6cb0; background:#2b6cb0; color:#fff; padding:10px 14px; min-height:52px; width:100%; border-radius:999px; display:flex; align-items:center; justify-content:center; text-align:center; line-height:1.1; font-weight:600; letter-spacing:2px; text-transform:uppercase; box-sizing:border-box; margin:4px 0 12px; cursor:pointer; }
.chip-top-option:hover, .chip-top-option:focus{ background:#1e4a7a; border-color:#1e4a7a; outline:none; }
.chip-footer{ display:flex; gap:8px; padding:12px; border-top:1px solid #eee; background:#fff; }
.chip-input{ flex:1; padding:10px 12px; border-radius:999px; border:1px solid #ddd; }
.chip-send{ border:0; padding:0 14px; border-radius:999px; background:#2b6cb0; color:#fff; cursor:pointer; }

/* Floating widget (CSS backup; inline style in PHP already sets right/left) */
.chip-floating, .dis-floating{
  position: fixed !important;
  right: auto !important;
  left: 50% !important;
  bottom: 176px !important;
  transform: translateX(-50%);
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 520px;
  z-index: 2147483647 !important;
  border-radius: 16px !important;
  overflow: hidden !important;
}
.chip-floating .chip-body, .dis-floating .chip-body{ height: calc(520px - 56px); }

/* Launcher button */
.chip-launcher, .dis-launcher{
  position: fixed !important;
  right: 20px !important;
  left: auto !important;
  bottom: 96px !important;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #1f2937;
  box-shadow: none;
  z-index: 1000000;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
}
.chip-launcher:hover, .dis-launcher:hover{ filter: brightness(1.05); }
.chip-launcher-hidden, .dis-launcher-hidden{ display:none; }
.dis-launcher-hidden-by-account{ visibility:hidden !important; opacity:0 !important; pointer-events:none !important; }
.dis-launcher{ display:none !important; }

.dis-help-bubble{
  position: fixed;
  right: 12px;
  bottom: 96px;
  background: #fff;
  color: #333;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 16px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
  z-index: 2147483646;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
}
.dis-help-bubble::after{
  content: '';
  position: absolute;
  right: 18px;
  top: 100%;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #fff;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.1));
}
.dis-help-bubble-hidden{
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
}

/* ── Guest-only: float-anchored bubble position ──
   WordPress adds .logged-in to <body> for authenticated users.
   When logged out the bubble hovers above the "Need Help" float
   (right: 80px, width: 56px → centre at right: 108px from viewport). */
body:not(.logged-in) .dis-help-bubble {
  right: 80px;
  bottom: 92px;
}
body:not(.logged-in) .dis-help-bubble::after {
  right: 22px;
}

@media (max-width: 480px){
  .chip-floating, .dis-floating{ right: auto !important; left: 50% !important; transform: translateX(-50%); bottom: 162px !important; width: calc(100vw - 20px); height: 70vh; z-index: 2147483647 !important; }
  .chip-floating .chip-body, .dis-floating .chip-body{ height: calc(70vh - 56px); }
  .chip-launcher, .dis-launcher{ right: 12px !important; bottom: 92px !important; }
  .dis-help-bubble{ right: 6px; bottom: 92px; font-size: 11px; }
  /* Guest mobile: help float at right: 72px, 52px wide → centre at right: 98px */
  body:not(.logged-in) .dis-help-bubble { right: 72px; bottom: 92px; }
  body:not(.logged-in) .dis-help-bubble::after { right: 20px; }
}
