.basil-widget {
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 40;
  font-family: inherit;
}

.basil-widget [hidden] { display: none !important; }

.basil-launcher {
  width: 58px;
  height: 58px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border: 1px solid #d85000;
  border-radius: 50%;
  background: #ff6908;
  box-shadow: 0 8px 26px #0004;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}

.basil-launcher:hover { transform: translateY(-3px); box-shadow: 0 12px 30px #0005; }
.basil-launcher img { display: block; width: 35px; height: 35px; }
.basil-launcher:focus-visible,
.basil-close:focus-visible,
.basil-send:focus-visible,
.basil-input:focus-visible { outline: 3px solid #ff6908; outline-offset: 3px; }

.basil-panel {
  width: min(390px, calc(100vw - 32px));
  height: min(600px, calc(100dvh - 104px));
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dfd8cf;
  border-radius: 18px;
  box-shadow: 0 20px 60px #0004;
  color: #1b1b1a;
}

.basil-panel-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #1b1b1a;
  color: #fff;
  border-top: 3px solid #ff6908;
}

.basil-panel-header strong { font-size: 17px; font-weight: 600; }
.basil-panel-header span { display: block; color: #c8c3bc; font-size: 12px; }
.basil-close { border: 0; background: transparent; color: #fff; font-size: 27px; line-height: 1; cursor: pointer; }

.basil-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  background: #f7f5f2;
  overscroll-behavior: contain;
}

.basil-message {
  max-width: 92%;
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 1px solid #e3ded7;
  border-radius: 12px;
  background: #fff;
  overflow-wrap: anywhere;
}

.basil-message-user { margin-left: auto; background: #fff0e5; border-color: #f2d6c3; }
.basil-message strong { display: block; margin-bottom: 3px; font-size: 12px; color: #a5430b; }
.basil-message p { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.basil-status { min-height: 22px; margin: 0; padding: 7px 18px 0; font-size: 12px; color: #58534e; }
.basil-form { display: flex; align-items: end; gap: 9px; padding: 12px 16px 16px; }
.basil-form label { flex: 1; min-width: 0; font-size: 12px; color: #504c47; }
.basil-input { display: block; width: 100%; min-height: 47px; max-height: 120px; margin-top: 5px; padding: 9px 11px; border: 1px solid #cec6bd; border-radius: 8px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.5; }
.basil-send { min-height: 47px; padding: 0 15px; border: 0; border-radius: 8px; background: #ff6908; color: #17110b; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.basil-send:disabled { opacity: .5; cursor: default; }
.basil-privacy { margin: 0; padding: 0 16px 13px; font-size: 11px; line-height: 1.45; color: #6e6862; }
.basil-privacy a { text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 600px) {
  .basil-widget { right: 16px; bottom: 16px; }
  .basil-panel { height: min(620px, calc(100dvh - 92px)); }
}

@media (prefers-reduced-motion: reduce) {
  .basil-launcher { transition: none; }
}

