.lagb-assistant {
  --lagb-navy: #062c3d;
  --lagb-yellow: #ffe889;
  --lagb-line: #dfe6e8;
  --lagb-soft: #f4f7f7;
  position: fixed;
  z-index: 99998;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  color: #17323e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.lagb-position-left { right: auto; left: max(24px, env(safe-area-inset-left)); align-items: flex-start; }
.lagb-assistant *, .lagb-assistant *::before, .lagb-assistant *::after { box-sizing: border-box; }
.lagb-assistant button, .lagb-assistant input, .lagb-assistant select, .lagb-assistant textarea { font: inherit; }
.lagb-assistant [hidden] { display: none !important; }

.lagb-window {
  width: min(408px, calc(100vw - 32px));
  height: min(680px, calc(100dvh - 110px));
  display: grid;
  grid-template-rows: auto auto 1fr auto auto auto;
  overflow: hidden;
  border: 1px solid rgba(6, 44, 61, .16);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 26px 90px rgba(0, 26, 38, .20), 0 4px 18px rgba(0, 26, 38, .07);
  animation: lagb-window-in .36s cubic-bezier(.2, .82, .2, 1) both;
  transform-origin: bottom right;
}

.lagb-position-left .lagb-window { transform-origin: bottom left; }

@keyframes lagb-window-in {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lagb-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 17px 18px;
  border: 0;
  border-bottom: 1px solid var(--lagb-line);
  background: rgba(255, 255, 255, .96);
  color: var(--lagb-navy);
}

.lagb-mark, .lagb-launcher-mark {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--lagb-yellow);
  color: var(--lagb-navy);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.lagb-mark { width: 44px; height: 44px; background: var(--lagb-navy); color: #fff; font-size: 13px; box-shadow: 0 8px 20px rgba(6, 44, 61, .16); }
.lagb-identity strong { display: block; color: var(--lagb-navy); font-size: 14px; line-height: 1.35; }
.lagb-identity span { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: #60737a; font-size: 11px; }
.lagb-identity i { width: 7px; height: 7px; border-radius: 50%; background: var(--lagb-yellow); box-shadow: 0 0 0 3px rgba(255, 232, 137, .34); }

.lagb-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--lagb-soft);
  color: var(--lagb-navy);
  cursor: pointer;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.lagb-close:hover, .lagb-close:focus-visible { background: #e8eeee; }

.lagb-notice {
  padding: 9px 17px;
  border-bottom: 1px solid var(--lagb-line);
  background: #fbfcfc;
  color: #617178;
  font-size: 10.5px;
  line-height: 1.35;
  text-align: center;
}

.lagb-messages {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 16px 24px;
  scrollbar-color: #becace transparent;
  scrollbar-width: thin;
}

.lagb-message { max-width: 91%; margin: 0 0 13px; animation: lagb-message-in .25s ease both; }
.lagb-message p { margin: 0; padding: 12px 14px; border-left: 3px solid var(--lagb-yellow); border-radius: 5px 17px 17px 17px; background: #f1f4f4; color: #203b46; font-size: 13px; line-height: 1.55; box-shadow: 0 5px 16px rgba(0, 26, 38, .04); }
.lagb-message.lagb-user { margin-left: auto; }
.lagb-message.lagb-user p { border-left: 0; border-radius: 17px 5px 17px 17px; background: var(--lagb-navy); color: #fff; box-shadow: 0 7px 18px rgba(6, 44, 61, .12); }
.lagb-message.lagb-tone-urgent p { border-left: 3px solid #d18b00; background: #fff8df; }
.lagb-message.lagb-tone-safety p { border-left: 3px solid #bd2f38; background: #fff0f1; color: #5f171c; font-weight: 650; }

@keyframes lagb-message-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.lagb-actions { display: grid; gap: 7px; margin-top: 9px; }
.lagb-actions button, .lagb-actions a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #cbd5d8;
  border-radius: 10px;
  background: #fff;
  color: var(--lagb-navy);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.lagb-actions button:hover, .lagb-actions a:hover, .lagb-actions button:focus-visible, .lagb-actions a:focus-visible {
  border-color: var(--lagb-navy);
  background: #f7f9f9;
  color: var(--lagb-navy);
  transform: translateY(-1px);
}

.lagb-message:not(:first-child) .lagb-actions button:not(.lagb-secondary):first-child,
.lagb-message:not(:first-child) .lagb-actions a:not(.lagb-secondary):first-child { border-color: var(--lagb-navy); background: var(--lagb-navy); color: #fff; }
.lagb-actions .lagb-urgent { border-color: #a62830 !important; background: #a62830 !important; color: #fff !important; }
.lagb-actions .lagb-urgent:hover, .lagb-actions .lagb-urgent:focus-visible { background: #861e25 !important; color: #fff !important; }

.lagb-typing { width: 54px; display: flex; justify-content: center; gap: 4px; padding: 12px; border-radius: 5px 15px 15px 15px; background: #eef2f2; }
.lagb-typing i { width: 5px; height: 5px; border-radius: 50%; background: #718187; animation: lagb-bounce 1s infinite ease-in-out; }
.lagb-typing i:nth-child(2) { animation-delay: .14s; }
.lagb-typing i:nth-child(3) { animation-delay: .28s; }

@keyframes lagb-bounce {
  0%, 60%, 100% { opacity: .55; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.lagb-consent { display: flex; align-items: flex-start; gap: 8px; padding: 9px 13px 3px; border-top: 1px solid var(--lagb-line); background: #fff; color: #65767c; font-size: 9.5px; line-height: 1.35; }
.lagb-consent input { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; accent-color: var(--lagb-navy); }
.lagb-consent a { color: var(--lagb-navy); text-decoration: underline; }

.lagb-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 0; padding: 11px 12px; border-top: 1px solid var(--lagb-line); background: #fff; }
.lagb-form input { min-width: 0; height: auto; margin: 0; padding: 11px 13px; border: 1px solid #cdd7da; border-radius: 12px; outline: 0; background: #fff; color: #17323e; font-size: 13px; box-shadow: none; }
.lagb-form input:focus { border-color: var(--lagb-navy); box-shadow: 0 0 0 3px rgba(6,44,61,.08); }
.lagb-form button { width: 42px; min-height: 42px; margin: 0; padding: 0; border: 0; border-radius: 12px; background: var(--lagb-yellow); color: var(--lagb-navy); cursor: pointer; font-size: 22px; font-weight: 900; }
.lagb-form button:disabled { cursor: default; opacity: .48; }
.lagb-contact-card { width: 100%; }
.lagb-contact-form { margin-top: 10px; }
.lagb-consent-gate { display: grid; gap: 10px; margin: 0; padding: 12px; border: 1px solid #cdd7da; border-radius: 11px; background: #f7f9f9; }
.lagb-consent-gate legend { padding: 0 5px; color: var(--lagb-navy); font-size: 11px; font-weight: 800; }
.lagb-consent-gate .lagb-check { display: flex; align-items: flex-start; gap: 8px; color: #42575f; font-size: 10px; font-weight: 500; line-height: 1.4; }
.lagb-consent-gate .lagb-check input { flex: 0 0 auto; width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--lagb-navy); }
.lagb-privacy-link { color: var(--lagb-navy); font-size: 10px; font-weight: 700; text-decoration: underline; }
.lagb-contact-continue { width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--lagb-yellow); color: var(--lagb-navy); cursor: pointer; font-size: 12px; font-weight: 800; }
.lagb-contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.lagb-contact-grid label { display: grid; gap: 4px; color: #42575f; font-size: 10px; font-weight: 700; }
.lagb-contact-grid .lagb-wide { grid-column: 1 / -1; }
.lagb-contact-grid input, .lagb-contact-grid select, .lagb-contact-grid textarea { width: 100%; margin: 0; padding: 9px 10px; border: 1px solid #cdd7da; border-radius: 9px; background: #fff; color: #17323e; font: inherit; font-size: 12px; box-sizing: border-box; }
.lagb-contact-grid textarea { resize: vertical; }
.lagb-contact-grid input:focus, .lagb-contact-grid select:focus, .lagb-contact-grid textarea:focus { outline: 0; border-color: var(--lagb-navy); box-shadow: 0 0 0 3px rgba(6,44,61,.08); }
.lagb-contact-grid .lagb-check { display: flex; grid-template-columns: none; align-items: flex-start; gap: 7px; font-weight: 500; line-height: 1.35; }
.lagb-contact-grid .lagb-check input { flex: 0 0 auto; width: 15px; margin-top: 1px; accent-color: var(--lagb-navy); }
.lagb-captcha { padding: 8px; border-radius: 9px; background: #f4f7f7; }
.lagb-captcha input { max-width: 74px; }
.lagb-character-count { justify-self: end; color: #65767c; font-size: 9px; font-weight: 500; }
.lagb-trap { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.lagb-contact-submit { width: 100%; margin-top: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--lagb-yellow); color: var(--lagb-navy); cursor: pointer; font-size: 12px; font-weight: 800; }
.lagb-contact-submit:disabled { cursor: wait; opacity: .6; }
.lagb-form-status { min-height: 16px; margin: 7px 0 0 !important; color: #9b2525; font-size: 10px; }
.lagb-form-status.lagb-success { color: #17603b; font-weight: 700; }
.lagb-source-list { display: grid; gap: 7px; margin-top: 9px; }
.lagb-source-link { display: grid; gap: 3px; padding: 9px 10px; border: 1px solid #d9e1e3; border-radius: 10px; background: #fff; color: var(--lagb-navy); text-decoration: none; }
.lagb-source-link:hover { border-color: var(--lagb-navy); }
.lagb-source-link strong { font-size: 10.5px; line-height: 1.3; }
.lagb-source-link span { display: -webkit-box; overflow: hidden; color: #65767c; font-size: 9.5px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.lagb-window footer { padding: 0 13px 11px; background: #fff; color: #7b8a8f; font-size: 9.5px; text-align: center; }
.lagb-window footer a { color: inherit; }

.lagb-invitation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  width: min(294px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(6, 44, 61, .12);
  border-radius: 17px 17px 5px 17px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 18px 48px rgba(0, 26, 38, .17), 0 3px 12px rgba(0, 26, 38, .06);
  animation: lagb-invitation-in .28s cubic-bezier(.2, .82, .2, 1) both;
}

.lagb-invitation-open {
  min-height: 52px;
  margin: 0;
  padding: 12px 8px 12px 14px;
  border: 0;
  background: transparent;
  color: var(--lagb-navy);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}

.lagb-invitation-close {
  width: 36px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6f8086;
  cursor: pointer;
  font-size: 20px;
  font-weight: 400;
}

.lagb-invitation-open:hover,
.lagb-invitation-open:focus-visible { background: #f7f9f9; }
.lagb-invitation-close:hover,
.lagb-invitation-close:focus-visible { color: var(--lagb-navy); }

@keyframes lagb-invitation-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.lagb-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 14px 8px 8px;
  border: 0;
  border-radius: 999px;
  background: var(--lagb-navy);
  color: #fff;
  cursor: pointer;
  min-height: 52px;
  box-shadow: 0 13px 34px rgba(0,26,38,.22);
  font-size: 13px;
  font-weight: 750;
}
.lagb-launcher-mark { width: 36px; height: 36px; font-size: 12px; }
.lagb-is-open .lagb-launcher { width: 50px; height: 50px; justify-content: center; padding: 0; }
.lagb-is-open .lagb-launcher-mark { background: transparent; color: #fff; font-family: sans-serif; font-size: 0; font-weight: 400; }
.lagb-is-open .lagb-launcher-mark::after { content: "×"; font-size: 27px; }
.lagb-is-open .lagb-launcher-label { display: none; }

.lagb-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (min-width: 641px) and (max-width: 900px) {
  .lagb-window { width: min(430px, calc(100vw - 36px)); }
  .lagb-launcher { min-height: 54px; }
}

@media (max-width: 640px) {
  .lagb-assistant { right: max(6px, env(safe-area-inset-right)); bottom: max(6px, env(safe-area-inset-bottom)); left: auto; gap: 8px; }
  .lagb-position-left { right: max(6px, env(safe-area-inset-right)); left: auto; align-items: flex-end; }
  .lagb-window { width: calc(100vw - 12px); height: calc(100dvh - 12px - env(safe-area-inset-bottom)); max-height: none; border-radius: 24px 24px 18px 18px; }
  .lagb-is-open .lagb-launcher { display: none; }
  .lagb-launcher { width: 54px; min-height: 54px; justify-content: center; padding: 0; }
  .lagb-launcher-mark { width: 38px; height: 38px; }
  .lagb-launcher-label { display: none; }
  .lagb-invitation { width: min(282px, calc(100vw - 24px)); }
  .lagb-contact-grid { grid-template-columns: 1fr; }
  .lagb-contact-grid .lagb-wide { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .lagb-assistant *, .lagb-assistant *::before, .lagb-assistant *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
