.codex-chatbox-root {
  --codex-chatbox-accent: #0f7cff;
  --codex-chatbox-accent-dark: #0758d8;
  --codex-chatbox-ink: #101828;
  --codex-chatbox-muted: #667085;
  bottom: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: fixed;
  z-index: 999999;
}

.codex-chatbox-root [hidden] {
  display: none !important;
}

.codex-chatbox-root--right {
  right: 24px;
}

.codex-chatbox-root--left {
  left: 24px;
}

.codex-chatbox__launcher,
.codex-chatbox__send,
.codex-chatbox__lead button {
  background: linear-gradient(135deg, var(--codex-chatbox-accent), var(--codex-chatbox-accent-dark));
  border: 0;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
}

.codex-chatbox__launcher {
  align-items: center;
  animation: codex-chatbox-buzz 4.8s infinite;
  border-radius: 999px;
  box-shadow: 0 20px 45px rgba(15, 124, 255, 0.32);
  display: inline-flex;
  gap: 10px;
  font-weight: 700;
  min-height: 58px;
  min-width: 104px;
  padding: 0 22px 0 16px;
  position: relative;
}

.codex-chatbox__launcher::before {
  animation: codex-chatbox-live-ring 1.9s infinite;
  border: 2px solid rgba(15, 124, 255, 0.34);
  border-radius: 999px;
  bottom: -7px;
  content: "";
  left: -7px;
  pointer-events: none;
  position: absolute;
  right: -7px;
  top: -7px;
}

.codex-chatbox__launcher::after {
  background: #28e98c;
  border: 3px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(40, 233, 140, 0.18);
  content: "";
  height: 13px;
  position: absolute;
  right: 5px;
  top: 5px;
  width: 13px;
}

.codex-chatbox-root--launcher-bubble .codex-chatbox__launcher {
  height: 62px;
  min-width: 62px;
  padding: 0;
  width: 62px;
}

.codex-chatbox-root--launcher-bubble .codex-chatbox__launcher::after {
  right: 2px;
  top: 2px;
}

.codex-chatbox-root--launcher-bubble .codex-chatbox__launcher-label {
  display: none;
}

.codex-chatbox__launcher-icon {
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
  height: 38px;
  overflow: hidden;
  position: relative;
  width: 38px;
}

.codex-chatbox__launcher-icon::before,
.codex-chatbox__launcher-icon::after {
  background: transparent;
  border-radius: 999px;
  content: "";
  left: 7px;
  position: absolute;
}

.codex-chatbox__launcher-icon::before {
  height: 0;
  top: 8px;
  width: 0;
}

.codex-chatbox__launcher-icon::after {
  height: 0;
  top: 15px;
  width: 0;
}

.codex-chatbox__badge {
  align-items: center;
  background: #ff3b5f;
  border: 2px solid #ffffff;
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 22px;
  justify-content: center;
  position: absolute;
  right: -5px;
  top: -6px;
  width: 22px;
}

.codex-chatbox__teaser {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  bottom: 76px;
  box-shadow: 0 18px 50px rgba(16, 24, 40, 0.18);
  color: var(--codex-chatbox-ink);
  cursor: pointer;
  display: flex;
  gap: 4px;
  max-width: 280px;
  padding: 14px 42px 14px 16px;
  position: absolute;
}

.codex-chatbox-root--right .codex-chatbox__teaser {
  right: 0;
}

.codex-chatbox-root--left .codex-chatbox__teaser {
  left: 0;
}

.codex-chatbox__teaser-copy {
  display: grid;
  gap: 4px;
}

.codex-chatbox__teaser-copy span {
  color: var(--codex-chatbox-muted);
  font-size: 13px;
  line-height: 1.35;
}

.codex-chatbox__teaser-close,
.codex-chatbox__close,
.codex-chatbox__minimize {
  align-items: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  justify-content: center;
}

.codex-chatbox__teaser-close {
  background: #f2f4f7;
  color: #475467;
  height: 24px;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 24px;
}

.codex-chatbox {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 22px;
  box-shadow: 0 26px 80px rgba(16, 24, 40, 0.24);
  display: flex;
  flex-direction: column;
  height: min(620px, calc(100vh - 48px));
  overflow: hidden;
  position: relative;
  width: min(390px, calc(100vw - 32px));
}

.codex-chatbox-root--small .codex-chatbox {
  height: min(500px, calc(100vh - 48px));
  width: min(330px, calc(100vw - 32px));
}

.codex-chatbox-root--large .codex-chatbox {
  height: min(720px, calc(100vh - 48px));
  width: min(460px, calc(100vw - 32px));
}

.codex-chatbox-root--minimized .codex-chatbox {
  height: 86px;
}

.codex-chatbox-root--minimized .codex-chatbox__messages,
.codex-chatbox-root--minimized .codex-chatbox__lead,
.codex-chatbox-root--minimized .codex-chatbox__form {
  display: none;
}

.codex-chatbox__shine {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.42), transparent 58%);
  height: 150px;
  position: absolute;
  right: -62px;
  top: -76px;
  width: 180px;
  z-index: 1;
}

.codex-chatbox__header {
  align-items: center;
  background: linear-gradient(135deg, var(--codex-chatbox-accent), var(--codex-chatbox-accent-dark));
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  min-height: 86px;
  padding: 0 18px 0 20px;
  position: relative;
  z-index: 2;
}

