/* Puki — TinyHug fox assistant widget (mobile-first) */
#puki-root {
  position: fixed; inset: auto 0 0 auto; z-index: 99990; font-family: inherit;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#puki-fab {
  position: fixed; right: 14px; bottom: 10px;
  width: 92px; height: 118px;
  display: block;
  background: none; border: none; box-shadow: none; border-radius: 0;
  cursor: pointer; padding: 0; overflow: visible;
  transform: scale(0); transition: transform .45s cubic-bezier(.34,1.56,.64,1);
}
#puki-fab.puki-show { transform: scale(1); }
#puki-fab img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  filter: drop-shadow(0 10px 18px rgba(65,47,36,.30));
  animation: puki-bob 3.4s ease-in-out 1s infinite;
}
@keyframes puki-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
#puki-fab-x {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(48,32,16,.5); color: #fff;
  font-size: 13px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 3; border: 1.5px solid rgba(255,255,255,.9);
}

#puki-hello {
  position: fixed; right: 100px; bottom: 34px; max-width: 220px;
  background: #fff; color: #302010; border-radius: 16px 16px 4px 16px;
  padding: 10px 14px 10px 14px; font-size: 14px; line-height: 1.45;
  box-shadow: 0 10px 26px rgba(65,47,36,.22);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .35s, transform .35s; padding-right: 38px;
}
#puki-hello.puki-show { opacity: 1; transform: translateY(0); pointer-events: auto; cursor: pointer; }
#puki-mini {
  position: fixed; right: 16px; bottom: 16px; z-index: 2147483001;
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.96); border: 2px solid #f0e2d2;
  border-radius: 999px; padding: 8px 14px 8px 10px;
  font-size: 13px; font-weight: 800; color: #5a4a3e; font-family: inherit;
  box-shadow: 0 6px 18px rgba(65,47,36,.18);
  cursor: pointer; transform: scale(0); transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
#puki-mini.puki-show { transform: scale(1); }
#puki-mini .puki-mini-fox { font-size: 20px; line-height: 1; }

#puki-panel {
  position: fixed; right: 14px; bottom: 102px;
  width: min(384px, calc(100vw - 28px)); height: min(600px, 72dvh);
  background: #fffdf9; border-radius: 22px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(65,47,36,.32);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(18px) scale(.97); pointer-events: none;
  transition: opacity .3s, transform .3s;
}
#puki-panel.puki-open { opacity: 1; transform: none; pointer-events: auto; }

