/* Shared screen controls. Document print styles remain independent. */
.button,
.text-button,
.icon-button {
  vertical-align: middle;
}

.button > svg,
.text-button > svg,
.icon-button > svg,
.back-link > svg {
  display: block;
  flex: 0 0 auto;
}

.icon-button {
  flex-shrink: 0;
  padding: 8px;
}

.image-chip .icon-button {
  padding: 0;
}

.icon-button:disabled,
.button:disabled:not([aria-busy="true"]) {
  cursor: not-allowed;
}

/* Long project names keep their space instead of competing with export actions. */
.page-heading {
  flex-wrap: wrap;
}

.page-heading > div:first-child {
  flex: 1 1 22rem;
}

.heading-actions {
  flex: 0 1 auto;
  justify-content: flex-end;
}

/* Inputs and action buttons share one height in list filters. */
.toolbar input,
.toolbar select,
.toolbar > .button {
  min-height: 48px;
}

.toolbar input,
.toolbar select {
  padding-block: 10px;
  line-height: 1.4;
}

.toolbar .search-field > svg {
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.toolbar > .button {
  flex-shrink: 0;
}

.toolbar select {
  max-width: 100%;
}

.row-actions,
.table-footer .pagination {
  align-items: center;
}

.table-footer .pagination {
  margin-left: auto;
  flex-shrink: 0;
}

.row-actions .icon-button,
.table-footer .icon-button {
  min-width: 40px;
  min-height: 40px;
}

/* Panel headings, counters and dismiss controls remain aligned when text wraps. */
.editor-heading h3 {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.editor-heading h3 > span {
  flex-shrink: 0;
}

.editor-heading > .icon-button {
  align-self: flex-start;
}

.summary-card dl > div {
  align-items: baseline;
}

.summary-card dd {
  font-variant-numeric: tabular-nums;
}

.form-footer,
.contract-preview-actions,
.dialog-actions {
  align-items: stretch;
}

.form-panel > .fields-grid + .button {
  margin-top: 18px;
}

.password-wrap > button {
  top: 50%;
  transform: translateY(-50%);
  min-height: 36px;
  padding: 4px 0;
}

.printable-toolbar > strong {
  flex: 1 1 15rem;
}

@media (max-width: 760px) {
  .heading-actions {
    justify-content: flex-start;
  }

  .toolbar > .button {
    flex: 1 1 100%;
  }

  .dialog-actions > .button {
    flex: 1 1 8rem;
  }
}
