/* Tack the helper (tack-helper.js): one short hint from the brass robot, standing free (tack-bot.css). A corner card on wide screens,
   a note in the page flow on phones. Never a modal. Motion only without prefers-reduced-motion. */
.tack-helper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  color: var(--ink, #000);
  font-family: inherit;
}
/* Tack stands beside the bubble, no frame (tack-bot.css draws it). */
.th-face {
  flex: none;
  width: 62px;
}
img.th-face {
  height: 62px;
}
.th-bubble {
  position: relative;
  flex: 1;
  padding: 10px 44px 10px 14px;
  border: 2px solid var(--ink, #000);
  border-radius: 14px;
  background: #fff;
}
/* The tail points at Tack, on the right. */
.th-bubble::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: 16px;
  border: 8px solid transparent;
  border-left: 10px solid var(--ink, #000);
}
/* Doubled class: page rules like ".now p" must not restyle Tack's line. */
.tack-helper .th-say.th-say {
  max-width: none;
  margin: 0;
  color: var(--ink, #000);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}
.th-close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--ink, #000);
  font: inherit;
  font-size: 1.625rem;
  line-height: 1;
  cursor: pointer;
}
.tack-helper .th-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}
.th-go,
.th-next {
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid var(--red, #c8102e);
  background: var(--red, #c8102e);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 800;
  cursor: pointer;
}
.th-next {
  border-color: var(--ink, #000);
  background: #fff;
  color: var(--ink, #000);
}
.th-close:focus-visible,
.th-go:focus-visible,
.th-next:focus-visible {
  outline: 3px solid var(--ink, #000);
  outline-offset: 2px;
}

/* Wide screens: a small card that peeks up from the bottom right corner. */
.th-corner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  width: 360px;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.22));
}
/* Room below the footer, so the last links scroll clear of the corner card. */
body:has(.th-corner) {
  padding-bottom: 170px;
}
.th-corner .th-face {
  width: 88px;
}
.th-corner .th-bubble::after {
  bottom: 76px;
}
/* The face is the open and fold button. Folded: only the face, with a small badge. */
.th-open {
  position: relative;
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.th-open:focus-visible {
  outline: 3px solid var(--ink, #000);
  outline-offset: 3px;
  border-radius: 16px;
}
/* Folded: Tack sinks to the bottom edge of the screen and peeks over it, head and antenna only. */
.th-corner.th-folded .th-open {
  transform: translateY(calc(52% + 18px));
}
.th-badge {
  position: absolute;
  top: 6px;
  left: -16px;
  padding: 1px 7px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--red, #c8102e);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}
.th-corner:not(.th-folded) .th-badge {
  display: none;
}
.th-corner.th-folded {
  width: auto;
}
.th-corner.th-folded .th-bubble {
  display: none;
}
/* Phones: in the page, right above the thing it points at. The tail points down at it. */
.th-inline {
  margin: 0 0 18px;
}
.th-inline .th-bubble::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 100%;
  border: 9px solid transparent;
  border-top-color: var(--ink, #000);
}
/* The ring on the thing Tack points at, after "Show me". */
.th-spot {
  outline: 4px solid var(--red, #c8102e);
  outline-offset: 6px;
}
@media (prefers-reduced-motion: no-preference) {
  /* Tack climbs up from below the screen edge, then the bubble pops out. */
  .th-corner .th-open {
    transition: transform 0.4s cubic-bezier(0.3, 1.3, 0.5, 1);
    animation: th-peek 0.6s cubic-bezier(0.3, 1.3, 0.5, 1);
  }
  .th-corner .th-bubble {
    animation: th-pop 0.3s ease-out 0.3s both;
  }
  .th-spot {
    animation: th-ring 0.9s ease-in-out 2;
  }
}
@keyframes th-peek {
  from {
    transform: translateY(110%);
  }
}
@keyframes th-pop {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}
@keyframes th-ring {
  50% {
    outline-offset: 12px;
  }
}
