.gizmowidget {
  --chat-bg: #07111f;
  --chat-panel: #0b1728;
  --chat-panel-2: #101f35;
  --chat-border: rgba(148, 163, 184, 0.24);
  --chat-text: #e8f0ff;
  --chat-muted: #9fb0c8;
  --chat-accent: #78e2ff;
  --chat-accent-2: #8f7cff;
  --chat-danger: #ff8796;
  --chat-success: #7ee3a8;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  font-family: "Lexend", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--chat-text);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.gizmowidget * {
  box-sizing: border-box;
}

.gizmoopenbtn {
  --gizmo-launcher-size: 52px;
  --gizmo-launcher-loop-angle: 0deg;
  --gizmo-launcher-loop-start: 235deg;
  --gizmo-launcher-loop-blue: 270deg;
  --gizmo-launcher-loop-violet: 302deg;
  --gizmo-launcher-loop-end: 360deg;
  min-width: var(--gizmo-launcher-size);
  width: var(--gizmo-launcher-size);
  height: var(--gizmo-launcher-size);
  color: var(--chat-text);
  cursor: pointer;
  position: relative;
  padding: 0;
  background: #0000009b;
  border: 1px solid #0000009b;
  -webkit-backdrop-filter: blur(9px) contrast(2);
  backdrop-filter: blur(9px) contrast(2);
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  overflow: visible;
  z-index: 1;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.gizmoopenbtn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(
    from var(--gizmo-launcher-loop-angle),
    transparent 0deg var(--gizmo-launcher-loop-start),
    #5fd0ff var(--gizmo-launcher-loop-blue),
    #7c5cff var(--gizmo-launcher-loop-violet),
    #f51fbf var(--gizmo-launcher-loop-end),
    transparent var(--gizmo-launcher-loop-end) 360deg
  );
  opacity: 0;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
    transition: opacity 0.2s ease;

}

.gizmowidget.is-launcher-looping:not(.is-open) .gizmoopenbtn::before {
  animation: gizmoLauncherLoop 2.5s linear both;
  transition: opacity 0.2s ease;
}

.gizmolauncheravatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  position: relative;
  flex: 0 0 46px;
  display: block;
  z-index: 1;
}

.gizmoicon {
  position: absolute;
  inset: 5px;
  width: 36px;
  height: 36px;
  object-fit: contain;
  pointer-events: none;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.gizmowidget.is-open .gizmoopenbtn {
  min-width: var(--gizmo-launcher-size);
  width: var(--gizmo-launcher-size);
  padding: 0;
  border-radius: 999px;
}

.gizmopanel {
  position: absolute;
  right: 0;
  bottom: 66px;
  width: min(360px, calc(100vw - 28px));
  height: min(560px, calc(100vh - 112px));
  min-height: 0;
  height: min(560px, calc(100dvh - 112px - env(safe-area-inset-bottom)));
  background: black;
  border: 1px solid var(--chat-border);
  border-radius: 14px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.gizmowidget.is-open .gizmopanel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.gizmoheader {
  min-height: 46px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.gizmoheaderavatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.gizmoheaderavatar img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.gizmoheadertxt {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1.1;
}

.gizmoheadertxt strong {
  color: var(--chat-text);
  font-size: 12px;
  font-weight: 800;
}

.gizmoheadertxt span {
  color: var(--chat-muted);
  font-size: 10px;
  font-weight: 650;
}

.gizmoiconbtn,
.gizmosoftbtn,
.gizmoprimarybtn {
  font: inherit;
  color: var(--chat-text);
  border: 1px solid var(--chat-border);
  background: rgba(16, 31, 53, 0.86);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.gizmoiconbtn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  flex: 0 0 auto;
}

.gizmoiconbtn svg,
.gizmosoftbtn svg,
.gizmoprimarybtn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  pointer-events: none;
}

.gizmoiconbtn:hover,
.gizmosoftbtn:hover,
.gizmoprimarybtn:hover {
  border-color: #2c6ddf;
}

.gizmobody {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr;
}

.gizmoauth,
.gizmonotice,
.gizmohistory {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 20px;
  display: grid;
  overflow-y: auto;
  place-items: center;
  background: rgba(7, 17, 31, 1);
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 180ms ease, transform 180ms ease;
  animation: gizmoOverlayIn 180ms ease both;
}

.gizmoauth.is-leaving,
.gizmonotice.is-leaving,
.gizmohistory.is-leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  pointer-events: none;
  animation: gizmoOverlayOut 180ms ease both;
}

.gizmohistory {
  align-items: stretch;
  justify-items: stretch;
  padding: 0;
  background: rgba(0, 0, 0, 0.96);
}

.gizmohistorypanel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  animation: gizmoHistoryPanelIn 180ms ease both;
}

