.ns-chat-widget,
.ns-chat-widget * {
  box-sizing: border-box;
}

.ns-chat-widget {
  --ns-chat-accent: var(--lpn-blue, #075ee8);
  --ns-chat-accent-hover: #0652ca;
  --ns-chat-border: #dbe5f1;
  --ns-chat-focus: #005fcc;
  --ns-chat-muted: #5b6b82;
  --ns-chat-surface: #ffffff;
  --ns-chat-text: #0f1f38;
  color-scheme: light;
  font-family: Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ns-chat-launcher {
  align-items: center;
  background: var(--ns-chat-accent);
  border: 0;
  border-radius: 999px;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 16px 42px rgba(7, 94, 232, 0.32);
  color: #fff;
  cursor: pointer;
  display: inline-flex !important;
  font: inherit;
  height: 3rem !important;
  justify-content: center;
  line-height: 1;
  padding: 0 !important;
  position: fixed !important;
  right: calc(1.25rem + env(safe-area-inset-right, 0px));
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  width: 3rem !important;
  z-index: 1000 !important;
}

.ns-chat-launcher:hover {
  background: var(--ns-chat-accent-hover);
  box-shadow: 0 18px 48px rgba(7, 94, 232, 0.4);
  transform: translateY(-2px);
}

.ns-chat-widget[data-launcher-mode="on-demand"]:not([data-open="true"]) .ns-chat-launcher {
  display: none !important;
}

.ns-chat-close:focus-visible,
.ns-chat-state button:focus-visible {
  outline: 3px solid var(--ns-chat-focus);
  outline-offset: 3px;
}

.ns-chat-launcher:focus-visible {
  background: var(--ns-chat-accent-hover);
  outline: 3px solid color-mix(in srgb, var(--ns-chat-accent) 42%, transparent);
  outline-offset: 3px;
}

.ns-chat-launcher svg {
  height: 1.75rem;
  width: 1.75rem;
}

.ns-chat-launcher__bubble {
  fill: currentColor;
}

.ns-chat-launcher__chat-icon,
.ns-chat-launcher__close-icon {
  transform-origin: center;
  transition: opacity 160ms ease, transform 160ms ease;
}

.ns-chat-launcher__close-icon {
  fill: none;
  opacity: 0;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 3.25;
  transform: rotate(-45deg) scale(0.8);
}

.ns-chat-widget[data-open="true"] .ns-chat-launcher__chat-icon {
  opacity: 0;
  transform: rotate(45deg) scale(0.8);
}

.ns-chat-widget[data-open="true"] .ns-chat-launcher__close-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.ns-chat-launcher__dot {
  fill: var(--ns-chat-accent);
  transition: fill 160ms ease;
}

.ns-chat-launcher:hover .ns-chat-launcher__dot,
.ns-chat-launcher:focus-visible .ns-chat-launcher__dot {
  fill: var(--ns-chat-accent-hover);
}

.ns-chat-panel {
  background: var(--ns-chat-surface);
  border: 1px solid var(--ns-chat-border);
  border-radius: 1rem;
  bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 28px 80px rgba(15, 31, 56, 0.24);
  color: var(--ns-chat-text);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 7rem);
  height: min(44rem, calc(100dvh - 7rem));
  max-height: calc(100vh - 7rem);
  overflow: hidden;
  position: fixed;
  right: calc(1.25rem + env(safe-area-inset-right, 0px));
  width: min(26rem, calc(100vw - 2rem));
  z-index: 1100;
}

.ns-chat-panel[hidden] {
  display: none !important;
}

.ns-chat-panel__header {
  align-items: center;
  background: var(--ns-chat-surface);
  border-bottom: 1px solid var(--ns-chat-border);
  display: grid;
  flex: 0 0 auto;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) 1.75rem;
  padding: 0.55rem 0.75rem;
}

.ns-chat-panel__header > div {
  grid-column: 1;
  text-align: left;
}

.ns-chat-panel__header h2 {
  color: var(--ns-chat-text);
  font-family: Ubuntu, Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0;
}

