.rule-card-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  padding-top: 4px;
}

.rule-card-group {
  min-width: 0;
}

.rule-card-group + .rule-card-group {
  padding-left: 18px;
  border-left: 1px solid var(--next-line);
}

.rule-card-group h4 {
  margin: 0 0 12px;
  color: #15803d;
  font-size: 14px;
  font-weight: 800;
}

.rule-card-details {
  display: grid;
  gap: 10px;
  margin: 0;
}

.rule-card-details div {
  display: grid;
  gap: 2px;
}

.rule-card-details dt {
  color: var(--next-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.rule-card-details dd {
  margin: 0;
  font-weight: 700;
}

.rule-current-card {
  overflow: hidden;
  border: 1px solid var(--next-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .05);
}

.rule-current-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--next-line);
  background: #f8fbf8;
}

.rule-current-head > div {
  min-width: 0;
}

.rule-current-head span:not(.badge) {
  display: block;
  margin-bottom: 5px;
  color: #15803d;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.rule-current-head h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.rule-current-head p {
  margin: 5px 0 0;
  color: var(--next-muted);
  font-size: 14px;
}

.rule-current-common {
  display: grid;
  grid-template-columns: minmax(190px, .32fr) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid #bbf7d0;
  background: #f0fdf4;
}

.rule-current-common-value {
  display: grid;
  gap: 3px;
}

.rule-current-common-value span {
  color: #166534;
  font-size: 12px;
  font-weight: 800;
}

.rule-current-common-value strong {
  color: #14532d;
  font-size: 24px;
  line-height: 1.1;
}

.rule-current-common p {
  margin: 0;
  color: #315c3d;
  font-size: 14px;
  line-height: 1.45;
}

.rule-current-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rule-current-group {
  min-width: 0;
  padding: 22px;
}

.rule-current-group + .rule-current-group {
  border-left: 1px solid var(--next-line);
}

.rule-current-group h4 {
  margin: 0 0 16px;
  color: #166534;
  font-size: 17px;
  font-weight: 850;
}

.rule-current-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
  margin: 0;
}

.rule-current-details div {
  min-width: 0;
}

.rule-current-details dt {
  margin-bottom: 4px;
  color: var(--next-muted);
  font-size: 12px;
  font-weight: 750;
}

.rule-current-details dd {
  margin: 0;
  color: var(--next-text);
  font-size: 16px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.rule-preset-section {
  margin-bottom: 22px;
}

.rule-preset-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rule-preset-heading h4 {
  margin: 0 0 3px;
  font-size: 17px;
  font-weight: 850;
}

.rule-preset-heading p,
.rule-preset-note {
  margin: 0;
  color: var(--next-muted);
  font-size: 13px;
}

.rule-preset-recommended {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 6px;
  background: #ecfdf3;
  color: #166534;
  font-size: 11px;
  font-weight: 800;
}

.rule-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rule-preset-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 138px;
  padding: 14px;
  border: 1px solid #d8ddda;
  border-radius: 8px;
  background: #fff;
  color: var(--next-text);
  text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

@media (hover: hover) {
  .rule-preset-card:hover {
    border-color: #86b596;
    background: #fbfefc;
  }
}

.rule-preset-card:focus-visible {
  outline: 3px solid rgba(22, 101, 52, .2);
  outline-offset: 2px;
}

.rule-preset-card[aria-pressed="true"] {
  border-color: #15803d;
  background: #eef9f1;
  box-shadow: 0 0 0 2px rgba(21, 128, 61, .16);
}

.rule-preset-card-title {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 15px;
  font-weight: 850;
}

.rule-preset-card-title::after {
  display: inline-flex;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: auto;
  border: 1px solid #b8c2bc;
  border-radius: 50%;
  color: transparent;
  content: "✓";
  font-size: 14px;
  line-height: 1;
}

.rule-preset-card[aria-pressed="true"] .rule-preset-card-title::after {
  border-color: #15803d;
  background: #15803d;
  color: #fff;
}

.rule-preset-card-title small {
  padding: 3px 6px;
  border-radius: 5px;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 850;
}

.rule-preset-card-description {
  color: #4b5f52;
  font-size: 12px;
  line-height: 1.4;
}

.rule-preset-card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-self: end;
}

