/* danit_dock.css - the floating Danit avatar of the DIVERSITY Tagger (host side; see js/danit_dock.js).
   Her own page (danit/danit_float_v39.html) lives in a transparent iframe. This file styles only what is around it: the small bar that
   moves her, and the round button that brings her back. The box itself has no background: she floats over the page. */
.danit-dock {
  position: fixed; right: 14px; bottom: 30px; z-index: 35;            /* above the footer (30), below the key popover (40) and the help bubble (60).
                                                                          The place here is only a fallback: danit_dock.js puts her in the middle of the paper area. */
  width: min(340px, calc(100vw - 16px));
  display: flex; flex-direction: column; gap: 4px;
  background: transparent; pointer-events: none;                       /* only the bar and her frame take the pointer */
}
.danit-dock[hidden], .danit-launcher[hidden] { display: none; }

.danit-bar {
  pointer-events: auto; align-self: center;
  display: flex; align-items: center; gap: 6px; padding: 3px 4px 3px 12px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: rgba(var(--surface-rgb), 0.94); color: var(--text);
  box-shadow: 0 6px 18px var(--shadow);
  font: 700 12.5px 'Segoe UI', system-ui, -apple-system, sans-serif; line-height: 1;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.danit-dock.is-dragging .danit-bar { cursor: grabbing; }
.danit-bar:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.danit-grip { display: inline-flex; width: 16px; height: 16px; opacity: 0.85; }
.danit-grip svg { width: 100%; height: 100%; display: block; }
.danit-name { margin-right: 6px; white-space: nowrap; }
/* The bar shows that it can be dragged: while the box has the class is-hinting (from her first appearance, and again from the start of her
   welcome, each time until she is moved and at most 90 seconds; never once the person has placed her) the bar blinks and carries the words
   "drag me". With reduced motion asked for, it is lit steadily instead. */
.danit-hint { display: none; margin: 0 6px 0 -2px; font-weight: 600; white-space: nowrap; }
.danit-dock.is-hinting .danit-hint { display: inline; }
.danit-dock.is-hinting .danit-bar { animation: danit-blink 1.1s ease-in-out infinite; }
@keyframes danit-blink {
  0%, 100% { background: rgba(var(--surface-rgb), 0.94); color: var(--text); box-shadow: 0 6px 18px var(--shadow), 0 0 0 0 rgba(45, 212, 191, 0); }
  50% { background: var(--pal-btn-primary); color: var(--pal-btn-text); box-shadow: 0 6px 18px var(--shadow), 0 0 0 7px rgba(45, 212, 191, 0.4); }
}
@media (prefers-reduced-motion: reduce) {
  .danit-dock.is-hinting .danit-bar { animation: none; background: var(--pal-btn-primary); color: var(--pal-btn-text); }
}
.danit-btn {
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pal-wine); color: var(--pal-btn-text);
  font: 800 15px 'Segoe UI', system-ui, -apple-system, sans-serif; line-height: 1;
}
.danit-btn:hover { box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.14); }
.danit-btn:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }

.danit-frame {
  pointer-events: auto; display: block; width: 100%; border: 0; background: transparent;
  /* her full height where the window allows it. In a shorter window she ends above its lower edge when she starts under the top of the paper
     area (159px = that top, her bar and a margin), but she is not made shorter than her buttons and boxes need (484px) unless the window is. */
  height: min(566px, calc(100vh - 46px), max(484px, calc(100vh - 159px)));
  height: min(566px, calc(100dvh - 46px), max(484px, calc(100dvh - 159px)));
}
.danit-dock.is-dragging .danit-frame { pointer-events: none; }        /* while she is moved the pointer stays with the bar */

.danit-launcher {
  position: fixed; right: 14px; bottom: 30px; z-index: 35;
  min-height: 46px; padding: 10px 18px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--pal-btn-primary); color: var(--pal-btn-text);
  box-shadow: 0 6px 18px var(--shadow);
  font: 700 14.5px 'Segoe UI', system-ui, -apple-system, sans-serif; line-height: 1.1;
}
.danit-launcher:hover { box-shadow: 0 6px 18px var(--shadow), inset 0 0 0 999px var(--hover-primary); }
.danit-launcher:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.danit-launcher svg { width: 18px; height: 18px; display: block; }
