/* Review controls pair their own background, text fill and native popup scheme.
   WebKit text fill is explicit: ancestor contrast-audit classes must not leak
   a cream-card foreground into a dark input, or the reverse. */
#sessionReviewBody {
  --review418-bg: #fffdfb;
  --review418-text: #201a20;
  --review418-hint: #685a63;
  --review418-border: #98838f;
  --review418-disabled-bg: #eee7eb;
  --review418-disabled-text: #685a63;
  --review418-focus: #aa235a;
  --review418-scheme: light;
}

#sessionReviewBody :is(.review-form-shell, .link-only-shell) {
  --review418-bg: #2a2328;
  --review418-text: #fff8f1;
  --review418-hint: #c9bbc3;
  --review418-border: #99828f;
  --review418-disabled-bg: #352d33;
  --review418-disabled-text: #c9bbc3;
  --review418-focus: #ff9cbe;
  --review418-scheme: dark;
}

#sessionReviewBody :is(.bf412-delivered, .bf412-next-decision, .bf412-form-detail, .gp411-editor) {
  --review418-bg: #fffdfb;
  --review418-text: #201a20;
  --review418-hint: #685a63;
  --review418-border: #98838f;
  --review418-disabled-bg: #eee7eb;
  --review418-disabled-text: #685a63;
  --review418-focus: #aa235a;
  --review418-scheme: light;
}

/* Dark observation tiles remain dark even inside an optional cream section. */
#sessionReviewBody :is(.review-observation, .review-dimension, .participant-manager, .review-focus-card) {
  --review418-bg: #2a2328;
  --review418-text: #fff8f1;
  --review418-hint: #c9bbc3;
  --review418-border: #99828f;
  --review418-disabled-bg: #352d33;
  --review418-disabled-text: #c9bbc3;
  --review418-focus: #ff9cbe;
  --review418-scheme: dark;
}

#sessionReviewBody :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
  background: var(--review418-bg) !important;
  color: var(--review418-text) !important;
  -webkit-text-fill-color: var(--review418-text) !important;
  caret-color: var(--review418-text) !important;
  border-color: var(--review418-border) !important;
  color-scheme: var(--review418-scheme) !important;
  opacity: 1 !important;
  min-width: 0;
  max-width: 100%;
}

#sessionReviewBody :is(select option, select optgroup) {
  background: var(--review418-bg) !important;
  color: var(--review418-text) !important;
  -webkit-text-fill-color: var(--review418-text) !important;
  color-scheme: var(--review418-scheme) !important;
}

#sessionReviewBody :is(input, textarea)::placeholder {
  color: var(--review418-hint) !important;
  -webkit-text-fill-color: var(--review418-hint) !important;
  opacity: 1 !important;
}

#sessionReviewBody :is(input, select, textarea):disabled {
  background: var(--review418-disabled-bg) !important;
  color: var(--review418-disabled-text) !important;
  -webkit-text-fill-color: var(--review418-disabled-text) !important;
  opacity: 1 !important;
}

#sessionReviewBody :is(input, textarea):-webkit-autofill {
  -webkit-text-fill-color: var(--review418-text) !important;
  caret-color: var(--review418-text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--review418-bg) inset !important;
}

#sessionReviewBody :is(input, select, textarea):focus-visible {
  outline: 3px solid var(--review418-focus) !important;
  outline-offset: 3px;
}

#sessionReviewBody :is(.bf412-delivered, .bf412-next-decision, .bf412-form-detail, .gp411-editor) :is(label, h3, h4, summary, p, b) {
  color: var(--review418-text) !important;
  -webkit-text-fill-color: var(--review418-text) !important;
}

#sessionReviewBody :is(.review-question, .review-observation, .review-dimension) > :is(label, .review-help),
#sessionReviewBody :is(.bf412-muted, .gp411-muted) {
  color: var(--review418-hint) !important;
  -webkit-text-fill-color: var(--review418-hint) !important;
}

@media (max-width: 650px) {
  #sessionReviewBody :is(input, select, textarea) { font-size: 16px; }
}
