/* Shared control contract, based on the dashboard search toolbar.
   Geometry deliberately wins over legacy page-specific sizing. Colors, widths,
   validation, disabled states, and native control behavior remain page-owned. */
.portal-body {
  --portal-control-height: 38px;
  --portal-control-font: 1rem;
  --portal-control-line: 1.5;
  --portal-control-py: .375rem;
  --portal-control-px: .75rem;
  --portal-control-radius: .375rem;
  --portal-control-gap: .4rem;
}

.portal-body :is(.btn, .journey-future-action, .journey-retry-email, .message-send-button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--portal-control-gap) !important;
  box-sizing: border-box;
  min-height: var(--portal-control-height) !important;
  height: auto !important;
  padding: var(--portal-control-py) var(--portal-control-px) !important;
  border-radius: var(--portal-control-radius) !important;
  font-size: var(--portal-control-font) !important;
  line-height: var(--portal-control-line) !important;
  font-weight: 400 !important;
  text-align: center;
  vertical-align: middle;
}

.portal-body :is(.btn, .journey-future-action) > svg,
.portal-action-icon {
  width: 1rem !important;
  height: 1rem !important;
  flex: 0 0 1rem;
  align-self: center;
}

.portal-body main :is(input.form-control, select.form-control, select.form-select, textarea.form-control) {
  box-sizing: border-box;
  padding: var(--portal-control-py) var(--portal-control-px) !important;
  border-radius: var(--portal-control-radius) !important;
  font-size: var(--portal-control-font) !important;
  line-height: var(--portal-control-line) !important;
  font-weight: 400 !important;
}

.portal-body main :is(input.form-control, select.form-control, select.form-select):not([multiple]):not([size]) {
  height: var(--portal-control-height) !important;
  min-height: var(--portal-control-height) !important;
}

/* Multiline editors and multi-selects retain their rows/height and scroll behavior. */
.portal-body main textarea.form-control {
  min-height: var(--portal-control-height);
}

.portal-body main :is(select.form-control, select.form-select) {
  padding-right: 2.25rem !important;
  background-position: right .75rem center;
}

.portal-body main .password-field input.form-control {
  padding-right: 4.5rem !important;
}

.portal-body .password-toggle {
  min-height: 30px !important;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .25rem .5rem !important;
}

.portal-body input.form-control[type="file"]::file-selector-button {
  padding: var(--portal-control-py) var(--portal-control-px);
  margin: calc(-1 * var(--portal-control-py)) var(--portal-control-px) calc(-1 * var(--portal-control-py)) calc(-1 * var(--portal-control-px));
  font: inherit;
}

.portal-body main .form-label {
  font-size: var(--portal-control-font) !important;
  font-weight: 600 !important;
  line-height: var(--portal-control-line);
  margin-bottom: .5rem;
}

/* Keep Bootstrap input groups joined despite the shared corner radius. */
.portal-body .input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu) {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}
.portal-body .input-group > :not(:first-child):not(.dropdown-menu) {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Preserve floating-label clearance on scaffolded Identity forms. */
.portal-body main .form-floating > :is(.form-control, .form-select) {
  height: 3.5rem !important;
  min-height: 3.5rem !important;
  padding-top: 1.625rem !important;
  padding-bottom: .625rem !important;
}

.portal-body .dashboard-status-filter > summary {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  min-height: var(--portal-control-height) !important;
  padding: var(--portal-control-py) var(--portal-control-px) !important;
  border-radius: var(--portal-control-radius) !important;
  font-size: var(--portal-control-font) !important;
  line-height: var(--portal-control-line) !important;
}

/* A long label may wrap; controls never clip text at narrow widths or zoom. */
.portal-body :is(.btn, .journey-future-action) { max-width: 100%; }
.portal-body .btn:focus-visible {
  outline: 2px solid #2174b2;
  outline-offset: 2px;
}

/* Allow the standard-size Journey actions to share one desktop row. */
.portal-body .journey-rule-actions { max-width: 30rem; }

/* Secondary inline actions beside conversation status pills share one compact size. */
.portal-body :is(.no-reply-needed-action, .reply-assignment-action) {
  --portal-control-height: 26px;
  --portal-control-font: .7rem;
  --portal-control-line: 1.4;
  --portal-control-py: .25rem;
  --portal-control-px: .6rem;
  --portal-control-gap: .25rem;
  font-weight: 700 !important;
  white-space: nowrap;
}

.portal-body :is(.no-reply-needed-action, .reply-assignment-action) > svg {
  width: .75rem !important;
  height: .75rem !important;
  flex-basis: .75rem;
}

/* Compact repeated actions in the Journey automation list. */
.portal-body .journey-rule-actions {
  --portal-control-height: 32px;
  --portal-control-font: .8125rem;
  --portal-control-line: 1.5;
  --portal-control-py: .25rem;
  --portal-control-px: .6rem;
  --portal-control-gap: .3rem;
}

.portal-body .journey-rule-actions :is(.btn, .journey-future-action) > svg {
  width: .875rem !important;
  height: .875rem !important;
  flex-basis: .875rem;
}
