:root {
  --lwa-accent: #41c4dd;
  --lwa-ink: #111820;
  --lwa-muted: #66727d;
  --lwa-border: #e5e9ec;
  --lwa-surface: #ffffff;
  --lwa-soft: #f4f7f8;
}

.lwa,
.lwa * {
  box-sizing: border-box;
}

.lwa {
  position: fixed;
  right: 20px;
  bottom: 80px;
  z-index: 999999;
  color: var(--lwa-ink);
  font-family: "Montserrat", "Lato", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.lwa button,
.lwa textarea {
  font: inherit;
}

.lwa__launcher {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--lwa-accent);
  box-shadow: 0 12px 32px rgba(65, 196, 221, 0.45);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.lwa__launcher:hover {
  box-shadow: 0 14px 36px rgba(65, 196, 221, 0.55);
  transform: translateY(-2px);
}

.lwa__launcher:focus-visible,
.lwa button:focus-visible,
.lwa textarea:focus-visible,
.lwa a:focus-visible {
  outline: 3px solid rgba(65, 196, 221, 0.4);
  outline-offset: 2px;
}

.lwa__launcher svg,
.lwa__form svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.lwa__launcher.is-hidden {
  display: none;
}

.lwa__panel {
  width: min(390px, calc(100vw - 28px));
  height: min(610px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(17, 24, 32, 0.08);
  border-radius: 20px;
  background: var(--lwa-surface);
  box-shadow: 0 24px 70px rgba(17, 24, 32, 0.24);
  animation: lwa-in 180ms ease-out;
}

.lwa__panel[hidden] {
  display: none;
}

@keyframes lwa-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lwa__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 16px 18px 15px 20px;
  border-bottom: 1px solid var(--lwa-border);
  background: var(--lwa-surface);
  color: var(--lwa-ink);
}

.lwa__header strong,
.lwa__header span {
  display: block;
}

.lwa__header strong {
  font-family: "minerva-modern", Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lwa__header span {
  margin-top: 3px;
  color: var(--lwa-muted);
  font-size: 12px;
}

.lwa__header i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--lwa-accent);
  box-shadow: 0 0 0 3px rgba(65, 196, 221, 0.2);
}

.lwa__close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--lwa-soft);
  color: var(--lwa-ink);
  cursor: pointer;
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
}

.lwa__close:hover {
  background: var(--lwa-border);
}

.lwa__messages {
  height: calc(100% - 188px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 16px 10px;
  scroll-behavior: smooth;
}

.lwa__message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 13px;
}

.lwa__message--user {
  align-items: flex-end;
}

.lwa__bubble {
  max-width: 86%;
  padding: 11px 13px;
  border-radius: 15px 15px 15px 4px;
  background: var(--lwa-soft);
  color: var(--lwa-ink);
  white-space: pre-wrap;
}

.lwa__message--user .lwa__bubble {
  border-radius: 15px 15px 4px 15px;
  background: var(--lwa-accent);
  color: #fff;
}

.lwa__message.is-thinking .lwa__bubble {
  color: var(--lwa-muted);
  animation: lwa-pulse 1.1s ease-in-out infinite;
}

@keyframes lwa-pulse {
  50% { opacity: 0.55; }
}

.lwa__sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  max-width: 88%;
  margin-top: 7px;
  padding-left: 4px;
  font-size: 11px;
}

.lwa__sources span {
  width: 100%;
  color: var(--lwa-muted);
}

.lwa__sources a,
.lwa__contact {
  color: #087f99;
  text-decoration: underline;
  text-decoration-color: rgba(8, 127, 153, 0.35);
  text-underline-offset: 2px;
}

.lwa__contact {
  margin: 8px 0 0 4px;
  font-size: 12px;
  font-weight: 700;
}

.lwa__suggestions {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 4px 15px 10px;
  scrollbar-width: none;
}

.lwa__suggestions::-webkit-scrollbar {
  display: none;
}

.lwa__suggestions[hidden] {
  display: none;
}

.lwa__suggestions button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #bfe9f2;
  border-radius: 999px;
  background: #f2fbfd;
  color: #126d80;
  cursor: pointer;
  font-size: 11px;
}

.lwa__suggestions button:hover {
  border-color: var(--lwa-accent);
  background: #e9f9fc;
}

.lwa__form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0 14px;
  padding: 8px 8px 8px 13px;
  border: 1px solid var(--lwa-border);
  border-radius: 14px;
  background: #fff;
}

.lwa__form:focus-within {
  border-color: var(--lwa-accent);
  box-shadow: 0 0 0 3px rgba(65, 196, 221, 0.12);
}

.lwa__form textarea {
  flex: 1;
  min-height: 34px;
  max-height: 112px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--lwa-ink);
  line-height: 1.45;
}

.lwa__form textarea::placeholder {
  color: #8b969f;
}

.lwa__form button {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--lwa-accent);
  color: #fff;
  cursor: pointer;
}

.lwa__form button:hover {
  filter: brightness(0.95);
}

.lwa__form button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.lwa__form button.is-loading svg {
  animation: lwa-spin 0.9s linear infinite;
}

@keyframes lwa-spin {
  to { transform: rotate(360deg); }
}

.lwa__callback-open {
  margin: 8px 0 0 4px;
  padding: 7px 11px;
  border: 1px solid #bfe9f2;
  border-radius: 999px;
  background: #f2fbfd;
  color: #126d80;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.lwa__callback-open:hover {
  border-color: var(--lwa-accent);
  background: #e9f9fc;
}

.lwa__task-form {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 86%;
  margin-top: 8px;
}

.lwa__task-form input,
.lwa__task-form textarea {
  padding: 9px 11px;
  border: 1px solid var(--lwa-border);
  border-radius: 10px;
  background: #fff;
  color: var(--lwa-ink);
  font: inherit;
  font-size: 13px;
}

.lwa__task-form input:focus,
.lwa__task-form textarea:focus {
  border-color: var(--lwa-accent);
  box-shadow: 0 0 0 3px rgba(65, 196, 221, 0.12);
  outline: 0;
}

.lwa__task-form textarea {
  resize: none;
}

.lwa__task-form .lwa__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.lwa__task-form button[type="submit"] {
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: var(--lwa-accent);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.lwa__task-form button[type="submit"]:hover {
  filter: brightness(0.95);
}

.lwa__task-form button[type="submit"]:disabled {
  cursor: wait;
  opacity: 0.55;
}

.lwa__privacy {
  margin: 6px 14px 9px;
  color: var(--lwa-muted);
  font-size: 10px;
  text-align: center;
}

@media (max-width: 520px) {
  .lwa {
    right: 14px;
    bottom: 72px;
  }

  .lwa__panel {
    width: calc(100vw - 28px);
    height: min(650px, calc(100vh - 28px));
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lwa__panel,
  .lwa__launcher,
  .lwa__message.is-thinking .lwa__bubble,
  .lwa__form button.is-loading svg {
    animation: none;
    transition: none;
  }
}

