/* Collection editor. */
.editor form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.editor form[hidden] {
    display: none;
}

.editor h2 {
    margin: 1.2rem 0 0;
}

.editor label, .editor legend, .editor code {
    color: var(--text);
    font-family: 'Source Sans 3', sans-serif;
}

.editor label {
    font-weight: bold;
    margin-top: 0.4rem;
}

.editor input[type="text"], .editor textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.7rem;
    background: var(--background);
    color: var(--text);
    border: 0.15rem solid var(--surface);
    border-radius: 0.6rem;
    font: 1rem 'Source Sans 3', sans-serif;
    resize: vertical;
}

.editor input:focus-visible, .editor textarea:focus-visible, .editor a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.editor [aria-invalid="true"] {
    border-color: #fa2b28;
}

.editor-topics {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.editor-topic fieldset {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    border: 0.15rem solid var(--surface);
    border-radius: 0.8rem;
    padding: 0.8rem;
    margin: 0;
    min-width: 0;
}

.editor-topic legend {
    font-weight: bold;
    padding: 0 0.4rem;
}

.editor-topic-actions, .editor-actions, .editor-recovery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.editor-topic-actions .button, .editor-actions .button, .editor-recovery .button {
    flex: 1 1 8rem;
    align-self: stretch;
    min-height: 2.75rem;
}

.editor-recovery[hidden], .editor-recovery .button[hidden], .editor-errors[hidden] {
    display: none;
}

.editor .editor-remove {
    background-color: #fa2b28;
    color: #fff;
}

#add-topic {
    width: 100%;
    align-self: stretch;
}

.editor-errors {
    border: 0.15rem solid #fa2b28;
    border-radius: 0.8rem;
    padding: 0.6rem 0.8rem;
}

.editor-errors p, .editor-errors ul {
    margin: 0.2rem 0;
}

.editor-errors li, .editor-errors a {
    color: var(--text);
}
