.fleet-ai {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(432px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid var(--brand);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(12, 17, 20, 0.1);
  color: #303030;
}

.fleet-ai__fabric {
  position: absolute;
  left: 25px;
  top: 24px;
  pointer-events: none;
}

.fleet-ai__head,
.fleet-ai__body,
.fleet-ai__foot {
  position: relative;
}

.fleet-ai__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.fleet-ai__mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
}

.fleet-ai__dots {
  position: relative;
  width: 24px;
  height: 24px;
}

.fleet-ai__dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform-origin: center;
}

.fleet-ai__dot--tl {
  top: 0;
  left: 0;
  background: #a9d6ff;
  animation: fleet-ai-tl-scale 3.15s cubic-bezier(0.4, 0, 0.2, 1) infinite, fleet-ai-tl-color 3.15s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.fleet-ai__dot--tr {
  top: 0;
  left: 16px;
  background: #73b7ff;
  animation: fleet-ai-tr-scale 3.15s cubic-bezier(0.4, 0, 0.2, 1) infinite, fleet-ai-tr-color 3.15s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.fleet-ai__dot--bl {
  top: 16px;
  left: 0;
  background: #0072ce;
  animation: fleet-ai-bl-scale 3.15s cubic-bezier(0.4, 0, 0.2, 1) infinite, fleet-ai-bl-color 3.15s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.fleet-ai__dot--br {
  top: 16px;
  left: 16px;
  background: #3894e9;
  animation: fleet-ai-br-scale 3.15s cubic-bezier(0.4, 0, 0.2, 1) infinite, fleet-ai-br-color 3.15s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.fleet-ai__min {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.fleet-ai__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 24px 12px;
  overflow: auto;
}

.fleet-ai__intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.fleet-ai__title {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.3;
}

.fleet-ai__lede {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

.fleet-ai__prompts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.fleet-ai__prompt {
  padding: 8px 16px;
  border: 1px solid var(--brand);
  border-radius: 100px;
  background: #fff;
  color: #303030;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  text-align: center;
  cursor: pointer;
}

.fleet-ai__prompt:hover,
.fleet-ai__prompt:focus-visible {
  background: var(--brand-100);
}

.fleet-ai__foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
}

.fleet-ai__ask {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 12px 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
}

.fleet-ai__ask input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
}

.fleet-ai__ask input::placeholder {
  color: var(--muted);
}

.fleet-ai__send,
.fleet-ai__send:disabled {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--brand);
  opacity: 1;
  cursor: pointer;
}

.fleet-ai__note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
}

.fleet-ai__expand,
.fleet-ai__bar-title {
  display: none;
}

.fleet-ai.is-min {
  right: 16px;
  bottom: 0;
  width: 335px;
  max-height: none;
  padding: 16px 24px 12px;
  border-width: 1px 1px 0;
  border-radius: 12px 12px 0 0;
  box-shadow: none;
}

.fleet-ai.is-min .fleet-ai__fabric,
.fleet-ai.is-min .fleet-ai__body,
.fleet-ai.is-min .fleet-ai__foot,
.fleet-ai.is-min .fleet-ai__min-icon {
  display: none;
}

.fleet-ai.is-min .fleet-ai__head {
  gap: 12px;
  width: 100%;
  padding: 0;
}

.fleet-ai.is-min .fleet-ai__mark {
  width: auto;
  height: auto;
  padding: 8px 0;
}

.fleet-ai.is-min .fleet-ai__dots {
  width: 16px;
  height: 16px;
}

.fleet-ai.is-min .fleet-ai__dot {
  width: 5.33px;
  height: 5.33px;
}

.fleet-ai.is-min .fleet-ai__dot--tr,
.fleet-ai.is-min .fleet-ai__dot--br {
  left: 10.67px;
}

.fleet-ai.is-min .fleet-ai__dot--bl,
.fleet-ai.is-min .fleet-ai__dot--br {
  top: 10.67px;
}

.fleet-ai.is-min .fleet-ai__bar-title {
  display: block;
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: #303030;
}

.fleet-ai.is-min .fleet-ai__min {
  width: 16px;
  height: 16px;
  background: transparent;
  backdrop-filter: none;
}

.fleet-ai.is-min .fleet-ai__expand {
  display: block;
}

@keyframes fleet-ai-tl-scale {
  0%, 100% { transform: scale(0.5); }
  11.11%, 33.33% { transform: scale(1); }
  44.44%, 66.67% { transform: scale(0.75); }
  55.56% { transform: scale(1); }
  77.78% { transform: scale(0.5); }
  88.89% { transform: scale(0.56); }
}

@keyframes fleet-ai-tl-color {
  0%, 44.44%, 100% { background: #a9d6ff; }
  11.11% { background: #73b7ff; }
  22.22% { background: #3894e9; }
  33.33% { background: #0072ce; }
}

@keyframes fleet-ai-tr-scale {
  0%, 22.22%, 66.67%, 100% { transform: scale(1); }
  33.33%, 44.44% { transform: scale(0.5); }
  55.56%, 77.78% { transform: scale(0.75); }
  88.89% { transform: scale(0.56); }
}

@keyframes fleet-ai-tr-color {
  0%, 100% { background: #73b7ff; }
  11.11% { background: #3894e9; }
  22.22%, 66.67% { background: #0072ce; }
  33.33%, 55.56%, 77.78%, 88.89% { background: #a9d6ff; }
}

@keyframes fleet-ai-bl-scale {
  0%, 22.22%, 44.44%, 100% { transform: scale(1); }
  11.11%, 66.67%, 77.78% { transform: scale(0.5); }
  55.56% { transform: scale(0.75); }
  88.89% { transform: scale(0.56); }
}

@keyframes fleet-ai-bl-color {
  0%, 44.44%, 100% { background: #0072ce; }
  11.11%, 55.56%, 88.89% { background: #a9d6ff; }
  22.22% { background: #73b7ff; }
  33.33% { background: #3894e9; }
}

@keyframes fleet-ai-br-scale {
  0%, 11.11%, 33.33%, 55.56%, 100% { transform: scale(1); }
  22.22%, 77.78% { transform: scale(0.5); }
  44.44%, 66.67% { transform: scale(0.75); }
  88.89% { transform: scale(0.56); }
}

@keyframes fleet-ai-br-color {
  0%, 33.33%, 100% { background: #3894e9; }
  11.11% { background: #0072ce; }
  22.22%, 44.44%, 88.89% { background: #a9d6ff; }
}

.fleet-ai__drawer-head,
.fleet-ai__note--drawer {
  display: none;
}

.fleet-ai.is-drawer {
  top: var(--header-h);
  right: 0;
  bottom: 0;
  width: 432px;
  max-height: none;
  border: 0;
  border-left: 1px solid rgba(12, 17, 20, 0.1);
  border-radius: 0;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.04), 1px 4px 4px rgba(0, 0, 0, 0.04);
}

body:has(.fleet-ai.is-drawer) .main {
  margin-right: 432px;
}

.fleet-ai.is-drawer .fleet-ai__head,
.fleet-ai.is-drawer .fleet-ai__intro,
.fleet-ai.is-drawer .fleet-ai__note:not(.fleet-ai__note--drawer) {
  display: none;
}

.fleet-ai.is-drawer .fleet-ai__drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 24px;
}

.fleet-ai__drawer-title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.3;
  color: #303030;
}

.fleet-ai__drawer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fleet-ai__tool {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.fleet-ai__tool.is-selected {
  background: var(--brand-100);
}

.fleet-ai__tool:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.fleet-ai__newchat {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 96px;
}

.fleet-ai__newchat[hidden] {
  display: none;
}

.fleet-ai__newchat-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(400px, 100%);
  padding: 16px;
  border: 1px solid rgba(12, 17, 20, 0.2);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(12, 17, 20, 0.1);
}

.fleet-ai__newchat-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fleet-ai__newchat-title {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  color: #0c1114;
}

.fleet-ai__newchat-copy {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: #303030;
}

.fleet-ai__newchat-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.fleet-ai__newchat-cancel,
.fleet-ai__newchat-continue {
  min-width: 108px;
  height: 40px;
  padding: 0 24px;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}

.fleet-ai__newchat-cancel {
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand);
}

.fleet-ai__newchat-continue {
  border: 1px solid var(--border);
  background: var(--brand);
  color: #fff;
}

.fleet-ai__newchat-cancel:focus-visible,
.fleet-ai__newchat-continue:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.fleet-ai.is-drawer .fleet-ai__body {
  flex: 1;
  justify-content: flex-end;
  padding: 0 24px;
}

.fleet-ai.is-drawer.is-thread {
  gap: 8px;
}

.fleet-ai.is-drawer.is-thread .fleet-ai__body {
  justify-content: flex-start;
}

.fleet-ai.is-drawer.is-thread .fleet-ai__prompts {
  display: none;
}

.fleet-ai.is-drawer.is-thread .fleet-ai__foot {
  padding-top: 24px;
}

.fleet-ai__thread {
  display: none;
  flex-direction: column;
  gap: 40px;
  width: 100%;
}

.fleet-ai.is-drawer.is-thread .fleet-ai__thread {
  display: flex;
}

.fleet-ai__queries {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.fleet-ai__query {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 0 auto;
  padding: 16px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  text-align: right;
}

.fleet-ai__thinking {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

.fleet-ai__ellipsis span {
  animation: fleet-ai-ellipsis 1.4s infinite;
  opacity: 0.25;
}

.fleet-ai__ellipsis span:nth-child(2) {
  animation-delay: 0.2s;
}

.fleet-ai__ellipsis span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes fleet-ai-ellipsis {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

.fleet-ai__turn {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
}

.fleet-ai__response {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}

.fleet-ai__answer {
  width: 100%;
  padding: 16px;
  border-radius: 12px;
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
}

.fleet-ai__answer p {
  margin: 0;
}

.fleet-ai__answer p + p {
  margin-top: 1.6em;
}

.fleet-ai__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fleet-ai__action {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

.fleet-ai__action:hover,
.fleet-ai__action.is-selected {
  background: var(--grey-200);
}

.fleet-ai__action:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.fleet-ai.is-drawer .fleet-ai__ask:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px #fff, 0 0 2px 2px #3894e9;
}

.fleet-ai.is-drawer .fleet-ai__foot {
  padding-top: 20px;
}

.fleet-ai.is-drawer .fleet-ai__note--drawer {
  display: block;
}

.fleet-ai__gate {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.fleet-ai__gate[hidden] {
  display: none;
}

.fleet-ai__scrim {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
}

.fleet-ai__disclosure {
  position: absolute;
  top: 302px;
  left: 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  width: 400px;
  padding: 12px;
  border: 1px solid rgba(12, 17, 20, 0.2);
  border-radius: 8px;
  background: #fff;
}

.fleet-ai__disclosure-top,
.fleet-ai__disclosure-copy {
  width: 100%;
}

.fleet-ai__disclosure-top {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fleet-ai__disclosure-title {
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: #0c1114;
}

.fleet-ai__disclosure-close {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.fleet-ai__disclosure-copy {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: #525e6d;
}

.fleet-ai__disclosure-link {
  color: var(--brand);
  font-weight: 500;
  text-decoration: none;
}

.fleet-ai__disclosure-link:hover {
  text-decoration: underline;
}

.fleet-ai__disclosure-actions {
  display: flex;
  gap: 8px;
}

.fleet-ai__disagree,
.fleet-ai__agree {
  min-width: 108px;
  height: 40px;
  padding: 0 32px;
  border-radius: 8px;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
}

.fleet-ai__disagree {
  border: 0;
  background: none;
  color: var(--brand);
}

.fleet-ai__agree {
  border: 1px solid rgba(12, 17, 20, 0.2);
  background: var(--brand);
  color: #fff;
}

.fleet-ai__disclosure-close:focus-visible,
.fleet-ai__disagree:focus-visible,
.fleet-ai__agree:focus-visible,
.fleet-ai__disclosure-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* The add-vehicles bar stays on the bottom edge, one 16px gap to the left of the assistant. */
body:has(.fleet-ai:not(.is-min)) .import-snack {
  right: calc(16px + min(432px, 100vw - 32px) + 16px);
}

body:has(.fleet-ai.is-drawer) .import-snack {
  right: calc(432px + 16px);
}

body:has(.fleet-ai.is-min) .import-snack {
  right: calc(16px + 335px + 16px);
}

@media (prefers-reduced-motion: reduce) {
  .fleet-ai__dot,
  .fleet-ai__ellipsis span {
    animation: none;
    opacity: 1;
  }
}
