.biolec-chat {
  --blm-green: #1fa85a;
  --blm-green-deep: #14703d;
  --blm-green-soft: #e9f5ed;
  --blm-bg: #f8f1e8;
  --blm-surface: #fffdf9;
  --blm-surface-2: #f7efe3;
  --blm-ink: #2a211a;
  --blm-ink-2: #5c5249;
  --blm-ink-3: #978a7c;
  --blm-line: #ece2d4;
  --blm-line-soft: #f4ecdf;
  --blm-shadow: 0 6px 24px rgba(74, 52, 30, 0.10), 0 28px 70px rgba(31, 168, 90, 0.14);
  /* Frosted-glass tokens: warm translucent fills + a soft blur. */
  --blm-glass: rgba(255, 252, 246, 0.74);
  --blm-glass-strong: rgba(255, 252, 246, 0.88);
  --blm-glass-line: rgba(255, 255, 255, 0.55);
  --blm-blur: blur(22px) saturate(135%);
  --blm-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  color: var(--blm-ink);
  isolation: isolate;
  contain: layout style;
}

:host {
  all: initial;
}

.biolec-chat *,
.biolec-chat *::before,
.biolec-chat *::after {
  box-sizing: border-box;
}

.biolec-chat [hidden] {
  display: none !important;
}

.biolec-chat button,
.biolec-chat textarea,
.biolec-chat a {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.biolec-chat button,
.biolec-chat textarea {
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}

.biolec-chat button {
  min-width: 0;
  min-height: 0;
  margin: 0;
  text-decoration: none;
}

.biolec-chat svg {
  display: block;
  max-width: none;
  fill: none;
}

.biolec-chat p,
.biolec-chat ul {
  font: inherit;
}

.biolec-chat img,
.biolec-chat svg {
  vertical-align: initial;
}

.biolec-chat__teaser {
  position: relative;
  max-width: 280px;
  padding: 14px 38px 14px 16px;
  border: 1px solid var(--blm-line);
  border-radius: 20px;
  background: var(--blm-surface);
  box-shadow: 0 2px 6px rgba(20, 32, 26, 0.06), 0 16px 36px rgba(20, 112, 61, 0.1);
  animation: biolec-fade-up 400ms var(--blm-ease);
}

.biolec-chat__teaser span {
  display: block;
  margin-bottom: 4px;
  color: var(--blm-green-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.biolec-chat__teaser p {
  margin: 0;
  color: var(--blm-ink-2);
  font-size: 13px;
  line-height: 1.4;
}

.biolec-chat__teaser-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--blm-ink-3);
  cursor: pointer;
}

.biolec-chat__teaser-close:hover {
  background: var(--blm-surface-2);
}

.biolec-chat__toggle {
  position: relative;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blm-green), var(--blm-green-deep));
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(20, 112, 61, 0.28), 0 4px 8px rgba(0, 0, 0, 0.08);
  transition: transform 200ms var(--blm-ease), box-shadow 200ms var(--blm-ease);
}

.biolec-chat__toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 16px 40px rgba(20, 112, 61, 0.4);
}

.biolec-chat__launcher-icon {
  width: 29px;
  height: 29px;
  display: block;
}

.biolec-chat__pulse {
  position: absolute;
  inset: -6px;
  border: 2px solid var(--blm-green);
  border-radius: 50%;
  animation: biolec-pulse 2s var(--blm-ease) infinite;
}

.biolec-chat__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e64545;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.biolec-chat__panel {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 48px));
  border: 1px solid var(--blm-glass-line);
  border-radius: 32px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(31, 168, 90, 0.10), transparent 55%),
    radial-gradient(120% 90% at 0% 100%, rgba(244, 196, 120, 0.16), transparent 55%),
    var(--blm-glass);
  backdrop-filter: var(--blm-blur);
  -webkit-backdrop-filter: var(--blm-blur);
  box-shadow: var(--blm-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: biolec-app-in 280ms var(--blm-ease);
}

.biolec-chat__header {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--blm-glass-line);
  background: var(--blm-glass-strong);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
}

