.scitech-ai-widget,
.scitech-ai-widget * {
  box-sizing: border-box;
}

.scitech-ai-widget {
  --saa-blue: #0b8cff;
  --saa-blue-dark: #006fe0;
  --saa-bg: #ffffff;
  --saa-soft: #f4f8ff;
  --saa-line: rgba(20, 73, 123, .14);
  --saa-text: #142033;
  --saa-muted: #718098;
  font-family: inherit;
  color: var(--saa-text);
}

.scitech-ai-widget--inline {
  width: 100%;
  max-width: 760px;
  margin: 24px 0;
}

.scitech-ai-widget--floating {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.scitech-ai-widget--floating.scitech-ai-widget--right {
  right: 22px;
  left: auto;
  align-items: flex-end;
}

.scitech-ai-widget--floating.scitech-ai-widget--left {
  left: 22px;
  right: auto;
  align-items: flex-start;
}

.scitech-ai-widget__bubble {
  min-width: 178px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(7, 94, 168, .12);
  background: rgba(255, 255, 255, .96);
  color: #172033;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(11, 44, 83, .18), 0 2px 8px rgba(10, 132, 255, .12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 18px 0 12px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.scitech-ai-widget__bubble:hover,
.scitech-ai-widget__bubble:focus {
  background: #fff;
  color: #172033;
  transform: translateY(-1px);
  box-shadow: 0 20px 44px rgba(11, 44, 83, .22), 0 2px 10px rgba(10, 132, 255, .16);
}

.scitech-ai-widget__bubble.is-hidden {
  display: none;
}

.scitech-ai-widget__bubble-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--saa-blue), #16c8ff);
  color: #fff;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.scitech-ai-widget__bubble-mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.scitech-ai-widget__bubble-text {
  white-space: nowrap;
  line-height: 1;
}

.scitech-ai-widget__panel {
  width: min(430px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 44px));
  max-height: calc(100vh - 44px);
  background: var(--saa-bg);
  border: 1px solid var(--saa-line);
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(12, 31, 58, .22);
  overflow: hidden;
  display: none;
  flex-direction: column;
  min-height: 0;
}

.scitech-ai-widget--floating .scitech-ai-widget__panel {
  margin-bottom: 14px;
}

.scitech-ai-widget__panel.is-open,
.scitech-ai-widget--inline .scitech-ai-widget__panel {
  display: flex;
}

.scitech-ai-widget--inline .scitech-ai-widget__panel {
  width: 100%;
  height: 560px;
  box-shadow: 0 16px 44px rgba(12, 31, 58, .08);
}

.scitech-ai-widget__head {
  padding: 18px 20px;
  background: linear-gradient(135deg, #092c59, #0b8cff);
  color: #fff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.scitech-ai-widget__title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.scitech-ai-widget__subtitle {
  margin-top: 4px;
  font-size: 12px;
  opacity: .78;
}

.scitech-ai-widget__close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.scitech-ai-widget__close:hover,
.scitech-ai-widget__close:focus {
  background: rgba(255, 255, 255, .22);
  color: #fff;
}

.scitech-ai-widget__messages {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.scitech-ai-widget__message {
  width: fit-content;
  min-width: 0;
  max-width: 88%;
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.scitech-ai-widget__message--assistant {
  background: var(--saa-soft);
  color: var(--saa-text);
  border: 1px solid var(--saa-line);
  border-top-left-radius: 6px;
}

.scitech-ai-widget__message a {
  color: #0095FF;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.scitech-ai-widget__message--user a {
  color: #fff;
}

.scitech-ai-widget__message--user {
  margin-left: auto;
  background: var(--saa-blue);
  color: #fff;
  border-top-right-radius: 6px;
}

.scitech-ai-widget__message--typing {
  display: flex;
  gap: 5px;
  align-items: center;
  min-width: 54px;
}

.scitech-ai-widget__message--typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--saa-blue);
  opacity: .35;
  animation: saaTyping 1s infinite ease-in-out;
}

.scitech-ai-widget__message--typing span:nth-child(2) { animation-delay: .15s; }
.scitech-ai-widget__message--typing span:nth-child(3) { animation-delay: .3s; }

@keyframes saaTyping {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.scitech-ai-widget__form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px 14px 10px;
  flex: 0 0 auto;
  border-top: 1px solid var(--saa-line);
  background: #fff;
}


.scitech-ai-widget__commands {
  padding: 0;
  min-width: 0;
}

.scitech-ai-widget__commands-kicker {
  margin: 0 0 6px 2px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--saa-muted);
  font-weight: 700;
}

