/**
 * WENEX CONTEXTUAL HELP SYSTEM (WCHS) — styles.
 * Tokens only. Never a browser tooltip, never wp-admin styling.
 *
 * The trigger is deliberately QUIET: it is secondary to the label it serves and
 * must never compete with a primary action. Crimson is not used here at all —
 * help is information, not an action.
 */

/* ============================== HelpTrigger ============================== */

.wchs-labelled { display: inline-flex; align-items: center; gap: 6px; }

.wchs-trigger {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; padding: 0; margin: 0 0 0 2px;
  border: 1px solid var(--wdxs-border, rgba(0,0,0,0.16));
  border-radius: var(--wdxs-radius-pill, 9999px);
  background: transparent;
  color: var(--wdxs-ink-muted, #6E6E73);
  font-family: var(--wdxs-font-text, 'Satoshi', sans-serif);
  font-size: 10px; font-weight: 700; line-height: 1;
  cursor: help;
  vertical-align: middle;
  flex: 0 0 auto;
  transition: color var(--wdxs-duration-fast, 120ms) ease, border-color var(--wdxs-duration-fast, 120ms) ease, background-color var(--wdxs-duration-fast, 120ms) ease;
}
.wchs-trigger__glyph { transform: translateY(-0.5px); font-style: normal; }

/* Effective touch target — 44px where practical, without moving the visual. */
.wchs-trigger::before {
  content: ''; position: absolute; inset: -14px; border-radius: inherit;
}
.wdxs-command .wchs-trigger::before { inset: -8px; }  /* dense staff surfaces: avoid overlap */

.wchs-trigger:hover,
.wchs-trigger[aria-expanded="true"] {
  color: var(--wdxs-ink-primary, #0A0A0A);
  border-color: var(--wdxs-ink-primary, #0A0A0A);
  background: rgba(0,0,0,0.03);
}
.wchs-trigger:focus-visible {
  outline: 2px solid var(--wdxs-focus, #0A0A0A);
  outline-offset: 2px;
}
/* IMPORTANT (!) is the ONLY variant that carries weight — never decorative. */
.wchs-trigger--important {
  color: var(--wdxs-warning-ink, #8A5A00);
  border-color: var(--wdxs-warning-ink, #8A5A00);
}
.wchs-trigger--important:hover { background: rgba(138,90,0,0.06); }

/* variants — position only; the control itself never changes weight */
.wchs-trigger--metric       { margin-inline-start: 6px; }
.wchs-trigger--table-header { margin-inline-start: 4px; vertical-align: baseline; }
.wchs-trigger--form-field   { margin-inline-start: 6px; }
.wchs-trigger--status       { margin-inline-start: 4px; }
.wchs-trigger--action       { margin-inline-start: 6px; }
.wchs-trigger--label        { margin-inline-start: 6px; }

/* On dark surfaces the trigger inverts with the text it belongs to. */
.wxp-hero .wchs-trigger, .wxp-spots .wchs-trigger, .wdxs-on-dark .wchs-trigger,
.wxpt-top .wchs-trigger {
  color: var(--wdxs-ink-on-dark-2, #B3B3B3);
  border-color: rgba(255,255,255,0.28);
}
.wxp-hero .wchs-trigger:hover, .wxp-spots .wchs-trigger:hover, .wdxs-on-dark .wchs-trigger:hover {
  color: #fff; border-color: #fff; background: rgba(255,255,255,0.10);
}

/* ========================= HelpTooltip / HelpPopover ========================= */

.wchs-panel {
  position: fixed; z-index: 2147483000;
  box-sizing: border-box;
  max-width: min(320px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: var(--wdxs-radius-md, 8px);
  background: var(--wdxs-surface-inverse-2, #101010);
  color: var(--wdxs-ink-on-dark, #fff);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 12px 32px rgba(0,0,0,0.32);
  font-family: var(--wdxs-font-text, 'Satoshi', sans-serif);
  font-size: 13px; line-height: 1.5;
  opacity: 0; transform: translateY(2px);
  transition: opacity var(--wdxs-duration-fast, 120ms) ease, transform var(--wdxs-duration-fast, 120ms) ease;
  overscroll-behavior: contain;
}
.wchs-panel[data-open] { opacity: 1; transform: none; }
[dir="rtl"] .wchs-panel { font-family: var(--wdxs-font-text-ar, 'IBM Plex Sans Arabic', sans-serif); }

.wchs-panel::after {                       /* arrow */
  content: ''; position: absolute;
  left: var(--wchs-arrow-x, 50%); margin-left: -5px;
  width: 10px; height: 10px;
  background: var(--wdxs-surface-inverse-2, #101010);
  border-inline-end: 1px solid rgba(255,255,255,0.10);
  border-block-end: 1px solid rgba(255,255,255,0.10);
}
.wchs-panel[data-side="above"]::after { bottom: -6px; transform: rotate(45deg); }
.wchs-panel[data-side="below"]::after { top: -6px; transform: rotate(-135deg); }

.wchs-panel__title {
  font-family: var(--wdxs-font-display, 'Switzer', sans-serif);
  font-weight: 700; font-size: 13px; letter-spacing: -0.01em;
  margin-bottom: 4px; padding-inline-end: 18px;
}
[dir="rtl"] .wchs-panel__title { font-family: var(--wdxs-font-display-ar, 'Alexandria', sans-serif); }
.wchs-panel__short { color: rgba(255,255,255,0.86); }
.wchs-panel__long { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.10); color: rgba(255,255,255,0.74); }
.wchs-panel__long p { margin: 0 0 8px; }
.wchs-panel__long p:last-child { margin-bottom: 0; }

.wchs-panel--popover { padding: 14px 16px; max-width: min(380px, calc(100vw - 24px)); }
.wchs-panel--tooltip .wchs-panel__title { font-size: 12px; }

.wchs-panel__extras { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.wchs-more, .wchs-media-link {
  display: inline-block; color: #fff; font-weight: 700; font-size: 12px;
  text-decoration: underline; text-underline-offset: 3px;
}
.wchs-more:hover, .wchs-media-link:hover { opacity: 0.82; }
.wchs-media { border-radius: var(--wdxs-radius-sm, 4px); overflow: hidden; background: #000; }
.wchs-media img, .wchs-media video { display: block; width: 100%; height: auto; }

.wchs-panel__close {
  position: absolute; inset-block-start: 6px; inset-inline-end: 6px;
  width: 24px; height: 24px; padding: 0;
  background: transparent; border: 0; border-radius: var(--wdxs-radius-sm, 4px);
  color: rgba(255,255,255,0.62); font-size: 16px; line-height: 1; cursor: pointer;
}
.wchs-panel__close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.wchs-panel__close:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

/* Calmer variant for customer/creator surfaces; denser for the Command Center. */
.wdxs-customer ~ .wchs-panel, body.wdxs-customer .wchs-panel { font-size: 13.5px; }
.wdxs-command ~ .wchs-panel, body.wdxs-command .wchs-panel { font-size: 12.5px; padding: 10px 12px; }

@media (max-width: 480px) {
  .wchs-panel { max-width: calc(100vw - 20px); font-size: 13px; }
  .wchs-panel--popover { max-width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  .wchs-panel { transition: none; transform: none; }
}
@media (forced-colors: active) {
  .wchs-panel { border: 1px solid CanvasText; background: Canvas; color: CanvasText; }
  .wchs-trigger { border: 1px solid CanvasText; color: CanvasText; }
}