.biolec-chat__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.biolec-chat__brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--blm-green);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.biolec-chat__brand strong {
  display: block;
  color: var(--blm-ink);
  font-size: 15px;
  line-height: 1.2;
}

.biolec-chat__brand span:not(.biolec-chat__brand-mark) {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--blm-ink-3);
  font-size: 12px;
  line-height: 1.3;
}

.biolec-chat__brand i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blm-green);
  box-shadow: 0 0 0 4px rgba(31, 168, 90, 0.18);
}

.biolec-chat__close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--blm-surface-2);
  color: var(--blm-ink-2);
  cursor: pointer;
  line-height: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.biolec-chat__minimize {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--blm-surface-2);
  color: var(--blm-ink-2);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.biolec-chat__minimize svg {
  width: 18px;
  height: 18px;
}

.biolec-chat__minimize:hover {
  background: var(--blm-green);
  color: #fff;
}

.biolec-chat__close:hover {
  background: var(--blm-ink);
  color: #fff;
}

.biolec-chat__close svg {
  width: 18px;
  height: 18px;
}

.biolec-chat__messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 18px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
}

.biolec-chat__messages::-webkit-scrollbar {
  width: 8px;
}

.biolec-chat__messages::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: var(--blm-line);
}

/* Full-panel frosted-glass name/email screen. Sits over the (blurred)
   conversation; the header stays above it (z-index) so close stays usable. */
.biolec-chat__start {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 28px 24px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(31, 168, 90, 0.18), transparent 60%),
    radial-gradient(120% 80% at 0% 100%, rgba(45, 110, 171, 0.14), transparent 60%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.62), rgba(230, 244, 236, 0.7));
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.biolec-chat__start strong {
  color: var(--blm-ink);
  font-size: 20px;
  line-height: 1.2;
}

.biolec-chat__start label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--blm-ink);
  font-size: 13px;
  font-weight: 700;
}

.biolec-chat__start input {
  width: 100%;
  min-height: 50px;
  border: 1.5px solid rgba(20, 32, 26, 0.22);
  border-radius: 14px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--blm-ink);
  font: inherit;
  font-size: 15px;
  outline: 0;
  box-shadow: 0 2px 8px rgba(20, 32, 26, 0.06);
}

.biolec-chat__start input::placeholder {
  color: var(--blm-ink-3);
}

.biolec-chat__start input:focus {
  border-color: var(--blm-green);
  box-shadow: 0 0 0 4px rgba(31, 168, 90, 0.2);
}

.biolec-chat__start button {
  min-height: 50px;
  margin-top: 4px;
  border: 0;
  border-radius: 999px;
  background: var(--blm-green);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 20px rgba(20, 112, 61, 0.28);
}

.biolec-chat__start button:hover {
  background: var(--blm-green-deep);
}

.biolec-chat__start button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.biolec-chat__start-intro {
  margin: 0;
  color: var(--blm-ink-2);
  font-size: 15px;
  line-height: 1.5;
}

.biolec-chat__start-error {
  margin: 0;
  color: #c0392b;
  font-size: 13px;
  line-height: 1.4;
}

/* Honeypot: kept in the DOM and off-screen (not display:none) so bots fill it
   while real users never see it. */
.biolec-chat__hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0);
  pointer-events: none !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.biolec-chat__handoff-open {
  border: 0;
  background: none;
  padding: 0;
  color: var(--blm-green-deep);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.biolec-chat__cta {
  background: var(--blm-green-soft);
}

.biolec-chat__cta .biolec-chat__handoff-open {
  text-decoration: none;
}

.biolec-chat__handoff-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--blm-line);
}

.biolec-chat__handoff-form strong {
  font-size: 15px;
}

.biolec-chat__handoff-intro {
  margin: 0;
  font-size: 13px;
  color: var(--blm-ink-2, #4A5650);
}

.biolec-chat__handoff-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.biolec-chat__handoff-form input,
.biolec-chat__handoff-form textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--blm-line);
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  color: var(--blm-ink);
  font: inherit;
  outline: 0;
}

