.prompt-entry {
  border-color: #806496;
  background: #38264d;
  color: #f1dcff;
}

dialog.prompt-studio {
  width: min(690px, calc(100% - 20px));
  max-width: none;
  max-height: calc(100dvh - 22px);
  padding: clamp(14px, 4vw, 24px);
  border: 1px solid #725889;
  border-radius: 24px;
  background: radial-gradient(ellipse at top right, #362447, transparent 65%), #201829;
  box-shadow: 0 24px 65px #090511a8;
  overflow: auto;
  overscroll-behavior: contain;
}

.prompt-studio-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.prompt-studio-header h2 {
  margin: 0;
  font-size: clamp(24px, 6vw, 34px);
  letter-spacing: -.035em;
  line-height: 1.12;
}

.prompt-studio-header > button { min-width: 42px; font-size: 21px; }
#prompt-library-back { margin-bottom: 9px; }

.prompt-library-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.prompt-library-actions input { flex: 1; min-width: 0; }
.prompt-library-actions button { flex: none; }
.prompt-studio input, .prompt-studio textarea { font-size: 16px; }
.prompt-studio button:focus-visible { outline: 2px solid #e6c3ff; outline-offset: 2px; }
.prompt-studio textarea { line-height: 1.5; }
.prompt-muted, #prompt-description, #prompt-library-status, #prompt-progress { color: #d0bedb; }
#prompt-library-status:empty, #prompt-feedback:empty { display: none; }
#prompt-library-status:not(:empty) { margin: 12px 0; line-height: 1.45; }

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
  gap: 8px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.prompt-grid:empty { margin: 0; }
.prompt-card {
  display: grid;
  align-content: start;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 14px;
  border: 1px solid #654b78;
  border-radius: 15px;
  background: linear-gradient(135deg, #372a47, #271d32);
  color: #fff3ff;
  text-align: left;
  font: inherit;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.prompt-card:hover { border-color: #a381bd; }
.prompt-card-detail { color: #dbc7e6; font-size: 13px; line-height: 1.4; }
.prompt-card-meta { color: #dcaeff; font-size: 12px; }
.prompt-studio h3 { margin: 16px 0 8px; font-size: 15px; }
.prompt-runner-info { margin-bottom: 12px; }
#prompt-description { margin: 0 0 9px; line-height: 1.4; overflow-wrap: anywhere; }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }

.prompt-workspace {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 10px;
}

.prompt-workspace > div, #prompt-hints {
  min-width: 0;
  padding: 12px;
  border: 1px solid #574363;
  border-radius: 15px;
  background: #261d32;
}

.prompt-workspace h3, #prompt-hints h3, .prompt-preview label { margin-top: 0; }
.prompt-field label { overflow-wrap: anywhere; }
#prompt-result { min-height: 160px; background: #191321; }
.prompt-copy-bar {
  position: sticky;
  bottom: -1px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 0 0;
  background: #201829;
}

.prompt-copy-bar p { margin: 0; font-size: 13px; }
.prompt-copy-bar button { min-height: 44px; }
.prompt-copy-bar .prompt-actions { margin: 0; justify-content: flex-end; }
.prompt-insert { margin-top: 8px; }
#prompt-hints { margin-top: 12px; }
#prompt-editor .study-actions { margin-top: 14px; }
#prompt-feedback { margin-top: 10px; color: #ead0fa; overflow-wrap: anywhere; }
.prompt-results-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid #79578f;
  border-radius: 14px;
  background: linear-gradient(120deg, #493158, #2e223d);
  color: #f6e6ff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.prompt-results-entry span { color: #dec4ec; font-size: 12px; text-align: right; }
.prompt-result-card img {
  width: 100%;
  height: 114px;
  object-fit: cover;
  border-radius: 9px;
  background: #23192e;
  color: #e7d6ed;
}
.prompt-output { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.prompt-output a { color: #e7c2ff; }
#prompt-results-empty:empty, #prompt-output-attachment-feedback:empty { display: none; }
#prompt-result-editor .study-actions { margin-top: 14px; }

@media (max-width: 520px) {
  .prompt-workspace { grid-template-columns: minmax(0, 1fr); }
  .prompt-copy-bar { flex-wrap: wrap; }
  .prompt-copy-bar .prompt-actions { justify-content: flex-start; width: 100%; }
}

@media (max-width: 350px) {
  .prompt-copy-bar { flex-wrap: wrap; }
  .prompt-copy-bar button { width: 100%; }
}
