.bot-chat-widget {
  position: fixed;
  z-index: 1038;
  left: auto;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
}

.bot-chat-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 1037;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

body.bot-chat-is-open .bot-chat-page-overlay {
  opacity: 1;
  pointer-events: auto;
}

.bot-chat-toggle {
  position: fixed;
  opacity: 0;
  pointer-events: none;
}

.bot-chat-button {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid #dfe4ea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
  cursor: pointer;
  pointer-events: auto;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, opacity .16s ease;
}

.bot-chat-button:hover,
.bot-chat-button:focus-visible {
  border-color: #c8d1dc;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
  transform: translateY(-1px);
}

.bot-chat-button [data-bot-chat-button-icon] { display: inline-flex; }
.bot-chat-button [data-bot-chat-button-icon][hidden] { display: none; }

.bot-chat-panel {
  position: absolute;
  right: 0;
  bottom: 54px;
  display: flex;
  flex-direction: column;
  width: min(425px, calc(100vw - 28px));
  height: min(538px, calc(100vh - 96px));
  border: 1px solid #e3e7ed;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, .18);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(.98);
  transform-origin: bottom right;
  overscroll-behavior: contain;
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}

.bot-chat-panel::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -12px;
  width: 60px;
  height: 12px;
}

.bot-chat-panel::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 4;
  border: 1px dashed rgba(33, 37, 41, .28);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
}

.bot-chat-widget.is-drag-over .bot-chat-panel::before {
  opacity: 1;
}

.bot-chat-toggle:checked ~ .bot-chat-panel,
.bot-chat-widget.is-open .bot-chat-panel {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.bot-chat-toggle:checked ~ .bot-chat-button,
.bot-chat-widget.is-open .bot-chat-button {
  opacity: .92;
}

@media (hover: hover) and (pointer: fine) {
  .bot-chat-widget:not(.is-hover-disabled):hover .bot-chat-panel,
  .bot-chat-widget:not(.is-hover-disabled):focus-within .bot-chat-panel {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
  }

  .bot-chat-widget:not(.is-hover-disabled):hover .bot-chat-button,
  .bot-chat-widget:not(.is-hover-disabled):focus-within .bot-chat-button {
    opacity: .92;
  }
}

.bot-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid #eef1f4;
}

.bot-chat-title {
  color: #15191f;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
}

.bot-chat-heading {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  line-height: 1;
}

.bot-chat-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.bot-chat-header-actions > .bot-chat-admin-toggle {
  display: none;
}

.bot-chat-settings-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #212529;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.bot-chat-settings-toggle:hover,
.bot-chat-settings-toggle:focus-visible {
  color: #000;
  border-color: #d8dde4;
  background: #eef1f4;
  transform: translateY(-1px);
}

.bot-chat-settings-toggle.is-active {
  color: #fff;
  border-color: #212529;
  background: #212529;
  box-shadow: none;
}

.bot-chat-admin-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #212529;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.bot-chat-admin-toggle input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.bot-chat-admin-toggle:hover,
.bot-chat-admin-toggle:has(input:focus-visible) {
  color: #000;
  border-color: #d8dde4;
  background: #eef1f4;
  transform: translateY(-1px);
}

.bot-chat-admin-toggle:has(input:checked) {
  border-color: #212529;
  color: #fff;
  background: #212529;
  box-shadow: none;
}

.bot-chat-admin-toggle:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(33, 37, 41, .1);
}

.bot-chat-admin-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #eef1f4;
  background: #fbfcfd;
}

.bot-chat-admin-bar[hidden] {
  display: none;
}

.bot-chat-admin-select {
  min-width: 0;
  height: 30px;
  padding: 3px 28px 3px 8px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  color: #20242a;
  background: #fff;
  font: inherit;
  font-size: .76rem;
  outline: none;
}

.bot-chat-admin-select:focus {
  border-color: #aeb9c7;
  box-shadow: 0 0 0 3px rgba(33, 37, 41, .08);
}

.bot-chat-admin-badge {
  color: #6b7280;
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.bot-chat-search-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px 30px 30px;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid #eef1f4;
  background: #fbfcfd;
}

.bot-chat-search-bar[hidden] {
  display: none;
}

.bot-chat-search-label {
  min-width: 0;
  color: #20242a;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-chat-settings-panel {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f4;
  background: #fbfcfd;
}

.bot-chat-settings-backdrop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0;
  border: 0;
  border-radius: 0 0 12px 12px;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}

.bot-chat-settings-backdrop[hidden] {
  display: none;
}

.bot-chat-settings-panel[hidden] {
  display: none;
}

.bot-chat-settings-title {
  color: #15191f;
  font-size: .76rem;
  font-weight: 700;
}

.bot-chat-settings-options {
  display: grid;
  gap: 6px;
}

.bot-chat-search-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px 30px;
  gap: 6px;
}

.bot-chat-search-input {
  width: 100%;
  min-height: 30px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid #e3e7ed;
  border-radius: 8px;
  color: #20242a;
  background: #fff;
  font: inherit;
  font-size: .78rem;
  line-height: 1.2;
  outline: 0;
}

.bot-chat-search-input:focus {
  border-color: #c8d1dc;
  box-shadow: 0 0 0 2px rgba(33, 37, 41, .08);
}

.bot-chat-search-input::placeholder {
  color: #8a94a3;
}

.bot-chat-search-input::-webkit-search-cancel-button {
  filter: brightness(0);
}

.bot-chat-search-step {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #e3e7ed;
  border-radius: 8px;
  color: #20242a;
  background: #fff;
  cursor: pointer;
}