.scitech-ai-widget__commands-type {
  width: 100%;
  min-height: 38px;
  max-height: 42px;
  border: 1px solid rgba(0, 149, 255, .18);
  border-radius: 16px;
  background: linear-gradient(180deg, #f7fbff 0%, #eef7ff 100%);
  color: var(--saa-text);
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow: hidden;
}


.scitech-ai-widget__commands-type:hover,
.scitech-ai-widget__commands-type:focus {
  border-color: rgba(0, 149, 255, .42);
  background: #f5fbff;
  color: var(--saa-text);
}

.scitech-ai-widget__commands-text {
  min-height: 17px;
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scitech-ai-widget__commands-cursor {
  width: 2px;
  height: 18px;
  display: inline-block;
  background: #0095FF;
  border-radius: 2px;
  animation: saaCursor .9s steps(1) infinite;
  flex: 0 0 auto;
}

@keyframes saaCursor {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0; }
}

.scitech-ai-widget__command-chips {
  margin-top: 7px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.scitech-ai-widget__command-chips::-webkit-scrollbar {
  display: none;
}

.scitech-ai-widget__command-chip {
  flex: 0 0 auto;
  max-width: 260px;
  border: 1px solid var(--saa-line);
  border-radius: 999px;
  background: #fff;
  color: var(--saa-text);
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scitech-ai-widget__command-chip:hover,
.scitech-ai-widget__command-chip:focus {
  border-color: #0095FF;
  color: #0095FF;
  background: #f7fbff;
}

.scitech-ai-widget__input {
  width: 100%;
  min-height: 78px;
  max-height: 140px;
  resize: vertical;
  border: 1px solid var(--saa-line);
  border-radius: 18px;
  padding: 13px 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  color: var(--saa-text);
  background: #fff;
  outline: none;
}

.scitech-ai-widget__input:focus {
  border-color: var(--saa-blue);
  box-shadow: 0 0 0 4px rgba(11, 140, 255, .12);
}

.scitech-ai-widget__send {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--saa-blue);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.scitech-ai-widget__send:hover,
.scitech-ai-widget__send:focus {
  background: var(--saa-blue-dark);
  color: #fff;
}

.scitech-ai-widget__send:disabled {
  opacity: .65;
  cursor: wait;
}

.scitech-ai-widget__note {
  padding: 0 16px 12px;
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1.35;
  color: var(--saa-muted);
  background: #fff;
}

@media (max-width: 640px) {
  .scitech-ai-widget--floating {
    right: 14px;
    bottom: 14px;
  }

  .scitech-ai-widget--floating.scitech-ai-widget--right {
    right: 14px;
    left: auto;
    align-items: flex-end;
  }

  .scitech-ai-widget--floating.scitech-ai-widget--left {
    left: 14px;
    right: auto;
    align-items: flex-start;
  }

  .scitech-ai-widget__bubble {
    min-width: 58px;
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 50%;
  }

  .scitech-ai-widget__bubble-mark {
    width: 44px;
    height: 44px;
  }

  .scitech-ai-widget__bubble-text {
    display: none;
  }

  .scitech-ai-widget__panel {
    width: calc(100vw - 24px);
    height: min(620px, calc(100vh - 28px));
    max-height: calc(100vh - 28px);
    border-radius: 22px;
  }

  .scitech-ai-widget__head {
    padding: 15px 16px;
  }

  .scitech-ai-widget__title {
    font-size: 17px;
  }

  .scitech-ai-widget__messages {
    padding: 14px;
  }

  .scitech-ai-widget__message {
    max-width: 92%;
    font-size: 13px;
  }

  .scitech-ai-widget__form {
    padding: 10px 12px 9px;
    gap: 7px;
  }

  .scitech-ai-widget__commands-type {
    min-height: 36px;
    max-height: 40px;
    font-size: 12px;
  }

  .scitech-ai-widget__command-chip {
    max-width: 220px;
    font-size: 11px;
    padding: 6px 9px;
  }

  .scitech-ai-widget__input {
    min-height: 76px;
    max-height: 120px;
    font-size: 13px;
  }

  .scitech-ai-widget__send {
    min-height: 42px;
  }

  .scitech-ai-widget__note {
    padding: 0 14px 11px;
  }
}

.scitech-ai-widget__bubble-mark--custom {
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.scitech-ai-widget__bubble-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border: 0;
  border-radius: inherit;
}
