.cs-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000030;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  direction: rtl;
  font-family: Tahoma, "Iranian Sans", sans-serif;
}
.cs-modal-overlay.is-open {
  display: flex;
}
.cs-modal {
  width: min(560px, 100%);
  max-height: min(92vh, 820px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1c1c1e 0%, #141416 100%);
  border: 1px solid #2b2b2d;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  color: #ededed;
  overflow: hidden;
}
.cs-modal-header,
.cs-modal-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #2b2b2d;
  flex-shrink: 0;
}
.cs-modal-footer {
  border-bottom: 0;
  border-top: 1px solid #2b2b2d;
  justify-content: space-between;
}
.cs-modal-title {
  margin: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.cs-modal-close,
.cs-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
}
.cs-modal-close {
  width: 36px;
  height: 36px;
  background: #2b2b2d;
  color: #fff;
}
.cs-btn {
  padding: 8px 14px;
  background: #2b2b2d;
  color: #ededed;
}
.cs-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.cs-btn-primary {
  background: #e0474b;
  color: #fff;
  font-weight: 700;
}
.cs-modal-body {
  flex: 1;
  overflow: auto;
  padding: 12px 14px 16px;
}
.cs-error {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(224, 71, 75, 0.18);
  color: #ffb4b6;
  font-size: 13px;
}
.cs-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #bdbdbd;
}
.cs-hub-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.cs-save-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-save-card {
  padding: 10px;
  border: 1px solid #2b2b2d;
  border-radius: 12px;
  background: #18181a;
}
.cs-save-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cs-save-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}
.cs-save-card.is-applied {
  border-color: #e0474b;
}
.cs-save-name {
  font-weight: 700;
}
.cs-save-meta {
  font-size: 12px;
  color: #9a9a9a;
}
.cs-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cs-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #2b2b2d;
  font-size: 12px;
}
.cs-chip.is-disabled {
  opacity: 0.55;
  text-decoration: line-through;
}
.cs-badge {
  font-size: 10px;
  color: #ffb4b6;
}
.cs-step-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 11px;
  color: #8a8a8a;
}
.cs-step-nav span.is-active {
  color: #e0474b;
  font-weight: 700;
}
.cs-tray {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #111;
  border: 1px solid #2b2b2d;
  font-size: 13px;
}
.cs-tray.is-ok {
  border-color: #3d8b4a;
}
.cs-tray.is-bad {
  border-color: #e0474b;
}
.cs-section-title {
  margin: 14px 0 8px;
  font-size: 13px;
  color: #e0474b;
}
.cs-scenario-block {
  margin-bottom: 12px;
}
.cs-scenario-name {
  margin: 0 0 6px;
  font-size: 12px;
  color: #cfcfcf;
}
.cs-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}
.cs-role-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px;
  border-radius: 10px;
  background: #1a1a1c;
  border: 1px solid #2b2b2d;
  text-align: center;
}
.cs-role-card.is-disabled {
  opacity: 0.45;
  filter: grayscale(0.7);
}
.cs-role-card img {
  width: 72px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  background: #000;
}
.cs-role-card-name {
  font-size: 11px;
  line-height: 1.3;
  min-height: 2.6em;
}
.cs-role-card-team {
  font-size: 10px;
  color: #9a9a9a;
}
.cs-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cs-qty button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 6px;
  background: #2b2b2d;
  color: #fff;
  cursor: pointer;
}
.cs-qty button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.cs-choice-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cs-choice {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #2b2b2d;
  background: #18181a;
  cursor: pointer;
}
.cs-choice.is-selected,
.cs-choice:has(input:checked) {
  border-color: #e0474b;
}
.cs-choice input {
  margin-left: 8px;
}
.cs-role-card.is-similar-blocked {
  opacity: 0.55;
}
.cs-check {
  margin-top: 12px;
}
.cs-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.cs-field label {
  font-size: 13px;
  font-weight: 600;
}
.cs-field input,
.cs-field select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #2b2b2d;
  background: #111;
  color: #fff;
  font: inherit;
}
.cs-disabled-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.cs-disabled-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #2a1a1a;
  font-size: 12px;
}
.cs-empty {
  color: #8a8a8a;
  font-size: 13px;
}