.ns-chat-panel__header p {
  color: var(--ns-chat-muted);
  font-size: 0.75rem;
  line-height: 1.4;
  margin: 0.2rem 0 0;
  max-width: 20rem;
}

.ns-chat-close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  color: var(--ns-chat-muted);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  grid-column: 2;
  height: 1.75rem;
  justify-content: center;
  margin: 0;
  padding: 0;
  width: 1.75rem;
}

.ns-chat-close:hover {
  background: #eff5fd;
  color: var(--ns-chat-text);
}

.ns-chat-close svg {
  fill: none;
  height: 1.25rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
  width: 1.25rem;
}

body.ns-chat-lightbox-open {
  overflow: hidden;
}

.ns-chat-lightbox {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
  position: fixed;
  z-index: 1300;
}

.ns-chat-lightbox[hidden] {
  display: none !important;
}

.ns-chat-lightbox__backdrop {
  background: rgba(3, 10, 22, 0.88);
  border: 0;
  cursor: zoom-out;
  inset: 0;
  padding: 0;
  position: absolute;
}

.ns-chat-lightbox__dialog {
  background: var(--ns-chat-surface);
  border: 1px solid var(--ns-chat-border);
  border-radius: 0.9rem;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.48);
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 2rem);
  max-width: calc(100vw - 2rem);
  min-width: min(20rem, calc(100vw - 2rem));
  overflow: hidden;
  position: relative;
}

.ns-chat-lightbox__header {
  align-items: center;
  border-bottom: 1px solid var(--ns-chat-border);
  display: flex;
  flex: 0 0 auto;
  gap: 1rem;
  justify-content: space-between;
  min-height: 3.25rem;
  padding: 0.6rem 0.65rem 0.6rem 1rem;
}

.ns-chat-lightbox__header h2 {
  color: var(--ns-chat-text);
  font-family: Ubuntu, Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.3;
  margin: 0;
}

.ns-chat-lightbox__close {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.5rem;
  color: var(--ns-chat-muted);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: 2.25rem;
  justify-content: center;
  padding: 0;
  width: 2.25rem;
}

.ns-chat-lightbox__close:hover {
  background: #eff5fd;
  color: var(--ns-chat-text);
}

.ns-chat-lightbox__close:focus-visible {
  outline: 3px solid var(--ns-chat-focus);
  outline-offset: 2px;
}

.ns-chat-lightbox__close svg {
  fill: none;
  height: 1.25rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
  width: 1.25rem;
}

.ns-chat-lightbox__body {
  align-items: center;
  background: #050b15;
  display: flex;
  justify-content: center;
  min-height: 0;
  overflow: auto;
}

.ns-chat-lightbox__body img {
  display: block;
  height: auto;
  max-height: calc(100dvh - 8rem);
  max-width: calc(100vw - 2rem);
  object-fit: contain;
  width: auto;
}

.ns-chat-lightbox__caption {
  color: var(--ns-chat-muted);
  flex: 0 0 auto;
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 0;
  max-width: min(70rem, calc(100vw - 4rem));
  padding: 0.7rem 1rem 0.8rem;
}

