/* Ask FinanceBee — answers from these pages only. */
.sb-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 260;
  font-family: Inter, system-ui, sans-serif;
  color: var(--navy, #0B2545);
}
.sb-root[hidden] { display: none !important; }

/* ---------- launcher: white hex, original bee, a soft ring breathing behind it ---------- */
.sb-launch {
  position: relative;
  width: 62px;
  height: 62px;
  padding: 0;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: transparent;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 12px 22px rgba(11, 37, 69, .28));
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.sb-launch::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: rgba(248, 180, 0, .45);
  animation: sb-breathe 2.8s ease-out infinite;
  z-index: -1;
}
@keyframes sb-breathe {
  0% { transform: scale(.85); opacity: .7; }
  80%, 100% { transform: scale(1.55); opacity: 0; }
}
.sb-launch:hover { transform: translateY(-2px) scale(1.04); }
.sb-launch:active { transform: scale(.96); }
.sb-hex { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.sb-launch-ico {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 34px;
  object-fit: contain;
  pointer-events: none;
  transition: opacity .2s, transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.sb-launch-x {
  position: absolute;
  z-index: 1;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--navy, #0B2545);
  stroke-width: 2.4;
  stroke-linecap: round;
  opacity: 0;
  transform: rotate(-90deg) scale(.6);
  transition: opacity .2s, transform .35s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
}
.sb-launch:focus-visible { outline: none; filter: drop-shadow(0 0 0 2px #fff) drop-shadow(0 0 0 4px var(--navy-2, #02417B)); }
.sb-root.is-open .sb-launch { color: #fff; }
.sb-root.is-open .sb-launch::before { animation: none; opacity: 0; }
.sb-root.is-open .sb-hex { transform: rotate(90deg); }
.sb-root.is-open .sb-launch-ico { opacity: 0; transform: scale(.5) rotate(45deg); }
.sb-root.is-open .sb-launch-x { opacity: 1; transform: none; }

.sb-tip {
  position: absolute;
  right: 74px;
  bottom: 13px;
  padding: 9px 14px;
  border-radius: 12px 12px 4px 12px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy, #0B2545);
  background: #fff;
  box-shadow: 0 14px 30px -14px rgba(11, 37, 69, .45), inset 0 0 0 1px #e6ebf2;
  opacity: 0;
  transform: translateX(10px) scale(.96);
  transform-origin: right center;
  transition: opacity .3s, transform .4s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none;
}
.sb-root.tip-on .sb-tip,
.sb-root:not(.is-open) .sb-launch:hover ~ .sb-tip { opacity: 1; transform: none; }
.sb-root:has(.sb-launch:hover):not(.is-open) .sb-tip { opacity: 1; transform: none; }

/* ---------- the panel ---------- */
.sb-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(392px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 124px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 40px 80px -30px rgba(11, 37, 69, .5), 0 12px 24px -12px rgba(11, 37, 69, .18), inset 0 0 0 1px rgba(11, 37, 69, .06);
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(.96);
  transform-origin: bottom right;
  transition: opacity .22s ease, transform .4s cubic-bezier(.16, 1, .3, 1);
}
.sb-panel[hidden] { display: none; }
.sb-root.is-open .sb-panel { opacity: 1; transform: none; }

/* small hex avatar, used in the header and beside each answer */
.sb-mark { position: relative; flex: none; display: grid; place-items: center; width: 30px; height: 30px; color: #fff; }
.sb-mark svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sb-mark img {
  position: relative;
  width: 16px;
  height: 17px;
  object-fit: contain;
}

.sb-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px 16px 18px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(248, 180, 0, .18), transparent 55%),
    linear-gradient(160deg, #0f325c 0%, #0b2545 60%, #071b33 100%);
}
.sb-head::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1.2px);
  background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000);
  mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.sb-head .sb-mark { width: 40px; height: 40px; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, .3)); }
.sb-head .sb-mark img { width: 22px; height: 24px; }
.sb-head-copy { position: relative; z-index: 1; min-width: 0; }
.sb-head b { display: block; font-size: 15.5px; font-weight: 700; letter-spacing: -.02em; }
.sb-head-copy span { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 12px; color: rgba(232, 238, 246, .72); }
.sb-on { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .22); }
.sb-clear {
  position: relative;
  z-index: 1;
  margin-left: auto;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  color: rgba(232, 238, 246, .78);
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  transition: background .2s, color .2s;
}
.sb-clear:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.sb-clear:focus-visible { outline: 2px solid var(--yellow, #F8B400); outline-offset: 2px; }
.sb-close {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
  transition: background .2s, transform .3s;
}
.sb-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.sb-close:hover { background: rgba(255, 255, 255, .16); transform: rotate(90deg); }
.sb-close:focus-visible { outline: 2px solid var(--yellow, #F8B400); outline-offset: 2px; }

/* ---------- conversation ---------- */
.sb-log {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px 14px 10px;
  display: grid;
  align-content: start;
  gap: 12px;
  background: linear-gradient(180deg, #f6f8fb, #fff);
  scrollbar-width: thin;
  scrollbar-color: #d5deea transparent;
}
.sb-row { display: flex; align-items: flex-end; gap: 8px; animation: sb-in .35s cubic-bezier(.16, 1, .3, 1) both; }
.sb-row-user { justify-content: flex-end; }
.sb-row .sb-mark { width: 26px; height: 26px; margin-bottom: 2px; }
.sb-row .sb-mark img { width: 14px; height: 15px; }
@keyframes sb-in { from { opacity: 0; transform: translateY(8px); } }
.sb-msg {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--body, #4B5563);
}
.sb-msg p { margin: 0 0 .55em; }
.sb-msg p:last-child { margin: 0; }
.sb-msg b { color: var(--navy, #0B2545); }
.sb-msg a { color: var(--navy-2, #02417B); font-weight: 600; }
.sb-bot {
  background: #fff;
  border-bottom-left-radius: 5px;
  box-shadow: 0 6px 18px -12px rgba(11, 37, 69, .3), inset 0 0 0 1px #e8edf3;
}
.sb-user {
  color: #fff;
  background: linear-gradient(160deg, #0f3b6b, #0b2545);
  border-bottom-right-radius: 5px;
  box-shadow: 0 8px 18px -12px rgba(11, 37, 69, .6);
}
.sb-src {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 6px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy-2, #02417B);
  background: #eef4fb;
  transition: background .2s;
}
.sb-src i { font-style: normal; transition: transform .25s; }
.sb-src:hover { background: #e1ecf8; }
.sb-src:hover i { transform: translateX(3px); }

/* suggested questions, stacked like quick replies */
.sb-chips { display: grid; gap: 6px; margin-top: 8px; }
.sb-bot .sb-chips { margin-top: 10px; }
.sb-bot .sb-chip { font-size: 12px; padding: 8px 11px; }

.sb-section {
  margin: 12px 0 6px !important;
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mute, #6B7585) !important;
}
.sb-offpage {
  margin: 8px 0 0 !important;
  font-size: 12px !important;
  color: var(--mute, #6B7585) !important;
}
.sb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.sb-gos {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.sb-go {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  color: var(--navy-2, #02417B);
  background: #eef4fb;
  box-shadow: inset 0 0 0 1px #d7e4f3;
  transition: background .2s, transform .2s;
}
.sb-go i { font-style: normal; transition: transform .25s; }
.sb-go:hover { background: #e1ecf8; }
.sb-go:hover i { transform: translateX(2px); }
.sb-go-primary {
  color: var(--navy, #0B2545);
  background: var(--yellow, #F8B400);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 14px -8px rgba(226, 164, 0, .7);
}
.sb-go-primary:hover { background: var(--yellow-2, #E2A400); }
.sb-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  color: var(--navy, #0B2545);
  background: #f4f7fb;
  box-shadow: inset 0 0 0 1px #e3e9f1;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .2s;
}
.sb-chip i { font-style: normal; color: #9aa7b8; transition: transform .25s, color .2s; }
.sb-chip:hover { background: #fff8e1; box-shadow: inset 0 0 0 1px rgba(248, 180, 0, .55); }
.sb-chip:hover i { color: #c58f00; transform: translateX(3px); }
.sb-chip:focus-visible { outline: 2px solid var(--navy-2, #02417B); outline-offset: 1px; }

/* three dots while an answer is found */
.sb-row.is-typing .sb-msg { padding: 13px 16px; }
.sb-typing { display: inline-flex; gap: 4px; }
.sb-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa7b8; animation: sb-dot 1s ease-in-out infinite; }
.sb-typing i:nth-child(2) { animation-delay: .15s; }
.sb-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes sb-dot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

/* ---------- composer: one pill holding the field and a round send button ---------- */
.sb-form { padding: 10px 14px 12px; background: #fff; border-top: 1px solid #eef2f7; }
.sb-field {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 5px 5px 16px;
  border-radius: 99px;
  background: #f4f7fb;
  box-shadow: inset 0 0 0 1px #e1e8f0;
  transition: box-shadow .2s, background .2s;
}
.sb-field:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px var(--navy-2, #02417B), 0 0 0 4px rgba(2, 65, 123, .1); }
.sb-form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 14px;
  color: var(--navy, #0B2545);
  background: transparent;
}
.sb-form input::placeholder { color: #8b97a8; }
.sb-form button[type="submit"] {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--yellow, #F8B400);
  color: var(--navy, #0B2545);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 14px -6px rgba(226, 164, 0, .8);
  transition: background .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.sb-form button[type="submit"] svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sb-form button[type="submit"]:hover { background: var(--yellow-2, #E2A400); transform: translateX(2px); }
.sb-form button[type="submit"]:focus-visible { outline: 2px solid var(--navy-2, #02417B); outline-offset: 2px; }
.sb-note { margin: 8px 0 0; text-align: center; font-size: 11px; color: var(--mute, #6B7585); }

/* ---------- phones: the panel becomes a sheet above the launcher ---------- */
@media (max-width: 520px) {
  .sb-root { right: 14px; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .sb-launch { width: 56px; height: 56px; }
  .sb-tip { right: 66px; bottom: 11px; }
  .sb-panel {
    position: fixed;
    right: 8px;
    left: 8px;
    bottom: calc(124px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: min(72vh, 600px);
    border-radius: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sb-panel, .sb-launch, .sb-hex, .sb-launch-ico, .sb-launch-x, .sb-tip { transition: none; }
  .sb-launch::before, .sb-row, .sb-typing i { animation: none; }
  .sb-panel { transform: none; }
}

/* keep clear of page content: smaller and tucked into the corner where the page margin is thin */
.sb-root { transition: transform .3s ease, opacity .25s ease; }
@media (max-width: 1500px) {
  .sb-root { right: 8px; bottom: 14px; }
  .sb-launch { width: 50px; height: 50px; }
  .sb-tip { right: 60px; bottom: 7px; }
}
/* touch sizes: no label, and it steps aside while reading down the page */
@media (max-width: 820px) {
  .sb-root { right: 10px; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  html.nav-locked .sb-root { opacity: 0; pointer-events: none; }
  .sb-launch { width: 48px; height: 48px; }
  .sb-tip { display: none; }
  .sb-root.is-away:not(.is-open) { transform: translateY(84px); opacity: 0; pointer-events: none; }
}
.sb-dock-slot, .sb-dock-label { display: none; }
@media (max-width: 1180px) {
  /* White tile with the bee, set apart from the navy items. */
  .sb-root {
    position: relative;
    right: auto;
    bottom: auto;
    flex: 1.05 1 0;
    min-width: 58px;
    height: 100%;
    z-index: auto;
    padding: 0;
  }
  .sb-launch {
    width: 100%;
    height: 100%;
    padding: 0 2px;
    border-radius: 12px;
    background: #fff;
    color: var(--navy, #0B2545);
    filter: none;
    box-shadow: 0 4px 12px rgba(11, 37, 69, .16);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
  }
  .sb-launch:hover { transform: none; }
  .sb-launch:active { transform: scale(.96); }
  .sb-launch:focus-visible { outline: 2px solid var(--yellow, #F8B400); outline-offset: 2px; filter: none; }
  .sb-launch::before, .sb-hex, .sb-tip, .sb-dock-slot { display: none; }
  .sb-launch-ico {
    display: block;
    position: relative;
    width: 16px;
    height: 16px;
    opacity: 1;
    transform: none;
  }
  .sb-dock-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .01em;
    color: var(--navy, #0B2545);
  }
  .sb-launch-x {
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    width: 16px;
    height: 16px;
    margin: 0 auto;
    stroke: var(--navy, #0B2545);
    stroke-width: 1.7;
    opacity: 0;
    transform: none;
  }
  .sb-root.is-open .sb-launch { background: #fff; }
  .sb-root.is-open .sb-launch-ico { opacity: 0; transform: none; }
  .sb-root.is-open .sb-launch-x { opacity: 1; transform: none; }
  .sb-root.is-away:not(.is-open) { transform: none; opacity: 1; pointer-events: auto; }
  html.nav-locked .sb-root { opacity: 1; pointer-events: auto; }
  .sb-panel.sb-panel-float {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    height: min(68dvh, 560px);
    margin: 0;
    border-radius: 20px;
    box-sizing: border-box;
    z-index: 260;
    transform-origin: center bottom;
  }
  .sb-panel.sb-panel-float.is-shown {
    opacity: 1;
    transform: none;
  }
}