.rule-preset-card-facts span {
  padding: 3px 6px;
  border: 1px solid #dbe5dd;
  border-radius: 5px;
  background: #f8faf9;
  color: #43544a;
  font-size: 10px;
  font-weight: 750;
}

.rule-preset-note {
  min-height: 20px;
  padding-top: 7px;
}

.rule-preset-help {
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid #d8e0da;
  border-radius: 8px;
  background: #fbfcfb;
}

.rule-preset-help summary {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 10px 13px;
  color: var(--next-text);
  cursor: pointer;
  list-style: none;
}

.rule-preset-help summary::-webkit-details-marker {
  display: none;
}

.rule-preset-help summary::after {
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-right: 2px solid #66726a;
  border-bottom: 2px solid #66726a;
  content: "";
  transform: rotate(45deg);
  transition: transform .15s ease;
}

.rule-preset-help[open] summary::after {
  transform: rotate(225deg);
}

.rule-preset-help summary:focus-visible {
  outline: 3px solid rgba(22, 101, 52, .2);
  outline-offset: -3px;
}

.rule-preset-help-icon {
  display: inline-flex;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #e8f5eb;
  color: #166534;
  font-size: 14px;
  font-weight: 850;
  font-style: normal;
}

.rule-preset-help summary > span:nth-child(2) {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.rule-preset-help summary strong {
  font-size: 14px;
  line-height: 1.3;
}

.rule-preset-help summary small {
  color: var(--next-muted);
  font-size: 12px;
}

.rule-preset-help-content {
  padding: 0 13px 14px;
  border-top: 1px solid #e5ebe7;
}

.rule-preset-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rule-preset-help-item {
  min-width: 0;
  padding: 13px 14px;
}

.rule-preset-help-item:nth-child(even) {
  border-left: 1px solid #e5ebe7;
}

.rule-preset-help-item:nth-child(n + 3) {
  border-top: 1px solid #e5ebe7;
}

.rule-preset-help-item span {
  display: block;
  margin-bottom: 4px;
  color: #166534;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.rule-preset-help-item p {
  margin: 0;
  color: #435048;
  font-size: 13px;
  line-height: 1.45;
}

.rule-preset-help-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 11px 14px 0;
  border-top: 1px solid #e5ebe7;
  color: #657168;
  font-size: 11px;
  line-height: 1.4;
}

.rule-preset-help-terms strong {
  color: #34453a;
}

.rule-formula-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #cfe0d3;
  border-radius: 8px;
  background: #cfe0d3;
}

.rule-formula-summary > div {
  min-width: 0;
  padding: 14px 16px;
  background: #f7fbf8;
}

.rule-formula-summary span {
  display: block;
  margin-bottom: 4px;
  color: #166534;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.rule-formula-summary strong {
  display: block;
  font-size: 14px;
  line-height: 1.45;
}

.rule-store-minimum {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
  gap: 14px;
  align-items: end;
  padding: 12px;
  border: 1px solid #d8e0da;
  border-radius: 8px;
  background: #f8faf9;
}

.rule-store-minimum .form-check-label {
  display: grid;
  gap: 2px;
}

.rule-store-minimum .form-check-label span {
  color: var(--next-muted);
  font-size: 12px;
  line-height: 1.35;
}

.rule-store-minimum .form-label {
  margin-bottom: 5px;
  font-size: 12px;
}

.rule-store-minimum.is-disabled #ruleManagerMinimumBox {
  opacity: .55;
}

.rule-form-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.rule-form-scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 22px 24px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.rule-fieldset.rule-shared-fieldset {
  height: auto;
  border-color: #bbf7d0;
  background: #f6fff8;
}

.rule-shared-layout {
  display: grid;
  grid-template-columns: minmax(190px, 220px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.rule-threshold-explanation {
  padding-top: 2px;
  color: #315c3d;
  font-size: 14px;
  line-height: 1.45;
}

.rule-threshold-explanation strong {
  display: block;
  margin-bottom: 4px;
  color: #166534;
}

.rule-threshold-explanation p {
  margin: 0;
}

.rule-prize-distribution {
  padding-top: 4px;
}

.rule-prize-distribution-head {
  display: flex;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--next-line);
}

.rule-prize-distribution-head strong {
  color: var(--next-text);
  font-size: 14px;
}

.rule-prize-distribution-head span {
  color: var(--next-muted);
  font-size: 12px;
}

.rule-form-footer {
  z-index: 2;
  flex: 0 0 auto;
  margin: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--next-line);
  background: #fff;
  box-shadow: 0 -8px 20px rgba(15, 23, 42, .06);
}

