/*
 * MMO 2026-11-20: Compact discrete slider presentation for NarcoEval.
 * WHY: 6-9 oversized radio choices made grouped interviews unnecessarily long.
 * CSS changes *presentation only*. Native values, submission and KBS untouched.
 * No global slider rule: legacy and categorical controls keep their own styles.
 * MMO 2026-11-21 FIX3: Step's device review found the forced 10px mobile
 * labels unreadable. Keep complete labels at 14px and allow natural wrapping;
 * gain compactness from spacing, not from shrinking the question or answer.
 * MMO 2026-11-21 FIX5: retain the FIX4 spacing and reading sizes.
 * Current section-title visibility is synchronized by the companion script;
 * there is deliberately no global display override for informational notes.
 */
#surveyContainer .question-label,
#surveyContainer .lead {
  font-size: 16px !important; line-height: 1.4 !important;
}
#surveyContainer .question > .small {
  font-size: 14px !important; line-height: 1.4 !important;
}
.statement .info {
  font-size: 16px !important; line-height: 1.35 !important;
}
#surveyContainer .ai-mmo-compact-scale {
  width: 100%; max-width: 100%; margin: 5px 0 10px;
  border: 0; background: transparent; padding: 3px 0 4px;
  box-shadow: none; --mmo-deep:#264b9c; --mmo-red:#a31c2c;
}
#surveyContainer .ai-mmo-compact-scale,
#surveyContainer .ai-mmo-compact-scale * {box-sizing: border-box;}
#surveyContainer .ai-mmo-compact-scale .ai-mmo-ticks {
  display: grid !important;
  grid-template-columns: repeat(var(--ai-compact-columns),minmax(0,1fr));
  width: 100%; gap: 2px; align-items: stretch; margin: 0 0 1px;
}
#surveyContainer .ai-mmo-compact-scale .ai-mmo-choice {
  display: flex !important; align-items: flex-end; justify-content: center;
  text-align: center; border: 0 !important; border-radius: 5px !important;
  font-family: inherit !important; font-weight: 500 !important; background: transparent !important;
  box-shadow: none !important; color: #334e70 !important;
  font-size: 14px !important;
  line-height: 1.3 !important; padding: 5px 2px 4px !important;
  min-width: 0; min-height: 44px; white-space: normal; overflow-wrap: anywhere;
  height: auto !important; max-height: none !important; overflow: visible !important;
  word-break: normal; -webkit-hyphens: auto; hyphens: auto;
  text-decoration: none !important;
}
#surveyContainer .ai-mmo-compact-scale .ai-mmo-choice.ai-original-selected,
#surveyContainer .ai-mmo-compact-scale .ai-mmo-choice[aria-pressed="true"] {
  color: var(--mmo-deep) !important;
  font-weight: 750 !important;
  background: #dce9fa !important;
}
/* MMO 2026-11-21 FIX5: Safari split "year" in "Once/year or less" when
   anywhere-wrapping was applied to the slash expression. The companion script
   supplies a WBR immediately after each slash in these labels. Wrap there or
   at existing spaces, never in a unit word. Other labels retain FIX4 wrapping;
   the original text, reading size, answer code and tick positions are retained. */
#surveyContainer .ai-mmo-compact-scale .ai-mmo-choice .ai-mmo-label-with-unit {
  display: block !important; width: 100%; min-width: 0;
  white-space: normal !important; overflow-wrap: normal !important;
  word-break: normal !important;
  -webkit-hyphens: none !important; hyphens: none !important;
}
/* MMO 2026-11-20: selectO is rendered through the ORIGINAL native radio
   inputs. Hide their tall labels only AFTER we have verified an exact ordered
   match and installed a working slider. WHY: avoid double controls, keep the
   normal native selected-radio serialization and original answers unchanged. */
#surveyContainer .ai-mmo-native-option-hidden {display: none !important;}
/* MMO 2026-11-21 FIX4: hide a verified option-only native wrapper as well as
   its label. WHY: an empty legacy option row must not retain vertical space.
   The adapter adds this class only after the original radios and labels have
   passed the exact native-option match; the original inputs stay in the DOM. */
