.gr-chat-widget {
  --gr-chat-red: #cc1f27;
  --gr-chat-navy: #172838;
  --gr-chat-paper: #fff;
  --gr-chat-soft: #f4f5f3;
  --gr-chat-line: #dce1e3;
  --gr-chat-muted: #52606a;
  --gr-chat-shadow: 0 20px 70px rgb(23 40 56 / 19%), 0 3px 12px rgb(23 40 56 / 8%);
  position: fixed;
  z-index: 1000;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  color: var(--gr-chat-navy);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  -webkit-text-size-adjust: 100%;
}

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

.gr-chat-widget button,
.gr-chat-widget input {
  font-family: inherit;
  font-size: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.gr-chat-widget button {
  cursor: pointer;
  margin: 0;
  min-width: 0;
  appearance: none;
}

.gr-chat-widget button:focus-visible,
.gr-chat-widget a:focus-visible,
.gr-chat-widget input:focus-visible,
.gr-chat-messages:focus-visible {
  outline: 3px solid var(--gr-chat-red);
  outline-offset: 3px;
}

.gr-chat-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 13px 20px;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 999px;
  background: var(--gr-chat-navy);
  color: var(--gr-chat-paper);
  box-shadow: 0 8px 28px rgb(23 40 56 / 22%);
  font-weight: 650;
  line-height: 1.3;
  transition: background 160ms ease, box-shadow 160ms ease;
}

.gr-chat-launcher:hover {
  background: #253f56;
  box-shadow: 0 10px 32px rgb(23 40 56 / 27%);
}

.gr-chat-icon {
  display: block;
  flex: 0 0 23px;
  width: 23px;
  height: 23px;
}

.gr-chat-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  display: flex;
  flex-direction: column;
  width: 390px;
  height: min(590px, calc(100vh - 124px));
  height: min(590px, calc(100dvh - 124px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  max-width: calc(100vw - 32px);
  min-height: 250px;
  overflow: hidden;
  border: 1px solid var(--gr-chat-line);
  border-radius: 20px;
  background: var(--gr-chat-paper);
  box-shadow: var(--gr-chat-shadow);
  animation: gr-chat-appear 160ms ease-out;
}

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

.gr-chat-header {
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
  gap: 12px;
  padding: 23px 19px 20px 23px;
  border-bottom: 1px solid var(--gr-chat-line);
  border-top: 4px solid var(--gr-chat-red);
  background: var(--gr-chat-paper);
}

.gr-chat-heading {
  flex: 1;
  min-width: 0;
}

.gr-chat-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--gr-chat-red);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.gr-chat-title {
  margin: 0;
  color: var(--gr-chat-navy);
  font-family: inherit;
  font-size: 22px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.035em;
}

.gr-chat-title:focus {
  outline: none;
}

.gr-chat-subtitle {
  margin: 9px 0 0;
  color: var(--gr-chat-muted);
  font-size: 12px;
  line-height: 1.5;
}

.gr-chat-close {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 0;
  border-radius: 50%;
  color: var(--gr-chat-navy);
  background: var(--gr-chat-soft);
}

.gr-chat-close:hover {
  background: #e7ebeb;
}

.gr-chat-close svg,
.gr-chat-send svg {
  display: block;
  width: 21px;
  height: 21px;
}

.gr-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  padding: 21px 20px 7px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #bdc5c9 transparent;
  background: var(--gr-chat-soft);
}

.gr-chat-message {
  width: fit-content;
  max-width: 100%;
  margin: 0 12px 15px 0;
  padding: 15px;
  border: 1px solid #e5e8e7;
  border-radius: 4px 16px 16px;
  background: var(--gr-chat-paper);
  overflow-wrap: anywhere;
}

.gr-chat-message-text {
  margin: 0;
  color: inherit;
  font-size: 13px;
  line-height: 1.65;
}

