#space-details {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin-right: 0.5em;
}

#space-details h1 {
  margin: 0.25em 0;
}

#space-details h3 {
  margin: 0.5em 0;
}

#space-diagram,
#space-manifests {
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  padding: 0.5em;
}

#space-diagram {
  height: 25em;
}

#space-manifests {
  display: flex;
  flex-direction: column;
}

#upload-manifests-form {
  align-items: center;
  display: flex;
  flex-direction: row;
  justify-content: center;
  margin: 0;
  width: initial;
}

#upload-manifests-form input[type=submit] {
  margin: 0;
}

#space-manifests-content {
  box-sizing: border-box;
  overflow-y: auto;
}

.manifest-form {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 0.5em;
  overflow: hidden;
}

.manifest-header {
  align-items: center;
  background-color: #f5f5f5;
  cursor: pointer;
  display: flex;
  gap: 0.5em;
  padding: 0.5em 0.75em;
  user-select: none;
}

.manifest-header:hover {
  background-color: #ebebeb;
}

.manifest-kind {
  color: #888;
  font-size: 0.75em;
  font-weight: bold;
  text-transform: uppercase;
}

.manifest-name {
  flex: 1;
  font-size: 0.9em;
}

.manifest-chevron {
  color: #888;
  transition: transform 0.15s ease;
}

.manifest-form.collapsed .manifest-chevron {
  transform: rotate(-90deg);
}

.manifest-form.collapsed .manifest-body {
  display: none;
}

.manifest-body {
  padding: 0.75em;
}

.manifest-body form {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  margin: 0;
  width: 100%;
}

.yaml-editor {
  border: 1px solid #ccc;
  border-radius: 3px;
  display: grid;
  font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: 0.95em;
  line-height: 1.5;
  overflow: hidden;
}

.yaml-editor:focus-within {
  border: 2px solid var(--secondary-color);
}

.yaml-editor > * {
  box-sizing: border-box;
  font: inherit;
  grid-area: 1 / 1;
  margin: 0;
  padding: 0.5em;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  width: 100%;
}

.yaml-backdrop {
  background: white;
  color: #333;
  overflow: hidden;
  pointer-events: none;
}

.manifest-body textarea {
  background: transparent;
  border: none;
  caret-color: #333;
  color: transparent;
  outline: none;
  overflow: hidden;
  resize: none;
  z-index: 1;
}

.manifest-body input[type=submit] {
  align-self: flex-end;
  grid-column: unset;
  margin: 0;
}

/* YAML syntax highlighting */
.yl-key     { color: var(--primary-color); }
.yl-string  { color: #c0392b; }
.yl-number  { color: #8e44ad; }
.yl-literal { color: #27ae60; }
.yl-comment { color: #95a5a6; font-style: italic; }
.yl-doc     { color: #888; font-weight: bold; }

#space-control {
  display: flex;
  flex-direction: row;
  gap: 1em;
}

#actions {
  display: flex;
  flex-direction: row;
  gap: 1em;
}