.biolec-chat__handoff-form input:focus,
.biolec-chat__handoff-form textarea:focus {
  border-color: var(--blm-green);
  box-shadow: 0 0 0 3px rgba(31, 168, 90, 0.12);
}

.biolec-chat__handoff-error {
  margin: 0;
  color: #c0392b;
  font-size: 13px;
}

.biolec-chat__handoff-actions {
  display: flex;
  gap: 8px;
}

.biolec-chat__handoff-actions button[type="submit"] {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--blm-green);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.biolec-chat__handoff-actions button[type="submit"]:hover {
  background: var(--blm-green-deep);
}

.biolec-chat__handoff-actions button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: progress;
}

.biolec-chat__handoff-cancel {
  min-height: 40px;
  border: 1px solid var(--blm-line);
  border-radius: 999px;
  background: #fff;
  color: var(--blm-ink);
  padding: 0 16px;
  cursor: pointer;
}

/* --- Accessibility --------------------------------------------------------- */

.biolec-chat__a11y-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--blm-line);
  border-radius: 999px;
  background: #fff;
  color: var(--blm-ink);
  padding: 4px 10px 4px 8px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.biolec-chat__a11y-toggle svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.biolec-chat__a11y-toggle span {
  font-size: 11px;
  line-height: 1;
}

.biolec-chat__a11y-toggle:hover {
  border-color: var(--blm-green);
  color: var(--blm-green-deep);
}

.biolec-chat__a11y {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--blm-line);
  background: var(--blm-surface-2);
}

.biolec-chat__a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.biolec-chat__a11y-textsize {
  display: flex;
  gap: 6px;
}

.biolec-chat__a11y-textsize button {
  min-width: 36px;
  min-height: 32px;
  border: 1px solid var(--blm-line);
  border-radius: 8px;
  background: #fff;
  color: var(--blm-ink);
  cursor: pointer;
}

.biolec-chat__a11y-textsize button.is-active {
  background: var(--blm-green);
  border-color: var(--blm-green);
  color: #fff;
}

.biolec-chat__bubble {
  display: inline-block;
}

.biolec-chat__speak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  border: 1px solid var(--blm-line, rgba(0, 0, 0, 0.12));
  background: rgba(0, 0, 0, 0.03);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--blm-ink-2, #555);
  cursor: pointer;
}

.biolec-chat__speak:hover {
  background: var(--blm-green-soft, rgba(0, 0, 0, 0.06));
}

.biolec-chat__speak.is-speaking {
  color: var(--blm-green-deep, #0a6);
  border-color: var(--blm-green, #0a6);
}

.biolec-chat__feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.biolec-chat__fb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--blm-line, rgba(0, 0, 0, 0.12));
  background: rgba(0, 0, 0, 0.03);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1.4;
  cursor: pointer;
}

.biolec-chat__fb:hover {
  background: var(--blm-green-soft, rgba(0, 0, 0, 0.06));
}

