/* Dots buddy. Self-contained (own pet drawing) so it works on every page. */
.dots-buddy {
  position: fixed;
  right: 14px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: min(260px, calc(100vw - 28px));
  pointer-events: none;
  font-family: var(--font-body, system-ui, sans-serif);
}
/* Clear the bottom tab bar on phones. */
@media (max-width: 767px) {
  body:has(nav.tab-bar) .dots-buddy { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}
.dots-bubble {
  margin: 0;
  padding: 9px 12px;
  border-radius: 14px 14px 4px 14px;
  background: #fff;
  color: var(--ink, #12142b);
  border: 1px solid var(--line, #e4e6ef);
  box-shadow: 0 6px 18px rgba(30, 27, 75, 0.14);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  pointer-events: auto;
}
.dots-bubble[hidden] { display: none; }
.dots-btn {
  pointer-events: auto;
  appearance: none;
  border: 0;
  padding: 4px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 20px;
  -webkit-tap-highlight-color: transparent;
}
.dots-btn:focus-visible { outline: 3px solid var(--indigo-x, #818cf8); outline-offset: 2px; }
.dots-pet { position: relative; display: block; width: 50px; height: 52px; transform-origin: 50% 100%; animation: dots-bob 2.8s ease-in-out infinite; }
.dots-bd { position: absolute; left: 3px; bottom: 0; width: 44px; height: 40px; border-radius: 22px 22px 18px 18px; background: var(--pet, #6366f1); box-shadow: inset -5px -5px 0 rgba(30, 27, 75, 0.2), 0 4px 10px rgba(30, 27, 75, 0.2); }
.dots-ey { position: absolute; top: 13px; width: 8px; height: 9px; border-radius: 4px; background: #fff; animation: dots-blink 5s infinite; transform-origin: 50% 50%; }
.dots-ey::after { content: ""; position: absolute; left: 2px; top: 3px; width: 4px; height: 5px; border-radius: 2px; background: var(--navy, #1e1b4b); }
.dots-e1 { left: 11px; }
.dots-e2 { left: 26px; }
.dots-ck { position: absolute; top: 24px; width: 7px; height: 3px; border-radius: 2px; background: var(--pet-cheek, #f9a8d4); }
.dots-k1 { left: 6px; }
.dots-k2 { left: 31px; }
.dots-mo { position: absolute; top: 23px; left: 18px; width: 9px; height: 4px; border-bottom: 2px solid var(--navy, #1e1b4b); border-radius: 0 0 6px 6px; }
.dots-sp { position: absolute; top: 0; left: 18px; width: 14px; height: 14px; }
.dots-hop .dots-pet { animation: dots-hop 0.45s ease-out, dots-bob 2.8s ease-in-out 0.45s infinite; }
@keyframes dots-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes dots-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.1); } }
@keyframes dots-hop { 0% { transform: translateY(0) scale(1, 1); } 35% { transform: translateY(-10px) scale(0.96, 1.05); } 70% { transform: translateY(0) scale(1.05, 0.94); } 100% { transform: translateY(0) scale(1, 1); } }
.dots-still .dots-pet, .dots-still .dots-ey, .dots-still.dots-hop .dots-pet { animation: none; }
@media print { .dots-buddy { display: none; } }
