*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--colorNeutralBackground2);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--colorNeutralBackground2);
  color: var(--colorNeutralForeground1);
  font-family: var(--fontFamilyBase);
  font-size: var(--fontSizeBase300);
  line-height: var(--lineHeightBase300);
  -webkit-font-smoothing: antialiased;
}

.app-root {
  min-height: 100vh;
}

h1, h2, h3, p {
  margin-block-start: 0;
}

h1 {
  font-size: var(--fontSizeBase600);
  font-weight: var(--fontWeightSemibold);
  line-height: var(--lineHeightBase600);
  margin-block-end: var(--spacingVerticalS);
}

h2 {
  font-size: var(--fontSizeBase500);
  font-weight: var(--fontWeightSemibold);
  line-height: var(--lineHeightBase500);
  margin-block-end: var(--spacingVerticalM);
}

h3 {
  font-size: var(--fontSizeBase400);
  font-weight: var(--fontWeightSemibold);
  line-height: var(--lineHeightBase400);
  margin-block-end: var(--spacingVerticalM);
}

.container {
  width: min(100% - 32px, 1280px);
  margin: var(--spacingVerticalXL) auto;
}

.topbar {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--zIndexContent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding-inline: var(--spacingHorizontalXXL);
  background: var(--colorNeutralBackground1);
  border-block-end: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
  box-shadow: var(--shadow2);
}

.topbar nav,
.profile-dialog-header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacingHorizontalM);
}

.logo {
  color: var(--colorNeutralForeground1);
  font-size: var(--fontSizeBase400);
  font-weight: var(--fontWeightSemibold);
}

#nav-user {
  color: var(--colorNeutralForeground3);
  font-size: var(--fontSizeBase200);
}

.login-page .app-root {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: var(--spacingVerticalXXL);
}

.login-card,
.upload-card,
.flow-diagram-section,
.review-layout > section,
.profiles-overview,
.profiles-list-panel,
.matcher-condition-row,
.live-calc-panel,
.run-card,
.toast {
  background: var(--colorNeutralBackground1);
  border: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
  border-radius: var(--borderRadiusLarge);
  box-shadow: var(--shadow2);
}

.login-card {
  width: min(100%, 380px);
  padding: var(--spacingVerticalXXL) var(--spacingHorizontalXXL);
}

.login-card h1 {
  text-align: center;
}

.field,
.field-row {
  display: flex;
  flex-direction: column;
  gap: var(--spacingVerticalXS);
  min-width: 0;
}

.field {
  margin-block-end: var(--spacingVerticalL);
}

.field label,
.field-row > span,
.field-row > label,
.modal-copy {
  color: var(--colorNeutralForeground2);
  font-size: var(--fontSizeBase200);
  font-weight: var(--fontWeightSemibold);
}

fluent-text-input,
fluent-textarea,
fluent-dropdown,
.field-input,
.login-submit {
  width: 100%;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--spacingHorizontalM);
  margin-block-end: var(--spacingVerticalXL);
}

.stat-card {
  min-height: 84px;
}

fluent-button.stat-card,
.stat-24h {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--spacingVerticalXS);
  padding: var(--spacingVerticalM) var(--spacingHorizontalL);
  text-align: center;
}

.stat-24h {
  color: var(--colorNeutralForeground2);
}

.stat-count,
.flow-count {
  color: var(--colorNeutralForeground1);
  font-size: var(--fontSizeBase600);
  font-weight: var(--fontWeightSemibold);
  line-height: var(--lineHeightBase600);
}

.stat-label,
.flow-label,
.summary-label {
  color: var(--colorNeutralForeground3);
  font-size: var(--fontSizeBase200);
  font-weight: var(--fontWeightSemibold);
  text-transform: uppercase;
}

.upload-card,
.flow-diagram-section,
.profiles-overview,
.profiles-list-panel,
.review-layout > section {
  padding: var(--spacingVerticalL) var(--spacingHorizontalXXL);
}

