/* Brand chrome matching www.b2bdatasolution.com */
:root {
  --b2b-bg: #071126;
  --b2b-panel: #0f1e3d;
  --b2b-card: #12244a;
  --b2b-primary: #2f7bff;
  --b2b-primary-dark: #225fe8;
  --b2b-primary-light: #5a92ff;
  --b2b-text: #e6eeff;
  --b2b-muted: #a8b7d9;
  --b2b-border: #2b3b66;
  --b2b-success: #3fcf8e;
  --b2b-container: 1200px;
}

/* Align app shell with marketing navy when brand header is present */
body:has(.b2b-site-header) {
  background: radial-gradient(circle at top, #102650 0%, #071126 55%) !important;
  color: var(--b2b-text);
}

body:has(.b2b-site-header) #app > main {
  background: transparent;
}

.b2b-site-chrome {
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

.b2b-container {
  width: min(var(--b2b-container), calc(100% - 2.5rem));
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Header ---------- */
.b2b-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 17, 38, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--b2b-border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  color: var(--b2b-text);
}

.b2b-header-topbar {
  font-size: 0.82rem;
  background: rgba(8, 22, 55, 0.95);
  border-bottom: 1px solid rgba(43, 59, 102, 0.6);
  color: var(--b2b-muted);
}

.b2b-header-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.45rem 0;
}

.b2b-header-topbar__contact {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.b2b-header-topbar__link {
  color: var(--b2b-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.b2b-header-topbar__link:hover {
  color: #fff;
}

.b2b-header-topbar__social {
  display: flex;
  gap: 0.35rem;
}

.b2b-header-topbar__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 8px;
  background: rgba(47, 123, 255, 0.12);
  color: var(--b2b-primary);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 700;
  transition: background 0.15s ease, color 0.15s ease;
}

.b2b-header-topbar__social-link:hover {
  background: var(--b2b-primary);
  color: #fff;
}

.b2b-site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.1rem 0;
  position: relative;
}

.b2b-site-branding {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  text-decoration: none;
  color: #fff;
}

.b2b-site-branding img {
  display: block;
  max-height: 44px;
  width: auto;
}

.b2b-site-branding__name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.b2b-main-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.b2b-primary-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.b2b-primary-menu a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.45rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--b2b-text);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.15s ease, background 0.15s ease;
}

.b2b-primary-menu a:hover,
.b2b-primary-menu a.is-active {
  color: #fff;
  background: rgba(47, 123, 255, 0.12);
}

.b2b-header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.6rem;
}

.b2b-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--b2b-primary), var(--b2b-primary-light));
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(47, 123, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}

.b2b-header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(47, 123, 255, 0.45);
  color: #fff !important;
}

.b2b-header-cta--ghost {
  background: transparent;
  border: 1px solid var(--b2b-border);
  box-shadow: none;
  color: var(--b2b-text) !important;
}

.b2b-header-cta--ghost:hover {
  border-color: var(--b2b-primary);
  color: #fff !important;
  box-shadow: none;
}

.b2b-menu-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--b2b-border);
  background: rgba(15, 30, 61, 0.6);
  color: #fff;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  touch-action: manipulation;
}

.b2b-menu-toggle__bars {
  display: grid;
  gap: 4px;
  width: 18px;
}

.b2b-menu-toggle__bar {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

/* Overlay drawer — does not expand the sticky header */
.b2b-mobile-drawer {
  display: none;
}

.b2b-mobile-drawer.is-open {
  display: block;
}

.b2b-mobile-drawer__backdrop {
  position: fixed;
  inset: 0;
  z-index: 10020;
  border: 0;
  padding: 0;
  background: rgba(2, 8, 20, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: pointer;
}

.b2b-mobile-drawer__panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10030;
  width: min(20rem, 88vw);
  background: linear-gradient(180deg, #0a1528 0%, #07111f 100%);
  border-left: 1px solid rgba(43, 59, 102, 0.55);
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.45);
  padding: max(1rem, env(safe-area-inset-top, 0px)) 1.15rem max(1.25rem, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.b2b-mobile-drawer.is-open .b2b-mobile-drawer__panel {
  transform: translateX(0);
}

.b2b-mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(43, 59, 102, 0.45);
}

.b2b-mobile-drawer__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(230, 238, 255, 0.55);
}

.b2b-mobile-drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  line-height: 0;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

.b2b-mobile-drawer__close svg {
  display: block;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  flex-shrink: 0;
}

/* Mobile app shell drawer — logo header close (X) */
.shell-drawer-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shell-drawer-close-btn svg {
  display: block !important;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  flex-shrink: 0 !important;
  opacity: 1 !important;
  pointer-events: none;
}

.shell-drawer-close-btn svg path {
  stroke-width: 2.5;
}

.b2b-mobile-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  overflow-y: auto;
}