#surveyContainer .ai-mmo-native-option-shell-hidden {display: none !important;}
#surveyContainer .ai-mmo-selecto-overlay {width: 100%; max-width: 100%;}
#surveyContainer .ai-mmo-selecto-error {color: #9b1c24; font-weight: 700; font-size: 14px;}
#surveyContainer .ai-mmo-selecto-overlay .ai-mmo-choice[aria-pressed="true"],
#surveyContainer .ai-mmo-selecto-overlay .ai-mmo-special[aria-pressed="true"] {
  background: #dce9fa !important; font-weight: 750 !important;
}

#surveyContainer .ai-mmo-compact-scale .ai-mmo-track {
  height: 44px !important; display: flex !important; align-items: center !important;
  border: 0 !important; margin: 0 !important; padding: 0 11px !important;
  box-shadow: none !important; background: transparent !important;
}
#surveyContainer .ai-mmo-compact-scale input.ai-semantic-range,
#surveyContainer .ai-mmo-compact-scale input.ai-mmo-selecto-range {
  display: block !important; width: 100% !important; margin: 0 !important;
  height: 44px !important; min-height: 44px !important; border: none !important;
  border-radius: 999px !important; box-shadow: none !important;
  background: transparent !important;
  appearance: none !important; -webkit-appearance: none !important;
  cursor: pointer; touch-action: pan-y;
}
/* MMO 2026-11-21: a 6px visible rail inside an actual 44px range control.
   WHY: a tall wrapper around a 7px input did not enlarge the input hit area. */
#surveyContainer .ai-mmo-compact-scale input[type="range"]::-webkit-slider-runnable-track {
  height: 6px !important; border: 0 !important; border-radius: 999px !important;
  background: linear-gradient(to right,#3154e7 0%,#7988de 35%,#d9b5c8 60%,#bd2430 100%) !important;
  box-shadow: none !important;
}
#surveyContainer .ai-mmo-compact-scale input[type="range"]::-moz-range-track {
  height: 6px !important; border: 0 !important; border-radius: 999px !important;
  background: linear-gradient(to right,#3154e7 0%,#7988de 35%,#d9b5c8 60%,#bd2430 100%) !important;
  box-shadow: none !important;
}
#surveyContainer .ai-mmo-compact-scale input[type="range"]::-moz-range-progress {
  background: transparent !important;
}
#surveyContainer .ai-mmo-compact-scale input.ai-semantic-range::-webkit-slider-thumb,
#surveyContainer .ai-mmo-compact-scale input.ai-mmo-selecto-range::-webkit-slider-thumb {
  -webkit-appearance: none !important; appearance: none !important;
  width: 22px !important; height: 22px !important; border-radius: 50% !important;
  margin-top: -8px !important; opacity: 1 !important;
  background: #f5e1bd !important; border: 2px solid #8f6934 !important;
  box-shadow: 0 0 0 3px #ffffffb8 !important; cursor: grab;
}
#surveyContainer .ai-mmo-compact-scale input.ai-semantic-range::-moz-range-thumb,
#surveyContainer .ai-mmo-compact-scale input.ai-mmo-selecto-range::-moz-range-thumb {
  width: 22px !important; height: 22px !important; border-radius: 50% !important;
  opacity: 1 !important;
  background: #f5e1bd !important; border: 2px solid #8f6934 !important;
  box-shadow: 0 0 0 3px #ffffffb8 !important;
}
#surveyContainer .ai-mmo-compact-scale .ai-mmo-current {
  /* MMO 2026-11-21 FIX4: the selected label and its thumb already identify
     the response. Keep the native live output accessible, without repeating
     the same sentence visually or reserving a separate row underneath. */
  display: block !important; position: absolute !important;
  width: 1px !important; height: 1px !important; min-height: 0 !important;
  margin: -1px !important; padding: 0 !important; border: 0 !important;
  overflow: hidden !important; white-space: nowrap !important;
  clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important;
}
#surveyContainer .ai-mmo-compact-scale .ai-mmo-specials {
  display: flex !important; gap: 6px !important; flex-wrap: wrap !important;
  justify-content: center !important; margin: 2px 0 !important;
  padding: 0 !important;
}
#surveyContainer .ai-mmo-compact-scale .ai-mmo-special {
  border: 1px solid #a6b8ce !important; background: #f8fbff !important;
  color: #314d70 !important; border-radius: 8px !important;
  font-family: inherit !important; font-size: 16px !important; padding: 8px 14px !important;
  min-height: 44px !important; box-shadow: none !important;
}
#surveyContainer .ai-mmo-compact-scale .ai-mmo-special.ai-selected,
#surveyContainer .ai-mmo-compact-scale .ai-mmo-special[aria-pressed="true"] {
  background: #dce9fa !important; font-weight: 750 !important;
}
/* MMO 2026-11-21: Not sure is exclusive, never a position on the scale.
   Hide its former thumb and neutralize the rail while keeping the range and
   literal labels interactive. These rules only read a presentation state;
   native hidden answers, radios, codes and submissions are never changed. */
