/* P400 #158 — the site-wide support launcher (static/help-launcher.js). Brand roles only; follows the site's light / dark
   (palette.css: html[data-theme] or the OS). The panel: width min(400px, 100vw − 32px), height min(width × 16/9, 100vh − 96px),
   anchored bottom-right above the logo; ≤ 640 px wide it fills the screen inside the safe-area insets and the logo hides. */
.aj-help-launcher { position: fixed; z-index: 900; right: calc(16px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom)); width: 56px; height: 56px; padding: 0; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface-1); box-shadow: var(--shadow-2);
  transition: transform var(--dur) var(--ease); }
.aj-help-launcher img { width: 32px; height: 32px; }
.aj-help-launcher:hover { transform: translateY(-2px); }
.aj-help-launcher[aria-expanded="true"] { background: var(--surface-2); }

.aj-help-panel { --w: min(400px, calc(100vw - 32px)); position: fixed; z-index: 901;
  right: calc(16px + env(safe-area-inset-right)); bottom: calc(84px + env(safe-area-inset-bottom));
  width: var(--w); height: min(calc(var(--w) * 16 / 9), calc(100vh - 96px)); height: min(calc(var(--w) * 16 / 9), calc(100dvh - 96px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--border);
  background: var(--bg); box-shadow: 0 12px 48px rgb(20 20 20 / 0.22); transform-origin: bottom right;
  animation: aj-help-in 180ms var(--ease); }
.aj-help-panel[hidden] { display: none; }
@keyframes aj-help-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .aj-help-panel { animation: none; } .aj-help-launcher { transition: none; } .aj-help-launcher:hover { transform: none; } }
.aj-help-panel__head { flex: none; display: flex; align-items: center; gap: var(--sp-2); min-height: 52px; padding: 0 4px 0 14px;
  border-bottom: 1px solid var(--border-soft); background: var(--bg); }
.aj-help-panel__head img { width: 24px; height: 24px; }
.aj-help-panel__title { flex: 1 1 auto; min-width: 0; font: 700 var(--fs-sm)/1.2 var(--font-title); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aj-help-panel__x { width: 44px; height: 44px; flex: none; display: grid; place-items: center; padding: 0; border: 0;
  border-radius: 50%; background: none; color: var(--text); }
.aj-help-panel__x svg { width: 20px; height: 20px; }
.aj-help-panel__x:hover { background: var(--surface-2); }
.aj-help-panel__frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; display: block; background: var(--bg); }

@media (max-width: 640px) {
  .aj-help-panel { --w: auto; left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right));
    top: calc(8px + env(safe-area-inset-top)); bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; height: auto; }
  html.aj-help-open .aj-help-launcher { display: none; }
  html.aj-help-open, html.aj-help-open body { overflow: hidden; }
}
@media print { .aj-help-launcher, .aj-help-panel { display: none !important; } }