.b2b-mobile-drawer__nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  color: var(--b2b-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.b2b-mobile-drawer__nav a:hover,
.b2b-mobile-drawer__nav a:active {
  background: rgba(47, 123, 255, 0.12);
  color: #fff;
}

.b2b-mobile-drawer__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(43, 59, 102, 0.45);
}

.b2b-mobile-drawer__actions .b2b-header-cta {
  width: 100%;
  justify-content: center;
  min-height: 48px;
}

html.b2b-menu-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .b2b-main-nav,
  .b2b-header-actions {
    display: none;
  }

  .b2b-menu-toggle {
    display: inline-flex;
  }
}

/* ---------- Footer ---------- */
.b2b-site-footer {
  display: block !important;
  width: 100% !important;
  margin-top: auto !important;
  flex-shrink: 0;
  background: linear-gradient(180deg, #050d22 0%, #081633 40%) !important;
  border-top: 1px solid #2b3b66 !important;
  color: #e6eeff !important;
  font-family: Inter, system-ui, -apple-system, sans-serif !important;
}

.b2b-footer-main {
  display: block !important;
  padding: 3rem 0 2rem !important;
  background: transparent !important;
}

.b2b-footer-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr)) !important;
  gap: 2rem 1.75rem !important;
  align-items: start !important;
  width: min(1200px, calc(100% - 2.5rem)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.b2b-site-footer a {
  color: inherit;
}

.b2b-footer-label {
  margin: 0 0 0.75rem !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: #a8b7d9 !important;
}

.b2b-footer-brand {
  display: inline-flex !important;
  align-items: center !important;
  text-decoration: none !important;
  color: #fff !important;
  margin-bottom: 0.65rem !important;
}

.b2b-footer-brand__name {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #fff !important;
}

.b2b-footer-brand img {
  max-height: 40px;
  width: auto;
  display: block;
}

.b2b-footer-tagline {
  margin: 0 0 1rem !important;
  color: #a8b7d9 !important;
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
  max-width: 320px !important;
}

.b2b-footer-social {
  list-style: none !important;
  margin: 0 0 1rem !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 0.5rem 1rem !important;
}

.b2b-footer-social a {
  color: #e6eeff !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  padding: 0.25rem 0 !important;
  border-bottom: 1px solid transparent !important;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.b2b-footer-social a:hover {
  color: #fff !important;
  border-color: #2f7bff !important;
}

.b2b-footer-contact {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.35rem !important;
  font-size: 0.9rem !important;
}

.b2b-footer-contact a {
  color: #a8b7d9 !important;
  text-decoration: none !important;
}

.b2b-footer-contact a:hover {
  color: #2f7bff !important;
}

.b2b-footer-menu {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0.4rem !important;
}

.b2b-footer-menu a {
  color: #a8b7d9 !important;
  text-decoration: none !important;
  font-weight: 500 !important;
  padding: 0.2rem 0 !important;
  transition: color 0.15s ease;
}

.b2b-footer-menu a:hover {
  color: #fff !important;
}

.b2b-footer-bottom {
  border-top: 1px solid #2b3b66 !important;
  padding: 1.25rem 0 !important;
  background: rgba(5, 13, 34, 0.85) !important;
  color: #a8b7d9 !important;
}

.b2b-footer-bottom__inner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 1rem !important;
  flex-wrap: wrap !important;
  color: #a8b7d9 !important;
  font-size: 0.88rem !important;
  width: min(1200px, calc(100% - 2.5rem)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.b2b-footer-bottom p {
  margin: 0 !important;
  color: #a8b7d9 !important;
}

.b2b-footer-bottom a {
  color: #2f7bff !important;
  text-decoration: none !important;
}

.b2b-footer-bottom a:hover {
  color: #fff !important;
}

@media (max-width: 900px) {
  .b2b-footer-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 640px) {
  .b2b-footer-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- Floating action buttons (scroll + live chat) ---------- */
.b2b-fab {
  --b2b-fab-size: 56px;
  --b2b-fab-gap: 12px;
  --b2b-fab-inset: 24px;
  position: fixed !important;
  right: var(--b2b-fab-inset) !important;
  width: var(--b2b-fab-size) !important;
  height: var(--b2b-fab-size) !important;
  min-width: var(--b2b-fab-size) !important;
  min-height: var(--b2b-fab-size) !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  background: linear-gradient(145deg, #5a92ff 0%, #2f7bff 55%, #225fe8 100%) !important;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.22) inset,
    0 10px 28px rgba(47, 123, 255, 0.42) !important;
  cursor: pointer;
  z-index: 9999 !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease !important;
  line-height: 0 !important;
}

.b2b-fab svg {
  width: 24px !important;
  height: 24px !important;
  flex-shrink: 0;
  display: block;
}

.b2b-fab:hover {
  transform: translateY(-2px) scale(1.04) !important;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.28) inset,
    0 14px 34px rgba(47, 123, 255, 0.55) !important;
}

.b2b-fab:active {
  transform: translateY(0) scale(1) !important;
}

.b2b-fab:focus-visible {
  outline: 3px solid rgba(90, 146, 255, 0.55) !important;
  outline-offset: 3px !important;
}

.b2b-fab--chat {
  bottom: var(--b2b-fab-inset) !important;
}

.b2b-fab--scroll {
  bottom: calc(var(--b2b-fab-inset) + var(--b2b-fab-size) + var(--b2b-fab-gap)) !important;
  z-index: 10000 !important;
}

/* User/admin SPA: stack scroll above live-chat FAB (bottom-right) */
body.spa-app {
  --user-fab-size: 56px;
  --user-fab-gap: 12px;
  --user-fab-right: max(16px, env(safe-area-inset-right, 0px));
  --user-fab-bottom-chat: max(20px, env(safe-area-inset-bottom, 0px));
}

body.spa-app .live-chat-widget-fab {
  right: var(--user-fab-right);
  bottom: var(--user-fab-bottom-chat);
  width: var(--user-fab-size);
  height: var(--user-fab-size);
  z-index: 10044;
}

body.spa-app .b2b-fab--scroll {
  right: var(--user-fab-right) !important;
  left: auto !important;
  bottom: calc(var(--user-fab-bottom-chat) + var(--user-fab-size) + var(--user-fab-gap)) !important;
  width: var(--user-fab-size) !important;
  height: var(--user-fab-size) !important;
  min-width: var(--user-fab-size) !important;
  min-height: var(--user-fab-size) !important;
  z-index: 10045 !important;
  background: linear-gradient(145deg, #64748b 0%, #475569 52%, #334155 100%) !important;
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.16) inset,
    0 10px 26px rgba(15, 23, 42, 0.42) !important;
}

body.spa-app .b2b-fab--scroll:hover {
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.22) inset,
    0 14px 32px rgba(15, 23, 42, 0.52) !important;
}

body.spa-app .live-chat-widget-panel {
  bottom: calc(var(--user-fab-bottom-chat) + (var(--user-fab-size) * 2) + var(--user-fab-gap) + 14px);
  right: var(--user-fab-right);
}

.b2b-fab.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .b2b-fab {
    --b2b-fab-size: 52px;
    --b2b-fab-inset: 16px;
    --b2b-fab-gap: 10px;
  }

  .b2b-fab svg {
    width: 22px !important;
    height: 22px !important;
  }
}

/* Mobile SPA bottom navigation — fixed, high-contrast, safe padding */
.spa-bottom-nav {
  display: none;
}

@media (max-width: 767px) {
  .spa-bottom-nav {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10040;
    box-sizing: border-box;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    /* Always keep breathing room under labels; safe-area stacks on top */
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: #07111f;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
  }

  .spa-bottom-nav__row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    gap: 2px;
    width: 100%;
  }

  .spa-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 3.4rem;
    padding: 4px 2px;
    border-radius: 14px;
    text-decoration: none;
    color: #e2e8f0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    background: transparent;
    border: 0;
    cursor: pointer;
    font: inherit;
  }

  .spa-bottom-nav__item:active {
    background: rgba(255, 255, 255, 0.06);
  }

  .spa-bottom-nav__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 12px;
    color: #f1f5f9;
  }

  .spa-bottom-nav__badge {
    position: absolute;
    top: -0.2rem;
    right: -0.35rem;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 0.28rem;
    border-radius: 999px;
    background: #f43f5e;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.05rem;
    text-align: center;
    box-shadow: 0 0 0 2px #07111f;
  }

  .spa-bottom-nav__icon svg {
    width: 1.35rem;
    height: 1.35rem;
    stroke: currentColor;
    stroke-width: 2.25;
    fill: none;
  }

  .spa-bottom-nav__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
    color: #e2e8f0;
  }

  .spa-bottom-nav__item.is-active {
    color: #7dd3fc;
  }

  .spa-bottom-nav__item.is-active .spa-bottom-nav__icon {
    color: #7dd3fc;
    background: rgba(14, 165, 233, 0.22);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.35);
  }

  .spa-bottom-nav__item.is-active .spa-bottom-nav__label {
    color: #bae6fd;
  }

  /* Full-screen chat thread: hide bottom nav so composer is usable */
  html.spa-chat-thread-open .spa-bottom-nav {
    display: none !important;
  }

  html.spa-chat-thread-open .spa-flush-shell {
    height: 100dvh !important;
    max-height: 100dvh !important;
  }
}

