.sblc-root,
.sblc-root * {
  box-sizing: border-box;
}

.sblc-root {
  --sblc-accent: #2563eb;
  --sblc-ink: #172033;
  --sblc-muted: #667085;
  --sblc-border: #e3e8ef;
  --sblc-surface: #fff;
  color: var(--sblc-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

.sblc-floating {
  bottom: max(22px, env(safe-area-inset-bottom));
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  z-index: 999999;
}

.sblc-launcher {
  align-items: center;
  background: var(--sblc-accent);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, .25);
  color: #fff;
  cursor: pointer;
  display: flex;
  font: 700 15px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
}

.sblc-launcher:hover { filter: brightness(.94); transform: translateY(-1px); }
.sblc-launcher:focus-visible,
.sblc-root button:focus-visible,
.sblc-root input:focus-visible,
.sblc-root textarea:focus-visible { outline: 3px solid #93b4ff; outline: 3px solid color-mix(in srgb, var(--sblc-accent) 35%, transparent); outline-offset: 2px; }
.sblc-launcher svg { fill: currentColor; height: 22px; width: 22px; }

.sblc-panel {
  background: var(--sblc-surface);
  border: 1px solid var(--sblc-border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
  display: flex;
  flex-direction: column;
  height: min(650px, calc(100vh - 110px));
  overflow: hidden;
  width: min(390px, calc(100vw - 32px));
}

.sblc-floating .sblc-panel { bottom: 0; position: absolute; right: 0; }
.sblc-floating .sblc-panel:not([hidden]) + * { display: none; }
.sblc-floating .sblc-panel:not([hidden]) ~ .sblc-launcher { display: none; }
.sblc-floating .sblc-panel:not([hidden]) { animation: sblc-open .18s ease-out; }
.sblc-floating:has(.sblc-panel:not([hidden])) .sblc-launcher { display: none; }
.sblc-embedded { margin: 24px auto; max-width: 760px; }
.sblc-embedded .sblc-panel { height: min(680px, 78vh); width: 100%; }

@keyframes sblc-open {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.sblc-header {
  align-items: center;
  background: linear-gradient(135deg, var(--sblc-accent), color-mix(in srgb, var(--sblc-accent) 74%, #0f172a));
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 15px 17px;
}

.sblc-header strong { display: block; font-size: 17px; letter-spacing: -.01em; }
.sblc-availability { display: block; font-size: 12px; margin-top: 3px; opacity: .82; }
.sblc-header-actions { align-items: center; display: flex; gap: 8px; }
.sblc-header button { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); color: #fff; cursor: pointer; }
.sblc-end { border-radius: 999px; font-size: 12px; padding: 5px 10px; }
.sblc-dismiss { border-radius: 50%; font-size: 23px; height: 34px; line-height: 28px; padding: 0; width: 34px; }

.sblc-messages {
  background: #f7f9fc;
  flex: 1;
  min-height: 180px;
  overflow-y: auto;
  padding: 18px 15px;
  scrollbar-color: #c7d0dd transparent;
}

.sblc-message { display: flex; margin: 0 0 11px; }
.sblc-message > div { background: #fff; border: 1px solid var(--sblc-border); border-radius: 15px 15px 15px 4px; box-shadow: 0 2px 5px rgba(15,23,42,.04); max-width: 82%; overflow-wrap: anywhere; padding: 10px 12px; white-space: pre-wrap; }
.sblc-message.sblc-visitor { justify-content: flex-end; }
.sblc-message.sblc-visitor > div { background: var(--sblc-accent); border-color: var(--sblc-accent); border-radius: 15px 15px 4px 15px; color: #fff; }
.sblc-message.sblc-system { justify-content: center; }
.sblc-message.sblc-system > div { background: transparent; border: 0; box-shadow: none; color: var(--sblc-muted); font-size: 12px; padding: 4px 8px; text-align: center; }
.sblc-message small { display: block; font-size: 10px; margin-top: 5px; opacity: .74; }

.sblc-status { background: #f7f9fc; color: var(--sblc-muted); font-size: 11px; min-height: 18px; padding: 1px 15px 5px; }
.sblc-status.is-error { color: #b42318; }
.sblc-form { background: #fff; border-top: 1px solid var(--sblc-border); padding: 13px; }
.sblc-identity { display: grid; gap: 9px; grid-template-columns: 1fr 1fr; margin-bottom: 10px; }
.sblc-identity[hidden] { display: none; }
.sblc-identity label span { color: var(--sblc-muted); display: block; font-size: 11px; font-weight: 650; margin: 0 0 4px 2px; }
.sblc-root input,
.sblc-root textarea { background: #fff; border: 1px solid #ccd5e1; border-radius: 10px; color: var(--sblc-ink); font: 14px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; margin: 0; width: 100%; }
.sblc-root input { height: 39px; padding: 0 10px; }
.sblc-compose { align-items: flex-end; background: #fff; border: 1px solid #cbd5e1; border-radius: 13px; display: flex; gap: 7px; padding: 7px; }
.sblc-compose:focus-within { border-color: var(--sblc-accent); box-shadow: 0 0 0 3px #e6edff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sblc-accent) 13%, transparent); }
.sblc-root textarea { border: 0; box-shadow: none; max-height: 110px; min-height: 42px; outline: 0; padding: 10px 6px 6px; resize: none; }
.sblc-send { align-items: center; background: var(--sblc-accent); border: 0; border-radius: 10px; color: #fff; cursor: pointer; display: flex; flex: 0 0 40px; height: 40px; justify-content: center; padding: 0; }
.sblc-send:hover { filter: brightness(.94); }
.sblc-send:disabled { cursor: wait; opacity: .55; }
.sblc-send svg { fill: currentColor; height: 20px; width: 20px; }
.sblc-privacy { color: #8490a3; font-size: 10px; margin-top: 7px; text-align: center; }
.sblc-company { height: 1px !important; left: -9999px !important; opacity: 0 !important; position: absolute !important; width: 1px !important; }
.sblc-root [hidden] { display: none !important; }

@media (max-width: 520px) {
  .sblc-floating { bottom: 14px; right: 14px; }
  .sblc-floating .sblc-panel { bottom: -14px; position: absolute; right: -14px; }
  .sblc-floating .sblc-panel { border-radius: 0; height: 100dvh; width: 100vw; }
  .sblc-header { padding-top: max(15px, env(safe-area-inset-top)); }
  .sblc-form { padding-bottom: max(13px, env(safe-area-inset-bottom)); }
  .sblc-identity { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .sblc-floating .sblc-panel:not([hidden]) { animation: none; }
  .sblc-launcher:hover { transform: none; }
}
