/* One support launcher; defer the source site's Chatwoot SDK until the user opens it. */
.theme-support-button {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 85;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 76px; height: 48px; padding: 0 13px; border: 1px solid #ffffff60; border-radius: 24px;
  color: #fff; background: #2563eb; box-shadow: 0 5px 20px #1e40af38; cursor: pointer;
  font: 600 14px/1.3 system-ui, sans-serif;
}
.theme-support-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-support-button:focus-visible { outline: 3px solid #60a5fa; outline-offset: 3px; }
.theme-support-button[hidden], .theme-support-notice[hidden] { display: none !important; }
.theme-support-notice { position: fixed; z-index: 86; right: 20px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: min(300px, calc(100vw - 32px)); border: 1px solid #cbd5e1; border-radius: 10px; padding: 12px; color: #334155; background: #fff; box-shadow: 0 5px 25px #0002; font: 14px/1.6 system-ui, sans-serif; }
body.dark .theme-support-notice, html.dark .theme-support-notice { color: #e2e8f0; background: #1e293b; border-color: #475569; }
/* Public bridge isolates SDK page tracking from application routes and identities. */
.theme-support-frame { position: fixed; z-index: 84; right: 20px; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100dvh - 108px)); border: 1px solid #e2e8f0; border-radius: 14px; box-shadow: 0 12px 40px #0003; background: #fff; }
.theme-support-frame[hidden] { display: none !important; }
@media (max-width: 600px) {
  .theme-support-button { right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); min-width: 66px; height: 44px; padding: 0 10px; font-size: 13px; }
  .theme-support-notice { right: 12px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .theme-support-frame { right: 12px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); width: calc(100vw - 24px); height: min(620px, calc(100dvh - 94px)); box-sizing: border-box; }
}

/* Preserve the homepage's existing back-to-top control without overlapping support. */
#back-to-top .top { right: 20px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); z-index: 83; }
@media (max-width: 600px) { #back-to-top .top { right: 12px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); } }

/* Landing sections use z-index:99 and its header uses 999. Keep the local
   launcher reachable there without raising it above protected app modals. */
body.cloned-static .theme-support-frame { z-index: 1100; }
body.cloned-static .theme-support-button { z-index: 1101; }
body.cloned-static .theme-support-notice { z-index: 1102; }
body.cloned-static #back-to-top .top { z-index: 1099; }
