/* Local contact UI. Telegram is contacted only when the visitor follows the link. */
.contact-widget {
  --contact-gap: 24px;
  position: fixed;
  z-index: 900;
  right: max(var(--contact-gap), env(safe-area-inset-right));
  bottom: max(var(--contact-gap), env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  width: 312px;
  max-width: calc(100vw - 2 * var(--contact-gap));
  pointer-events: none;
  color: #f7faf8;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  text-align: left;
}
.contact-widget > * { pointer-events: auto; }
.contact-launcher {
  position: relative;
  order: 2;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  border: 1px solid #365140;
  border-radius: 50%;
  background: #8bea36;
  color: #15220d;
  box-shadow: 0 4px 18px #0003;
  text-decoration: none;
  touch-action: manipulation;
}
.contact-launcher svg { width: 28px; height: 28px; margin-right: 2px; }
.contact-launcher::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 2px solid #79c83a;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
/* Two gentle pulses stop within five seconds; opening the panel stops them immediately. */
.contact-launcher[aria-expanded="false"]::after { animation: contact-pulse 2.4s ease-out 2; }
.contact-widget[data-motion-paused="true"] .contact-launcher::after { animation: none; }
.contact-panel {
  position: relative;
  width: 100%;
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px - env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px;
  border: 1px solid #3e5348;
  border-radius: 14px;
  background: #17221c;
  box-shadow: 0 8px 32px #0003;
  animation: contact-appear 160ms ease-out;
}
.contact-widget .contact-caption { margin: 0 32px 10px 0; color: #b9c9bf; font-size: 12px; line-height: 1.5; }
.contact-widget h2 { margin: 0 20px 10px 0; color: #f7faf8; font-size: 21px; line-height: 1.3; letter-spacing: -.025em; font-weight: 650; }
.contact-widget .contact-copy { position: relative; margin: 0 0 18px; color: #d0dbd4; font-size: 14px; line-height: 1.55; }
/* The full text reserves the final height and remains available to screen readers. */
.contact-copy-typed { display: none; position: absolute; inset: 0; white-space: pre-wrap; pointer-events: none; }
.contact-copy[data-typing="true"] .contact-copy-full { opacity: 0; }
.contact-copy[data-typing="true"] .contact-copy-typed { display: block; }
.contact-copy[data-typing="true"] .contact-copy-typed::after { content: ""; display: inline-block; width: 2px; height: .95em; margin-left: 2px; vertical-align: -.08em; background: #8bea36; }
.contact-close {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c5d2c9;
  cursor: pointer;
  touch-action: manipulation;
}
.contact-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #8bea36;
  color: #15220d;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 650;
  text-decoration: none;
  touch-action: manipulation;
}
.contact-widget .contact-note { margin: 11px 0 0; color: #b9c9bf; font-size: 12px; line-height: 1.5; }
.contact-widget :focus-visible { outline: 3px solid #f7faf8; outline-offset: 3px; }
.contact-widget .contact-launcher:focus-visible { outline-color: #365140; box-shadow: 0 0 0 7px #f7faf8; }
.consent-visible .contact-widget, .menu-open .contact-widget { display: none; }
/* Let the last page action scroll clear of the fixed launcher, including the standalone checklist. */
body:has(.contact-widget) { padding-bottom: 100px; }
@media (hover: hover) {
  .contact-launcher:hover, .contact-action:hover { background: #a1f456; }
  .contact-close:hover { background: #2b3b30; color: #fff; }
}
@media (max-width: 600px) {
  .contact-widget { --contact-gap: 16px; gap: 12px; }
  .contact-launcher { width: 56px; height: 56px; flex-basis: 56px; }
  .contact-panel { padding: 20px; }
}
@keyframes contact-appear {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes contact-pulse {
  0%, 12% { opacity: 0; transform: scale(1); }
  25% { opacity: .55; }
  75%, 100% { opacity: 0; transform: scale(1.34); }
}
@media (prefers-reduced-motion: reduce) {
  .contact-panel, .contact-launcher[aria-expanded="false"]::after { animation: none; }
  .contact-copy[data-typing="true"] .contact-copy-full { opacity: 1; }
  .contact-copy[data-typing="true"] .contact-copy-typed { display: none; }
}
@media print {
  .contact-widget { display: none !important; }
  body:has(.contact-widget) { padding-bottom: 0; }
}