/* Chat composer — seamless messenger-style input */
.spa-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(18, 32, 52, 0.95), rgba(8, 16, 30, 0.98));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 10px 28px rgba(0, 0, 0, 0.28);
}

.spa-chat-composer__attach {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.spa-chat-composer__attach:hover,
.spa-chat-composer__attach:focus-visible {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  outline: none;
}

.spa-chat-composer__attach:active {
  transform: scale(0.96);
}

.spa-chat-composer__attach svg {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
}

.spa-chat-composer__field {
  flex: 1;
  min-width: 0;
  max-height: 8rem;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.7rem 0.35rem;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
  resize: none;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
  background: transparent !important;
  color: #f8fafc;
  font-size: 0.9375rem;
  line-height: 1.45;
  caret-color: #38bdf8;
}

.spa-chat-composer__field::-webkit-scrollbar {
  width: 4px;
}

.spa-chat-composer__field::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.spa-chat-composer__field::placeholder {
  color: #64748b;
  opacity: 1;
  font-size: 0.875rem;
}

.spa-chat-composer__field:focus,
.spa-chat-composer__field:focus-visible {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}

.spa-chat-composer__send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  min-width: 3rem;
  height: 2.75rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #38bdf8, #0ea5e9);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.35);
  transition: filter 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.spa-chat-composer__send:hover:not(:disabled) {
  filter: brightness(1.06);
}

.spa-chat-composer__send:active:not(:disabled) {
  transform: scale(0.97);
}

.spa-chat-composer__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.spa-chat-composer__send svg {
  width: 1.05rem;
  height: 1.05rem;
}

@media (max-width: 767px) {
  .spa-chat-composer {
    gap: 0.4rem;
    padding: 0.4rem;
    border-radius: 1.1rem;
  }

  .spa-chat-composer__attach,
  .spa-chat-composer__send {
    width: 2.65rem;
    height: 2.65rem;
    min-width: 2.65rem;
    padding: 0;
  }

  .spa-chat-composer__field {
    min-height: 2.65rem;
    padding: 0.65rem 0.25rem;
    font-size: 16px; /* avoid iOS zoom on focus */
  }
}

/* Mobile SPA: sit above bottom nav; stack scroll above chat on the right */
@media (max-width: 767px) {
  body.spa-app {
    --user-fab-size: 52px;
    --user-fab-bottom-chat: max(96px, calc(6.25rem + env(safe-area-inset-bottom, 0px)));
  }

  body.spa-app .b2b-fab--scroll {
    right: var(--user-fab-right) !important;
    left: auto !important;
    bottom: calc(var(--user-fab-bottom-chat) + var(--user-fab-size) + var(--user-fab-gap)) !important;
    z-index: 10045 !important;
  }

  body.spa-app.has-sticky-cta .b2b-fab--scroll {
    /* Avoid covering payment methods / Buy CTA while purchasing */
    display: none !important;
  }

  body.spa-app .b2b-fab--chat {
    bottom: calc(6rem + 0.75rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ---------- Custom AI Filter Chat (Data Search) ---------- */
@keyframes ai-fab-pulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  70% { transform: scale(1.22); opacity: 0; }
  100% { transform: scale(1.22); opacity: 0; }
}

@keyframes ai-fab-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes ai-sparkle-spin {
  0%, 100% { transform: rotate(0deg) scale(1); }
  40% { transform: rotate(12deg) scale(1.08); }
  70% { transform: rotate(-8deg) scale(0.96); }
}

@keyframes ai-sparkle-twinkle {
  0%, 100% { opacity: 0.45; transform: scale(0.75); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes ai-sparkle-twinkle-b {
  0%, 100% { opacity: 0.35; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes ai-avatar-glow {
  0%, 100% { box-shadow: 0 8px 18px rgba(13, 148, 136, 0.35); }
  50% { box-shadow: 0 10px 24px rgba(45, 212, 191, 0.55); }
}

@keyframes ai-attach-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes ai-send-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px); }
}

@keyframes ai-close-wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

@keyframes ai-badge-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes ai-panel-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ai-typing {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}

.ai-sparkles--live .ai-sparkles__star--main {
  transform-origin: 12px 8px;
  animation: ai-sparkle-spin 2.8s ease-in-out infinite;
}

.ai-sparkles--live .ai-sparkles__star--a {
  transform-origin: 18.5px 16.5px;
  animation: ai-sparkle-twinkle 1.6s ease-in-out infinite;
}

.ai-sparkles--live .ai-sparkles__star--b {
  transform-origin: 6.2px 16.5px;
  animation: ai-sparkle-twinkle-b 1.9s ease-in-out infinite 0.25s;
}

/* Pause sparkle motion when hovering the control that contains them */
.ai-filter-chat-fab:hover .ai-sparkles--live .ai-sparkles__star,
.ai-filter-chat-fab:focus-visible .ai-sparkles--live .ai-sparkles__star,
.ai-filter-chat-panel__avatar:hover .ai-sparkles--live .ai-sparkles__star,
.ai-filter-chat-panel__header:hover .ai-filter-chat-panel__avatar .ai-sparkles--live .ai-sparkles__star {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .ai-sparkles--live .ai-sparkles__star,
  .ai-filter-chat-fab,
  .ai-filter-chat-fab__icon,
  .ai-filter-chat-fab__badge,
  .ai-filter-chat-fab__ring,
  .ai-filter-chat-fab__glow,
  .ai-filter-chat-panel__avatar,
  .ai-filter-chat-attach__icon,
  .ai-filter-chat-send__icon,
  .ai-filter-chat-icon-btn--close svg {
    animation: none !important;
  }
}

.ai-filter-chat-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 10045;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ecfeff;
  cursor: pointer;
  overflow: visible;
  background: linear-gradient(145deg, #2dd4bf 0%, #14b8a6 42%, #0891b2 100%);
  box-shadow:
    0 14px 32px rgba(13, 148, 136, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  transition: filter 0.18s ease, box-shadow 0.18s ease, background 0.2s ease;
  animation: ai-fab-float 3.2s ease-in-out infinite;
}

.ai-filter-chat-fab:hover,
.ai-filter-chat-fab:focus-visible {
  animation-play-state: paused;
  filter: brightness(1.08);
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 18px 36px rgba(13, 148, 136, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.24) inset;
  outline: none;
}

.ai-filter-chat-fab:active {
  transform: translateY(0) scale(0.97);
}

.ai-filter-chat-fab.is-open {
  background: linear-gradient(145deg, #334155, #1e293b);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.45);
  animation: none;
}

.ai-filter-chat-fab__glow {
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.35), transparent 60%);
  pointer-events: none;
  opacity: 0.55;
}

.ai-filter-chat-fab__icon {
  width: 26px;
  height: 26px;
  position: relative;
  z-index: 1;
}

.ai-filter-chat-fab svg {
  width: 22px;
  height: 22px;
  position: relative;
  z-index: 1;
}

.ai-filter-chat-fab__close {
  display: block !important;
  width: 14px !important;
  height: 14px !important;
  min-width: 14px !important;
  min-height: 14px !important;
  flex-shrink: 0 !important;
  transition: transform 0.18s ease;
}

.ai-filter-chat-fab.is-open:hover .ai-filter-chat-fab__close,
.ai-filter-chat-fab.is-open:focus-visible .ai-filter-chat-fab__close {
  transform: rotate(90deg);
}

.ai-filter-chat-fab__badge {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  min-width: 1.35rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #0f172a;
  border: 1px solid rgba(45, 212, 191, 0.55);
  color: #5eead4;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2rem;
  text-align: center;
  transform: translate(12%, -12%);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  animation: ai-badge-soft 2.4s ease-in-out infinite;
}

.ai-filter-chat-fab:hover .ai-filter-chat-fab__badge,
.ai-filter-chat-fab:focus-visible .ai-filter-chat-fab__badge {
  animation-play-state: paused;
}

.ai-filter-chat-fab__ring {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid rgba(45, 212, 191, 0.45);
  opacity: 0;
  pointer-events: none;
}

.ai-filter-chat-fab.is-hint .ai-filter-chat-fab__ring {
  animation: ai-fab-pulse 2.2s ease-out infinite;
}

.ai-filter-chat-fab:hover .ai-filter-chat-fab__ring,
.ai-filter-chat-fab:focus-visible .ai-filter-chat-fab__ring {
  animation-play-state: paused;
  opacity: 0.35;
}

html.spa-data-search .ai-filter-chat-fab,
body.admin-data-search .ai-filter-chat-fab,
body.user-data-search .ai-filter-chat-fab {
  bottom: max(96px, calc(6.25rem + env(safe-area-inset-bottom, 0px)));
}

@media (min-width: 768px) {
  html.spa-data-search .ai-filter-chat-fab,
  body.admin-data-search .ai-filter-chat-fab,
  body.user-data-search .ai-filter-chat-fab {
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 767px) {
  html.spa-data-search .b2b-fab--scroll,
  body.admin-data-search .b2b-fab--scroll,
  body.user-data-search .b2b-fab--scroll {
    left: max(12px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    bottom: max(96px, calc(6.25rem + env(safe-area-inset-bottom, 0px))) !important;
  }

  html.spa-data-search .b2b-fab--chat,
  body.admin-data-search .b2b-fab--chat,
  body.user-data-search .b2b-fab--chat {
    display: none !important;
  }
}

.ai-filter-chat-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(88px, calc(5.5rem + env(safe-area-inset-bottom, 0px)));
  z-index: 10046;
  width: min(420px, calc(100vw - 24px));
  height: min(620px, calc(100dvh - 7rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.35rem;
  border: 1px solid rgba(45, 212, 191, 0.22);
  background: linear-gradient(180deg, #0c1f2a 0%, #07111f 55%, #061018 100%);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: ai-panel-in 0.22s ease-out;
}

.ai-filter-chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.12), rgba(10, 21, 38, 0.55));
}

.ai-filter-chat-panel__avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ecfeff;
  background: linear-gradient(145deg, #2dd4bf, #0e7490);
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.35);
  animation: ai-avatar-glow 2.6s ease-in-out infinite;
}

.ai-filter-chat-panel__avatar:hover,
.ai-filter-chat-panel__header:hover .ai-filter-chat-panel__avatar {
  animation-play-state: paused;
}

.ai-filter-chat-status {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-filter-chat-status.is-live {
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.ai-filter-chat-status.is-locked {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.ai-filter-chat-panel__upsell {
  margin: 0.75rem 0.85rem 0;
  padding: 0.75rem 0.85rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(45, 212, 191, 0.25);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(8, 145, 178, 0.1));
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.ai-filter-chat-upsell-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #2dd4bf, #0d9488);
  color: #042f2e;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(13, 148, 136, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.ai-filter-chat-upsell-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.ai-filter-chat-icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  border-radius: 0.65rem;
  min-height: 2rem;
  min-width: 2rem;
  padding: 0 0.55rem;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.ai-filter-chat-icon-btn__icon {
  display: block;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
}

.ai-filter-chat-icon-btn__text {
  display: inline;
  line-height: 1;
  white-space: nowrap;
}

.ai-filter-chat-icon-btn:hover,
.ai-filter-chat-icon-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(45, 212, 191, 0.35);
  outline: none;
}

.ai-filter-chat-icon-btn--close {
  padding: 0;
  width: 2rem;
}

.ai-filter-chat-icon-btn--close svg {
  display: block;
  width: 14px;
  height: 14px;
  min-width: 14px;
  min-height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  animation: ai-close-wiggle 2.8s ease-in-out infinite;
}

.ai-filter-chat-icon-btn--close:hover svg,
.ai-filter-chat-icon-btn--close:focus-visible svg {
  animation-play-state: paused;
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}

.ai-filter-chat-icon-btn.is-active {
  color: #99f6e4;
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.14);
}

.ai-filter-chat-history {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 16, 24, 0.92);
  max-height: 220px;
  overflow-y: auto;
  padding: 0.65rem 0.75rem 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.ai-filter-chat-history__head {
  margin-bottom: 0.55rem;
}

.ai-filter-chat-history__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #f1f5f9;
}

.ai-filter-chat-history__hint {
  font-size: 0.6875rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.ai-filter-chat-history__empty {
  font-size: 0.75rem;
  color: #64748b;
  padding: 0.5rem 0;
}

.ai-filter-chat-history__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ai-filter-chat-history__item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.ai-filter-chat-history__item:hover,
.ai-filter-chat-history__item.is-active {
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(45, 212, 191, 0.08);
}

.ai-filter-chat-history__item-title {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.3;
}

.ai-filter-chat-history__item-meta {
  display: block;
  font-size: 0.6875rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.ai-filter-chat-history__item-preview {
  display: block;
  font-size: 0.6875rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  line-height: 1.35;
}

.ai-filter-chat-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ai-filter-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  width: fit-content;
}

.ai-filter-chat-typing span {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: #5eead4;
  animation: ai-typing 1s ease-in-out infinite;
}

.ai-filter-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-filter-chat-typing span:nth-child(3) { animation-delay: 0.3s; }

.ai-filter-chat-panel__footer {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(8, 22, 36, 0.65), rgba(6, 16, 28, 0.95));
  padding-top: 0.5rem;
}

.ai-filter-chat-clarification {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ai-filter-chat-panel__summary {
  margin: 0 0.75rem 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(45, 212, 191, 0.25);
  background: rgba(13, 148, 136, 0.1);
}

.ai-filter-chat-ready-card {
  margin: 0 0.75rem 0.5rem;
  padding: 0.65rem 0 0.35rem;
  border-radius: 0.95rem;
  border: 1px solid rgba(45, 212, 191, 0.35);
  background: linear-gradient(145deg, rgba(13, 148, 136, 0.22), rgba(8, 47, 73, 0.35));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.ai-filter-chat-ready-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.75rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-filter-chat-ready-card__title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #99f6e4;
}

.ai-filter-chat-count-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: #042f2e;
  background: linear-gradient(180deg, #5eead4, #14b8a6);
}

.ai-filter-chat-count-badge.is-zero {
  color: #fef3c7;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.85), rgba(180, 83, 9, 0.9));
}

.ai-filter-chat-submit {
  width: 100%;
  min-height: 2.75rem;
  border: 0;
  border-radius: 0.85rem;
  background: linear-gradient(180deg, #2dd4bf, #0d9488);
  color: #042f2e;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(13, 148, 136, 0.3);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.ai-filter-chat-submit:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.ai-filter-chat-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-filter-chat-panel__composer {
  padding: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 17, 31, 0.85);
}

.ai-filter-chat-panel__composer .spa-chat-composer {
  width: 100%;
}

.ai-filter-chat-attach,
.ai-filter-chat-send {
  flex-shrink: 0;
  height: 2.5rem;
  border: 0;
  border-radius: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.ai-filter-chat-attach {
  width: 2.5rem;
  color: #99f6e4;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

.ai-filter-chat-attach__icon {
  width: 18px;
  height: 18px;
  animation: ai-attach-bob 2.2s ease-in-out infinite;
}

.ai-filter-chat-attach:hover,
.ai-filter-chat-attach:focus-visible {
  background: rgba(45, 212, 191, 0.22);
  border-color: rgba(94, 234, 212, 0.55);
  transform: translateY(-1px);
  outline: none;
}

.ai-filter-chat-attach:hover .ai-filter-chat-attach__icon,
.ai-filter-chat-attach:focus-visible .ai-filter-chat-attach__icon {
  animation-play-state: paused;
  transform: scale(1.08);
}

.ai-filter-chat-attach:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ai-filter-chat-attach:disabled .ai-filter-chat-attach__icon {
  animation: none;
}

.ai-filter-chat-input {
  flex: 1;
  min-width: 0;
  min-height: 2.5rem;
  max-height: 96px;
  resize: none;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #f8fafc;
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.35;
  outline: none !important;
  box-shadow: none !important;
}

.ai-filter-chat-input:focus {
  border-color: rgba(45, 212, 191, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.12) !important;
}

.ai-filter-chat-input::placeholder {
  color: #64748b;
}

.ai-filter-chat-send {
  width: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
  background: linear-gradient(180deg, #2dd4bf, #0d9488);
  color: #042f2e;
}

.ai-filter-chat-send__icon {
  width: 16px;
  height: 16px;
  animation: ai-send-nudge 1.8s ease-in-out infinite;
}

.ai-filter-chat-send:hover:not(:disabled),
.ai-filter-chat-send:focus-visible:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px) scale(1.04);
  outline: none;
}

.ai-filter-chat-send:hover:not(:disabled) .ai-filter-chat-send__icon,
.ai-filter-chat-send:focus-visible:not(:disabled) .ai-filter-chat-send__icon {
  animation-play-state: paused;
  transform: translateX(2px) scale(1.1);
}

.ai-filter-chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ai-filter-chat-send:disabled .ai-filter-chat-send__icon {
  animation: none;
}

@media (min-width: 768px) {
  html.spa-data-search .ai-filter-chat-panel,
  body.admin-data-search .ai-filter-chat-panel,
  body.user-data-search .ai-filter-chat-panel {
    bottom: max(92px, calc(5.75rem + env(safe-area-inset-bottom, 0px)));
  }

  .ai-filter-chat-icon-btn--labeled .ai-filter-chat-icon-btn__icon {
    display: none;
  }

  .ai-filter-chat-icon-btn--labeled .ai-filter-chat-icon-btn__text {
    display: inline;
  }
}

@media (max-width: 767px) {
  .ai-filter-chat-panel {
    left: max(8px, env(safe-area-inset-left, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    width: auto;
    bottom: calc(var(--mobile-nav-height, calc(3.4rem + 1.5rem + env(safe-area-inset-bottom, 0px))) + 0.5rem);
    height: min(34rem, 72dvh);
    max-height: min(34rem, 72dvh);
  }

  .ai-filter-chat-panel__header .ai-filter-chat-icon-btn--labeled {
    width: 2.35rem;
    height: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0;
  }

  .ai-filter-chat-panel__header .ai-filter-chat-icon-btn--labeled .ai-filter-chat-icon-btn__text {
    display: none;
  }

  .ai-filter-chat-panel__header .ai-filter-chat-icon-btn--close {
    width: 2.35rem;
    height: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
  }

  .ai-filter-chat-panel__header .ai-filter-chat-icon-btn__icon,
  .ai-filter-chat-panel__header .ai-filter-chat-icon-btn--close svg {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    flex-shrink: 0 !important;
    opacity: 1 !important;
    color: #f1f5f9;
  }

  .ai-filter-chat-panel__header .ai-filter-chat-icon-btn__icon path,
  .ai-filter-chat-panel__header .ai-filter-chat-icon-btn--close svg path {
    stroke-width: 2.5;
  }
}

/* ---------- Auth (login / register) mobile: form first, content below ---------- */
@media (max-width: 1023px) {
  .auth-page {
    padding-top: 0.75rem !important;
  }

  .auth-form-pin {
    position: relative;
    z-index: 20;
    width: 100%;
    flex-shrink: 0;
  }

  .auth-form-pin > div {
    background: rgba(8, 18, 36, 0.94) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }
}

/* ---------- Live support chat widget (user SPA) ---------- */
@keyframes live-chat-panel-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.live-chat-widget-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: 10044;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f0f9ff;
  cursor: pointer;
  background: linear-gradient(145deg, #38bdf8 0%, #0ea5e9 45%, #0284c7 100%);
  box-shadow:
    0 14px 32px rgba(14, 165, 233, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transition: filter 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.live-chat-widget-fab:hover,
.live-chat-widget-fab:focus-visible {
  filter: brightness(1.08);
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 18px 36px rgba(14, 165, 233, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.26) inset;
  outline: none;
}

.live-chat-widget-fab:active {
  transform: translateY(0) scale(0.97);
}

.live-chat-widget-fab.is-open {
  background: linear-gradient(145deg, #334155, #1e293b);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.45);
}

.live-chat-widget-fab__glow {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 70%);
  opacity: 0.6;
  pointer-events: none;
}

.live-chat-widget-fab.is-open .live-chat-widget-fab__glow {
  display: none;
}

.live-chat-widget-fab__icon {
  width: 26px;
  height: 26px;
  position: relative;
  z-index: 1;
}

/* Data Search: live chat sits above AI assistant FAB; scroll stacks above live chat */
html.user-data-search body.spa-app,
body.user-data-search.spa-app {
  --user-fab-bottom-chat: max(92px, calc(24px + var(--user-fab-size, 56px) + 10px + env(safe-area-inset-bottom, 0px)));
}

/* When AI chat panel is open, hide live chat and the AI FAB */
body.ai-filter-chat-open .live-chat-widget-fab,
body.ai-filter-chat-open .live-chat-widget-panel {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.ai-filter-chat-open .ai-filter-chat-fab {
  display: none !important;
}

@media (max-width: 767px) {
  html.user-data-search body.spa-app,
  body.user-data-search.spa-app {
    --user-fab-bottom-chat: max(168px, calc(6.25rem + var(--user-fab-size, 52px) + 12px + env(safe-area-inset-bottom, 0px)));
  }
}

.live-chat-widget-sheet-handle {
  display: none;
}

.live-chat-widget-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(88px, calc(5.5rem + env(safe-area-inset-bottom, 0px)));
  z-index: 10043;
  width: min(400px, calc(100vw - 24px));
  height: min(560px, calc(100dvh - 7rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.25rem;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: linear-gradient(180deg, #0a1628 0%, #07111f 55%, #061018 100%);
  box-shadow:
    0 28px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: live-chat-panel-in 0.22s ease-out;
}

.live-chat-widget-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.14), rgba(10, 21, 38, 0.55));
}

.live-chat-widget-panel__avatar {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f0f9ff;
  background: linear-gradient(145deg, #38bdf8, #0284c7);
  box-shadow: 0 8px 18px rgba(14, 165, 233, 0.35);
}

.live-chat-widget-status.is-online {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.live-chat-widget-status.is-online::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
}

.live-chat-widget-icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  border-radius: 0.65rem;
  min-height: 2rem;
  min-width: 2rem;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.live-chat-widget-icon-btn:hover,
.live-chat-widget-icon-btn:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(56, 189, 248, 0.35);
  outline: none;
}

.live-chat-widget-icon-btn--close svg {
  width: 16px;
  height: 16px;
}

.live-chat-widget-panel__flash {
  flex-shrink: 0;
  margin: 0.5rem 0.85rem 0;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  color: #fecdd3;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.live-chat-widget-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.live-chat-widget-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
  text-align: center;
}

.live-chat-widget-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  border-radius: 1rem;
  border: 1px solid rgba(56, 189, 248, 0.25);
  background: rgba(14, 165, 233, 0.1);
}

.live-chat-widget-msg {
  display: flex;
}

.live-chat-widget-msg.is-mine {
  justify-content: flex-end;
}

.live-chat-widget-msg.is-theirs {
  justify-content: flex-start;
}

.live-chat-widget-msg__bubble {
  max-width: 85%;
  padding: 0.55rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.live-chat-widget-msg.is-mine .live-chat-widget-msg__bubble {
  border-bottom-right-radius: 0.25rem;
  background: linear-gradient(145deg, #0ea5e9, #0284c7);
  color: #f0f9ff;
  box-shadow: 0 6px 16px rgba(14, 165, 233, 0.25);
}

.live-chat-widget-msg.is-theirs .live-chat-widget-msg__bubble {
  border-bottom-left-radius: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #152338;
  color: #f1f5f9;
}

.live-chat-widget-msg__time {
  margin-top: 0.35rem;
  font-size: 0.625rem;
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.live-chat-widget-panel__composer {
  flex-shrink: 0;
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 21, 38, 0.92);
}

.live-chat-widget-preview {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.live-chat-widget-preview__thumb {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  object-fit: cover;
}

.live-chat-widget-panel__composer .spa-chat-composer {
  padding: 0.35rem;
  border-radius: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .live-chat-widget-panel,
  .live-chat-widget-fab {
    animation: none !important;
    transition: none !important;
  }
}
