.myori-contact {
  position: fixed;
  z-index: 8;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: grid;
  justify-items: end;
  width: 52px;
  min-height: 52px;
  align-content: end;
  font: 600 13px/1.3 system-ui, sans-serif;
  color: #243e35;
}
.myori-contact[hidden], .myori-contact [hidden] { display: none; }
.contact-circle {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  box-sizing: border-box;
  border: 1px solid #ccd8ce;
  border-radius: 50%;
  padding: 0;
  color: inherit;
  background: #fffdf8;
  box-shadow: 0 3px 12px #233f351a;
}
.myori-contact svg { display: block; width: 23px; height: 23px; }
.myori-contact button { cursor: pointer; }
.myori-contact .contact-toggle {
  width: 52px;
  height: 52px;
  color: #fffdf8;
  background: #243e35;
  border-color: #3d564b;
  box-shadow: 0 4px 14px #233f3538;
}
.contact-toggle > span { pointer-events: none; }
.myori-contact .contact-top { position:absolute; right:60px; bottom:4px; width:44px; height:44px; }
.myori-contact .contact-toggle[hidden] ~ .contact-top { right:4px; }
.contact-top svg { width: 19px; height: 19px; }
.myori-contact :focus-visible { outline: 2px solid #a33f59; outline-offset: 3px; }
.contact-actions {
  display: grid;
  justify-items: end;
  gap: 7px;
  position: absolute;
  bottom: calc(100% + 9px);
  right: 3px;
  width: max-content;
  max-height: calc(100vh - 90px);
  max-height: calc(100dvh - max(16px, env(safe-area-inset-bottom)) - max(16px, env(safe-area-inset-top)) - 61px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.myori-contact.is-open .contact-actions { visibility: visible; opacity: 1; transform: none; }
.contact-actions a {
  display: flex;
  align-items: center;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}
.contact-label {
  padding: 3px 6px;
  border: 1px solid #e1e8e0;
  border-radius: 5px;
  background: #fffdf8;
}
.contact-actions a:hover .contact-circle { border-color: #8aa094; }
.contact-messenger .contact-circle { color: #0866ff; }
.contact-zalo .contact-circle { color: #0068ff; }
@supports (height: 100svh) {
  @media (max-width: 700px), (pointer: coarse) {
    /* Use the viewport with browser controls expanded as a stable anchor. */
    .myori-contact {
      top: calc(100svh - max(16px, env(safe-area-inset-bottom)) - 52px);
      bottom: auto;
    }
    .contact-actions {
      max-height: calc(100svh - max(16px, env(safe-area-inset-bottom)) - max(16px, env(safe-area-inset-top)) - 61px);
    }
  }
}
@media (prefers-reduced-motion: reduce) { .contact-actions { transition: none; } }