.bot-chat-search-step:hover,
.bot-chat-search-step:focus-visible {
  border-color: #c8d1dc;
  box-shadow: 0 0 0 2px rgba(33, 37, 41, .08);
}

.bot-chat-search-step::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.bot-chat-search-step[data-bot-chat-search-prev]::before {
  transform: rotate(45deg) translate(1px, 1px);
}

.bot-chat-search-step[data-bot-chat-search-next]::before {
  transform: rotate(225deg) translate(1px, 1px);
}

.bot-chat-search-step:disabled {
  opacity: .45;
  cursor: default;
  box-shadow: none;
}

.bot-chat-search-clear {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #e3e7ed;
  border-radius: 8px;
  color: #6b7280;
  background: #fff;
  cursor: pointer;
}

.bot-chat-search-clear:hover,
.bot-chat-search-clear:focus-visible {
  color: #20242a;
  border-color: #c8d1dc;
  box-shadow: 0 0 0 2px rgba(33, 37, 41, .08);
}

.bot-chat-search-clear::before,
.bot-chat-search-clear::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.bot-chat-search-clear::before {
  transform: rotate(45deg);
}

.bot-chat-search-clear::after {
  transform: rotate(-45deg);
}

.bot-chat-settings-options label,
.bot-chat-history-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid #e3e7ed;
  border-radius: 8px;
  color: #20242a;
  background: #fff;
  font-size: .78rem;
  line-height: 1.2;
  cursor: pointer;
}

.bot-chat-settings-options input,
.bot-chat-history-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #212529;
}

.bot-chat-settings-status {
  min-height: 14px;
  color: #6b7280;
  font-size: .68rem;
  line-height: 1.3;
}

.bot-chat-settings-status[data-tone="error"] {
  color: #b42318;
}

.bot-chat-status {
  display: none;
}

.bot-chat-close {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #6b7280;
  background: transparent;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, transform .22s ease;
}

.bot-chat-close:hover,
.bot-chat-close:focus-visible {
  color: #20242a;
  background: #f1f3f5;
  transform: rotate(90deg);
}

.bot-chat-close::before,
.bot-chat-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.bot-chat-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.bot-chat-scroll-shell {
  position: relative;
}

.bot-chat-messages-shell {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.bot-chat-messages {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bot-chat-messages::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.bot-chat-messages::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.bot-chat-scrollbar-thumb {
  position: absolute;
  top: 0;
  width: 2px;
  height: 0;
  border-radius: 999px;
  background: rgba(33, 37, 41, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
}

.bot-chat-scroll-shell > .bot-chat-scrollbar-thumb {
  right: 4px;
}

.bot-chat-scroll-shell.is-scrolling > .bot-chat-scrollbar-thumb {
  opacity: 1;
}

.bot-chat-message {
  display: flex;
  width: 100%;
}

.bot-chat-date-separator {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 2px 0;
  pointer-events: none;
}

.bot-chat-date-separator span {
  max-width: 100%;
  padding: 3px 9px;
  border: 1px solid rgba(226, 232, 240, .86);
  border-radius: 999px;
  color: rgba(75, 85, 99, .78);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
  font-size: .66rem;
  font-weight: 700;
  line-height: 1.25;
}

.bot-chat-message--user {
  justify-content: flex-end;
}

.bot-chat-message--bot {
  justify-content: flex-start;
}

.bot-chat-bubble {
  position: relative;
  box-sizing: border-box;
  max-width: 80%;
  min-height: 30px;
  min-width: 50px;
  padding: 8px 10px 15px;
  border: 1px solid #e4e8ee;
  border-radius: 10px;
  color: #222831;
  background: #f7f8fa;
  font-size: .86rem;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bot-chat-bubble strong {
  font-weight: 600;
}

.bot-chat-message-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: .22em;
  stroke-width: 2;
  transform: translateY(-1.5px);
}

.bot-chat-search-hit {
  border-radius: 3px;
  background: #fff176;
  color: #111827;
}

.bot-chat-message.is-search-current .bot-chat-bubble {
  border-color: #facc15;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, .28);
}

.bot-chat-time {
  position: absolute;
  right: 7px;
  bottom: 3px;
  color: rgba(75, 85, 99, .64);
  font-size: .58rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  user-select: none;
}

.bot-chat-message--user .bot-chat-bubble {
  color: #fff;
  border-color: #212529;
  background: #212529;
}

.bot-chat-message--user .bot-chat-time {
  color: rgba(255, 255, 255, .58);
}

.bot-chat-admin-author {
  display: block;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, .62);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: normal;
}

.bot-chat-bubble--thinking {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: none;
  min-width: 0;
  padding: 7px 10px;
  min-height: 0;
  line-height: 1;
  white-space: normal;
}

.bot-chat-bubble--thinking::before {
  content: "";
  position: absolute;
  top: -6px;
  right: -32px;
  bottom: -6px;
  width: 36px;
  background: transparent;
}

.bot-chat-thinking-wrap {
  display: inline-flex;
  align-items: center;
}

.bot-chat-thinking {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 23px;
  height: 6px;
  vertical-align: middle;
}

.bot-chat-thinking-cancel {
  position: absolute;
  top: 50%;
  right: -24px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 999px;
  color: #6b7280;
  background: #eef1f5;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(.92);
  transition: opacity .14s ease, transform .14s ease, background-color .14s ease, color .14s ease;
}

.bot-chat-thinking-cancel::before,
.bot-chat-thinking-cancel::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
}

.bot-chat-thinking-cancel::before {
  transform: rotate(45deg);
}

.bot-chat-thinking-cancel::after {
  transform: rotate(-45deg);
}

.bot-chat-bubble--thinking:hover .bot-chat-thinking-cancel,
.bot-chat-bubble--thinking:focus-within .bot-chat-thinking-cancel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.bot-chat-thinking-cancel:hover,
.bot-chat-thinking-cancel:focus-visible {
  color: #212529;
  background: #e9edf2;
  outline: 0;
}

.bot-chat-thinking span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6b7280;
  opacity: .35;
  animation: bot-chat-thinking-pulse 1s ease-in-out infinite;
}

