.contact-widget {
  --contact-edge: 24px;
  --contact-size: 72px;
  --contact-safe-bottom: env(safe-area-inset-bottom, 0px);
  --contact-safe-right: env(safe-area-inset-right, 0px);
}

.contact-launcher {
  position: fixed;
  right: calc(var(--contact-edge) + var(--contact-safe-right));
  bottom: calc(var(--contact-edge) + var(--contact-safe-bottom));
  z-index: 51;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--contact-size);
  height: var(--contact-size);
  padding: 0;
  border: 3px solid #aeb6c0;
  border-radius: 50%;
  outline: 1px solid #fff;
  background: var(--navy-deep);
  color: #fff;
  box-shadow: 0 8px 24px #10131930;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.contact-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px #10131940;
}

.contact-launcher[aria-expanded="true"] { border-color: #e4e6e9; }
.contact-widget .brand-symbol img {
  /* Display the original monogram inside its square frame. */
  width: 894.323144%;
  left: -396.943231%;
  top: -359.825328%;
}
.contact-launcher .brand-symbol { width: 52px; height: 52px; }
.contact-launcher-dot {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 17px;
  height: 17px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #34a66b;
  box-shadow: 0 1px 4px #10131920;
}

.contact-widget-panel {
  position: fixed;
  right: calc(var(--contact-edge) + var(--contact-safe-right));
  bottom: calc(var(--contact-edge) + var(--contact-size) + 14px + var(--contact-safe-bottom));
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 2 * var(--contact-edge) - var(--contact-safe-right)));
  max-height: calc(100vh - 2 * var(--contact-edge) - var(--contact-size) - 14px - var(--contact-safe-bottom));
  max-height: calc(100dvh - 2 * var(--contact-edge) - var(--contact-size) - 14px - var(--contact-safe-bottom));
  overflow: hidden;
  border: 1px solid #dbe2e4;
  border-radius: 18px;
  background: #f5f7f7;
  box-shadow: 0 18px 60px #10131935;
}

.contact-widget-header {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
  padding: 17px 12px 17px 18px;
  background: var(--navy-deep);
  color: #fff;
}
.contact-widget-header .brand-symbol { width: 34px; height: 34px; }
.contact-widget-header > div { flex: 1; min-width: 0; }
.contact-widget-header h2 { font-family: var(--sans); font-size: 16px; font-weight: 600; line-height: 1.35; }
.contact-widget-header p { margin-top: 4px; color: #c3c7cd; font-size: 12px; line-height: 1.45; }
.contact-widget-close {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.contact-widget-close:hover { background: #ffffff14; }
.contact-widget-close svg { width: 21px; height: 21px; }
.contact-widget-header :focus-visible { outline-color: #e4e6e9; outline-offset: 1px; }

.contact-widget-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px; }
.contact-widget-greeting {
  padding: 15px 16px;
  border: 1px solid #e1e5e8;
  border-radius: 3px 14px 14px;
  background: #fff;
  color: #343c46;
  font-size: 16px;
  line-height: 1.55;
}
.contact-widget-greeting p + p { margin-top: 9px; }
#contact-widget-form { display: grid; gap: 14px; margin-top: 20px; }
.contact-widget-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; line-height: 1.5; }
.contact-widget-field small { color: var(--muted); font-size: 12px; font-weight: 400; }
.contact-widget-field input,
.contact-widget-field select,
.contact-widget-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cdd4db;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
}
.contact-widget-field select { padding-right: 28px; }
.contact-widget-field textarea { resize: vertical; max-height: 210px; }
.contact-widget-field input::placeholder,
.contact-widget-field textarea::placeholder { color: #727982; opacity: 1; }
.contact-widget-field :focus-visible { outline-offset: 2px; }
.contact-widget-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: var(--navy-deep);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
}
.contact-widget-primary:hover { background: #303b49; }
.contact-widget-primary svg { flex-shrink: 0; width: 20px; height: 20px; }
.contact-widget-result { margin-top: 15px; padding: 12px; border-radius: 8px; background: #e9edf1; font-size: 14px; line-height: 1.6; }
.contact-widget-result a { text-decoration: underline; text-underline-offset: 3px; }
.contact-widget-note { margin-top: 12px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.6; }
.contact-widget-direct { display: block; padding: 12px 4px 0; text-align: center; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.contact-widget-direct:hover { color: #49596d; }

@media (max-width: 650px) {
  .contact-widget { --contact-edge: 16px; --contact-size: 62px; }
  .contact-launcher .brand-symbol { width: 44px; height: 44px; }
  .contact-widget-body { padding: 16px; }
  .contact-widget-header { padding-left: 14px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-launcher { transition: none; }
}

@media print {
  .contact-widget { display: none; }
}