.biolec-chat__fb.is-selected {
  border-color: var(--blm-green, #0a6);
  background: var(--blm-green-soft, rgba(0, 0, 0, 0.06));
}

.biolec-chat__feedback[data-done="1"] .biolec-chat__fb:not(.is-selected) {
  opacity: 0.35;
  cursor: default;
}

.biolec-chat__fb-thanks {
  font-size: 12px;
  color: var(--blm-ink-2, #555);
  margin-left: 2px;
}

.biolec-chat__mic {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--blm-line);
  border-radius: 999px;
  background: #fff;
  color: var(--blm-ink-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.biolec-chat__mic svg {
  width: 20px;
  height: 20px;
}

.biolec-chat__mic.is-listening {
  background: var(--blm-green);
  border-color: var(--blm-green);
  color: #fff;
  animation: biolec-mic-pulse 1.2s ease-in-out infinite;
}

@keyframes biolec-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(31, 168, 90, 0.45); }
  50% { box-shadow: 0 0 0 6px rgba(31, 168, 90, 0); }
}

/* Larger text */
.biolec-chat.biolec-a11y-text-large .biolec-chat__message,
.biolec-chat.biolec-a11y-text-large .biolec-chat__input {
  font-size: 16px;
}

.biolec-chat.biolec-a11y-text-larger .biolec-chat__message,
.biolec-chat.biolec-a11y-text-larger .biolec-chat__input {
  font-size: 18px;
}

/* High contrast: override the brand variables for stronger legibility. */
.biolec-chat.biolec-a11y-contrast {
  --blm-ink: #000000;
  --blm-ink-2: #1a1a1a;
  --blm-ink-3: #333333;
  --blm-line: #000000;
  --blm-line-soft: #000000;
  --blm-surface: #ffffff;
  --blm-surface-2: #ffffff;
  --blm-green: #0a6b34;
  --blm-green-deep: #064d24;
}

.biolec-chat.biolec-a11y-contrast .biolec-chat__message--user {
  background: #0a6b34;
  color: #ffffff;
}

.biolec-chat__message {
  max-width: 84%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: biolec-msg-in 280ms var(--blm-ease);
}

.biolec-chat__message--user {
  align-self: flex-end;
  border-bottom-right-radius: 6px;
  background: linear-gradient(160deg, #29b765, var(--blm-green-deep));
  color: #fff;
  box-shadow: 0 6px 18px rgba(20, 112, 61, 0.20);
  overflow-wrap: anywhere;
}

.biolec-chat__message--bot {
  align-self: flex-start;
  max-width: 100%;
  border-bottom-left-radius: 6px;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid var(--blm-glass-line);
  box-shadow: 0 4px 16px rgba(74, 52, 30, 0.07);
  color: var(--blm-ink);
}

.biolec-chat__message--bot p {
  margin: 0 0 8px;
}

.biolec-chat__message--bot p:last-child,
.biolec-chat__message--bot ul:last-child,
.biolec-chat__message--bot .biolec-result:last-child {
  margin-bottom: 0;
}

.biolec-chat__message--bot ul {
  margin: 0 0 10px;
  padding-left: 18px;
}

.biolec-result {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid var(--blm-glass-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 4px 14px rgba(74, 52, 30, 0.06);
}

.biolec-result strong {
  display: block;
  color: var(--blm-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.biolec-result p {
  margin: 0;
  color: var(--blm-ink-2);
  line-height: 1.35;
}

.biolec-result__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 32px;
  margin-top: 4px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--blm-green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.biolec-result__link:hover,
.biolec-result__link:focus {
  background: var(--blm-green-deep);
  color: #fff;
  text-decoration: none;
}

.biolec-chat__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 8px;
  flex-shrink: 0;
}

.biolec-chat__prompts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 16px 12px;
  flex-shrink: 0;
}

.biolec-chat__prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--blm-line);
  border-radius: 14px;
  background: #fff;
  color: var(--blm-ink);
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: transform 200ms var(--blm-ease), border-color 200ms var(--blm-ease), box-shadow 200ms var(--blm-ease);
}

.biolec-chat__prompt:hover {
  transform: translateY(-2px);
  border-color: var(--blm-green);
  box-shadow: 0 4px 16px rgba(20, 112, 61, 0.1);
}

.biolec-chat__prompt-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blm-green-soft);
  color: var(--blm-green-deep);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
}

.biolec-chat__prompt span:not(.biolec-chat__prompt-icon) {
  flex: 1;
  line-height: 1.35;
}

.biolec-chat__prompt i {
  color: var(--blm-ink-3);
  font-style: normal;
  transition: transform 160ms var(--blm-ease), color 160ms var(--blm-ease);
}

.biolec-chat__prompt:hover i {
  color: var(--blm-green-deep);
  transform: translateX(2px);
}

.biolec-chat__quick button {
  flex-shrink: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--blm-surface-2);
  color: var(--blm-ink-2);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.biolec-chat__quick button:hover {
  border-color: var(--blm-green);
  background: #fff;
  color: var(--blm-green-deep);
}