.bot-chat-thinking span:nth-child(2) {
  animation-delay: .16s;
}

.bot-chat-thinking span:nth-child(3) {
  animation-delay: .32s;
}

@keyframes bot-chat-thinking-pulse {
  0%,
  80%,
  100% {
    opacity: .35;
    transform: translateY(0);
  }

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

.bot-chat-command-link {
  color: #111827;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
}

.bot-chat-command-link:hover,
.bot-chat-command-link:focus-visible {
  color: #000;
  text-decoration-thickness: 2px;
}

.bot-chat-message--user .bot-chat-command-link {
  color: #fff;
}

.bot-chat-message--user .bot-chat-command-link:hover,
.bot-chat-message--user .bot-chat-command-link:focus-visible {
  color: #fff;
}

.bot-chat-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  padding: 5px 8px;
  border-radius: 7px;
  color: #fff;
  background: #212529;
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
}

.bot-chat-download-link:hover,
.bot-chat-download-link:focus-visible {
  color: #fff;
  background: #000;
  text-decoration: none;
}

.bot-chat-download-link.is-downloaded {
  color: #20242a;
  border: 1px solid #dfe4ea;
  background: #fff;
  pointer-events: none;
}

.bot-chat-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 7px;
}

.bot-chat-action {
  min-height: 24px;
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid #dfe4ea;
  border-radius: 6px;
  color: #20242a;
  background: #fff;
  font: inherit;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color .14s ease, background-color .14s ease, border-color .14s ease;
}

.bot-chat-action.is-selected {
  color: #fff;
  border-color: #212529;
  background: #212529;
}

.bot-chat-action:hover,
.bot-chat-action:focus-visible {
  border-color: #c8d0da;
  background: #f8f9fa;
}

.bot-chat-action.is-selected:hover,
.bot-chat-action.is-selected:focus-visible {
  color: #fff;
  border-color: #000;
  background: #000;
}

.bot-chat-system {
  margin: auto;
  color: #8a94a3;
  font-size: .82rem;
  text-align: center;
}

.bot-chat-history-note {
  align-self: center;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  color: rgba(107, 114, 128, .72);
  background: rgba(241, 243, 245, .72);
  font-size: .68rem;
  line-height: 1.4;
}

.bot-chat-upload-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 62px;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(.98);
  transition: opacity .14s ease, transform .14s ease;
}

.bot-chat-upload-caption.is-open {
  max-height: min(390px, calc(100% - 86px));
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.bot-chat-upload-caption-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: inherit;
  min-height: 0;
  padding: 12px;
  border: 1px solid #e3e7ed;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
  overflow: hidden;
}

.bot-chat-upload-title {
  padding-right: 28px;
  color: #15191f;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.2;
}

.bot-chat-upload-files {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(230px, 34vh);
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-right: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  color: #6b7280;
  font-size: .74rem;
  line-height: 1.5;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bot-chat-upload-files::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.bot-chat-upload-files::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.bot-chat-upload-files::-webkit-scrollbar-track {
  background: transparent;
}

.bot-chat-upload-files::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
}

.bot-chat-upload-file {
  min-height: 1.5em;
  padding-block: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.bot-chat-upload-file.is-editable {
  width: 100%;
  border: 0;
  border-radius: 5px;
  padding: 1px 3px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

button.bot-chat-upload-file.is-editable:hover,
button.bot-chat-upload-file.is-editable:focus-visible {
  color: #4b5563;
  background: #f4f6f8;
  outline: none;
}

.bot-chat-upload-file em {
  margin-left: 4px;
  color: #9aa1aa;
  font-size: .82em;
  font-style: italic;
  font-weight: 400;
}

.bot-chat-upload-scrollbar-thumb {
  position: absolute;
  top: 0;
  right: 18px;
  width: 2px;
  height: 0;
  border-radius: 999px;
  background: rgba(33, 37, 41, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
}

.bot-chat-upload-caption-box.is-scrolling-files .bot-chat-upload-scrollbar-thumb {
  opacity: 1;
}

.bot-chat-upload-input {
  box-sizing: border-box;
  resize: none;
  width: 100%;
  min-width: 0;
  height: 38px;
  max-height: 92px;
  padding: 6px 12px;
  border: 1px solid #dfe4ea;
  border-radius: 9px;
  color: #20242a;
  background: #fff;
  font: inherit;
  font-size: .92rem;
  line-height: 24px;
  outline: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bot-chat-upload-input.is-multiline {
  padding-top: 6px;
  padding-bottom: 6px;
}

.bot-chat-upload-input:focus {
  border-color: #aeb9c7;
  box-shadow: 0 0 0 3px rgba(33, 37, 41, .08);
}

.bot-chat-upload-input.is-scrollable {
  scrollbar-color: rgba(107, 114, 128, .38) transparent;
  scrollbar-width: thin;
}

.bot-chat-upload-input::-webkit-scrollbar {
  width: 6px;
  height: 0;
}

.bot-chat-upload-input::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.bot-chat-upload-input::-webkit-scrollbar-track {
  background: transparent;
}

.bot-chat-upload-input::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: transparent;
}

.bot-chat-upload-input.is-scrollable::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, .34);
}

.bot-chat-upload-input.is-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, .52);
}

