/* mf6 forms: one system for app pages, dialogs, drawers and filters */
body.mf6 .mf6-form,
body.mf6 .compact-form,
body.mf6 .module-form-v524k {
  display: grid;
  gap: var(--mf6-space-4);
}

body.mf6 .mf6-form-grid,
body.mf6 .two-col-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--mf6-space-4);
}

body.mf6 .field,
body.mf6 .form-field,
body.mf6 .mf6-field,
body.mf6 .mf-form-field-entry_type {
  display: grid;
  gap: .38rem;
  min-width: 0;
}

body.mf6 .field > span,
body.mf6 .mf6-field > span,
body.mf6 .form-field > label,
body.mf6 .mf-form-field-entry_type > span {
  color: var(--mf6-text);
  font-size: var(--mf6-type-xs);
  font-weight: 900;
  letter-spacing: .02em;
}

body.mf6 .field small,
body.mf6 .mf6-field small,
body.mf6 .check-note {
  color: var(--mf6-muted);
  font-size: var(--mf6-type-xs);
  font-weight: 700;
  line-height: 1.45;
}

body.mf6 .checkbox-field,
body.mf6 .checkbox-line,
body.mf6 .checkbox-line-v45,
body.mf6 .mf6-checkbox-row,
body.mf6 .choice-card {
  display: flex !important;
  align-items: flex-start;
  gap: .55rem;
  min-height: 2rem;
  padding: .24rem 0;
  color: var(--mf6-text);
  font-weight: 780;
}

body.mf6 .choice-card-group {
  display: grid;
  gap: var(--mf6-space-2);
}

body.mf6 .mf6-filter-bar,
body.mf6 .filter-form,
body.mf6 .storylogic-filter-v40a,
body.mf6 .storycontrol-filter-v44,
body.mf6 .knowledge-filter-v43,
body.mf6 .timeline-filter-v520e,
body.mf6 .knowledge-filter-v20 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  align-items: end;
  gap: var(--mf6-space-3);
  padding: var(--mf6-space-4);
  border: 1px solid var(--mf6-line);
  border-radius: var(--mf6-radius-md);
  background: #fff;
  box-shadow: none;
}

body.mf6 .mf6-filter-bar .btn,
body.mf6 .filter-form .btn,
body.mf6 .storylogic-filter-v40a .btn,
body.mf6 .storycontrol-filter-v44 .btn {
  width: 100%;
}

body.mf6 .mf6-form-actions,
body.mf6 .mf6-action-bar,
body.mf6 .form-actions,
body.mf6 .mf-form-page-actions-v524m5,
body.mf6 .chapter-form-actions-v45,
body.mf6 .codex-create-actions-v523b {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--mf6-space-3);
  padding-top: var(--mf6-space-3);
}

body.mf6 .mf6-upload-field input[type="file"],
body.mf6 input[type="file"] {
  width: 100%;
  padding: .56rem;
  border: 1px solid var(--mf6-line-strong);
  border-radius: var(--mf6-radius-md);
  background: #fff;
}

body.mf6 .errorlist,
body.mf6 .error {
  margin: .25rem 0 0;
  color: var(--mf6-danger);
  font-size: var(--mf6-type-xs);
  font-weight: 800;
}

/* v6.2i12-mf6-dark-surface-audit-contract
   Form controls consume the shared mf6 field/control tokens in every theme. */
body.mf6 :is(.mf6-form, .mf6-form-card, .mf6-form-section, .mf6-fieldset) {
  background: var(--mf6-surface-raised) !important;
  color: var(--mf6-text) !important;
  border-color: var(--mf6-line) !important;
}

body.mf6 :is(.mf6-field, .mf6-checkbox-row, .mf6-radio-row) {
  color: var(--mf6-text) !important;
}