#surveyContainer .ai-mmo-compact-scale[data-mmo-answer-state="special"] input[type="range"]::-webkit-slider-runnable-track {
  background: #c7d0dd !important;
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-answer-state="special"] input[type="range"]::-moz-range-track {
  background: #c7d0dd !important;
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-answer-state="special"] input[type="range"]::-webkit-slider-thumb {
  opacity: 0 !important; box-shadow: none !important;
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-answer-state="special"] input[type="range"]::-moz-range-thumb {
  opacity: 0 !important; box-shadow: none !important;
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-answer-state="unanswered"] input[type="range"]::-webkit-slider-thumb {
  opacity: .4 !important; background: #f2f5f9 !important; border-color: #788ba4 !important;
  box-shadow: none !important;
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-answer-state="unanswered"] input[type="range"]::-moz-range-thumb {
  opacity: .4 !important; background: #f2f5f9 !important; border-color: #788ba4 !important;
  box-shadow: none !important;
}
#surveyContainer .ai-mmo-compact-scale button:focus-visible,
#surveyContainer .ai-mmo-compact-scale input[type="range"]:focus-visible {
  outline: 2px solid #264b9c !important; outline-offset: 2px !important;
}
/* MMO 2026-11-21 FIX6: native autofocus on arrival may match focus-visible
   without keyboard navigation. Suppress only the compact range outline in
   pointer/touch mode; keep the focused element and its 44px hit target intact.
   Real keyboard input reveals a clear outline even when focus was already on
   the range. Buttons and all controls outside compact scales keep their styles. */
html[data-mmo-focus-modality="pointer"] #surveyContainer .ai-mmo-compact-scale input[type="range"]:focus {
  outline: none !important;
}
html[data-mmo-focus-modality="keyboard"] #surveyContainer .ai-mmo-compact-scale input[type="range"]:focus {
  outline: 2px solid #264b9c !important; outline-offset: 2px !important;
}
/* MMO: compact spacing on mobile without reducing the reading size. */
@media (max-width: 760px) {
  #surveyContainer .ai-mmo-compact-scale {margin: 0 0 6px !important;}
}
@media (prefers-reduced-motion: reduce) {
  #surveyContainer .ai-mmo-compact-scale * {animation: none !important; transition: none !important;}
}

/* MMO 2026-11-21 FIX7: two readable text levels within the native question.
   Spans remain valid inside the native p.lead; all details remain visible.
   Scope only our inserted spans, without layout changes to response controls. */
#surveyContainer .ai-mmo-question-context {
  display: block;
  margin: 0 0 0.4em;
  color: #44546a;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
}
#surveyContainer .ai-mmo-question-context-label {
  font-weight: 600;
}
#surveyContainer .ai-mmo-question-main {
  display: block;
}
#surveyContainer .ai-mmo-time-context {
  display: block;
  margin: 0 0 0.25em;
  color: #44546a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

/* MMO 2026-11-21 FIX8: readable labels on dense non-fatigue scales.
   The compact renderer opts in for 6-10 ordinary positions, plus the exact
   five-choice intensity signature validated by the renderer. Each column
   has at least 96 CSS px: words such as Completely, months and year remain
   whole at 14px. Only ticks and rail scroll; special answers and navigation
   remain in the normal page flow. No native option text/code is changed. */
#surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-scale-viewport {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  margin: 0;
  padding: 4px 0;
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-scale-content {
  width: 100%;
  /* 96px per column plus the existing 2px gap between adjacent columns. */
  min-width: calc(var(--ai-compact-columns) * 98px - 2px);
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-ticks {
  gap: 2px !important;
}
/* Match the slider endpoint centres to the first and last label centres.
   parts() supplies numeric calc coefficients for the actual column count. */
#surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-track {
  padding: 0 var(--mmo-edge-inset, 11px) !important;
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] input[type="range"]::-webkit-slider-thumb {
  box-sizing: border-box !important;
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] input[type="range"]::-moz-range-thumb {
  box-sizing: border-box !important;
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-choice,
#surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-label-with-unit {
  font-size: 14px !important;
  white-space: normal !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  -webkit-hyphens: none !important;
  hyphens: none !important;
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-choice:focus-visible,
#surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-scale-viewport:focus-visible {
  outline: 2px solid #264b9c !important;
  outline-offset: -2px !important;
}
#surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-scale-hint {
  display: none;
  margin: 3px 0 6px;
  padding: 0;
  color: #59677a;
  font-size: 14px !important;
  font-weight: 400;
  line-height: 1.35;
}
/* Modern CSS can compare the scale's own available width, independently of
   viewport orientation or nested question cards. A fitting scale has no hint. */
@supports (container-type: inline-size) {
  #surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] {
    container-type: inline-size;
    container-name: mmo-readable-scale;
  }
  @container mmo-readable-scale (max-width: 487.98px) {
    #surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-scale-hint-5 {display: block;}
  }
  @container mmo-readable-scale (max-width: 585.98px) {
    #surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-scale-hint-6 {display: block;}
  }
  @container mmo-readable-scale (max-width: 683.98px) {
    #surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-scale-hint-7 {display: block;}
  }
  @container mmo-readable-scale (max-width: 781.98px) {
    #surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-scale-hint-8 {display: block;}
  }
  @container mmo-readable-scale (max-width: 879.98px) {
    #surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-scale-hint-9 {display: block;}
  }
  @container mmo-readable-scale (max-width: 977.98px) {
    #surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-scale-hint-10 {display: block;}
  }
}
/* Older CSS engines still get the complete scrollable scale. The small hint
   is conservative on mobile there; no runtime measurement or browser API is
   needed. This fallback is not an assertion that actual overflow was measured. */
@supports not (container-type: inline-size) {
  @media (max-width: 760px) {
    #surveyContainer .ai-mmo-compact-scale[data-mmo-wide-scale="1"] .ai-mmo-scale-hint {display: block;}
  }
}

/* MMO 2026-11-21 FIX7: small categorical choices on a verified legacy range.
   Only the adapter's own elements/classes are styled. Native controls remain
   enabled and present for their original handler, validation and serializer. */
#surveyContainer .ai-mmo-categorical-native-hidden {
  display: none !important;
}
#surveyContainer .ai-mmo-legacy-categorical {
  clear: both;
  margin: 10px 0 12px;
  color: #345477;
  font-size: 14px;
  line-height: 1.25;
}
#surveyContainer .ai-mmo-categorical-main,
#surveyContainer .ai-mmo-categorical-specials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
#surveyContainer .ai-mmo-categorical-specials {
  margin-top: 6px;
}
#surveyContainer .ai-mmo-legacy-categorical .ai-mmo-categorical-choice {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 76px;
  min-height: 44px;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid #9bb0ca;
  border-radius: 6px;
  background: #f8fbff;
  color: #345477;
  font: inherit;
  font-weight: 500;
  white-space: normal;
  cursor: pointer;
  box-shadow: none;
}
#surveyContainer .ai-mmo-legacy-categorical .ai-mmo-categorical-selected {
  background: #dce9ff;
  border-color: #3e68ad;
  color: #254f92;
  font-weight: 700;
}
#surveyContainer .ai-mmo-legacy-categorical button:focus-visible {
  outline: 2px solid #527cc3;
  outline-offset: 2px;
}

/* MMO 2026-11-21 FIX8: keep the native optional-family exit legible at rest
   and during interaction. The archived app creates #ad-family-exit-button
   under #surveyContainer with .button.hollow.secondary. The archived CSS
   combines grey #777 text with a blue #4f80ba form-button background; its
   hover/focus rules then change that background, explaining the contrast shift.
   Target the native ID, not the translated label. White on #315f92 is 6.60:1
   at full opacity. Leave labels, dimensions, focus outline, disabled state,
   native opacity, visibility, confirmation and onclick completely unchanged. */
#surveyContainer #ad-family-exit-button,
#surveyContainer #ad-family-exit-button:hover,
#surveyContainer #ad-family-exit-button:focus,
#surveyContainer #ad-family-exit-button:active {
  color: #ffffff !important;
  background-color: #315f92 !important;
  border-color: #315f92 !important;
}