.upload-card {
  margin-block-end: var(--spacingVerticalXL);
}

.drop-zone {
  display: grid;
  min-height: 140px;
  place-items: center;
  gap: var(--spacingVerticalXS);
  padding: var(--spacingVerticalXXL);
  border: var(--strokeWidthThicker) dashed var(--colorNeutralStroke1);
  border-radius: var(--borderRadiusMedium);
  color: var(--colorNeutralForeground2);
  cursor: pointer;
  text-align: center;
}

.drop-zone:hover,
.drop-zone.dragover {
  background: var(--colorBrandBackground2);
  border-color: var(--colorBrandStroke1);
}

.drop-zone input[type="file"] {
  display: none;
}

.drop-zone-text {
  font-weight: var(--fontWeightSemibold);
}

.drop-zone-hint,
.upload-selected .file-info,
.profile-result-count,
.profile-fact,
.profile-identity span,
.pagination-info,
.na {
  color: var(--colorNeutralForeground3);
  font-size: var(--fontSizeBase200);
}

.upload-selected,
.toolbar,
.filters,
.review-actions,
.requeue-actions,
.downloads-row,
.pagination,
.profile-commandbar,
.matcher-toolbar,
.profile-actions,
.profile-row-actions,
.profiles-meta,
.profile-list-facts {
  display: flex;
  align-items: center;
  gap: var(--spacingHorizontalS);
  flex-wrap: wrap;
}

.upload-selected {
  margin-block-start: var(--spacingVerticalM);
}

.upload-selected .file-info {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-result,
.error-msg,
.field-error-msg {
  font-size: var(--fontSizeBase200);
}

.upload-result {
  margin-block-start: var(--spacingVerticalM);
  padding: var(--spacingVerticalS) var(--spacingHorizontalM);
  border-radius: var(--borderRadiusMedium);
}

.upload-result.success {
  background: var(--colorStatusSuccessBackground1);
  color: var(--colorStatusSuccessForeground1);
}

.upload-result.error,
.error-msg,
.field-error-msg {
  color: var(--colorStatusDangerForeground1);
}

.upload-result.error,
.iban-change-banner {
  background: var(--colorStatusDangerBackground1);
}

.toolbar {
  justify-content: space-between;
  margin-block-end: var(--spacingVerticalM);
}

.filters {
  justify-content: flex-end;
}

.filters fluent-dropdown,
.profile-status-filter {
  min-width: 180px;
}

.data-table,
#line-items-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  background: var(--colorNeutralBackground1);
  border: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
  border-radius: var(--borderRadiusLarge);
  box-shadow: var(--shadow2);
}

.data-table th,
.data-table td,
#line-items-table th,
#line-items-table td {
  padding: var(--spacingVerticalS) var(--spacingHorizontalM);
  border-block-end: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
  text-align: start;
  vertical-align: top;
}

.data-table th,
#line-items-table th {
  background: var(--colorNeutralBackground2);
  color: var(--colorNeutralForeground2);
  font-size: var(--fontSizeBase200);
  font-weight: var(--fontWeightSemibold);
  text-transform: uppercase;
}

.data-table tr:last-child td,
#line-items-table tr:last-child td {
  border-block-end: 0;
}

.data-table tbody tr:hover td,
#line-items-table tbody tr:hover td {
  background: var(--colorNeutralBackground2);
}

.badge {
  vertical-align: middle;
}

.review-layout {
  display: flex;
  flex-direction: column;
  gap: var(--spacingVerticalL);
}

.meta-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: var(--spacingVerticalS) var(--spacingHorizontalL);
}

.meta-key {
  color: var(--colorNeutralForeground3);
  font-weight: var(--fontWeightSemibold);
}

.meta-val {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quick-summary-header,
.profiles-title-row,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--spacingHorizontalL);
}

.quick-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacingVerticalM) var(--spacingHorizontalL);
}

