.challenge-editor-info-banner {
  margin: 0.75rem 1.5rem 0;
  padding: 0.6rem 1rem;
  background: #eef6ff;
  border: 1px solid #b6d8ff;
  border-radius: 6px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.challenge-editor {
  padding: 0 1.5rem 2rem;
}

.challenge-editor-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.challenge-editor-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
}

.challenge-editor-toprow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.challenge-editor-toprow-actions .btn-edit {
  width: auto;
  white-space: nowrap;
}

.challenge-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
}

.challenge-editor-section {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.challenge-editor-section h3 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}

.challenge-editor-section--wide {
  grid-column: 1 / -1;
}

.challenge-editor-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #444;
}

.challenge-editor-field input,
.challenge-editor-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
}

.challenge-editor-save-settings-btn {
  align-self: flex-start;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  border: none;
}

.challenge-editor-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 12rem;
  overflow-y: auto;
}

.challenge-editor-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f7f7f9;
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.challenge-editor-delete-btn {
  background: none;
  border: none;
  color: #b33;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.25rem;
}

.challenge-editor-delete-btn:hover {
  color: #800;
}

.challenge-editor-add-row {
  display: flex;
  gap: 0.5rem;
}

.challenge-editor-add-row input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
}

.challenge-editor-challenge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.challenge-editor-challenge-card {
  width: 16rem;
  max-width: 100%;
  background: #fbfbfc;
  border: 1px solid #e6e6ea;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.challenge-editor-add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #bbb;
  color: #bbb;
  font-size: 1rem;
  cursor: pointer;
}

.challenge-editor-add-card:hover {
  border-color: rgb(5, 39, 103);
  color: rgb(5, 39, 103);
}

.challenge-editor-challenge-card--success {
  background: #eaf7ea;
  border-color: #bfe3bf;
}

.challenge-editor-challenge-card--failure {
  background: #fdeaea;
  border-color: #f0bcbc;
}

.challenge-editor-challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.challenge-editor-points {
  font-size: 0.8rem;
  color: #2a8a2a;
  font-weight: 600;
  white-space: nowrap;
}

.challenge-editor-challenge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.challenge-editor-tag-chip {
  background: #e9ecf5;
  color: rgb(5, 39, 103);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.75rem;
}

.challenge-editor-failure-info {
  font-size: 0.75rem;
  color: #b33;
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.challenge-editor-repeat-info {
  font-size: 0.75rem;
  color: #6c757d;
}

.challenge-editor-pictures {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid #e6e6ea;
  padding-top: 0.5rem;
  margin-top: 0.25rem;
}

.challenge-editor-picture-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.challenge-editor-picture-meta {
  font-size: 0.75rem;
  color: #6c757d;
  width: 100%;
}

.challenge-editor-picture-thumb {
  width: 3.5rem;
  height: 3.5rem;
  object-fit: cover;
  border-radius: 6px;
}

.challenge-editor-picture-download,
.challenge-editor-picture-upload-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(5, 39, 103);
}

.challenge-editor-picture-error {
  font-size: 0.75rem;
  color: #b33;
}

.challenge-editor-challenge-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: auto;
}

.challenge-editor-modal {
  width: 26rem;
}

.challenge-editor-import-modal {
  width: 32rem;
  max-height: 80vh;
  overflow-y: auto;
}

.challenge-editor-tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.challenge-editor-tag-option {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  background: #f0f0f4;
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
}

.challenge-editor-muted {
  font-size: 0.75rem;
  color: #6c757d;
}

.challenge-editor-checkbox-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.challenge-editor-import-challenges-heading {
  margin-top: 1rem;
}

.challenge-editor-import-challenge {
  border-bottom: 1px solid #eee;
  padding: 0.4rem 0;
}

.challenge-editor-import-tag-picker {
  margin-left: 1.5rem;
  margin-top: 0.3rem;
}

.challenge-editor-danger-zone {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1.25rem;
}

.challenge-editor-danger-link {
  background: none;
  border: none;
  color: #ccc;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem;
}

.challenge-editor-danger-link:hover {
  color: #b33;
}

.challenge-editor-danger-confirm-btn {
  background-image: none;
  background: #b33;
}

.challenge-editor-danger-confirm-btn:hover {
  background: #800;
  opacity: 1;
}

@media (max-width: 640.98px) {
  .challenge-editor-info-banner {
    margin: 0.75rem 1rem 0;
    flex-wrap: wrap;
  }

  .challenge-editor {
    padding: 0 1rem 2rem;
  }

  .challenge-editor-modal,
  .challenge-editor-import-modal {
    width: 22rem;
  }
}
