.challenge-form-panel {
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(243, 206, 19, 0.35);
  border-radius: 10px;
  margin-bottom: 14px;
}
.challenge-form-panel h2 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--accent, #f3ce13);
}
.challenge-form-grid {
  display: grid;
  gap: 12px;
  max-width: 42rem;
}
.challenge-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.92);
}
.challenge-form-grid input:not(.obs-combo-input),
.challenge-form-grid select:not(.obs-select-native),
.challenge-form-grid textarea {
  font: inherit;
  font-size: 0.9rem;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(243, 206, 19, 0.45);
  background: rgba(0, 0, 0, 0.55);
  color: #f3ce13;
  box-sizing: border-box;
}
.challenge-form-grid textarea {
  min-height: 100px;
  resize: vertical;
  color: #fff;
}
.challenge-form-hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
  max-width: 72ch;
}
.challenge-form-hint a {
  color: var(--accent, #f3ce13);
}
.challenge-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.challenge-form-btn {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent, #f3ce13);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(243, 206, 19, 0.5);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: inherit;
}
.challenge-form-btn:hover:not(:disabled) {
  background: rgba(243, 206, 19, 0.12);
}
.challenge-form-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.challenge-form-btn--primary {
  background: rgba(243, 206, 19, 0.15);
  border-color: rgba(243, 206, 19, 0.85);
}
.challenge-form-status {
  margin-top: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  min-height: 1.2em;
}
.challenge-form-status.is-ok {
  color: #9fd89f;
}
.challenge-form-status.is-err {
  color: #ffb4b4;
}
.challenge-form-preview {
  margin-top: 14px;
  padding: 12px;
  border: 1px dashed rgba(243, 206, 19, 0.35);
  border-radius: 8px;
  background: rgba(243, 206, 19, 0.06);
}
.challenge-form-preview h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--accent, #f3ce13);
}
.challenge-form-preview .preview-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 6px;
}
.challenge-form-preview .preview-meta {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 8px;
}
.challenge-form-preview .preview-desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}
.cw-overlay-host {
  position: relative;
}

.cw-overlay-host.is-dialog-open::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.45);
  z-index: 15;
  pointer-events: none;
}

.challenge-card-grid .manage-item.is-dialog-open,
.challenge-form-list li.is-dialog-open {
  position: relative;
  z-index: 2;
}

.challenge-card-grid .manage-item.is-dialog-open::before,
.challenge-form-list li.is-dialog-open::before {
  border-radius: 10px;
}

.cw-inline-dialog {
  margin: 0;
  padding: 12px 14px;
  background: rgba(18, 18, 24, 0.97);
  border: 1px solid rgba(243, 206, 19, 0.55);
  border-radius: 10px;
  box-sizing: border-box;
}

.cw-inline-dialog--overlay {
  position: absolute;
  z-index: 20;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
}

.cw-inline-dialog--anchor-panel {
  top: 12px;
  right: 12px;
  left: auto;
  width: min(22rem, calc(100% - 24px));
  max-width: calc(100% - 24px);
}

.cw-inline-dialog--anchor-row {
  top: 50%;
  right: 8px;
  left: auto;
  width: min(20rem, 72%);
  max-width: calc(100% - 16px);
  transform: translateY(-50%);
}

.cw-inline-dialog[hidden] {
  display: none !important;
}

.cw-inline-dialog__title {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent, #f3ce13);
}

.cw-inline-dialog__text {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
}

.cw-inline-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.challenge-form-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.challenge-form-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.challenge-form-list li:last-child {
  border-bottom: none;
}
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.challenge-workflow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.challenge-workflow-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(243, 206, 19, 0.3);
  background: rgba(0, 0, 0, 0.45);
}

.challenge-workflow-card.is-active {
  border-color: rgba(243, 206, 19, 0.75);
  background: rgba(243, 206, 19, 0.08);
}

.challenge-workflow-card h2 {
  margin: 0 0 6px;
  font-size: 0.92rem;
  color: var(--accent, #f3ce13);
}

.challenge-workflow-card p {
  margin: 0 0 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.86);
}

.challenge-workflow-card a.challenge-form-btn {
  display: inline-block;
  text-decoration: none;
}

.challenge-form-layout {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .challenge-form-layout.has-preview {
    grid-template-columns: 1fr min(320px, 36%);
    align-items: start;
  }
}

.challenge-form-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.86rem;
  line-height: 1.45;
  border: 1px solid rgba(243, 206, 19, 0.35);
  background: rgba(243, 206, 19, 0.06);
  color: rgba(255, 255, 255, 0.9);
}

.challenge-form-notice.is-warn {
  border-color: rgba(255, 180, 80, 0.45);
  background: rgba(255, 140, 0, 0.08);
}

.challenge-form-notice[hidden] {
  display: none;
}

.challenge-form-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: 0;
  pointer-events: none;
}

.challenge-form-field-hint {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 400;
}

.challenge-form-counter {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: right;
  margin-top: 2px;
}

.challenge-form-counter.is-near-limit {
  color: rgba(243, 206, 19, 0.85);
}

.challenge-form-counter.is-over {
  color: #ffb4b4;
}

.challenge-form-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.challenge-form-success-actions[hidden] {
  display: none;
}

.challenge-form-btn--link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.challenge-form-list .list-empty {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.88rem;
  padding: 4px 0;
}

.challenge-form-list .list-item-main {
  flex: 1 1 12rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.challenge-form-list .list-item-name {
  font-weight: 700;
}

.challenge-form-list .list-item-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}

.challenge-form-btn--danger {
  color: #ffb4b4;
  border-color: rgba(255, 120, 120, 0.55);
}

.challenge-form-btn--danger:hover:not(:disabled) {
  background: rgba(255, 100, 100, 0.15);
}

.challenge-form-list .list-item-meta {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
}

.challenge-form-list .list-item-desc {
  margin: 4px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

.challenge-form-list .list-item-image {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(243, 206, 19, 0.88);
  word-break: break-all;
}

.challenge-form-section-label {
  margin: 4px 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(243, 206, 19, 0.75);
}

.challenge-form-advanced {
  margin-top: 8px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.8);
}

.challenge-form-advanced summary {
  cursor: pointer;
  color: var(--accent, #f3ce13);
  font-weight: 700;
}

.challenge-image-picker {
  display: inline-flex;
  align-items: stretch;
  flex-wrap: wrap;
  max-width: 100%;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent, #f3ce13);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(243, 206, 19, 0.5);
  border-radius: 8px;
  box-sizing: border-box;
}

.challenge-image-picker:hover {
  background: rgba(243, 206, 19, 0.12);
}

.challenge-image-picker input[type='file'] {
  font-size: 0;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  max-width: none;
}

.challenge-image-picker input[type='file']::file-selector-button {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--accent, #f3ce13);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0;
}

.challenge-image-picker.has-image input[type='file']::file-selector-button {
  border-radius: 8px 0 0 8px;
  border-right: 1px solid rgba(243, 206, 19, 0.35);
}

.challenge-image-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: min(100%, 20rem);
  padding: 4px 4px 4px 10px;
  box-sizing: border-box;
}

.challenge-image-chip[hidden] {
  display: none !important;
}

.challenge-image-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.challenge-image-chip-remove {
  flex-shrink: 0;
  cursor: pointer;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 700;
  color: var(--accent, #f3ce13);
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  margin: 0;
}

.challenge-image-chip-remove:hover {
  background: rgba(243, 206, 19, 0.12);
}