.rule-form-feedback {
  flex: 0 0 auto;
  max-height: 30dvh;
  overflow-y: auto;
  background: #fff;
}

.rule-form-feedback .alert {
  margin: 12px 24px 0;
}

@media (max-width: 575.98px) {
  .rule-modal .modal-dialog {
    height: 100dvh;
    min-height: 100dvh;
  }

  .rule-modal .modal-content {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .rule-modal .modal-header {
    flex: 0 0 auto;
    padding: 18px 16px 14px;
  }

  .rule-modal .rule-form-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}

.rule-fieldset {
  height: 100%;
  padding: 16px;
  border: 1px solid var(--next-line);
  border-radius: 14px;
}

.rule-fieldset legend {
  float: none;
  width: auto;
  margin: 0 0 12px;
  padding: 0;
  font-size: 16px;
  font-weight: 800;
}

@media (max-width: 991.98px) {
  .rule-preset-heading {
    display: grid;
  }

  .rule-preset-recommended {
    justify-self: start;
  }

  .rule-preset-grid {
    grid-template-columns: 1fr;
  }

  .rule-preset-card {
    gap: 0;
    min-height: 0;
    padding: 12px 14px;
  }

  .rule-preset-card[aria-pressed="true"] {
    gap: 8px;
  }

  .rule-preset-card:not([aria-pressed="true"]) .rule-preset-card-description,
  .rule-preset-card:not([aria-pressed="true"]) .rule-preset-card-facts {
    display: none;
  }

  .rule-preset-card-title small {
    display: none;
  }
}

@media (max-width: 640px) {

  .rule-card-groups {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .rule-current-groups,
  .rule-current-details {
    grid-template-columns: 1fr;
  }

  .rule-current-common,
  .rule-shared-layout,
  .rule-store-minimum {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .rule-current-common {
    align-items: start;
    padding: 16px;
  }

  .rule-prize-distribution-head {
    display: grid;
    justify-content: stretch;
  }

  .rule-current-group + .rule-current-group {
    border-top: 1px solid var(--next-line);
    border-left: 0;
  }

  .rule-card-group + .rule-card-group {
    padding-top: 16px;
    padding-left: 0;
    border-top: 1px solid var(--next-line);
    border-left: 0;
  }
}

@media (max-width: 480px) {

  .rule-formula-summary {
    grid-template-columns: 1fr;
  }

  .rule-preset-help-grid {
    grid-template-columns: 1fr;
  }

  .rule-preset-help-item:nth-child(even) {
    border-left: 0;
  }

  .rule-preset-help-item + .rule-preset-help-item {
    border-top: 1px solid #e5ebe7;
  }

  .rule-preset-help-content {
    padding-inline: 10px;
  }

  .rule-form-scroll {
    padding: 18px 16px 14px;
  }

  .rule-form-footer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  }

  .rule-form-feedback .alert {
    margin-inline: 16px;
  }

  .rule-form-footer .btn {
    min-width: 0;
    white-space: normal;
  }
}

.kpi-model-section + .kpi-model-section {
  margin-top: 28px;
}

.kpi-role-tabs {
  background: #f3f6f4;
  border: 1px solid #dce5df;
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
}

.kpi-role-tab {
  align-items: flex-start;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #526057;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 11px 14px;
  text-align: left;
}

.kpi-role-tab span {
  font-size: 15px;
  font-weight: 800;
}

.kpi-role-tab small {
  color: #748078;
  font-size: 12px;
  line-height: 1.35;
}

.kpi-role-tab.active {
  background: #fff;
  box-shadow: 0 2px 8px rgba(27, 45, 34, 0.08);
  color: #14753d;
}

.kpi-role-tab:focus-visible {
  outline: 3px solid rgba(25, 135, 84, 0.22);
  outline-offset: 1px;
}

.kpi-model-notice {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.kpi-model-notice > span {
  min-width: 0;
}

.kpi-model-notice .btn {
  flex: 0 0 auto;
}

.kpi-model-section > h2,
.kpi-model-section-head h2 {
  color: #1f2b24;
  font-size: 15px;
  font-weight: 800;
  margin: 0 0 12px;
}

.kpi-model-section-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-model-section-head h2 {
  margin: 0;
}

.kpi-model-section-head > span {
  background: #eef2ef;
  border-radius: 999px;
  color: #526057;
  font-size: 13px;
  font-weight: 700;
  min-width: 28px;
  padding: 4px 9px;
  text-align: center;
}

.kpi-model-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kpi-model-card {
  background: #fff;
  border: 1px solid #dce5df;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(27, 45, 34, 0.06);
  min-width: 0;
  overflow: hidden;
}

.kpi-model-card.is-active {
  border-color: #9fcdb0;
  box-shadow: 0 10px 28px rgba(23, 131, 69, 0.09);
}

.kpi-model-card-head {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 20px 20px 16px;
}

.kpi-model-card-head > div {
  min-width: 0;
}

.kpi-model-status {
  color: #68756d;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.kpi-model-status.is-active {
  color: #14753d;
}

.kpi-model-card-head h3 {
  color: #152019;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}

.kpi-model-card-head p {
  color: #66726a;
  font-size: 14px;
  line-height: 1.45;
  margin: 7px 0 0;
}

.kpi-model-period {
  background: #f3f6f4;
  border-radius: 6px;
  color: #4e5a52;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 9px;
}

.kpi-model-conditions {
  background: #edf1ee;
  border-bottom: 1px solid #edf1ee;
  border-top: 1px solid #edf1ee;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.kpi-model-conditions > div {
  background: #fff;
  min-width: 0;
  padding: 14px 20px;
}

.kpi-model-conditions span,
.kpi-model-conditions strong {
  display: block;
}

.kpi-model-conditions span {
  color: #748078;
  font-size: 12px;
  margin-bottom: 4px;
}

.kpi-model-conditions strong {
  color: #27342c;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.kpi-model-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px 18px;
}

.app-confirm-dialog {
  width: min(30rem, calc(100vw - 2rem));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  color: var(--bs-body-color);
  background: transparent;
  box-shadow: 0 1.5rem 4rem rgb(15 23 42 / 24%);
}

.app-confirm-dialog::backdrop {
  background: rgb(15 23 42 / 48%);
  backdrop-filter: blur(2px);
}

.app-confirm-dialog-card {
  display: grid;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--bs-border-color);
  border-radius: inherit;
  background: var(--bs-body-bg);
}

.app-confirm-dialog-card h2 {
  margin: 0.25rem 0 0;
  font-size: 1.25rem;
}

.app-confirm-dialog-card p {
  margin: 0;
  color: var(--bs-secondary-color);
  line-height: 1.55;
}

.app-confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

@media (max-width: 575.98px) {
  .app-confirm-dialog {
    width: calc(100vw - 1rem);
    margin: auto;
  }

  .app-confirm-dialog-card {
    padding: 1.25rem;
  }

  .app-confirm-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.rule-progressive-switch {
  background: #f6f8f6;
  border: 1px solid #dde6df;
  border-radius: 8px;
  padding: 14px 14px 14px 46px;
}

.rule-progressive-switch .form-check-input {
  margin-left: -32px;
}

.rule-progressive-switch label strong,
.rule-progressive-switch label span {
  display: block;
}

.rule-progressive-switch label strong {
  color: #26332b;
  font-size: 14px;
}

.rule-progressive-switch label span {
  color: #6c776f;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 3px;
}

.rule-tier-editor {
  border-left: 3px solid #d1a637;
  margin-top: 10px;
  padding: 4px 0 2px 12px;
}

.rule-tier-editor-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.rule-tier-list {
  display: grid;
  gap: 8px;
}

.rule-tier-row {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
}

.rule-tier-row label > span {
  color: #657168;
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.rule-tier-remove {
  align-items: center;
  display: inline-flex;
  font-size: 20px;
  height: 40px;
  justify-content: center;
  padding: 0;
  width: 40px;
}

@media (max-width: 991px) {
  .kpi-model-grid {
    grid-template-columns: 1fr;
  }

  .kpi-model-conditions {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 575px) {
  .kpi-role-tabs {
    grid-template-columns: 1fr;
  }

  .kpi-role-tab {
    padding: 10px 12px;
  }

  .kpi-model-notice {
    align-items: stretch;
    flex-direction: column;
  }

  .kpi-model-notice .btn {
    width: 100%;
  }

  .kpi-model-card-head {
    display: block;
    padding: 17px 16px 14px;
  }

  .kpi-model-period {
    display: inline-block;
    margin-top: 12px;
  }

  .kpi-model-conditions > div,
  .kpi-model-actions {
    padding-left: 16px;
    padding-right: 16px;
  }

  .kpi-model-actions .btn:not(.btn-link) {
    flex: 1 1 100%;
  }

  .rule-tier-row {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .rule-tier-row label:nth-child(2) {
    grid-column: 1 / 2;
  }

  .rule-tier-remove {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-bottom: 0;
  }
}

#rulesSection { max-width: 1200px; margin-inline: auto; }
.rule-options { padding-block: 12px; border-block-start: 1px solid #dfe6e3; }
.rule-options > summary { cursor: pointer; font-weight: 600; font-size: 15px; line-height: 1.5; padding-block: 4px; }
.rule-options > summary:focus-visible { outline: 2px solid #18794b; outline-offset: 3px; }
.rule-options > summary > span { font-size: 13px; font-weight: 400; color: #64716c; margin-left: 8px; }
.rule-options[open] > summary { margin-bottom: 16px; }
.rule-start-preview { margin-block: 16px; padding: 10px 12px; border-left: 3px solid #178459; background: #f3f8f5; font-size: 14px; line-height: 1.5; }
.rule-start-preview > .btn { margin-top: 10px; }
#ruleForm .rule-fieldset { padding: 0; border: 0; border-radius: 0; background: transparent; }
#ruleForm .rule-fieldset legend { font-size: 17px; margin-bottom: 16px; }
#ruleForm :is(.rule-fieldset, .rule-options, .rule-prize-distribution) > .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0;
}
#ruleForm :is(.rule-fieldset, .rule-options, .rule-prize-distribution) > .row > * {
  min-width: 0;
  width: auto;
  margin: 0;
  padding: 0;
}
@media (min-width: 992px) {
  #ruleForm :is(.rule-fieldset, .rule-options) > .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #ruleForm :is(.rule-fieldset, .rule-options) > .row > .col-12 {
    grid-column: 1 / -1;
  }
}
@media (min-width: 576px) {
  #ruleForm .rule-prize-distribution > .row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
#ruleForm .form-label { font-size: 14px; font-weight: 500; }
#ruleForm .form-control { min-height: 44px; font-size: 16px; }
#ruleForm .form-text { font-size: 13px; }
#ruleForm .rule-preset-section { margin-bottom: 0; }
#ruleForm .rule-formula-summary { display: grid; grid-template-columns: minmax(0, 1fr); margin-block: 16px; padding: 12px 0; border: 0; border-top: 1px solid #dfe6e3; border-radius: 0; background: transparent; gap: 10px; }
#ruleForm .rule-formula-summary > div { padding: 0; background: transparent; border: 0; }
#ruleForm .rule-formula-summary strong { font-size: 14px; font-weight: 500; line-height: 1.6; }
.kpi-model-period small { display: block; margin-top: 4px; color: #62746a; font-weight: 400; }
.kpi-model-notice > div { min-width: 0; overflow-wrap: anywhere; }
.kpi-mutation-details { margin-top: 8px; }
.kpi-mutation-details summary { cursor: pointer; font-weight: 600; }
.kpi-mutation-details ul { margin: 8px 0 0; padding-left: 20px; }
.kpi-mutation-details li + li { margin-top: 6px; }
#ruleSubmitButton { min-width: 160px; min-height: 44px; white-space: normal; }
.kpi-model-period { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.kpi-model-history { margin-top: 20px; }
.kpi-model-history-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-block: 14px; border-top: 1px solid #e2e7e4; }
.kpi-model-history-row small { display: block; margin-top: 4px; color: #63716b; }
.kpi-model-history-row > div:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 575px) {
  .rule-options > summary > span { display: block; margin-left: 0; }
  #ruleForm .rule-form-scroll { padding: 16px; }
  #ruleForm .rule-start-preview .btn { min-height: 44px; white-space: normal; }
  #rulesSection .kpi-model-history-row .btn { min-height: 44px; }
}