.summary-item {
  min-width: 0;
}

.summary-value {
  overflow-wrap: anywhere;
  font-weight: var(--fontWeightSemibold);
}

.iban-change-banner {
  display: flex;
  gap: var(--spacingHorizontalM);
  color: var(--colorStatusDangerForeground1);
}

.review-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacingHorizontalL);
}

.checkbox-option {
  display: inline-flex;
  align-items: center;
  gap: var(--spacingHorizontalS);
  color: var(--colorNeutralForeground2);
  font-size: var(--fontSizeBase300);
  font-weight: var(--fontWeightRegular);
}

.switch-option {
  display: inline-flex;
  align-items: center;
  gap: var(--spacingHorizontalS);
  color: var(--colorNeutralForeground2);
  font-size: var(--fontSizeBase300);
}

#corrections-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacingVerticalL);
}

fieldset {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--spacingVerticalM) var(--spacingHorizontalL);
  min-width: 0;
  margin: 0;
  padding: var(--spacingVerticalL);
  border: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
  border-radius: var(--borderRadiusLarge);
}

legend {
  padding-inline: var(--spacingHorizontalS);
  font-weight: var(--fontWeightSemibold);
}

#fs-lineitems {
  display: block;
  overflow-x: auto;
}

.field-row.field-error,
.review-highlight-errors tr.row-error td,
.review-highlight-errors .line-error-detail-row td {
  background: var(--colorStatusDangerBackground1);
  border-radius: var(--borderRadiusMedium);
}

.review-filter-errors .field-row[data-review-error="false"],
.review-filter-errors fieldset[data-has-errors="false"],
.review-filter-errors .live-calc-panel[data-has-errors="false"],
.review-filter-errors .live-calc-row[data-review-error="false"],
.review-filter-errors tr[data-line-error="false"],
.review-filter-errors .screenshot-row[data-line-error="false"] {
  display: none;
}

.field-screenshot {
  display: block;
  max-width: min(100%, 680px);
  max-height: 320px;
  margin-block-start: var(--spacingVerticalS);
  border: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
  border-radius: var(--borderRadiusMedium);
  object-fit: contain;
}

.field-screenshot[data-loaded="true"]:not(.screenshot-error) {
  cursor: zoom-in;
}

.screenshot-error {
  min-height: 80px;
  background: var(--colorNeutralBackground3);
}

.screenshot-popover {
  position: fixed;
  inset: 0;
  z-index: calc(var(--zIndexMessages) + 1);
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 48px);
}

.screenshot-popover-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.68);
  cursor: zoom-out;
}

.screenshot-popover-panel {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: min(96vw, 1200px);
  max-height: 92vh;
  padding: var(--spacingVerticalM);
  background: var(--colorNeutralBackground1);
  border: var(--strokeWidthThin) solid var(--colorNeutralStroke1);
  border-radius: var(--borderRadiusLarge);
  box-shadow: var(--shadow64);
}

.screenshot-popover-image {
  display: block;
  max-width: calc(96vw - 32px);
  max-height: calc(92vh - 48px);
  object-fit: contain;
}

.screenshot-popover-close {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-end: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--colorNeutralForegroundOnBrand);
  background: rgba(0, 0, 0, 0.72);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  font-weight: var(--fontWeightSemibold);
  line-height: 32px;
}

.screenshot-popover-open {
  overflow: hidden;
}

.live-calc-panel {
  display: grid;
  gap: var(--spacingVerticalS);
  margin-block-start: var(--spacingVerticalL);
  padding: var(--spacingVerticalM) var(--spacingHorizontalL);
  box-shadow: none;
}

.live-calc-heading {
  margin-block-end: 0;
}

.live-calc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--spacingHorizontalM);
}

.live-calc-value {
  font-variant-numeric: tabular-nums;
}

.review-actions,
.requeue-actions,
.downloads-row,
.pagination,
.profile-actions {
  justify-content: flex-end;
}

