header nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 24px);
}
#manage-projects {
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid #b8aec2;
  border-radius: 18px;
  background: transparent;
  font-size: .9375rem;
}
#manage-projects:hover { background: #e9e4ed; }
#project-editor, #remove-project {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(18px, 4vw, 30px);
  overflow: auto;
  border: 1px solid #bcb3c6;
  border-radius: 10px;
  color: var(--text);
  background: #faf9fb;
  box-shadow: 0 20px 80px #21142e33;
}
#project-editor::backdrop, #remove-project::backdrop { background: #231a30a8; }
#project-editor h2, #remove-project h2 { margin: 0 0 22px; font-size: 1.6rem; letter-spacing: -.05em; }
.editor-fields { display: grid; gap: 6px; }
#editor-selector { display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px; }
#editor-selector select { flex: 1; margin: 0; }
#editor-add {
  flex: none;
  border: 1px solid #b6afbd;
  border-radius: 4px;
  padding: 8px 12px;
  background: #eee8f3;
}
#editor-add:hover { background: #e4dce9; }
#project-editor [hidden] { display: none; }
.editor-fields label { font-size: .9375rem; font-weight: 600; }
.editor-fields input, .editor-fields select, .editor-fields textarea, .editor-actions button {
  min-width: 0;
  max-width: 100%;
  font: inherit;
  color: inherit;
}
.editor-fields input:not([type="file"]), .editor-fields select, .editor-fields textarea {
  width: 100%;
  min-height: 42px;
  margin-bottom: 8px;
  border: 1px solid #b6afbd;
  border-radius: 4px;
  padding: 8px 10px;
  background: white;
}
.editor-case-study {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid #d2cbd8;
}
.editor-case-study legend { padding: 0 10px 0 0; font-weight: 600; }
.editor-case-study legend span { color: #61586b; font-size: .875rem; font-weight: 400; }
.editor-case-study textarea { resize: vertical; line-height: 1.4; }
.editor-preview {
  display: grid;
  place-items: center;
  min-height: 80px;
  height: clamp(80px, 19dvh, 170px);
  margin: 2px 0 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #e9e5ed;
}
.editor-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
#editor-image::file-selector-button, .editor-actions button {
  margin-inline-end: 6px;
  border: 1px solid #b6afbd;
  border-radius: 4px;
  padding: 8px 12px;
  background: #f2eff4;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
#editor-image-help { margin: 0; color: #61586b; font-size: .875rem; }
#editor-error, #remove-error { margin: 12px 0 0; color: #962c42; line-height: 1.4; }
#editor-error:empty, #remove-error:empty { margin: 0; }
.editor-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.editor-actions button { margin: 0; min-height: 42px; }
#editor-remove { margin-inline-end: auto; color: #882c43; background: transparent; border-color: transparent; padding-inline: 0; }
#editor-remove:hover { text-decoration: underline; }
#remove-project-description { line-height: 1.5; overflow-wrap: anywhere; }
#remove-confirm { background: #842d44; border-color: #842d44; color: white; }
#editor-save { background: #332a40; border-color: #332a40; color: white; }
#project-editor :disabled { opacity: .65; cursor: wait; }
@media (max-width: 540px) {
  header nav { gap: 4px; }
  #manage-projects { font-size: .875rem; }
  #manage-projects { padding-inline: 9px; }
}
@media (max-width: 370px) {
  #editor-remove { flex-basis: 100%; text-align: start; }
  header nav { gap: 0; }
  header a img { max-width: 102px; }
}