.gizmohistory.is-leaving .gizmohistorypanel {
  animation: gizmoHistoryPanelOut 180ms ease both;
}

.gizmohistoryhead {
  min-height: 46px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gizmohistoryhead strong {
  color: var(--chat-text);
  font-size: 12px;
  font-weight: 800;
}

.gizmohistoryhead .gizmoiconbtn {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: grey;
  transition: all 0.1s ease;
}

.gizmohistoryhead .gizmoiconbtn:hover {
  background-color: rgba(255, 255, 255, 0.16);
    color: white;

}

.gizmohistorylist {
  min-height: 0;
  padding: 4px 10px 12px;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow-y: auto;
}

.gizmohistoryitem {
  width: 100%;
  min-height: 42px;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  text-align: left;
  background: rgb(32, 37, 47);
  color: var(--chat-text);
  font: inherit;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.gizmohistoryitem:hover,
.gizmohistoryitem:focus-visible {
  background: rgb(57, 66, 83);
  outline: none;
}

.gizmohistoryitem strong {
  overflow: hidden;
  color: var(--chat-text);
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gizmohistoryitem span,
.gizmohistoryempty {
  margin: 0;
  color: var(--chat-muted);
  font-size: 10px;
  font-weight: 550;
}

.gizmocard {
  width: min(320px, 100%);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.gizmocard h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.gizmocard p {
  margin: 0;
  color: var(--chat-muted);
  font-size: 12px;
  line-height: 1.55;
}

.gizmoprimarybtn,
.gizmosoftbtn {
  min-height: 38px;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gizmoprimarybtn {
  background: #2c6ddf;
  color: white;
  border-color: transparent;
}

.gizmosoftbtn[disabled],
.gizmoprimarybtn[disabled],
.gizmoiconbtn[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.gizmofeed {
  min-height: 0;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-color: rgba(120, 226, 255, 0.28) transparent;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 160ms ease, transform 160ms ease;
}

.gizmofeed.is-resetting {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.gizmofeed.is-entering {
  animation: gizmoFeedIn 180ms ease both;
}

.gizmoempty {
  margin: auto 0;
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
  color: var(--chat-muted);
}

.gizmoempty img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.gizmoempty h3 {
  margin: 0;
  color: var(--chat-text);
  font-size: 17px;
}

.gizmoempty p {
  margin: 0;
  font-size: 12px;
}

.gizmosuggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.gizmosuggestion {
  border: none;
  background: rgba(49, 50, 56, 0.82);
  color: var(--chat-text);
  border-radius: 999px;
  padding: 8px 10px;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.1s ease;
}

.gizmosuggestion:hover {
  background: rgb(66, 70, 78);
}

.gizmomessage {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.gizmomessage.is-user {
  justify-content: flex-end;
}

.gizmobubble {
  max-width: 88%;
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  padding: 10px 11px;
  background: rgba(16, 31, 53, 0.88);
  color: var(--chat-text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.55;
}

.gizmomessage.is-assistant .gizmobubble {
  white-space: normal;
}

.gizmomessage.is-user .gizmobubble {
  background: color(srgb 0.1729 0.4292 0.8766);
  color: white;
  border-color: transparent;
}

.gizmobubble p,
.gizmobubble ol,
.gizmobubble ul,
.gizmobubble h3,
.gizmobubble h4,
.gizmobubble h5,
.gizmobubble h6 {
  margin: 0;
}

.gizmobubble > * + * {
  margin-top: 7px;
}

.gizmobubble ol,
.gizmobubble ul {
  padding-left: 18px;
}

.gizmobubble li {
  padding-left: 2px;
}

.gizmobubble li + li {
  margin-top: 4px;
}

.gizmobubble h3,
.gizmobubble h4,
.gizmobubble h5,
.gizmobubble h6 {
  color: var(--chat-text);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
}

.gizmobubble strong {
  font-weight: 800;
}

.gizmobubble em {
  color: color-mix(in srgb, var(--chat-text) 92%, var(--chat-accent) 8%);
  font-style: italic;
}

.gizmobubble code {
  padding: 1px 4px;
  border: 1px solid rgb(36, 100, 159);
  border-radius: 4px;
  background: rgb(13, 43, 103);
color: rgb(204, 224, 255);
  font: 0.92em ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-weight: 750;
}

.gizmobubble a {
  color: var(--chat-accent);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--chat-accent) 48%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.gizmobubble a:hover,
.gizmobubble a:focus-visible {
  color: color-mix(in srgb, var(--chat-accent) 82%, white 18%);
  text-decoration-color: currentColor;
  outline: none;
}

.gizmomessage.is-user .gizmobubble a {
  color: #07111f;
}

.gizmohighlight {
  display: inline;
  padding: 1px 5px;
  border-radius: 999px;
    border: 1px solid rgb(36, 100, 159);
  background: rgb(13, 43, 103);
color: rgb(204, 224, 255);
  font-weight: 750;
}

.gizmothinking {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.gizmomessage.is-thinking .gizmobubble,
.gizmobubblethinking {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 2px 0;
}

.gizmothinking span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #ffffff;
  animation: gizmoPulse 1s infinite ease-in-out;
}

.gizmothinking span:nth-child(2) {
  animation-delay: 0.12s;
}

.gizmothinking span:nth-child(3) {
  animation-delay: 0.24s;
}

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

.gizmofooter {
  padding: 10px 10px 7px;
  display: grid;
  gap: 7px;
}

.gizmobar {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  min-width: 0;
}

.gizmobar .gizmoiconbtn {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

.gizmobar .gizmoiconbtn svg {
  width: 11px;
  height: 11px;
}

.gizmobillingwrap {
  position: relative;
}

.gizmonewchatbtn,
.gizmohistorybtn {
  height: 22px;
  min-height: 22px;
  min-width: 0;
  border-radius: 6px;
  padding: 0 7px;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  color: color-mix(in srgb, var(--chat-muted) 78%, var(--chat-text) 22%);
  background: transparent;
}

.gizmonewchatbtn svg,
.gizmohistorybtn svg {
  width: 10px;
  height: 10px;
}

.gizmocredits {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-left: auto;
  width: 66px;
  min-width: 66px;
  cursor: help;
}

.gizmocredits.is-empty .gizmocreditfill {
  background: color-mix(in srgb, #ef4444 74%, var(--chat-muted) 26%);
}

.gizmocrediticon {
  width: 10px;
  height: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 10px;
  color: color-mix(in srgb, var(--chat-muted) 82%, var(--chat-text) 18%);
}

.gizmocrediticon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.gizmocredittrack {
  width: 100%;
  height: 3px;
  display: block;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--chat-border) 64%, transparent);
}

.gizmocreditfill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6d5dfc 0%, #8b5cf6 54%, #b06dff 100%);
  transition: width 180ms ease, background 180ms ease;
}

.gizmocredittext {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.gizmobillingbtn {
  height: 22px;
  min-height: 22px;
  min-width: 0;
  border-radius: 6px;
  padding: 0 7px;

  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  color: white;
  background: #2c6ddf;
  text-decoration: none;
}

.gizmobillingbtn svg {
  width: 11px;
  height: 11px;
}

.gizmocomposer {
  --gizmo-composer-angle: 0deg;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 2px;
  background:
    linear-gradient(black, black) padding-box,
    conic-gradient(from var(--gizmo-composer-angle), #ff5f6d, rgba(255, 195, 112, 0), rgba(247, 255, 95, 0), #6dffb100, #5fd0ff, #7c5cff, #ff5fd6, #ff5f6d) border-box;
  animation: gizmoBorderLoop 3.6s linear infinite;
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 6px;
  align-items: center;
}

.gizmoinput {
  min-height: 34px;
  height: 34px;
  max-height: 118px;
  resize: none;
  border-radius: 8px;
  border: 0;
  background: black;
  color: var(--chat-text);
  padding: 8px 11px;
  font: inherit;
  font-size: 12px;
  line-height: 16px;
  outline: none;
}

.gizmoinput:focus {
  box-shadow: none;
}

.gizmosendbtn {
  width: 34px;
  height: 34px;
  align-self: center;
  border: 0;
}

.gizmohidden {
  display: none !important;
}

@property --gizmo-composer-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@property --gizmo-launcher-loop-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@property --gizmo-launcher-loop-start {
  syntax: '<angle>';
  inherits: false;
  initial-value: 235deg;
}

@property --gizmo-launcher-loop-blue {
  syntax: '<angle>';
  inherits: false;
  initial-value: 270deg;
}

@property --gizmo-launcher-loop-violet {
  syntax: '<angle>';
  inherits: false;
  initial-value: 302deg;
}

@property --gizmo-launcher-loop-end {
  syntax: '<angle>';
  inherits: false;
  initial-value: 360deg;
}

@keyframes gizmoBorderLoop {
  to {
    --gizmo-composer-angle: 360deg;
  }
}

@keyframes gizmoLauncherLoop {
   0% {
    --gizmo-launcher-loop-angle: 0deg;
    --gizmo-launcher-loop-start: 235deg;
    --gizmo-launcher-loop-blue: 270deg;
    --gizmo-launcher-loop-violet: 302deg;
    --gizmo-launcher-loop-end: 360deg;
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  72% {
    --gizmo-launcher-loop-start: 235deg;
    --gizmo-launcher-loop-blue: 270deg;
    --gizmo-launcher-loop-violet: 302deg;
    --gizmo-launcher-loop-end: 360deg;
    opacity: 1;
  }

  88% {
    --gizmo-launcher-loop-start: 345deg;
    --gizmo-launcher-loop-blue: 270deg;
    --gizmo-launcher-loop-violet: 343deg;
    --gizmo-launcher-loop-end: 358deg;
    opacity: 1;
  }

  96% {
    --gizmo-launcher-loop-start: 406deg;
    --gizmo-launcher-loop-blue: 270deg;
    --gizmo-launcher-loop-violet: 356deg;
    --gizmo-launcher-loop-end: 359deg;
    opacity: 0.8;
  }

  100% {
    --gizmo-launcher-loop-angle: 690deg;
    --gizmo-launcher-loop-start: 359deg;
    --gizmo-launcher-loop-blue: 360deg;
    --gizmo-launcher-loop-violet: 360deg;
    --gizmo-launcher-loop-end: 360deg;
    opacity: 0;

  }
}

@keyframes gizmoOverlayIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gizmoOverlayOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

@keyframes gizmoFeedIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gizmoHistoryPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gizmoHistoryPanelOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

@media (max-width: 560px) {
  .gizmowidget {
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .gizmopanel {
    right: 0;
    bottom: 64px;
    width: calc(100vw - 28px);
    height: min(540px, calc(100vh - 98px));
    min-height: 0;
    height: min(540px, calc(100dvh - 98px - env(safe-area-inset-bottom)));
  }

  .gizmoopenbtn {
    --gizmo-launcher-size: 52px;
    min-width: var(--gizmo-launcher-size);
    width: var(--gizmo-launcher-size);
    height: var(--gizmo-launcher-size);
    padding: 0;
    border-radius: 999px;
  }

  .gizmolauncheravatar {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .gizmoicon {
    inset: 5px;
    width: 34px;
    height: 34px;
  }

  .gizmobar {
    gap: 6px;
  }

  .gizmoinput {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gizmowidget,
  .gizmoopenbtn,
  .gizmoopenbtn::before,
  .gizmocomposer,
  .gizmofeed,
  .gizmoauth,
  .gizmonotice,
  .gizmohistory {
    animation: none;
    transition: none;
  }
}