.job-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--spacingHorizontalS);
}

.run-card {
  display: grid;
  gap: var(--spacingVerticalS);
  margin-block-end: var(--spacingVerticalS);
  padding: var(--spacingVerticalM) var(--spacingHorizontalM);
}

.usage {
  max-width: 100%;
  overflow: auto;
  margin: 0;
  padding: var(--spacingVerticalS) var(--spacingHorizontalM);
  background: var(--colorNeutralBackground2);
  border-radius: var(--borderRadiusMedium);
  font-family: var(--fontFamilyMonospace);
}

.run-profile,
.audit-event-detail {
  color: var(--colorNeutralForeground3);
  font-size: var(--fontSizeBase200);
}

.audit-event-detail {
  margin-block-start: var(--spacingVerticalXS);
}

.flow-diagram-section {
  margin-block-end: var(--spacingVerticalXL);
}

.flow-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacingVerticalS);
}

.flow-row {
  display: grid;
  justify-content: center;
  gap: var(--spacingHorizontalM);
  width: 100%;
}

.flow-row--sources {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.flow-row--single {
  grid-template-columns: minmax(160px, 220px);
}

.flow-row--outcomes {
  grid-template-columns: repeat(2, minmax(140px, 220px));
}

.flow-node {
  display: flex;
  min-height: 72px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacingVerticalM) var(--spacingHorizontalM);
  border: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
  border-radius: var(--borderRadiusLarge);
  text-align: center;
}

.flow-arrow {
  color: var(--colorNeutralForeground3);
}

.pagination {
  margin-block-start: var(--spacingVerticalL);
}

.pagination-info {
  margin-inline-start: auto;
}

.toast-container {
  position: fixed;
  inset-block-end: var(--spacingVerticalXXL);
  inset-inline-end: var(--spacingHorizontalXXL);
  z-index: var(--zIndexMessages);
  display: flex;
  max-width: min(360px, calc(100vw - 32px));
  flex-direction: column;
  gap: var(--spacingVerticalS);
  pointer-events: none;
}

.toast {
  display: flex;
  gap: var(--spacingHorizontalS);
  padding: var(--spacingVerticalM) var(--spacingHorizontalL);
  pointer-events: auto;
}

.toast--success {
  border-color: var(--colorStatusSuccessBorder1);
}

.toast--error {
  border-color: var(--colorStatusDangerBorder1);
}

.toast--info {
  border-color: var(--colorBrandStroke1);
}

.toast-message {
  color: var(--colorNeutralForeground1);
}

.profiles-page {
  max-width: 1440px;
}

.profiles-page,
.profile-form,
.profile-form-block,
.profiles-list,
.matcher-conditions {
  display: flex;
  flex-direction: column;
  gap: var(--spacingVerticalL);
}

.profiles-meta {
  margin-block-start: var(--spacingVerticalS);
}

.profile-commandbar {
  margin-block-start: var(--spacingVerticalL);
}

.profile-search {
  flex: 1 1 280px;
  min-width: 220px;
}

.profiles-list-wrap {
  overflow: hidden;
  border: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
  border-radius: var(--borderRadiusLarge);
}

.profile-list-message,
.profiles-empty {
  color: var(--colorNeutralForeground3);
  padding: var(--spacingVerticalL) var(--spacingHorizontalL);
}

.profiles-empty {
  margin-block-start: var(--spacingVerticalM);
  border: var(--strokeWidthThin) dashed var(--colorNeutralStroke1);
  border-radius: var(--borderRadiusLarge);
  text-align: center;
}

.profile-list-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.4fr) auto auto;
  align-items: center;
  gap: var(--spacingHorizontalL);
  min-height: 76px;
  padding: var(--spacingVerticalM) var(--spacingHorizontalL);
  border-block-end: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
  cursor: pointer;
}

.profile-list-item:last-child {
  border-block-end: 0;
}