.gr-chat-message-visitor {
  margin-right: 0;
  margin-left: auto;
  border-color: var(--gr-chat-navy);
  border-radius: 16px 4px 16px 16px;
  color: var(--gr-chat-paper);
  background: var(--gr-chat-navy);
}

.gr-chat-list {
  display: block;
  margin: 10px 0 0;
  padding: 0 0 0 17px;
  list-style: disc;
  font-size: 13px;
  line-height: 1.6;
}

.gr-chat-list li + li {
  margin-top: 7px;
}

.gr-chat-choices,
.gr-chat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.gr-chat-choice,
.gr-chat-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 38px;
  max-width: 100%;
  padding: 8px 11px;
  border: 1px solid #cad1d6;
  border-radius: 8px;
  background: var(--gr-chat-paper);
  color: var(--gr-chat-navy);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
}

.gr-chat-widget .gr-chat-choice {
  font-size: 12px;
}

.gr-chat-choice:hover,
.gr-chat-link:hover {
  border-color: var(--gr-chat-navy);
  background: #f0f3f4;
  color: var(--gr-chat-navy);
}

.gr-chat-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin-top: 15px !important;
  padding: 11px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--gr-chat-red);
  color: var(--gr-chat-paper);
  font-weight: 650;
  line-height: 1.3;
}

.gr-chat-contact:hover,
.gr-chat-send:hover:not(:disabled) {
  background: #aa1720;
}

.gr-chat-bottom {
  flex: 0 0 auto;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--gr-chat-line);
  background: var(--gr-chat-paper);
}

.gr-chat-notice {
  margin: 0 0 11px;
  color: var(--gr-chat-muted);
  font-size: 10px;
  line-height: 1.5;
}

.gr-chat-form {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 4px;
  border: 1px solid #bbc4ca;
  border-radius: 10px;
  background: var(--gr-chat-paper);
}

.gr-chat-widget .gr-chat-input {
  display: block;
  flex: 1;
  width: 0;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 8px 9px;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  background: transparent;
  color: var(--gr-chat-navy);
  font-size: 16px;
  line-height: 1.4;
}

.gr-chat-input::placeholder {
  color: var(--gr-chat-muted);
  opacity: 1;
  font-size: 13px;
}

.gr-chat-send {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 9px;
  border: 0;
  border-radius: 7px;
  background: var(--gr-chat-red);
  color: var(--gr-chat-paper);
}

.gr-chat-send:disabled {
  background: #e8ebed;
  color: #65737d;
  cursor: default;
}

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

@keyframes gr-chat-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .gr-chat-widget {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .gr-chat-launcher {
    min-height: 50px;
    padding: 11px 16px;
    font-size: 13px;
  }

  .gr-chat-panel {
    width: calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));
    bottom: 64px;
    height: min(590px, calc(100vh - 112px));
    height: min(590px, calc(100dvh - 112px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    border-radius: 17px;
  }

  .gr-chat-header {
    padding: 19px 15px 16px 19px;
  }

  .gr-chat-messages {
    padding: 17px 15px 3px;
  }

  .gr-chat-choice,
  .gr-chat-link,
  .gr-chat-close,
  .gr-chat-send {
    min-height: 44px;
  }

  .gr-chat-close,
  .gr-chat-send {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }
}

@media (max-height: 500px) {
  .gr-chat-panel {
    bottom: 0;
    height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 180px;
  }

  .gr-chat-eyebrow,
  .gr-chat-subtitle {
    display: none;
  }

  .gr-chat-header {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .gr-chat-bottom {
    padding-top: 8px;
    padding-bottom: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gr-chat-panel {
    animation: none;
  }

  .gr-chat-launcher {
    transition: none;
  }
}

/* Leave the mobile call/coverage bar available without overlapping it. */
.gr-chat-eyebrow { font-size: 12px; font-weight: 700; }
@media (max-width: 700px) {
  .gr-chat-widget { right: 16px; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .gr-chat-panel {
    position: fixed;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    max-width: none;
    height: min(590px, calc(100dvh - 100px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    min-height: 180px;
  }
}
