/* Hide optional guidance only after its usable disclosure button exists. */
.field-help-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.field-help-label-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.field-help-label-row > label {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
}

[data-field-help-anchor] {
  display: inline-flex;
  flex: 0 0 auto;
}

.field-help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--brand-forest-deep, #244b35);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.field-help-icon {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1.3px solid currentColor;
  border-radius: 50%;
  font: 600 13px/1 Georgia, serif;
}

.field-help-trigger:hover,
.field-help-trigger[aria-expanded="true"] {
  background: #e9f1eb;
  color: #173b24;
}

.field-help-trigger:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.field-help-bubble {
  box-sizing: border-box;
  position: fixed;
  z-index: 10000;
  inset: auto;
  width: max-content;
  max-width: min(340px, calc(100vw - 24px));
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #c4d5c9;
  border-radius: 12px;
  background: #f9fcf9;
  color: #263e2e;
  box-shadow: 0 6px 24px rgb(25 48 33 / 15%);
  font: 400 .875rem/1.55 var(--font-body, Arial, sans-serif);
  text-align: start;
  white-space: normal;
  overflow: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
}

.field-help-bubble[hidden] {
  display: none !important;
}

/* Preserve each existing form's typography and alignment after explicit labels. */
.organization-switcher > .field-help-label-row > label {
  color: var(--charcoal-deep);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.trial-field > .field-help-label-row { margin-bottom: 7px; }
.trial-field > .field-help-label-row > label { font-size: .91rem; font-weight: 650; }
.resource-search-shell > .field-help-label-row { margin-bottom: 8px; }
.resource-search-shell > .field-help-label-row > label { color: var(--forest-deep); font-weight: 900; }
.position-body > .field-help-label-row > label:not(.coverage-label) { color: var(--slate); font-size: 11px; font-weight: 700; }
.workbook-guided-field { display: grid; gap: 3px; }
.workbook-guided-field > .field-help-label-row > label { color: var(--slate); font-size: 11px; font-weight: 700; }
.workbook-guided-field select { min-height: 46px; width: 100%; padding: 9px 36px 9px 11px; border: 1px solid var(--line-strong); background: white; color: var(--ink); border-radius: 9px; }
.revision-guided-field { display: grid; gap: 7px; min-width: 0; }
.decision-field { display: grid; align-content: start; gap: .35rem; min-width: 0; color: var(--charcoal-deep); font-size: .78rem; font-weight: 750; }
.decision-choice-controls > .decision-field { max-width: 620px; }
.decision-field > .field-help-label-row > label { display: block; }
.decision-field > small { color: var(--slate); font-size: .68rem; font-weight: 500; line-height: 1.4; }
.clarification-question legend .field-help-label-row { margin: 0; }
.clarification-question legend .field-help-label-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.source-context-grid { align-items: end; }
.insurance-knowledge-search > .field-help-label-row { display: flex; gap: 2px; }
.field-support:has(> .field-help-source) { justify-content: flex-end; }
.field-support:has(> .field-help-source):not(:has(> :not(.field-help-source))) { display: none; }

@media (forced-colors: active) {
  .field-help-bubble,
  .field-help-icon { border-color: CanvasText; }
  .field-help-trigger { color: ButtonText; }
  .field-help-bubble { background: Canvas; color: CanvasText; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .field-help-trigger,
  .field-help-bubble { animation: none; transition: none; scroll-behavior: auto; }
}
