ion-modal.fidelity-form-modal {
  --height: min(650px, calc(100vh - 16px)) !important;
  --max-height: calc(100vh - 16px) !important;
}

@media (min-height: 620px) {
  ion-modal.fidelity-form-modal ion-content::part(scroll) {
    overflow-y: hidden !important;
  }
}

.fidelity-form .form-section:nth-of-type(2) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  column-gap: 12px !important;
}

.fidelity-form .form-section:nth-of-type(2) > .form-section__heading,
.fidelity-form .form-section:nth-of-type(2) > .tf-fidelity-rule-summary {
  grid-column: 1 / -1;
}

.fidelity-form .form-section:nth-of-type(2) > .form-grid {
  display: contents !important;
}

.fidelity-form mat-form-field:has(input[name="min"]) {
  display: none !important;
}

.tf-fidelity-rule-summary {
  margin: 0 0 9px;
  border: 1px solid #d9e3f2;
  border-radius: 7px;
  background: #f7f9fc;
  padding: 9px 11px;
  color: #65748a;
  font-size: 10.5px;
  line-height: 1.4;
}

.tf-fidelity-rule-summary.is-ready {
  border-color: #bfdbcb;
  background: #f3faf6;
  color: #315f44;
}

.fidelity-form mat-form-field.tf-fidelity-invalid {
  position: relative;
  margin-bottom: 13px;
}

.fidelity-form mat-form-field.tf-fidelity-invalid::after {
  content: attr(data-error);
  position: absolute;
  right: 12px;
  bottom: -3px;
  left: 12px;
  color: #c62828;
  font-size: 9px;
  line-height: 1.2;
}

@media (max-width: 700px) {
  .fidelity-form .form-section:nth-of-type(2) {
    grid-template-columns: 1fr !important;
  }
}

.fidelities-table .tf-fidelity-period {
  white-space: nowrap;
}

.fidelities-table {
  width: 100% !important;
  min-width: 1120px !important;
  table-layout: fixed !important;
}

.fidelities-table th,
.fidelities-table td {
  vertical-align: middle !important;
}

.fidelities-table th:nth-child(1), .fidelities-table td:nth-child(1) { width: 15%; text-align: left !important; }
.fidelities-table th:nth-child(2), .fidelities-table td:nth-child(2) { width: 8%; text-align: center !important; }
.fidelities-table th:nth-child(3), .fidelities-table td:nth-child(3) { width: 12%; text-align: center !important; }
.fidelities-table th:nth-child(4), .fidelities-table td:nth-child(4) { width: 11%; text-align: right !important; }
.fidelities-table th:nth-child(5), .fidelities-table td:nth-child(5) { width: 10%; text-align: right !important; }
.fidelities-table th:nth-child(6), .fidelities-table td:nth-child(6) { width: 20%; text-align: center !important; }
.fidelities-table th:nth-child(7), .fidelities-table td:nth-child(7) { width: 8%; text-align: center !important; }
.fidelities-table th:nth-child(8), .fidelities-table td:nth-child(8) { width: 9%; text-align: center !important; }
.fidelities-table th:nth-child(9), .fidelities-table td:nth-child(9) { width: 7%; text-align: center !important; }

.fidelities-table td:nth-child(4),
.fidelities-table td:nth-child(5) {
  padding-right: 18px !important;
}
