/* Ben's storefront launcher and invitation share the Atmospheric palette. */
#ben-floating-btn, #ben-chat-invite {
  --ben-shell-navy: var(--wp--preset--color--primary-dark, #12123f);
  --ben-shell-blue: var(--wp--preset--color--primary, #0945c8);
  --ben-shell-sky: var(--wp--preset--color--secondary, #dbe6ee);
  --ben-shell-cloud: var(--wp--preset--color--tertiary, #f1f4fa);
  --ben-shell-sun: var(--wp--preset--color--sun, #f9d13e);
  box-sizing: border-box;
  font-family: var(--wp--preset--font-family--heading, Raleway, system-ui, sans-serif);
}
#ben-floating-btn {
  position: fixed; right: 20px; bottom: calc(var(--ben-shell-bottom, 20px) + env(safe-area-inset-bottom, 0px));
  z-index: 2147483000; width: auto; min-width: 158px; height: 60px; padding: 8px 16px 8px 8px;
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  border: 1px solid var(--ben-shell-blue); border-radius: 12px; overflow: visible;
  background: var(--ben-shell-navy); color: #f1f4fa; cursor: pointer;
  box-shadow: 0 6px 20px rgba(18, 18, 63, .18);
  text-align: left; line-height: 1.2; transition: background .16s ease, box-shadow .16s ease;
}
#ben-floating-btn:hover { background: var(--ben-shell-blue); transform: none; box-shadow: 0 8px 24px rgba(18,18,63,.24); }
#ben-floating-btn:focus-visible, #ben-chat-invite:focus-visible, #ben-chat-invite button:focus-visible {
  outline: 3px solid var(--ben-shell-sun); outline-offset: 3px;
}
#ben-floating-btn img, #ben-floating-btn .ben-portrait {
  width: 42px; height: 42px; flex: none; object-fit: cover; border: 2px solid var(--ben-shell-sky); border-radius: 50%; box-sizing: border-box;
}
#ben-floating-btn .ben-launcher-label, #ben-floating-btn:not([data-ben-v2])::after { font-size: 14px; font-weight: 700; color: inherit; }
#ben-floating-btn:not([data-ben-v2])::after { content: "Ask Ben"; }
#ben-floating-btn .ben-launcher-label > span { display: block; margin-top: 3px; font-size: 10px; font-weight: 500; color: #dbe6ee; }
#ben-floating-btn .ben-btn-dot { display: none; }
#ben-floating-btn[data-ben-invite="true"] .ben-btn-dot, #ben-floating-btn .ben-badge {
  display: block; position: absolute; top: -4px; right: -4px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--ben-shell-sun); border: 2px solid var(--ben-shell-navy); animation: none;
}
#ben-chat-invite {
  position: fixed; right: 20px; bottom: calc(var(--ben-shell-bottom, 20px) + 72px + env(safe-area-inset-bottom, 0px));
  z-index: 2147482999; width: 304px; max-width: calc(100vw - 40px); padding: 20px;
  display: flex; flex-direction: column; gap: 8px; text-align: left;
  border: 1px solid var(--ben-shell-sky); border-top: 3px solid var(--ben-shell-sun); border-radius: 12px;
  background: var(--ben-shell-cloud); color: var(--ben-shell-navy); box-shadow: 0 8px 24px rgba(18,18,63,.14);
  animation: ben-invite-reveal .18s ease-out;
}
#ben-chat-invite::after {
  content: ""; position: absolute; right: 27px; bottom: -6px; width: 10px; height: 10px;
  border-right: 1px solid var(--ben-shell-sky); border-bottom: 1px solid var(--ben-shell-sky);
  background: var(--ben-shell-cloud); transform: rotate(45deg);
}
#ben-chat-invite .ben-chat-invite__title { display: block; padding-right: 26px; font: 700 13px/1.3 var(--wp--preset--font-family--heading, Raleway, system-ui, sans-serif); color: var(--ben-shell-navy); }
#ben-chat-invite .ben-chat-invite__copy { display: block; margin: 0; font: 400 16px/1.5 var(--wp--preset--font-family--primary, 'Source Serif 4', Georgia, serif); color: var(--ben-shell-navy); overflow-wrap: anywhere; }
#ben-chat-invite .ben-chat-invite__open { align-self: flex-start; min-height: 44px; margin-top: 4px; padding: 10px 16px; border: 0; border-radius: 8px; background: var(--ben-shell-blue); color: #f1f4fa; font: 700 13px/1.2 var(--wp--preset--font-family--heading, Raleway, system-ui, sans-serif); cursor: pointer; }
#ben-chat-invite .ben-chat-invite__open:hover { background: var(--ben-shell-navy); }
#ben-chat-invite .ben-chat-invite__dismiss { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ben-shell-navy); font: 400 22px/1 system-ui; cursor: pointer; }
#ben-chat-invite .ben-chat-invite__dismiss:hover { background: var(--ben-shell-sky); }
@keyframes ben-invite-reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  #ben-floating-btn { right: 14px; bottom: calc(var(--ben-shell-bottom, 14px) + env(safe-area-inset-bottom, 0px)); width: 48px; min-width: 48px; height: 48px; padding: 0; border-radius: 50%; justify-content: center; box-shadow: 0 2px 10px rgba(18,18,63,.16); }
  #ben-floating-btn .ben-launcher-label, #ben-floating-btn:not([data-ben-v2])::after, #ben-chat-invite { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #ben-floating-btn, #ben-chat-invite { animation: none; transition: none; }
}

