#chg-generator {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0;
}

#chg-generator * {
  box-sizing: border-box;
}

/* Header */
#chg-generator .chg-header {
  margin-bottom: 2rem;
}

#chg-generator .chg-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1rem 0;
  line-height: 1.2;
}

#chg-generator .chg-header p {
  font-size: 1.125rem;
  color: #4b5563;
  line-height: 1.6;
  margin: 0;
  max-width: 48rem;
}

/* Form Container */
#chg-form {
  display: contents;
}

/* Input Grid */
#chg-generator .chg-input-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

#chg-generator .chg-input-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

#chg-generator .chg-input-card label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#chg-generator .chg-input-card textarea {
  width: 100%;
  height: 7rem;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: #374151;
  font-family: inherit;
  resize: none;
  transition: all 0.2s ease;
}

#chg-generator .chg-input-card textarea::placeholder {
  color: #9ca3af;
}

#chg-generator .chg-input-card textarea:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 0 0 1px #2563eb;
}

/* Channels Section */
#chg-generator .chg-channels-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

#chg-generator .chg-channels-section > label:first-of-type {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#chg-generator .chg-channels-list {
  display: flex;
  gap: 2rem;
}

#chg-generator .chg-channel-option {
  display: flex;
  align-items: center;
  cursor: pointer;
}

#chg-generator .chg-channel-option input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: #2563eb;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
}

#chg-generator .chg-channel-option input[type="checkbox"]:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

#chg-generator .chg-channel-option span {
  margin-left: 0.5rem;
  color: #374151;
  font-weight: 500;
  transition: color 0.2s ease;
  user-select: none;
}

#chg-generator .chg-channel-option:hover span {
  color: #2563eb;
}

/* Submit Button */
#chg-generator .chg-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 9999px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#chg-generator .chg-submit-btn:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

#chg-generator .chg-submit-btn:active:not(:disabled) {
  transform: scale(0.98);
}

#chg-generator .chg-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#chg-generator .chg-submit-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

#chg-generator .chg-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: chg-spin 0.8s linear infinite;
}

@keyframes chg-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Output Section */
#chg-generator .chg-output-section {
  margin-top: 3rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 2rem;
}

#chg-generator .chg-output-section h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1.5rem 0;
}

#chg-generator .chg-output-section pre {
  font-size: 1rem;
  line-height: 1.5;
  color: #374151;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0;
}

/* Error Message */
#chg-generator .chg-error {
  color: #dc2626;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  background: #fee2e2;
  border-left: 4px solid #dc2626;
  border-radius: 0.375rem;
  margin-top: 1rem;
}

/* Loading State */
#chg-generator .chg-loading {
  color: #6b7280;
  font-style: italic;
  padding: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  #chg-generator .chg-input-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  #chg-generator .chg-input-card textarea {
    height: 6rem;
  }

  #chg-generator .chg-channels-list {
    flex-direction: column;
    gap: 0.75rem;
  }

  #chg-generator .chg-submit-btn {
    width: 100%;
  }

  #chg-generator .chg-header h2 {
    font-size: 1.5rem;
  }

  #chg-generator .chg-header p {
    font-size: 1rem;
  }
}
