.patch-scope-card {
  border: 1px solid #e9edf4;
}

.patch-scope-card .form-check-input {
  margin-top: 0.35rem;
}

.patch-note {
  font-size: 0.82rem;
  color: #6c757d;
}

.patch-summary {
  font-size: 0.87rem;
  color: #495057;
}

.patch-code {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
}

.patch-script-box {
  min-height: 140px;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.patch-script-entry {
  background: #fbfcfe;
  border-color: #dbe5f0 !important;
}

.patch-script-empty {
  border: 1px dashed #ced4da;
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
  color: #6c757d;
  background: #f8f9fa;
}

.patch-card-header {
  border-bottom: 1px solid #edf1f7;
}

.scope-chip {
  display: inline-flex;
  align-items: center;
  margin: 0 0.3rem 0.3rem 0;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.lookup-text {
  font-size: 0.83rem;
  color: #6c757d;
}

/* Select2 tweaks so the widget lines up with Bootstrap form controls. */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  min-height: calc(1.5em + 0.75rem + 2px);
  border-color: #ced4da;
  border-radius: 0.25rem;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: calc(1.5em + 0.75rem);
  padding-left: 0.75rem;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: calc(1.5em + 0.75rem);
}

/* Multi-select selected tags: dark text on a light blue background
so they are always legible, regardless of inherited color rules. */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: #cfe2ff !important;
  color: #052c65 !important;
  border: 1px solid #9ec5fe !important;
  padding: 0.1rem 0.5rem !important;
  margin-top: 0.25rem !important;
  margin-right: 0.25rem !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__display {
  color: #052c65 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color: #052c65 !important;
  background-color: transparent !important;
  border: 0 !important;
  margin-right: 0.3rem !important;
  font-weight: 700;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus {
  color: #842029 !important;
  background-color: transparent !important;
}

/* Dropdown results: dark text on white, blue highlight on hover/keyboard */
.select2-container--default .select2-results__option {
  color: #212529;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted {
  background-color: #0d6efd !important;
  color: #ffffff !important;
}

/* Disabled state: grey out the container without hurting tag legibility */
.select2-container--disabled .select2-selection {
  background-color: #e9ecef !important;
}

.select2-container--disabled .select2-selection--multiple .select2-selection__choice {
  background-color: #dee2e6 !important;
  color: #495057 !important;
  border-color: #ced4da !important;
}

.select2-container--disabled .select2-selection--multiple .select2-selection__choice__display,
.select2-container--disabled .select2-selection--multiple .select2-selection__choice__remove {
  color: #495057 !important;
}

.patch-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.patch-delete-form {
  display: inline-flex;
  margin: 0;
}

.patch-delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border-radius: 999px;
  box-shadow: 0 0.15rem 0.45rem rgba(220, 53, 69, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.patch-delete-button:hover,
.patch-delete-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0.35rem 0.75rem rgba(220, 53, 69, 0.16);
}

.patch-action-icon {
  width: 0.95rem;
  height: 0.95rem;
}