#ben-chat-window{position:fixed;bottom:88px;right:20px;z-index:2147483000;width:380px;height:600px;max-width:calc(100vw - 24px);max-height:calc(100vh - 110px);background:#fff;border:1px solid #dbe6ee;border-radius:16px;box-shadow:0 12px 40px rgba(18,18,63,.22);display:flex;flex-direction:column;overflow:hidden;opacity:0;transform:translateY(12px) scale(.98);pointer-events:none;transition:opacity .18s ease,transform .18s ease;font-family:Raleway,system-ui,-apple-system,sans-serif}
#ben-chat-window[data-ben-open="true"]{opacity:1;transform:none;pointer-events:auto}
#ben-chat-window .ben-widget-header{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid #dbe6ee;background:#f1f4fa;color:#12123f}
#ben-chat-window .ben-widget-header .ben-portrait{width:32px;height:32px;border-radius:50%;object-fit:cover;flex:none}
#ben-chat-window .ben-widget-header .ben-h-title{font-weight:600;font-size:14px}
#ben-chat-window .ben-widget-header .ben-h-sub{font-size:12px;color:#5b6478}
#ben-chat-window .ben-widget-header .ben-h-spacer{flex:1}
#ben-chat-window .ben-widget-header button{border:none;background:transparent;cursor:pointer;color:#12123f;padding:4px;border-radius:6px;display:flex;align-items:center}
#ben-chat-window .ben-widget-header button:hover{background:#dbe6ee}
#ben-chat-window .ben-widget-body{flex:1;min-height:0;display:flex;flex-direction:column;position:relative}
#ben-chat-window .ben-widget-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:8px;color:#5b6478;font-size:13px;background:#fff}
#ben-chat-window .ben-widget-loading .ben-spin{width:16px;height:16px;border:2px solid #dbe6ee;border-top-color:#0945c8;border-radius:50%;animation:ben-spin .8s linear infinite}
@keyframes ben-spin{to{transform:rotate(360deg)}}
@media (max-width:480px){#ben-chat-window{bottom:0;right:0;left:0;top:0;width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0;border:none}}
#ben-chat-window button:focus-visible {outline:3px solid #0945c8;outline-offset:2px}
@media(prefers-reduced-motion:reduce){#ben-chat-window{transition:none}#ben-chat-window .ben-spin{animation:none}}

/* Header icon strokes (kept out of the loader's inline SVG markup to hold the
   loader under its 10KB budget). ID-scoped so host SVG rules can't win. */
#ben-chat-window .ben-widget-header svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
