.prompt-builder {
  margin-top: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  padding: 18px;
  display: grid;
  gap: 18px;
}

.prompt-builder__tracks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.prompt-builder__track {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.prompt-builder__track.is-active {
  border-color: rgba(94, 234, 212, 0.7);
  background: rgba(94, 234, 212, 0.16);
  color: var(--text);
}

.prompt-builder__track:focus-visible {
  outline: 2px solid rgba(94, 234, 212, 0.6);
  outline-offset: 2px;
}

.prompt-builder__template {
  border-radius: 14px;
  border: 1px solid rgba(94, 234, 212, 0.24);
  background: rgba(0, 0, 0, 0.25);
  padding: 12px 14px;
}

.prompt-builder__template label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.prompt-builder__template-select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 8px 10px;
  font-family: inherit;
  color-scheme: light dark;
}

.prompt-builder__template-select option {
  background-color: var(--bg);
  color: var(--text);
}

.prompt-builder__template-desc {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--faint);
}

.prompt-builder__guidance {
  border-radius: 14px;
  border: 1px dashed rgba(94, 234, 212, 0.35);
  background: rgba(94, 234, 212, 0.08);
  padding: 12px 14px;
}

.prompt-builder__guidance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.prompt-builder__guidance-header h3 {
  margin: 0;
  font-size: 14px;
}

.prompt-builder__guidance-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.prompt-builder__guidance.is-collapsed .prompt-builder__guidance-list {
  display: none;
}

.prompt-builder__guidance.is-collapsed .prompt-builder__guidance-header {
  margin-bottom: 0;
}

.prompt-builder__field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.prompt-builder__field label {
  font-size: 14px;
  color: var(--muted);
}

.prompt-builder__field textarea {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 10px 12px;
  font-family: inherit;
}

.prompt-builder__output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.prompt-builder__output-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.prompt-builder__text {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  white-space: pre-wrap;
}

.prompt-builder__status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.prompt-builder__status.is-visible {
  opacity: 1;
}

.prompt-builder__saved {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.prompt-builder__saved-header h3 {
  margin: 0 0 6px;
}

.prompt-builder__saved-hint {
  margin: 0;
  font-size: 13px;
  color: var(--faint);
}

.prompt-builder__saved-list {
  display: grid;
  gap: 12px;
}

.prompt-builder__saved-item {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
}

.prompt-builder__saved-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.prompt-builder__saved-meta {
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 10px;
}

.prompt-builder__saved-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-builder__saved-empty {
  color: var(--faint);
  margin: 0;
}

.prompt-builder__saved-clear {
  width: fit-content;
}

@media (max-width: 720px) {
  .prompt-builder__guidance-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