.profile-list-item:hover,
.profile-list-item.is-selected {
  background: var(--colorNeutralBackground2);
}

.profile-list-item.is-selected {
  box-shadow: inset var(--strokeWidthThicker) 0 0 var(--colorBrandStroke1);
}

.profile-identity,
.profile-list-detail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--spacingVerticalXS);
}

.profile-identity strong,
.matcher-summary {
  overflow-wrap: anywhere;
}

.profile-list-state {
  display: flex;
}

.profile-form {
  margin-block-start: var(--spacingVerticalL);
}

.profile-editor-dialog {
  --profile-dialog-height: min(840px, calc(100vh - 48px));
  --profile-dialog-width: min(1120px, calc(100vw - 48px));
  --profile-dialog-form-height: min(672px, calc(100vh - 168px));
}

.profile-editor-dialog::part(dialog) {
  width: var(--profile-dialog-width);
  max-width: var(--profile-dialog-width);
  height: var(--profile-dialog-height);
  max-height: var(--profile-dialog-height);
  overflow: hidden;
}

.profile-editor-dialog fluent-dialog-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
}

.profile-editor-dialog fluent-dialog-body::part(content) {
  min-block-size: 0;
  overflow: hidden;
}

.profile-editor-dialog fluent-dialog-body::part(actions) {
  border-block-start: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
}

.profile-editor-dialog .profile-form {
  block-size: var(--profile-dialog-form-height);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: var(--spacingVerticalL);
  min-block-size: 0;
  overflow: hidden;
}

.profile-editor-dialog .profile-actions {
  width: 100%;
  justify-content: flex-end;
  padding-block-start: 0;
  border-block-start: 0;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacingVerticalM) var(--spacingHorizontalL);
}

.profile-tabs {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--spacingVerticalM);
  inline-size: 100%;
  min-block-size: 0;
  min-width: 0;
  overflow: hidden;
}

.profile-tab-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  inline-size: 100%;
  min-block-size: 0;
  overflow: hidden;
  padding-block-start: var(--spacingVerticalS);
  padding-inline-end: var(--spacingHorizontalXS);
}

.profile-tab-panel[hidden] {
  display: none !important;
}

.profile-tab-panel .field-row,
#profile-panel-adjustment .profile-form-block {
  inline-size: 100%;
  max-inline-size: 100%;
  width: 100%;
}

#profile-panel-matcher > .profile-form-block {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--spacingVerticalL);
  min-block-size: 0;
  overflow: hidden;
}

#matcher-conditions {
  min-block-size: 0;
  overflow-y: auto;
  padding-inline-end: var(--spacingHorizontalXS);
}

.profile-adjustment-block {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--spacingVerticalL);
  min-block-size: 0;
  overflow: hidden;
}

.profile-adjustment-grid {
  margin: 0;
}

.profile-textarea-row {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  block-size: 100%;
  min-block-size: 0;
}

.profile-switch-row {
  align-items: flex-start;
}

.profile-prompt-input,
.profile-json-input {
  --block-size: 100%;
  --inline-size: 100%;
  --min-block-size: 180px;
  display: block;
  align-self: stretch;
  block-size: 100%;
  flex: 1 1 auto;
  inline-size: 100%;
  max-inline-size: 100%;
  min-block-size: 0;
  min-height: 0;
  width: 100%;
  font-family: var(--fontFamilyMonospace);
}

.profile-json-input {
  --min-block-size: 260px;
}

.profile-actions {
  padding-block-start: var(--spacingVerticalM);
  border-block-start: var(--strokeWidthThin) solid var(--colorNeutralStroke2);
}

.matcher-toolbar {
  justify-content: space-between;
}

.toolbar-title {
  font-weight: var(--fontWeightSemibold);
}

.matcher-condition-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: end;
  gap: var(--spacingVerticalM) var(--spacingHorizontalM);
  padding: var(--spacingVerticalL) var(--spacingHorizontalL);
  box-shadow: none;
}

