/* Floating Asisten Perizinan (assets/js/chat-dock.js): a launcher above the WhatsApp button and the chat panel.
   Colours come from the option's tokens; each option restyles the launcher and panel in its own style.css. */
.chat-fab { position: fixed; right: 24px; bottom: 96px; z-index: 45; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--deep-900); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 10px 28px rgba(0, 0, 0, .22); transition: transform .2s ease, box-shadow .2s ease; }
.chat-fab .i { width: 22px; height: 22px; }
.chat-fab:hover { transform: translateY(-2px); }
.chat-fab:focus-visible { outline: 3px solid var(--brand-500); outline-offset: 3px; }
.chat-open .chat-fab { visibility: hidden; }
/* No transition on visibility: a button still mid-transition cannot take the focus returned by a closing chat */
.wa-fab, .chat-fab { transition: opacity .25s ease, transform .2s ease; }
html:has(.hero):not(.past-hero) :is(.wa-fab, .chat-fab) { opacity: 0; visibility: hidden; }
.to-top { bottom: 166px; }

.chat-dock { position: fixed; z-index: 60; right: 24px; bottom: 24px; width: min(420px, calc(100vw - 48px)); max-height: calc(100svh - 48px); display: flex; opacity: 0; transform: translateY(16px) scale(.98); transform-origin: bottom right; transition: opacity .22s ease, transform .22s ease; }
.chat-dock.is-open { opacity: 1; transform: none; }
.chat-dock[hidden] { display: none; }
.chat-dock .pj-chat { flex: 1; min-height: 0; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.chat-dock .pj-chat-log { flex: 1 1 auto; height: auto; min-height: 64px; max-height: 52svh; }
/* Short screens (phones in landscape): the log and the suggestions shrink first so the input and WhatsApp stay visible */
.chat-dock .pj-chat-head, .chat-dock .pj-chat-form, .chat-dock .chat-foot { flex: none; }
.chat-dock .pj-chat-chips { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
@media (max-height: 480px) { .chat-dock .pj-chat-head { padding-block: 8px; } .chat-foot > span { display: none; } .chat-foot { justify-content: flex-end; padding-block: 6px; } }
.chat-close { display: grid; place-items: center; flex: none; width: 40px; height: 40px; margin-left: 4px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .14); color: inherit; cursor: pointer; }
.chat-close:hover { background: rgba(255, 255, 255, .24); }
.chat-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.chat-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 12px; border-top: 1px solid var(--line); background: #fff; font-size: 12.5px; color: var(--muted); }
.chat-foot a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; background: #25d366; color: #062b16; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.chat-foot a .i { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .chat-fab { display: none; }
  .chat-dock { inset: 0; width: auto; max-height: none; transform: translateY(24px); }
  .chat-dock .pj-chat { border-radius: 0; border: 0; }
  .chat-dock .pj-chat-head { padding-top: max(13px, env(safe-area-inset-top)); }
  .chat-dock .pj-chat-log { max-height: none; }
  .chat-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .chat-open body { overflow: hidden; }
  .to-top { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .chat-dock { transition: none; } }
