/* Final webapp field-contour contract, after page and workspace styles.
   One subtle border per visible field; focus never changes field geometry.
   !important is limited to contour ownership across legacy page selectors. */
input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="submit"], [type="reset"], [type="button"], [type="image"]),
select,
textarea,
:is(.ui-control, .ui-control-shell, .ks-input-shell, .page-search, .ui-search-shell, .ui-custom-select-shell, .report-margin-input-wrap, .analytics-entity-picker-button){
  border: 1px solid var(--ui-field-border) !important;
}

/* Focus/open/explicit active state belongs to the outer field shell.
   Search, legacy and generated select shells are compatibility equivalents. */
:is(.ui-control-shell, .ks-input-shell, .page-search, .ui-search-shell, .ui-custom-select-shell, .report-margin-input-wrap):is(:focus-within, :active, .is-active, .ui-custom-select-open){
  border-color: var(--ui-field-focus) !important;
  outline: none;
  box-shadow: var(--ui-field-focus-ring) !important;
}

/* Inner fields stay flat in every state, also inside .ui-form and filters. */
:is(.ui-control-shell, .ks-input-shell, .page-search, .ui-search-shell, .ui-custom-select-shell, .report-margin-input-wrap) > :is(input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="submit"], [type="reset"], [type="button"], [type="image"]), select, textarea, .ui-custom-select-trigger){
  border: 0 solid transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Fields without a shell retain an inset focus indicator for keyboard use. */
input:not([type="hidden"], [type="checkbox"], [type="radio"], [type="submit"], [type="reset"], [type="button"], [type="image"]):focus,
select:not(.ui-native-select):focus,
textarea:focus{
  border-color: var(--ui-field-focus) !important;
  outline: none;
  box-shadow: var(--ui-field-focus-ring);
}
