.contact-fab {
  position: fixed;
  z-index: 40;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--electric-blue, #0254ec);
  color: #fff;
  box-shadow: 0 8px 22px rgba(1, 18, 63, .24), 0 2px 0 var(--navy-ink, #01123f);
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.contact-fab[hidden] {
  display: none;
}

.contact-fab svg {
  width: 27px;
  height: 27px;
}

.contact-fab:hover {
  transform: translateY(-3px);
  background: var(--electric-blue-dark, #0243bd);
  box-shadow: 0 12px 26px rgba(1, 18, 63, .28), 0 2px 0 var(--navy-ink, #01123f);
}

.contact-fab:active {
  transform: translateY(0);
}

.contact-fab:focus-visible,
#contact-dialog .contact-dialog-close:focus-visible,
#contact-dialog :focus-visible {
  outline: 3px solid #6195ff;
  outline-offset: 4px;
}

#contact-dialog {
  position: fixed;
  inset: 0;
  width: min(680px, calc(100% - 32px));
  max-width: none;
  max-height: min(840px, calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--navy-ink, #01123f);
}

#contact-dialog::backdrop {
  background: rgba(1, 18, 63, .62);
  backdrop-filter: blur(5px);
}

.contact-dialog-panel {
  position: relative;
  max-height: min(840px, calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 18px;
  background: #f5f8ff;
  box-shadow: 0 28px 90px rgba(1, 18, 63, .34);
  scrollbar-color: #9bb6e5 transparent;
  scrollbar-width: thin;
}

.contact-dialog-close {
  position: sticky;
  z-index: 2;
  top: 0;
  float: right;
  display: grid;
  width: 42px;
  height: 42px;
  margin: -14px -14px 4px 12px;
  place-items: center;
  border: 1px solid #c7d3e8;
  border-radius: 50%;
  background: #fff;
  color: var(--navy-ink, #01123f);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(1, 18, 63, .08);
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease;
}

.contact-dialog-close:hover {
  transform: rotate(5deg);
  border-color: #8aa9e4;
  background: #eaf1ff;
}

.contact-dialog-close svg {
  width: 19px;
  height: 19px;
}

.contact-dialog-heading {
  margin: 0 34px 25px 0;
}

.contact-dialog-eyebrow {
  margin: 0 0 9px;
  color: var(--electric-blue, #0254ec);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

#contact-dialog #contact-dialog-title {
  clear: none;
  margin: 0 0 9px;
  color: var(--navy-ink, #01123f);
  font-family: var(--font-display, Poppins, sans-serif);
  font-size: clamp(25px, 5vw, 36px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: 1.08;
}

.contact-dialog-intro {
  margin: 0;
  color: #52617b;
  font-size: 14px;
  line-height: 1.55;
}

#contact-dialog .contact-calendar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 6px;
  color: var(--electric-blue, #0254ec);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#contact-dialog .contact-calendar-link:hover {
  color: var(--navy-ink, #01123f);
}

#contact-dialog .contact-calendar-link:focus-visible {
  outline: 2px solid var(--electric-blue, #0254ec);
  outline-offset: 3px;
  border-radius: 4px;
}

#contact-dialog .contact-form {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#contact-dialog .contact-form-heading {
  margin-bottom: 19px;
}

#contact-dialog .contact-field label {
  color: #182c56;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

#contact-dialog .contact-field input,
#contact-dialog .contact-field select,
#contact-dialog .contact-field textarea {
  background: #fff;
  color: var(--navy-ink, #01123f);
}

#contact-dialog .contact-field input::placeholder {
  color: #68758e;
  opacity: 1;
}

#contact-dialog .contact-form-submit {
  background: var(--electric-blue, #0254ec);
  color: #fff;
}

#contact-dialog .contact-form-submit:hover,
#contact-dialog .contact-form-submit:focus-visible {
  background: var(--electric-blue-dark, #0243bd);
  color: #fff;
}

html.contact-is-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  .contact-fab {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    width: 56px;
    height: 56px;
  }

  #contact-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .contact-dialog-panel {
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 25px 20px 24px;
    border-radius: 15px;
  }

  .contact-dialog-close {
    width: 38px;
    height: 38px;
    margin: -11px -9px 4px 10px;
  }

  .contact-dialog-heading {
    margin-right: 22px;
    margin-bottom: 21px;
  }

  #contact-dialog .contact-form {
    padding: 0;
  }
}

@media (max-height: 680px) {
  #contact-dialog,
  .contact-dialog-panel {
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .contact-dialog-panel {
    padding-block: 22px;
  }

  .contact-dialog-heading {
    margin-bottom: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .contact-fab,
  .contact-dialog-close {
    transition: none;
  }
}