.bot-chat-upload-actions {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
}

.bot-chat-upload-input {
  grid-column: 1;
  grid-row: 1;
}

.bot-chat-upload-primary {
  grid-column: 2;
  grid-row: 1;
}

.bot-chat-upload-primary,
.bot-chat-upload-attach {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #212529;
  border-radius: 9px;
  color: #fff;
  background: #212529;
  font: inherit;
  font-size: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.bot-chat-upload-primary:hover,
.bot-chat-upload-primary:focus-visible {
  background: #000;
}

.bot-chat-upload-attach {
  grid-column: 2;
  grid-row: 1;
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(.96);
  transition: opacity .14s ease, transform .14s ease, border-color .16s ease, background-color .16s ease;
  color: #20242a;
  border: 1px solid #dfe4ea;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .14);
}

.bot-chat-upload-caption-box.is-attach-open .bot-chat-upload-attach,
.bot-chat-upload-attach:hover,
.bot-chat-upload-attach:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

@media (hover: hover) and (pointer: fine) {
  .bot-chat-upload-primary:hover + .bot-chat-upload-attach,
  .bot-chat-upload-primary:focus-visible + .bot-chat-upload-attach {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
}

.bot-chat-upload-attach::before,
.bot-chat-upload-attach::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.bot-chat-upload-attach::before {
  width: 14px;
  height: 2px;
}

.bot-chat-upload-attach::after {
  width: 2px;
  height: 14px;
}

.bot-chat-upload-attach:hover,
.bot-chat-upload-attach:focus-visible {
  border-color: #c8d1dc;
  background: #f7f8fa;
}

.bot-chat-upload-primary::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  transform: translate(-62%, -50%) rotate(45deg);
}

.bot-chat-upload-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #6b7280;
  background: transparent;
  font-size: 0;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, transform .22s ease;
}

.bot-chat-upload-close:hover,
.bot-chat-upload-close:focus-visible {
  color: #20242a;
  background: #f1f3f5;
  transform: rotate(90deg);
}

.bot-chat-upload-close::before,
.bot-chat-upload-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.bot-chat-upload-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.bot-chat-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #eef1f4;
  overflow: visible;
}

.bot-chat-widget.is-admin-readonly .bot-chat-form {
  opacity: .56;
}

.bot-chat-widget.is-admin-readonly .bot-chat-input,
.bot-chat-widget.is-admin-readonly .bot-chat-send,
.bot-chat-widget.is-admin-readonly .bot-chat-attach {
  cursor: not-allowed;
}

.bot-chat-file-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bot-chat-input-shell {
  grid-column: 1;
  position: relative;
  display: flex;
  min-width: 0;
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}