.ns-chat-panel__body {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.ns-chat-host {
  grid-area: 1 / 1;
  min-height: 0;
}

.ns-chat-host openai-chatkit {
  display: block;
  height: 100%;
  min-height: 0;
  width: 100%;
}

.ns-chat-start-screen-copy {
  color: var(--ns-chat-muted);
  font-size: 0.8rem;
  left: 1.5rem;
  line-height: 1.45;
  margin: 0;
  pointer-events: none;
  position: absolute;
  right: 1.5rem;
  text-align: center;
  top: calc(50% + 1.75rem);
  z-index: 1;
}

.ns-chat-start-screen-copy[hidden] {
  display: none;
}

.ns-chat-state {
  align-items: center;
  align-self: center;
  background: var(--ns-chat-surface);
  background: color-mix(in srgb, var(--ns-chat-surface) 94%, transparent);
  border: 1px solid var(--ns-chat-border);
  border-radius: 0.75rem;
  box-shadow: 0 14px 40px rgba(15, 31, 56, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  grid-area: 1 / 1;
  justify-self: center;
  max-width: calc(100% - 2rem);
  padding: 1rem 1.2rem;
  text-align: center;
  z-index: 2;
}

.ns-chat-state[hidden] {
  display: none;
}

.ns-chat-state:not([data-error="true"]) {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.ns-chat-state p {
  color: var(--ns-chat-muted);
  font-size: 0.875rem;
  line-height: 1.45;
  margin: 0;
}

.ns-chat-state:not([data-error="true"]) p {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.ns-chat-state[data-error="true"] p {
  color: #b42318;
}

.ns-chat-state button {
  background: var(--ns-chat-accent);
  border: 0;
  border-radius: 0.55rem;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.65rem 0.9rem;
}

.ns-chat-state button:hover {
  background: var(--ns-chat-accent-hover);
}

.ns-chat-spinner {
  animation: ns-chat-spin 800ms linear infinite;
  border: 3px solid #dbeafe;
  border-radius: 50%;
  border-top-color: var(--ns-chat-accent);
  height: 1.65rem;
  width: 1.65rem;
}

.ns-chat-state[data-error="true"] .ns-chat-spinner {
  display: none;
}

html.dark .ns-chat-widget,
html[data-ns-theme="dark"] .ns-chat-widget,
html[data-lp-theme="dark"] .ns-chat-widget {
  --ns-chat-accent: var(--lpn-blue, #23aaff);
  --ns-chat-accent-hover: #049eff;
  --ns-chat-border: #1f3c63;
  --ns-chat-focus: #6cddff;
  --ns-chat-muted: #a9bdd6;
  --ns-chat-surface: #07162e;
  --ns-chat-text: #f3f7fc;
  color-scheme: dark;
}

html.dark .ns-chat-close:hover,
html[data-ns-theme="dark"] .ns-chat-close:hover,
html[data-lp-theme="dark"] .ns-chat-close:hover,
html.dark .ns-chat-lightbox__close:hover,
html[data-ns-theme="dark"] .ns-chat-lightbox__close:hover,
html[data-lp-theme="dark"] .ns-chat-lightbox__close:hover {
  background: #0b2344;
}

html.dark .ns-chat-state[data-error="true"] p,
html[data-ns-theme="dark"] .ns-chat-state[data-error="true"] p,
html[data-lp-theme="dark"] .ns-chat-state[data-error="true"] p {
  color: #fda29b;
}

body:has(.public-cookie:not([hidden])) .ns-chat-launcher {
  bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 700px) {
  body:has(.public-cookie:not([hidden])) .ns-chat-launcher {
    bottom: calc(15rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 640px) {
  body.ns-chat-panel-open {
    overflow: hidden;
  }

  .ns-chat-launcher {
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    right: calc(1rem + env(safe-area-inset-right, 0px));
  }

  .ns-chat-panel {
    border: 0;
    border-radius: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    right: 0;
    width: 100vw;
  }

  .ns-chat-panel__header {
    padding:
      max(0.55rem, env(safe-area-inset-top, 0px))
      max(0.75rem, env(safe-area-inset-right, 0px))
      0.55rem
      max(0.75rem, env(safe-area-inset-left, 0px));
  }

  .ns-chat-lightbox {
    padding: 0;
  }

  .ns-chat-lightbox__dialog {
    border: 0;
    border-radius: 0;
    height: 100dvh;
    max-height: none;
    max-width: none;
    width: 100vw;
  }

  .ns-chat-lightbox__body {
    flex: 1 1 auto;
  }

  .ns-chat-lightbox__body img {
    max-height: calc(100dvh - 7rem);
    max-width: 100vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ns-chat-launcher,
  .ns-chat-launcher__chat-icon,
  .ns-chat-launcher__close-icon {
    transition: none;
  }

  .ns-chat-spinner {
    animation-duration: 1600ms;
  }
}

@keyframes ns-chat-spin {
  to {
    transform: rotate(360deg);
  }
}
