/* <djjs-help-tip>: the "?" beside a section heading and its popover (assets/js/help-tip.js, includes/help-tips.php). Tokens only: Temple Dark and
   Temple Dawn both come from the design system's custom properties. The element reserves its 44 px square, so the heading does not move when
   the script upgrades it; one that has no content yet (a script-drawn desk waiting on the server) takes no room until it has. */

.djjs-help-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--ds-space-1) var(--ds-space-2); }
.djjs-help-row > :is(h2, h3, h4) { margin: 0; }

djjs-help-tip { display: inline-flex; flex: none; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; vertical-align: middle; }
djjs-help-tip[hidden], djjs-help-tip:not([data-ready]):not(:has(> template)) { display: none; }

.djjs-help-tip__btn, .djjs-help-tip__close {
  position: relative; display: inline-flex; align-items: center; justify-content: center; inline-size: 44px; block-size: 44px; margin: 0; padding: 0;
  border: 0; border-radius: var(--ds-radius-pill); background: transparent; color: var(--ds-accent); font: inherit; cursor: pointer;
}
.djjs-help-tip__mark {
  display: inline-flex; align-items: center; justify-content: center; inline-size: 28px; block-size: 28px; box-sizing: border-box;
  border: 1px solid var(--ds-border); border-radius: var(--ds-radius-pill); background: var(--ds-surface-raised);
  font-family: var(--font-display, inherit); font-size: var(--ds-text-md); font-weight: 600; line-height: 1;
}
.djjs-help-tip__btn:hover .djjs-help-tip__mark, djjs-help-tip[data-open] .djjs-help-tip__mark { border-color: var(--ds-accent); background: var(--ds-surface-sunken); }
.djjs-help-tip__btn:focus-visible, .djjs-help-tip__close:focus-visible, .djjs-help-tip__link:focus-visible, .djjs-help-tip__pop:focus-visible {
  outline: 2px solid var(--ds-focus); outline-offset: 2px;
}
.djjs-help-tip__close { color: var(--ds-text-muted); font-size: var(--ds-text-md); line-height: 1; }
.djjs-help-tip__close:hover { color: var(--ds-text); }

.djjs-help-tip__pop {
  position: fixed; z-index: var(--ds-z-dialog); box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--ds-space-3) var(--ds-space-4) var(--ds-space-4); border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md);
  background: var(--ds-surface-raised); color: var(--ds-text); box-shadow: var(--ds-shadow-2); text-align: start; font-size: var(--ds-text-sm); line-height: 1.5;
}
.djjs-help-tip__pop[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .djjs-help-tip__pop:not([hidden]) { animation: djjs-help-tip-in var(--ds-dur-fast) var(--ds-ease-gentle); }
}
@keyframes djjs-help-tip-in { from { opacity: 0; transform: translateY(-4px); } }

.djjs-help-tip__top { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-2); margin-block-start: calc(var(--ds-space-1) * -1); }
.djjs-help-tip__title { margin: 0; font-family: var(--font-display, inherit); font-weight: 600; font-size: var(--ds-text-lg); line-height: 1.2; overflow-wrap: anywhere; }
.djjs-help-tip__h { margin: var(--ds-space-3) 0 var(--ds-space-1); color: var(--ds-text-muted); font-size: var(--ds-text-xs); font-weight: 600; }
.djjs-help-tip__for { margin: 0; }
.djjs-help-tip__steps { margin: 0; padding-inline-start: 1.25em; }
.djjs-help-tip__steps li { margin-block-start: var(--ds-space-1); padding-inline-start: var(--ds-space-1); }
.djjs-help-tip__steps li::marker { color: var(--ds-accent); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.djjs-help-tip__link {
  display: inline-flex; align-items: center; min-block-size: 44px; margin-block-start: var(--ds-space-2); color: var(--ds-accent); font-weight: 600;
  text-decoration: underline; text-underline-offset: .2em;
}
.djjs-help-tip__link:hover { color: var(--ds-text); }