.bot-chat-input {
  width: 100%;
  min-width: 0;
  height: 38px;
  max-height: 92px;
  padding: 8px 12px;
  border: 1px solid #dfe4ea;
  border-radius: 9px;
  color: #20242a;
  background: #fff;
  font: inherit;
  font-size: .92rem;
  line-height: 1.35;
  outline: none;
  resize: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bot-chat-input-shell:focus-within {
  box-shadow: 0 0 0 3px rgba(33, 37, 41, .08);
}

.bot-chat-input-scrollbar-thumb {
  right: 4px;
  z-index: 1;
}

.bot-chat-input::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.bot-chat-input::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

@supports (-webkit-touch-callout: none) {
  .bot-chat-input {
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    clip-path: inset(0 round 9px);
  }
}

.bot-chat-input:focus {
  border-color: #aeb9c7;
}

.bot-chat-attach,
.bot-chat-send {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #212529;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.bot-chat-send {
  grid-column: 2;
}

.bot-chat-attach {
  grid-column: 2;
  position: absolute;
  right: 12px;
  bottom: 58px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(.96);
  transition: opacity .14s ease, transform .14s ease, border-color .16s ease, background-color .16s ease;
  color: #20242a;
  border: 1px solid #dfe4ea;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .14);
}

.bot-chat-cropper {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  background: rgba(220, 224, 229, .96);
  transition: opacity .15s ease;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

html.bot-chat-cropper-open,
body.bot-chat-cropper-open {
  overflow: hidden;
  overscroll-behavior: none;
  scrollbar-width: none;
}

html.bot-chat-cropper-open::-webkit-scrollbar,
body.bot-chat-cropper-open::-webkit-scrollbar {
  display: none;
}

.bot-chat-cropper.is-open {
  opacity: 1;
  pointer-events: auto;
}

.bot-chat-cropper-dialog {
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  color: #171a1f;
  background: #f4f4f4;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
}

.bot-chat-cropper-header,
.bot-chat-cropper-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bot-chat-cropper-header {
  width: 100%;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
}
.bot-chat-cropper-heading {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: .28em;
  overflow: hidden;
}

.bot-chat-cropper-heading > [data-bot-chat-crop-title] { white-space: nowrap; }

.bot-chat-cropper-filename {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: inherit;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  cursor: text;
  outline: none;
  pointer-events: auto;
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
  transition: color .15s ease;
}

.bot-chat-cropper.is-scanning .bot-chat-cropper-filename {
  pointer-events: auto;
  opacity: 1;
}

.bot-chat-cropper-filename[contenteditable="true"] {
  overflow: visible;
  white-space: pre-wrap;
}

.bot-chat-cropper-filename.is-saving { color: #9ca3af; }

.bot-chat-cropper-header-actions,
.bot-chat-cropper-history {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bot-chat-cropper-history .bot-chat-crop-icon-button {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  padding: 0;
  border: 0;
  color: #64748b;
  background: transparent;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.bot-chat-cropper-history .bot-chat-crop-icon-button .compass-lucide {
  width: 18px;
  height: 18px;
}

.bot-chat-cropper-history .bot-chat-crop-icon-button:disabled { opacity: .45; }

.bot-chat-cropper-actions {
  position: relative;
  justify-content: center;
  flex-wrap: nowrap;
}

.bot-chat-cropper-transform {
  display: grid;
  gap: 8px;
}

.bot-chat-cropper.is-scanned .bot-chat-cropper-transform {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.bot-chat-cropper.is-scanned .bot-chat-cropper-transform * {
  visibility: hidden;
}

.bot-chat-cropper-modes,
.bot-chat-pdf-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.bot-chat-cropper-modes .bot-chat-transform-icon-button,
.bot-chat-pdf-tools .bot-chat-transform-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  color: #64748b;
  background: transparent;
  line-height: 1;
  touch-action: manipulation;
  transition: color .15s ease, transform .15s ease;
}

.bot-chat-cropper-modes .bot-chat-transform-icon-button:focus-visible,
.bot-chat-pdf-tools .bot-chat-transform-icon-button:focus-visible {
  color: #111;
}

.bot-chat-pdf-tools .bot-chat-transform-icon-button:disabled {
  opacity: .38;
  cursor: default;
}

@media (hover: hover) and (pointer: fine) {
  .bot-chat-cropper-modes .bot-chat-transform-icon-button:hover,
  .bot-chat-pdf-tools .bot-chat-transform-icon-button:hover {
    color: #111;
  }
}

.bot-chat-cropper-modes .bot-chat-transform-icon-button.is-active {
  color: #111;
  background: transparent;
  transform: scale(1.08);
}

.bot-chat-cropper-range-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  visibility: hidden;
  pointer-events: none;
}

.bot-chat-cropper-range-row.is-visible {
  visibility: visible;
  pointer-events: auto;
}

.bot-chat-cropper-range-row > span {
  color: #111;
  font-size: .72rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.bot-chat-cropper-range-row input {
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

@media (min-width: 769px) {
  .bot-chat-cropper-range-row input {
    width: 50%;
  }
}

.bot-chat-cropper-range-row input::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #111;
}

.bot-chat-cropper-range-row input::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -9px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: #111;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .36);
}

.bot-chat-cropper-range-row input::-moz-range-track {
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: #111;
}

.bot-chat-cropper-range-row input::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: #111;
}

.bot-chat-cropper-range-row input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: #111;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .36);
}

.bot-chat-cropper-close {
  flex: 0 0 auto;
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #111;
  background: transparent;
}

.bot-chat-cropper-close::before,
.bot-chat-cropper-close::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 14px;
  width: 14px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.bot-chat-cropper-close::after { transform: rotate(-45deg); }

.bot-chat-cropper-stage {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border-radius: 8px;
  background: #f4f4f4;
  touch-action: none;
  user-select: none;
}

.bot-chat-cropper-viewport {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.bot-chat-cropper-image {
  position: absolute;
  left: 50%;
  top: 50%;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  display: block;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}

.bot-chat-cropper-image.is-loading {
  visibility: hidden;
}

.bot-chat-scan-prompt {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 8;
  width: min(420px, calc(100% - 24px));
  padding: 12px;
  border: 1px solid #dfe4ea;
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
  transform: translateX(-50%);
  -webkit-user-select: none;
  user-select: none;
}

.bot-chat-scan-dots.tbl-indicators {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: auto;
  max-width: calc(100% - 32px);
  min-height: 0;
  padding: 7px 10px;
  margin: 0;
  overflow-x: auto;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  transform: translateX(-50%);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.bot-chat-scan-dots[hidden] { display: none; }
.bot-chat-scan-dots::-webkit-scrollbar { display: none; }

.bot-chat-scan-prompt-message {
  display: grid;
  gap: 3px;
  font-size: .82rem;
}

.bot-chat-editor-prompt-heading {
  display: grid;
  grid-template-columns: 1.1em minmax(0, 1fr);
  align-items: flex-start;
  gap: 7px;
  line-height: 1.35;
  color: #222831;
}

.bot-chat-editor-prompt-heading > .compass-lucide {
  display: block;
  width: 1.1em;
  height: 1.1em;
  margin: .125em 0 0;
  transform: translateY(-0.5px);
}

.bot-chat-scan-prompt-message > span {
  color: #64748b;
  font-size: .72rem;
}

.bot-chat-scan-prompt-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.bot-chat-scan-prompt-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d5dae1;
  border-radius: 9px;
  color: #20242a;
  background: #fff;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}

.bot-chat-scan-prompt-actions [data-bot-chat-scan-finish] {
  border-color: #20242a;
  color: #fff;
  background: #20242a;
}

.bot-chat-scan-output-actions button,
.bot-chat-scan-output-actions button:first-child {
  border-color: #d5dae1;
  color: #20242a;
  background: #fff;
}

.bot-chat-pdf-add-prompt {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  overflow-y: auto;
  background: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.bot-chat-pdf-add-prompt[hidden],
.bot-chat-scan-prompt[hidden],
.bot-chat-scan-output-prompt[hidden] {
  display: none;
}

.bot-chat-pdf-add-card {
  box-sizing: border-box;
  width: min(420px, 100%);
  max-height: 100%;
  padding: 12px;
  overflow-y: auto;
  border: 1px solid #dfe4ea;
  border-radius: 14px;
  color: #222831;
  background: #fff;
  font-size: .82rem;
  line-height: 1.35;
  box-shadow: none;
}

.bot-chat-pdf-add-heading {
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 9px;
  font-size: .82rem;
  font-weight: 700;
  text-align: left;
}

.bot-chat-pdf-add-list,
.bot-chat-pdf-add-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bot-chat-pdf-add-actions {
  flex-direction: row;
  justify-content: center;
  margin-top: 20px;
}

.bot-chat-pdf-add-actions > button {
  flex: 0 1 180px;
  width: auto;
}

.bot-chat-pdf-add-option,
.bot-chat-pdf-add-confirm,
.bot-chat-pdf-add-close {
  width: min(180px, 100%);
  min-height: 34px;
  height: auto;
  padding: 7px 12px;
  border: 1px solid #d5dae1;
  border-radius: 9px;
  color: #20242a;
  background: #fff;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.bot-chat-pdf-add-option.is-selected {
  border-color: #20242a;
  color: #fff;
  background: #20242a;
  box-shadow: none;
}

.bot-chat-pdf-add-option.is-selected:hover,
.bot-chat-pdf-add-option.is-selected:focus-visible {
  border-color: #000;
  color: #fff;
  background: #000;
}

.bot-chat-pdf-add-confirm:disabled {
  opacity: .42;
  cursor: default;
}

.bot-chat-pdf-add-actions .bot-chat-pdf-add-close {
  border-color: #d5dae1;
  color: #20242a;
  background: #fff;
}

.bot-chat-pdf-add-actions .bot-chat-pdf-add-confirm {
  border-color: #20242a;
  color: #fff;
  background: #20242a;
}

.bot-chat-pdf-add-close {
  margin-top: 0;
  text-align: center;
}

.bot-chat-pdf-page-indicator {
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, .72);
  font-size: .7rem;
  line-height: 1.2;
  transform: translateX(-50%);
  pointer-events: none;
}

.bot-chat-pdf-scroll {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overscroll-behavior: contain;
  scroll-snap-type: y proximity;
  scrollbar-width: thin;
  touch-action: pan-y;
  overflow-anchor: none;
  -webkit-overflow-scrolling: touch;
}

.bot-chat-pdf-scroll.is-free-scrolling {
  scroll-snap-type: none;
}

.bot-chat-cropper.is-pdf .bot-chat-cropper-stage {
  touch-action: pan-y;
}

.bot-chat-pdf-page {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 120px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  scroll-snap-stop: normal;
}

.bot-chat-pdf-page-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #4b5563;
  font-size: .82rem;
  font-weight: 600;
  pointer-events: none;
}

.bot-chat-pdf-page-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

.bot-chat-text-layer {
  position: absolute;
  z-index: 6;
  pointer-events: none;
}

.bot-chat-image-text-layer { inset: 0; }
.bot-chat-pdf-text-layer { top: 0; left: 50%; transform: translateX(-50%); }
.bot-chat-pdf-page.is-loading .bot-chat-pdf-text-layer { visibility: hidden; }

.bot-chat-text-box {
  position: absolute;
  box-sizing: border-box;
  min-width: 24px;
  min-height: 18px;
  padding: 0;
  border: 0;
  outline: 2px dashed transparent;
  color: #111827;
  background: transparent;
  font-family: Arial, sans-serif;
  line-height: 1.15;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: move !important;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
}

.bot-chat-cropper[aria-busy="true"] .bot-chat-text-box { pointer-events: none; }

.bot-chat-text-box.is-selected {
  outline-color: #0b7bdc;
  background: rgba(255, 255, 255, .25);
  box-shadow: 0 0 0 2px rgba(11, 123, 220, .18);
}

.bot-chat-text-content {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  color: inherit;
  background: transparent;
  font: inherit;
  line-height: inherit;
  white-space: pre-wrap;
  appearance: none;
  cursor: text;
  resize: none;
  user-select: text;
  outline: none;
}

.bot-chat-text-box.is-selected .bot-chat-text-content { overflow: hidden; }
.bot-chat-text-box.is-selected.is-text-overflowing .bot-chat-text-content { overflow: auto; }

.bot-chat-text-drag-edge {
  position: absolute;
  z-index: 0;
  display: block;
}

.bot-chat-text-drag-edge.is-top,
.bot-chat-text-drag-edge.is-bottom { left: 0; width: 100%; height: 4px; }
.bot-chat-text-drag-edge.is-left,
.bot-chat-text-drag-edge.is-right { top: 0; width: 4px; height: 100%; }
.bot-chat-text-drag-edge.is-top { top: -6px; }
.bot-chat-text-drag-edge.is-right { right: -6px; }
.bot-chat-text-drag-edge.is-bottom { bottom: -6px; }
.bot-chat-text-drag-edge.is-left { left: -6px; }

.bot-chat-text-box.is-selected,
.bot-chat-text-box.is-selected .bot-chat-text-drag-edge {
  cursor: move !important;
}

button.bot-chat-text-drag-handle {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: -20px;
  width: 22px;
  height: 30px;
  padding: 0;
  border: 0;
  color: #0b7bdc;
  background: transparent;
  cursor: move !important;
  display: none;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  touch-action: none;
}

button.bot-chat-text-drag-handle:hover,
button.bot-chat-text-drag-handle:focus,
button.bot-chat-text-drag-handle:active,
button.bot-chat-text-drag-handle *,
button.bot-chat-text-drag-handle *::before,
button.bot-chat-text-drag-handle *::after {
  cursor: move !important;
}

.bot-chat-text-box.is-selected .bot-chat-text-drag-handle { display: inline-flex; }
.bot-chat-text-drag-handle .compass-lucide { width: 18px; height: 18px; }

.bot-chat-text-toolbar {
  position: absolute;
  z-index: 12;
  top: 8px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .24);
  transform: translateX(-50%);
  user-select: none;
}

.bot-chat-text-toolbar-drag {
  min-width: 22px !important;
  width: 22px;
  background: transparent !important;
  cursor: grab !important;
  touch-action: none;
}
.bot-chat-text-toolbar-drag .compass-lucide { display: block; margin: 0; }
.bot-chat-text-toolbar.is-dragging .bot-chat-text-toolbar-drag { cursor: grabbing !important; }

.bot-chat-text-toolbar[hidden] { display: none; }
.bot-chat-text-toolbar > button,
.bot-chat-text-colors button {
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: #f3f4f6;
  color: #111827;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bot-chat-text-colors { display: flex; gap: 4px; }
.bot-chat-text-colors button {
  flex: 0 0 26px;
  min-width: 26px;
  width: 26px;
  height: 26px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--text-color);
}
.bot-chat-text-colors button.is-active { outline: 2px solid #94a3b8; outline-offset: 0; }
.bot-chat-text-toolbar [data-bot-chat-text-smaller] { font-size: .8rem; }
.bot-chat-text-toolbar [data-bot-chat-text-larger] { font-size: 1.05rem; padding-bottom: 2px; }
.bot-chat-text-toolbar [data-bot-chat-text-delete] .compass-lucide { display: block; margin: 0; }

.bot-chat-cropper.is-pdf .bot-chat-cropper-transform,
.bot-chat-cropper.is-pdf .bot-chat-cropper-shade,
.bot-chat-cropper.is-pdf .bot-chat-cropper-box {
  display: none;
}

.bot-chat-cropper:not(.is-pdf) .bot-chat-pdf-tools {
  display: none;
}

.bot-chat-cropper.is-pdf .bot-chat-cropper-image {
  display: none;
}
.bot-chat-cropper.is-pdf .bot-chat-image-text-layer { display: none; }

.bot-chat-cropper-shade {
  position: absolute;
  pointer-events: none;
}

.bot-chat-cropper-shade span {
  position: absolute;
  background: rgba(227, 230, 234, .7);
}

.bot-chat-cropper-shade svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bot-chat-cropper-shade path {
  fill: rgba(227, 230, 234, .7);
}

.bot-chat-cropper-shade > span {
  display: none;
}

.bot-chat-cropper-box {
  position: absolute;
  box-shadow: none;
  cursor: crosshair;
  touch-action: none;
}

.bot-chat-cropper-quad {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.bot-chat-cropper-quad polygon {
  fill: transparent;
  stroke: rgba(0, 0, 0, .92);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.bot-chat-cropper-box::before,
.bot-chat-cropper-box::after {
  content: "";
  position: absolute;
  pointer-events: none;
  display: none;
}

.bot-chat-cropper-box::before {
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(16.666% - 1px),
    rgba(0, 0, 0, .28) calc(16.666% - 1px),
    rgba(0, 0, 0, .28) 16.666%
  );
}

.bot-chat-cropper-box::after {
  inset: 0;
  background: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(16.666% - 1px),
    rgba(0, 0, 0, .28) calc(16.666% - 1px),
    rgba(0, 0, 0, .28) 16.666%
  );
}

.bot-chat-cropper-handle {
  position: absolute;
  width: 28px;
  height: 28px;
  touch-action: none;
}

.bot-chat-cropper-handle::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: solid #111;
}

.bot-chat-cropper-handle.is-nw { left: -15px; top: -15px; cursor: nwse-resize; }
.bot-chat-cropper-handle.is-ne { right: -15px; top: -15px; cursor: nesw-resize; }
.bot-chat-cropper-handle.is-sw { left: -15px; bottom: -15px; cursor: nesw-resize; }
.bot-chat-cropper-handle.is-se { right: -15px; bottom: -15px; cursor: nwse-resize; }
.bot-chat-cropper-handle.is-nw::before { border-width: 2px 0 0 2px; }
.bot-chat-cropper-handle.is-ne::before { border-width: 2px 2px 0 0; }
.bot-chat-cropper-handle.is-sw::before { border-width: 0 0 2px 2px; }
.bot-chat-cropper-handle.is-se::before { border-width: 0 2px 2px 0; }

.bot-chat-cropper-magnifier {
  position: absolute;
  z-index: 5;
  width: 132px;
  height: 132px;
  border: 3px solid rgba(0, 0, 0, .92);
  border-radius: 50%;
  background: #e3e6ea;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .28);
  pointer-events: none;
}

.bot-chat-cropper-magnifier[hidden] {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .bot-chat-cropper-magnifier {
    display: none;
  }
}

.bot-chat-cropper-secondary,
.bot-chat-cropper-confirm {
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid #20242a;
  border-radius: 8px;
  color: #20242a;
  background: transparent;
  font: inherit;
  font-size: .7rem;
  white-space: nowrap;
}

.bot-chat-cropper-confirm {
  border-color: #111;
  color: #fff;
  background: #111;
  font-weight: 700;
}

.bot-chat-cropper-actions .bot-chat-crop-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  flex: 0 0 42px;
  padding: 0;
  border: 0;
  color: #64748b;
  background: transparent;
  line-height: 1;
  touch-action: manipulation;
  transition: color .15s ease, transform .15s ease, opacity .15s ease;
}

.bot-chat-cropper-actions .bot-chat-crop-icon-button:focus-visible {
  color: #111;
}

.bot-chat-cropper-actions .bot-chat-crop-icon-button--danger,
.bot-chat-cropper-actions .bot-chat-crop-icon-button--danger:focus-visible {
  color: #dc3545;
}

.bot-chat-cropper-actions .bot-chat-crop-icon-button--success,
.bot-chat-cropper-actions .bot-chat-crop-icon-button--success:focus-visible {
  color: #198754;
}

.bot-chat-cropper-actions .bot-chat-crop-icon-button:disabled {
  opacity: .45;
}

@media (hover: hover) and (pointer: fine) {
  .bot-chat-cropper-actions .bot-chat-crop-icon-button:hover {
    color: #111;
    transform: scale(1.08);
  }

  .bot-chat-cropper-actions .bot-chat-crop-icon-button--danger:hover {
    color: #b02a37;
  }

  .bot-chat-cropper-actions .bot-chat-crop-icon-button--success:hover {
    color: #146c43;
  }
}

.bot-chat-form.is-attach-open .bot-chat-attach,
.bot-chat-attach:hover,
.bot-chat-attach:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

@media (hover: hover) and (pointer: fine) {
  .bot-chat-send:hover + .bot-chat-attach,
  .bot-chat-send:focus-visible + .bot-chat-attach {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }
}

.bot-chat-attach::before,
.bot-chat-attach::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.bot-chat-attach::before {
  width: 14px;
  height: 2px;
}

.bot-chat-attach::after {
  width: 2px;
  height: 14px;
}

.bot-chat-attach:focus-visible {
  border-color: #c8d1dc;
  background: #f7f8fa;
}

@media (hover: hover) and (pointer: fine) {
  .bot-chat-attach:hover {
    border-color: #c8d1dc;
    background: #f7f8fa;
  }
}

.bot-chat-send::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  transform: translate(-62%, -50%) rotate(45deg);
}