.biolec-chat__form {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--blm-glass-line);
  background: var(--blm-glass-strong);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
}

.biolec-chat__composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--blm-glass-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  transition: border 160ms var(--blm-ease), box-shadow 160ms var(--blm-ease);
}

.biolec-chat__composer:focus-within {
  border-color: var(--blm-green);
  box-shadow: 0 0 0 3px rgba(31, 168, 90, 0.12);
}

.biolec-chat__input {
  flex: 1;
  min-width: 0;
  max-height: 120px;
  padding: 6px 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--blm-ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
}

.biolec-chat__input::placeholder {
  color: var(--blm-ink-3);
}

.biolec-chat__send {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--blm-green);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 160ms var(--blm-ease);
}

.biolec-chat__send:hover {
  background: var(--blm-green-deep);
}

.biolec-chat__send svg {
  width: 19px;
  height: 19px;
}

.biolec-chat__foot {
  padding: 8px 4px 0;
  color: var(--blm-ink-3);
  font-size: 11px;
}

@keyframes biolec-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes biolec-app-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes biolec-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes biolec-pulse {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.3); }
}

@media (max-width: 640px) {
  .biolec-chat {
    right: 16px;
    bottom: 16px;
  }

  /* The wrapper has `contain: layout`, which makes it the containing block for
     the panel's `position: fixed`. So when the chat opens we expand the wrapper
     to fill the viewport; otherwise the full-screen panel would be offset to the
     launcher's corner and render off-screen. */
  .biolec-chat--open {
    inset: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  /* Full-screen chat on phones. 100dvh tracks the visible viewport so the
     composer never hides behind the browser address bar. */
  .biolec-chat__panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  /* Hide the launcher and teaser while the full-screen chat is open. */
  .biolec-chat--open .biolec-chat__toggle,
  .biolec-chat__teaser {
    display: none;
  }

  /* Hide the per-message read-aloud (play/pause) button on phones. */
  .biolec-chat__speak {
    display: none;
  }

  /* Respect notch / home-bar safe areas. */
  .biolec-chat__header {
    padding: 12px 14px;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .biolec-chat__form {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  /* Larger tap targets for easier use. */
  .biolec-chat__close,
  .biolec-chat__send,
  .biolec-chat__mic {
    min-width: 44px;
    min-height: 44px;
  }

  .biolec-chat__send svg,
  .biolec-chat__mic svg {
    width: 22px;
    height: 22px;
  }

  .biolec-chat__minimize,
  .biolec-chat__a11y-toggle {
    min-height: 40px;
  }

  /* Icon-only accessibility button on phones so the header never crowds. */
  .biolec-chat__a11y-toggle {
    padding: 8px;
  }

  .biolec-chat__a11y-toggle span {
    display: none;
  }

  .biolec-chat__message {
    max-width: 90%;
    font-size: 16px;
  }

  /* 16px inputs prevent iOS Safari from zooming the page on focus. */
  .biolec-chat__input,
  .biolec-chat__start input,
  .biolec-chat__handoff-form input,
  .biolec-chat__handoff-form textarea {
    font-size: 16px;
  }
}

/* --- UI polish: product image, typing indicator, callback phone ----------- */

.biolec-result__img {
  width: 100%;
  max-height: 150px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 4px;
  background: var(--blm-surface-2);
}

.biolec-chat__typing {
  display: inline-flex;
  gap: 4px;
  padding: 3px 2px;
}

.biolec-chat__typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blm-ink-3);
  animation: biolec-typing 1.2s infinite ease-in-out both;
}

.biolec-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.biolec-chat__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes biolec-typing {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.biolec-chat__disclaimer {
  line-height: 1.45;
}

.biolec-chat__disclaimer .biolec-chat__handoff-open,
.biolec-chat__disclaimer .biolec-chat__call {
  margin-left: 2px;
}

.biolec-chat__call {
  color: var(--blm-green-deep);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.biolec-chat__call:hover {
  text-decoration: underline;
}
