
.builder-app {
  max-width: 1250px;
  margin: auto;
  padding: 30px 20px 60px;
  color: #f5f3ff;
}

.builder-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 30px;
}

.back-link {
  display: inline-block;
  color: #ad95ff;
  text-decoration: none;
  margin-bottom: 22px;
}

.builder-label,
.optional-label,
.panel-title {
  color: #a78bfa;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.builder-header h1 {
  font-size: clamp(29px, 5vw, 43px);
  margin: 10px 0;
}

.builder-header p,
.builder-intro p,
.preview-header p {
  color: #9999ae;
  line-height: 1.6;
}

.ai-status {
  background: #211a38;
  color: #cbbaff;
  border: 1px solid #44336e;
  padding: 11px 15px;
  border-radius: 30px;
  font-size: 11px;
  white-space: nowrap;
}

.ai-status span {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #a78bfa;
  border-radius: 50%;
  margin-right: 7px;
}

.builder-intro,
.builder-panel,
.preview-section {
  background: #11131d;
  border: 1px solid #292c40;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}

.builder-intro {
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(110deg, #1d1732, #11131d);
}

.intro-icon {
  display: grid;
  place-items: center;
  min-width: 54px;
  height: 54px;
  border-radius: 15px;
  background: #37275f;
  color: #d3c4ff;
  font-size: 25px;
}

.builder-intro h2,
.section-heading h2,
.preview-header h2 {
  margin: 0;
  font-size: 19px;
}

.builder-intro p {
  margin-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-number {
  color: #a78bfa;
  font-size: 12px;
  font-weight: 800;
}

#serverPrompt {
  width: 100%;
  resize: vertical;
  min-height: 145px;
  box-sizing: border-box;
  background: #090b13;
  border: 1px solid #35364b;
  border-radius: 11px;
  padding: 16px;
  color: white;
  font: inherit;
  line-height: 1.6;
  outline: none;
}

#serverPrompt:focus {
  border-color: #9270ef;
}

.prompt-footer {
  display: flex;
  justify-content: space-between;
  color: #77788c;
  font-size: 12px;
  margin-top: 9px;
}

.text-button {
  background: none;
  border: 0;
  color: #ad95ff;
  cursor: pointer;
}

.type-heading {
  margin-top: 30px;
}

.server-types {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.type-card {
  background: #171a28;
  border: 1px solid #303448;
  border-radius: 12px;
  padding: 17px 12px;
  text-align: left;
  color: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.type-card > span {
  font-size: 24px;
}

.type-card strong {
  font-size: 14px;
}

.type-card small {
  color: #9090a4;
}

.type-card.active {
  border-color: #9876ff;
  background: #211a38;
}

.builder-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 24px 0;
}

.builder-options label {
  color: #aaa9bd;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.builder-options select {
  background: #090b13;
  color: white;
  border: 1px solid #35364b;
  border-radius: 9px;
  padding: 13px;
  font: inherit;
}

.generate-button,
.build-button {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 16px;
  background: linear-gradient(100deg, #7952e8, #9b64ee);
  color: white;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.generate-button:disabled {
  opacity: .6;
  cursor: wait;
}

.generator-note,
.build-disclaimer {
  color: #77788c;
  font-size: 12px;
  text-align: center;
  margin: 13px 0 0;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.preview-header h2 {
  margin-top: 8px;
}

.preview-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 15px;
}

.structure-panel,
.roles-panel {
  background: #090b13;
  border: 1px solid #292c40;
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
}

.panel-title {
  margin-bottom: 17px;
}

.category-item {
  border: 1px solid #303448;
  border-radius: 9px;
  padding: 12px;
  margin-bottom: 12px;
}

.category-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.category-top input,
.channel-row input,
.role-row input {
  background: #171a28;
  border: 1px solid #34364a;
  border-radius: 6px;
  color: white;
  padding: 9px;
  min-width: 0;
  width: 100%;
}

.category-top input {
  font-weight: bold;
}

.channel-list {
  margin: 10px 0 0 18px;
  display: grid;
  gap: 7px;
}

.channel-row,
.role-row {
  display: flex;
  gap: 7px;
  align-items: center;
}

.channel-row span {
  color: #8d8da0;
  min-width: 17px;
}

.small-delete {
  background: #39202b;
  border: 0;
  color: #ff9aaf;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
}

.add-channel,
.add-button {
  background: #211a38;
  border: 1px solid #44336e;
  color: #c9b8ff;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
}

.add-button {
  width: 100%;
}

.role-row {
  margin-bottom: 10px;
}

.preview-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 12px;
  margin-top: 22px;
}

.secondary-button {
  background: #292c40;
  border: 1px solid #45485d;
  color: white;
  border-radius: 9px;
  padding: 14px;
  cursor: pointer;
}

.builder-message {
  color: #c4b5fd;
  text-align: center;
  padding: 10px;
  font-size: 13px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 700px) {
  .builder-header {
    flex-direction: column;
  }

  .server-types {
    grid-template-columns: repeat(2, 1fr);
  }

  .preview-layout {
    grid-template-columns: 1fr;
  }

  .preview-header {
    flex-direction: column;
  }

  .preview-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .builder-app {
    padding: 20px 12px 40px;
  }

  .builder-panel,
  .preview-section,
  .builder-intro {
    padding: 17px;
  }

  .builder-options {
    grid-template-columns: 1fr;
  }
  }