.puki-head {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #c06030, #a04e24); color: #fff;
  padding: 12px 14px;
}
.puki-head .puki-avatar {
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
  border: 2px solid rgba(255,255,255,.85); flex: none; background: #f8f2ea;
  display: flex; align-items: center; justify-content: center;
}
.puki-head .puki-avatar img { width: 88%; height: 88%; object-fit: contain; display: block; }
.puki-head .puki-name { font-weight: 800; font-size: 16px; line-height: 1.2; }
.puki-head .puki-status { font-size: 12px; opacity: .92; display: flex; align-items: center; gap: 5px; }
.puki-head .puki-dot { width: 8px; height: 8px; border-radius: 50%; background: #7ee2a0; display: inline-block; }
.puki-head .puki-close {
  margin-left: auto; background: rgba(255,255,255,.16); border: 0; color: #fff;
  width: 32px; height: 32px; border-radius: 50%; font-size: 17px; cursor: pointer; flex: none;
}

#puki-msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; background: #fbf7f1; }
.puki-msg { max-width: 84%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; word-wrap: break-word; }
.puki-msg.bot { background: #fff; color: #342d29; border-bottom-left-radius: 5px; box-shadow: 0 2px 8px rgba(65,47,36,.07); align-self: flex-start; }
.puki-msg.user { background: #c06030; color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
.puki-msg.bot a { color: #a04e24; font-weight: 700; }

/* Working / tablet — loose, no icon box */
.puki-typing {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  align-self: stretch;
  box-shadow: none;
  max-width: 100%;
  width: 100%;
  overflow: visible;
}
.puki-typing-vid {
  width: 100%;
  height: auto;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  display: flex;
  justify-content: center;
  flex: none;
  padding: 2px 0 4px;
  box-sizing: border-box;
}
.puki-typing-vid video {
  width: 64px !important;
  max-width: 64px !important;
  min-width: 0 !important;
  height: auto !important;
  flex: none !important;
  object-fit: contain;
  object-position: center top;
  display: block;
  background: transparent;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(48,32,16,.14);
}
.puki-typing .puki-ttext {
  font-size: 13.5px;
  color: #5a4a3e;
  font-style: normal;
  font-weight: 650;
  line-height: 1.35;
  padding: 0 4px;
}
.puki-typing .puki-dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: middle; }
.puki-typing .puki-dots i { width: 6px; height: 6px; border-radius: 50%; background: #c06030; animation: puki-blink 1.2s infinite; }
.puki-typing .puki-dots i:nth-child(2) { animation-delay: .2s; }
.puki-typing .puki-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes puki-blink { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; transform: translateY(-3px); } }

#puki-quick { display: flex; gap: 8px; padding: 10px 12px 4px; overflow-x: auto; background: #fbf7f1; flex: none; }
#puki-quick button {
  flex: none; border: 1.5px solid #e4d5c3; background: #fff; color: #7a4a2e;
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.puki-inputbar { display: flex; gap: 8px; padding: 10px 12px 14px; background: #fbf7f1; flex: none; }
.puki-inputbar input {
  flex: 1; border: 1.5px solid #e4d5c3; border-radius: 999px; padding: 11px 16px;
  font-size: 16px; outline: none; background: #fff; color: #342d29; font-family: inherit;
  caret-color: #c06030; -webkit-text-fill-color: #342d29;
}
.puki-inputbar button {
  width: 46px; height: 46px; border-radius: 50%; border: 0; flex: none;
  background: #c06030; color: #fff; font-size: 18px; cursor: pointer;
}
.puki-choices { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.puki-choice {
  display: block; width: 100%; text-align: center;
  background: #c06030; color: #fff !important; border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: 13.5px;
  font-family: inherit;
}

@media (max-width: 480px) {
  #puki-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 74dvh; border-radius: 22px 22px 0 0; }
  #puki-fab { right: 10px; bottom: 8px; }
  .puki-typing { width: 100%; }
  .puki-typing-vid { height: auto; }
}

/* Puki HARD dodge: mosaic + entire footer trust/pay zone.
   Hide fox FAB completely; park Help under sticky (never over paymarks). */
#puki-root.puki-dodge-mosaic #puki-fab,
#puki-root.puki-dodge-mosaic #puki-fab.puki-show,
#puki-root.puki-dodge-mosaic #puki-hello,
#puki-root.puki-dodge-mosaic #puki-hello.puki-show,
#puki-root.puki-dodge-clear #puki-fab,
#puki-root.puki-dodge-clear #puki-fab.puki-show,
#puki-root.puki-dodge-clear #puki-hello,
#puki-root.puki-dodge-clear #puki-hello.puki-show,
body.puki-clear-fab #puki-fab,
body.puki-clear-fab #puki-fab.puki-show,
body.puki-clear-fab #puki-hello,
body.puki-clear-fab #puki-hello.puki-show {
  opacity: 0 !important;
  visibility: hidden !important;
  transform: scale(0) !important;
  pointer-events: none !important;
  clip: rect(0 0 0 0) !important;
}
#puki-root.puki-dodge-mosaic #puki-mini,
#puki-root.puki-dodge-mosaic #puki-mini.puki-show,
#puki-root.puki-dodge-clear #puki-mini,
#puki-root.puki-dodge-clear #puki-mini.puki-show,
body.puki-clear-fab #puki-mini,
body.puki-clear-fab #puki-mini.puki-show {
  top: var(--th-puki-mini-top, 100px) !important;
  bottom: auto !important;
  right: 12px !important;
  left: auto !important;
  transform: scale(1) !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 2147483001 !important;
  pointer-events: auto !important;
}
#puki-root.puki-dodge-mosaic.puki-chat-open #puki-mini,
#puki-root.puki-dodge-clear.puki-chat-open #puki-mini,
body.puki-clear-fab.puki-chat-open #puki-mini,
body.puki-clear-fab #puki-root.puki-chat-open #puki-mini {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(0) !important;
}
/* Extra footer breathing room on mobile so paymarks never sit under FAB. */
@media (max-width: 720px) {
  body.puki-clear-fab .site-footer {
    padding-bottom: 28px;
  }
  .site-footer {
    padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 901px) {
  #puki-root.puki-dodge-mosaic #puki-mini,
  #puki-root.puki-dodge-clear #puki-mini,
  body.puki-clear-fab #puki-mini {
    top: var(--th-puki-mini-top, 114px) !important;
  }
}