.bot-chat-send.is-thinking::before,
.bot-chat-send.is-thinking::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 2px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  transform: translate(-50%, -50%) rotate(45deg);
}

.bot-chat-send.is-thinking::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.bot-chat-send:hover,
.bot-chat-send:focus-visible {
  background: #000;
}

.modal-open .bot-chat-widget,
.logistica-modal-open .bot-chat-widget {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .bot-chat-widget {
    left: auto;
    right: 17px;
    bottom: 17px;
  }

  .bot-chat-button {
    width: 42px;
    height: 42px;
  }

  .bot-chat-panel {
    width: min(413px, calc(100vw - 28px));
    height: min(525px, calc(100vh - 82px));
    bottom: 52px;
  }

  .bot-chat-form {
    grid-template-columns: minmax(0, 1fr) 40px 40px;
  }

  .bot-chat-attach,
  .bot-chat-send {
    width: 40px;
  }

  .bot-chat-form .bot-chat-attach {
    position: relative;
    right: auto;
    bottom: auto;
    opacity: 1;
    pointer-events: none;
    transform: none;
    box-shadow: none;
  }

  .bot-chat-form .bot-chat-attach { grid-column: 2; grid-row: 1; }
  .bot-chat-form .bot-chat-send { grid-column: 3; grid-row: 1; }

  .bot-chat-upload-actions {
    grid-template-columns: minmax(0, 1fr) 38px 38px;
  }

  .bot-chat-upload-actions .bot-chat-upload-attach {
    position: relative;
    right: auto;
    bottom: auto;
    opacity: 1;
    pointer-events: none;
    transform: none;
    box-shadow: none;
  }

  .bot-chat-toggle:checked ~ .bot-chat-panel .bot-chat-attach,
  .bot-chat-widget.is-open .bot-chat-panel .bot-chat-attach {
    pointer-events: auto;
  }

  .bot-chat-upload-actions .bot-chat-upload-attach { grid-column: 2; grid-row: 1; }
  .bot-chat-upload-actions .bot-chat-upload-primary { grid-column: 3; grid-row: 1; }

  .bot-chat-cropper {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 0;
  }

  .bot-chat-cropper-dialog {
    border-radius: 0;
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .bot-chat-cropper-header {
    align-items: center;
  }

  .bot-chat-cropper-heading {
    align-items: center;
  }

  .bot-chat-cropper-filename:not([contenteditable="true"]) {
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
  }

  .bot-chat-cropper-filename[contenteditable="true"] {
    overflow-x: auto;
    overflow-y: hidden;
    overflow-wrap: normal;
    word-break: normal;
    white-space: nowrap;
  }

  .bot-chat-cropper-history {
    gap: 2px;
  }

  .bot-chat-cropper-stage {
    min-height: 0;
  }

  .bot-chat-cropper-actions > button {
    font-size: .64rem;
  }
}

@media (min-width: 769px) and (max-width: 992px) {
  .bot-chat-widget {
    right: 21px;
    bottom: 21px;
  }
}

@media (max-width: 380px) {
  .bot-chat-panel {
    width: calc(100vw - 24px);
  }
}
