/* Contact speed dial (views/partials/footer.ejs): a native <details>; sits above Mobi (css/mobi-buddy.css), drops to the corner when Mobi is out. */
.cdial {
  position: fixed;
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: calc(max(0.75rem, env(safe-area-inset-bottom)) + clamp(6.5rem, 9vw, 7.5rem) + 0.75rem);
  z-index: 31;
  display: flex;
  flex-direction: column-reverse; /* summary must come first in <details>; the list shows above it */
  align-items: flex-end;
  gap: 0.875rem;
  font: 600 1.125rem/1 Outfit, Anuphan, sans-serif;
  transition: bottom 0.4s cubic-bezier(0.2, 0.8, 0.3, 1);
}
body:has(.sb[data-out]) .cdial { bottom: max(1rem, env(safe-area-inset-bottom)); }
body:has(.sb-chat) .cdial { display: none; } /* Mobi's chat takes the corner */
.cdial > summary {
  list-style: none;
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 1.25rem;
  background: #142a47;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgb(20 42 71 / 0.28);
}
.cdial > summary::-webkit-details-marker { display: none; }
.cdial > summary:focus-visible { outline: 3px solid #2f6fd6; outline-offset: 3px; }
.cdial > summary svg { width: 1.75rem; height: 1.75rem; }
.cdial > summary .cdial-x, .cdial[open] > summary .cdial-chat { display: none; }
.cdial[open] > summary .cdial-x { display: block; }
.cdial-list { display: flex; flex-direction: column; align-items: flex-end; gap: 0.875rem; }
.cdial-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0 1.75rem 0 1.5rem;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgb(20 42 71 / 0.22);
}
.cdial-list a:focus-visible { outline: 3px solid #2f6fd6; outline-offset: 3px; }
.cdial-list svg { width: 1.5rem; height: 1.5rem; flex: none; }
.cdial-line { background: #367c3c; }
.cdial-fb { background: #2f62d0; }
.cdial-tel { background: #142a47; }
@media (hover: hover) { .cdial-list a:hover, .cdial > summary:hover { filter: brightness(1.12); } }
@media (prefers-reduced-motion: no-preference) {
  .cdial[open] .cdial-list a { animation: cdial-in 0.32s cubic-bezier(0.2, 0.8, 0.3, 1) backwards; }
  .cdial[open] .cdial-list a:nth-child(2) { animation-delay: 0.04s; }
  .cdial[open] .cdial-list a:nth-child(1) { animation-delay: 0.08s; }
}
@keyframes cdial-in { from { opacity: 0; translate: 0 0.75rem; scale: 0.92; } }
@media (max-width: 639.98px) {
  .cdial { font-size: 1rem; gap: 0.625rem; }
  .cdial-list a { min-height: 3rem; padding: 0 1.25rem 0 1.125rem; }
  .cdial > summary { width: 3.5rem; height: 3.5rem; border-radius: 1.125rem; }
}