.matcher-row-index {
  display: inline-flex;
  align-items: center;
  align-self: start;
  justify-content: center;
  grid-column: 1;
  grid-row: 1;
  width: 24px;
  height: 24px;
  border-radius: var(--borderRadiusCircular);
  background: var(--colorNeutralBackground3);
  color: var(--colorNeutralForeground2);
  font-size: var(--fontSizeBase200);
  font-weight: var(--fontWeightSemibold);
}

.matcher-field-cell,
.matcher-op-cell,
.matcher-value-cell,
.matcher-remove {
  grid-column: 1 / -1;
  min-width: 0;
}

.matcher-field-cell {
  grid-column: 2;
}

.profile-row-actions {
  justify-content: flex-end;
}

.hidden {
  display: none !important;
}

@media (min-width: 720px) {
  .profile-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .matcher-condition-row {
    grid-template-columns: 28px minmax(220px, 1fr) minmax(180px, .8fr);
  }

  .matcher-row-index {
    grid-row: span 2;
  }

  .matcher-field-cell,
  .matcher-op-cell {
    grid-column: auto;
  }

  .matcher-value-cell {
    grid-column: 2 / 4;
  }

  .matcher-remove {
    grid-column: 3;
    justify-self: end;
  }
}

@media (min-width: 980px) {
  .profile-editor-dialog .profile-form-grid:not(.profile-adjustment-grid) {
    grid-template-columns: minmax(0, 1fr) 180px;
  }

  .profile-adjustment-grid {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, .8fr);
  }
}

@media (min-width: 1060px) {
  .matcher-condition-row {
    grid-template-columns:
      28px
      minmax(190px, 1.1fr)
      minmax(150px, .85fr)
      minmax(260px, 1.45fr)
      auto;
  }

  .matcher-row-index {
    grid-row: auto;
    align-self: end;
    margin-block-end: var(--spacingVerticalXS);
  }

  .matcher-field-cell,
  .matcher-op-cell,
  .matcher-value-cell,
  .matcher-remove {
    grid-column: auto;
  }

  .matcher-remove {
    align-self: end;
    justify-self: end;
  }
}

@media (min-width: 1180px) {
  .profile-list-item {
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.6fr) auto auto;
  }
}

@supports (height: 1dvh) {
  .profile-editor-dialog {
    --profile-dialog-height: min(840px, calc(100dvh - 48px));
    --profile-dialog-form-height: min(672px, calc(100dvh - 168px));
  }
}

@media (max-width: 760px) {
  .profile-editor-dialog {
    --profile-dialog-height: calc(100vh - 16px);
    --profile-dialog-width: calc(100vw - 16px);
    --profile-dialog-form-height: calc(100vh - 136px);
  }

  @supports (height: 1dvh) {
    .profile-editor-dialog {
      --profile-dialog-height: calc(100dvh - 16px);
      --profile-dialog-form-height: calc(100dvh - 136px);
    }
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    gap: var(--spacingVerticalS);
    padding-block: var(--spacingVerticalM);
  }

  .stats-bar,
  .flow-row--sources,
  .flow-row--outcomes,
  .profile-list-item {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .filters,
  .quick-summary-header,
  .profiles-title-row,
  .section-heading,
  .profile-commandbar,
  .profile-actions,
  .profile-row-actions,
  .review-actions,
  .requeue-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-search,
  .profile-status-filter,
  .filters fluent-dropdown {
    min-width: 0;
    width: 100%;
  }

  .meta-grid,
  .live-calc-row {
    grid-template-columns: 1fr;
  }

  fieldset,
  .review-layout > section,
  .upload-card,
  .profiles-overview,
  .profiles-list-panel {
    padding: var(--spacingVerticalM) var(--spacingHorizontalM);
  }

  .toast-container {
    inset-inline: var(--spacingHorizontalL);
  }
}