.codex-chatbox__identity {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.codex-chatbox__identity span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.codex-chatbox__identity strong,
.codex-chatbox__identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-chatbox__identity small {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  padding-left: 14px;
  position: relative;
}

.codex-chatbox__identity small::before {
  background: #28e98c;
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(40, 233, 140, 0.18);
  content: "";
  height: 7px;
  left: 1px;
  position: absolute;
  top: 5px;
  width: 7px;
}

.codex-chatbox__avatar {
  align-items: center;
  background: linear-gradient(135deg, #ffffff, #dbeafe);
  background-position: center;
  background-size: cover;
  border-radius: 999px;
  color: var(--codex-chatbox-accent);
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 800;
  justify-content: center;
}

.codex-chatbox__avatar--header {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.22);
  font-size: 14px;
  height: 46px;
  width: 46px;
}

.codex-chatbox__avatar--message {
  font-size: 11px;
  height: 28px;
  width: 28px;
}

.codex-chatbox__avatar--teaser {
  box-shadow: 0 8px 20px rgba(15, 124, 255, 0.16);
  font-size: 13px;
  height: 42px;
  margin-right: 8px;
  width: 42px;
}

.codex-chatbox__avatar--launcher {
  border: 2px solid #ffffff;
  font-size: 12px;
  height: 100%;
  width: 100%;
}

.codex-chatbox-root--launcher-bubble .codex-chatbox__launcher-icon {
  height: 54px;
  width: 54px;
}

.codex-chatbox__actions {
  display: inline-flex;
  gap: 8px;
  position: relative;
  z-index: 3;
}

.codex-chatbox__close,
.codex-chatbox__minimize {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  height: 30px;
  width: 30px;
}

.codex-chatbox__messages {
  background:
    radial-gradient(circle at top left, rgba(15, 124, 255, 0.1), transparent 34%),
    linear-gradient(180deg, #f7fbff 0%, #ffffff 42%);
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 20px 18px;
}

.codex-chatbox__message-row {
  align-items: flex-end;
  display: flex;
  gap: 8px;
}

.codex-chatbox__message-row--bot {
  align-self: flex-start;
}

.codex-chatbox__message-row--user {
  align-self: flex-end;
  justify-content: flex-end;
}

.codex-chatbox__message {
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 84%;
  padding: 10px 12px;
  word-break: break-word;
}

.codex-chatbox__message--bot {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-bottom-left-radius: 7px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
  color: var(--codex-chatbox-ink);
}

.codex-chatbox__message--typing {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  min-height: 20px;
  min-width: 44px;
}

.codex-chatbox__typing-dot {
  animation: codex-chatbox-typing 900ms infinite ease-in-out;
  background: #98a2b3;
  border-radius: 999px;
  height: 7px;
  width: 7px;
}

.codex-chatbox__typing-dot:nth-child(2) {
  animation-delay: 120ms;
}

.codex-chatbox__typing-dot:nth-child(3) {
  animation-delay: 240ms;
}

.codex-chatbox__message--live::after {
  animation: codex-chatbox-caret 700ms infinite;
  content: "";
  border-right: 2px solid var(--codex-chatbox-accent);
  margin-left: 2px;
}

@keyframes codex-chatbox-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes codex-chatbox-caret {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

@keyframes codex-chatbox-live-ring {
  0% {
    opacity: 0.72;
    transform: scale(0.92);
  }

  72%,
  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

@keyframes codex-chatbox-buzz {
  0%,
  88%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0);
  }

  90% {
    transform: translate3d(-1px, 0, 0) rotate(-1deg);
  }

  92% {
    transform: translate3d(1px, 0, 0) rotate(1deg);
  }

  94% {
    transform: translate3d(-1px, 0, 0) rotate(-1deg);
  }

  96% {
    transform: translate3d(1px, 0, 0) rotate(1deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .codex-chatbox__launcher,
  .codex-chatbox__launcher::before,
  .codex-chatbox__typing-dot,
  .codex-chatbox__message--live::after {
    animation: none;
  }
}

.codex-chatbox__message--user {
  background: linear-gradient(135deg, var(--codex-chatbox-accent), var(--codex-chatbox-accent-dark));
  border-bottom-right-radius: 7px;
  color: #ffffff;
}

.codex-chatbox__prompts {
  align-self: stretch;
  display: grid;
  gap: 8px;
  margin-top: 2px;
  padding-left: 36px;
}

.codex-chatbox__prompt {
  background: #ffffff;
  border: 1px solid rgba(15, 124, 255, 0.18);
  border-radius: 999px;
  color: #0b5fcc;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  min-height: 36px;
  padding: 0 14px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.codex-chatbox__prompt:hover {
  border-color: rgba(15, 124, 255, 0.42);
  box-shadow: 0 8px 18px rgba(15, 124, 255, 0.1);
  transform: translateY(-1px);
}

.codex-chatbox__lead {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.codex-chatbox__lead strong {
  color: var(--codex-chatbox-ink);
  font-size: 14px;
}

.codex-chatbox__lead input,
.codex-chatbox__input {
  background: #f8fafc;
  border: 1px solid #d9e2ef;
  border-radius: 999px;
  font: inherit;
  min-width: 0;
  padding: 10px 12px;
}

.codex-chatbox__lead button {
  border-radius: 999px;
  font-weight: 700;
  min-height: 42px;
}

.codex-chatbox__form {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  padding: 14px 14px 10px;
}

.codex-chatbox__input {
  flex: 1;
}

.codex-chatbox__send {
  border-radius: 999px;
  font-weight: 700;
  min-width: 68px;
  padding: 0 16px;
}

@media (max-width: 480px) {
  .codex-chatbox-root {
    bottom: 16px;
    left: 16px;
    right: 16px;
  }

  .codex-chatbox,
  .codex-chatbox-root--small .codex-chatbox,
  .codex-chatbox-root--large .codex-chatbox {
    height: min(620px, calc(100vh - 32px));
    width: 100%;
  }

  .codex-chatbox__teaser {
    left: 0;
    max-width: none;
    right: 0;
  }
}
