article.result > section {
    border: 0;
    border-left: 1px solid var(--gray);
    border-right: 1px solid var(--gray);
}

article.result > section:first-child {
    border-top: 1px solid var(--gray);
}

.analysis-gallery h3 {
    border-top: 0.5em solid var(--accent);
    margin-top: 1em;
}

.analysis-gallery .intro {
    padding: 1em 0;
}

.analysis-gallery #child-tree-header {
    transition: 0.25s;
    height: 1.5em;
}

.analysis-gallery #child-tree-header.collapsed {
    height: 0 !important;
    border-width: 0;
    padding: 0;
    overflow: hidden;
}

.result h2 input {
    padding: 0;
    border: 0;
    height: 1em;
    width: 75%;
}

.children-processors {
    padding-bottom: 0.5em;
}


/** result card **/
.card-content {
    display: grid;
    grid-auto-rows: auto;
    align-content: start;
    align-items: start;
}

#dataset-result dd {
    padding: 0;
}

#dataset-result dd .status-message {
    padding: 0.5em;
}

#dataset-result .dataset-items {
    display: block;
    padding: 0.5em;
    border-bottom: 1px solid var(--gray);
}

#dataset-result .result-actions {
    text-align: center;
    padding: 0;
}

#dataset-result ul {
    list-style: none;
    margin: 0;
    display: flex;
    align-items: stretch;
}

#dataset-result li {
    width: 100%;
}

#dataset-result li:not(:last-child) {
    border-right: 1px solid var(--gray);
}

#dataset-result a {
    /*background: var(--accent-okay);
    color: var(--always-white);*/
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0.5em 0;
    column-gap: 0.5em;
}
#dataset-result a.popup-trigger {
    cursor: zoom-in;
}

#dataset-result .result-status {
    padding: 0.5em;
}

#dataset-result .result-row {
    display: grid;
    grid-template-columns: 3fr 1fr;
}

#dataset-result .result-row:not(:last-child) {
    border-bottom: 1px solid var(--gray);
}

#dataset-result .result-log {
    border-left: 1px solid var(--gray);
}

.query.card div.notice {
    color: var(--accent-alternate);
    background: var(--contrast-bright);
    text-align: center;
    padding: 0.5em;
}

.query.card div.fullwidth.notice {
    display: block;
}

.metadata-wrapper {
    display: grid;
    grid-template-columns: 12.5% 12.5% 12.5% 12.5% 12.5% 12.5% 12.5% 12.5%;
    border-bottom: 1px solid var(--gray);
}

.metadata-wrapper > div {
    grid-column: span 4;
}

.metadata-wrapper > div.fullwidth {
    grid-column: 1 / span 8;
}

.metadata-wrapper > div.onequarter {
    grid-column: 1 / span 3;
}

.metadata-wrapper > div.threequarters {
    grid-column: 4 / span 5;
}

.metadata-wrapper > div:not(.filter-list) {
    display: grid;
    grid-template-columns: 9em auto;
}

.metadata-wrapper > div:not(:last-child):not(.filter-list) {
    border-bottom: 1px solid var(--gray-light);
}

.metadata-wrapper dt, .metadata-wrapper dd {
    padding: 0.5em;
}

.metadata-wrapper dt {
    color: var(--accent-alternate);
    border: 0 solid var(--gray-light);
    border-right-width: 1px;
    text-align: right;
}

.dataset-owner-list {
    position: relative;
}

.dataset-owner-list .owner-tag {
    font-family: monospace;
}

.dataset-owner-list ul {
    list-style: none;
    margin: 0;
    padding-right: 5em;
}

.dataset-owner-list #add-dataset-owner {
    position: absolute;
    top: 0.5em;
    right: 0.5em;
}
.dataset-owner-list .button-like-small {
    margin: 0;
}

.dataset-owner-list li[data-owner] .button-like-small {
    height: 1em;
    padding: 0 0.25em 0.25em 0.25em;
    position: relative;
    line-height: 1.3em;
}

.button-like-small.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}


.dataset-owner-list li {
    display: inline-block;
}

.dataset-owner-list li:not(:last-child)::after {
    content: '\02022';
}

.annotation-fields-list {
    position: relative;
}

.result-page .annotation-fields-list .property-badge {
    cursor: pointer;
}

.annotation-fields-list ul {
    list-style: none;
    margin: 0;
    padding-right: 5em;
}

.annotation-fields-list li {
    display: inline-block;
}

.annotation-fields-list #edit-annotation-fields {
    position: absolute;
    top: 0;
    right: 0.5em;
    line-height: 1.3em;
}

/** dataset toolbox **/
.dataset-toolbox {
    border-bottom: 1px solid var(--gray-light);
}

.dataset-toolbox ul {
    list-style: none;
    display: flex;
    justify-content: space-evenly;
}

.dataset-toolbox a, a.button-like-small {
    display: inline-block;
    padding: 0 0.5em;
    margin: 0.5em 0;
    text-decoration: none;
    background: var(--gray-light);
    border: 1px solid var(--gray-dark);
    font-size: 0.8em;
    cursor: pointer;
}

.dataset-toolbox a:hover, a.button-like-small:hover {
    border-color: var(--contrast-dark);
    background: var(--gray-dark);
}

/** analysis tree **/
.child-list li {
    padding: 0;
}

.child-list .child-wrapper {
    display: grid;
    grid-template-columns: 5em 4em auto 5em;
    background: var(--always-white);
    border-bottom: 1px solid var(--gray);
    border-top: 0;
    padding: 0;
    position: relative;
}

.child-list .processor-child-wrapper.child-wrapper {
    grid-template-columns: 5em 4em auto;
}

.child-wrapper .child-wrapper::before {
    position: absolute;
    top: 1.25em;
    left: -1.5em;
    font-family: 'Font Awesome 6 Pro', 'Font Awesome 6 Free';
    font-weight: 900;
    content: '\f061';
    color: var(--gray-dark);
}

.child-wrapper:hover::before, .child-wrapper.anchor-child::before {
    color: var(--text);
}

.child-wrapper.anchor-child {
    outline: 1px solid var(--gray-dark);
}

/** middle column **/
.child-list .processor-header, .child-list .processor-details {
    border-left: 1px solid var(--gray);
}

.child-wrapper .button-wrap.processor-result-indicator {
    grid-column-start: span 2;
}

.child-wrapper .button-wrap .button-object, .child-wrapper .button-wrap button {
    border: 0;
    border-radius: 0;
    display: block;
    width: 100%;
    padding: 0.25em 0 0 0;
    min-height: 3.5em;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
    justify-self: center;
    align-self: center;
}

.child-wrapper .button-wrap button {
    padding-left: 0;
    padding-right: 0;
    height: 100%;
}

.child-list.processor-list .button-wrap button {
    padding: 0;
    height: 100%;
}

.child-wrapper .button-wrap.finished {
    background: var(--accent-okay);
    color: var(--always-white);
}

.pending {
    background: var(--accent-alternate);
    color: var(--always-white);
}

.failed {
    background: var(--accent-error);
    color: var(--always-white);
}

.child-wrapper .button-wrap.processor-result-indicator a {
    display: inline-block;
    color: inherit;
}

.child-wrapper .button-wrap {
    text-align: center;
    display: grid;
    min-height: 4em;
}

.child-wrapper .button-wrap .headline, .child-wrapper .button-wrap .byline {
    display: block;
}

.child-wrapper .button-wrap .byline {
    cursor: default;
    font-size: 0.8em;
}

.child-wrapper .button-wrap .queue-notice {
    font-size: 0.8em;
    color: var(--accent-alternate);
}

.child-wrapper .queued-button .button-object .queue-notice {
    font-size: 0.8em;
    color: var(--always-white);
}

.child-list .processor-header ul {
    margin: 0;
}

.child-list .processor-header li {
    display: inline-block;
    background: transparent;
    padding: 0 0.5em;
}

.child-list .property-badge.permalink {
    color: var(--accent);
}

.child-list li[rel=external] .property-badge {
    width: 2em;
}

.child-list .processor-header {
    padding: 0.5em 0 0 0.5em;
}

.child-list .processor-header p {
    margin-bottom: 0;
}

.child-list .processor-header li {
    padding: 0;
}

.child-list .processor-header li a {
    text-transform: lowercase;
}

.child-list .processor-child-wrapper .processor-header {
    padding-bottom: 0.5em;
}

.child-list .processor-header h4, .child-list .processor-header button, .child-list .processor-header header, .child-list .processor-header span {
    display: inline-block;
}

.child-list:not(.processor-list) li:not(.inline) > .processor-header header:after {
    content: ':';
}

.child-list .processor-details {
    transition: 250ms;
    grid-column-start: span 4;
    border-top: 1px solid var(--gray);
    border-left: 2em solid var(--gray-light);
}

.child-list .processor-details.processor-options-wrap {
    border-left-width: 0;
}

.child-list .processor-details[aria-expanded=false], .child-list .processor-options-wrap[aria-expanded=false] {
    height: 0;
    overflow: hidden;
    display: none;
}

.child-list .processor-header .property-badge, p[role=tooltip] .property-badge {
    border: 0;
    background: var(--gray);
    display: inline;
    margin: 0;
}

.child-wrapper.updated > .processor-header {
    animation: child-blink 1s linear 1;
    background-repeat: repeat-y;
}

.child-list .processor-header .property-badge.status {
    padding: 2px;
}

/** "further options" **/
.processor-further {
    font-size: 0.8em;
    margin-left: 0.5em;
}

.processor-further p {
    font-style: italic;
}

.processor-further ul, .processor-further li, .processor-further p {
    display: inline;
    margin: 0;
}

.processor-further li:not(:last-child):after {
    content: ', ';
}

.processors-available {
    position: absolute;
    top: 0;
    right: 0;
    padding-top: 5px;
    padding-right: 10px;
    text-align: center;
    font-size: 0.8em;
    cursor: pointer;
}

.processors-available a:hover {
    text-decoration: none;
}

/* processor configuration options */
.processor-options {
    border: 0;
    padding: 0.5em 1em;
    margin: 0.5em 0.5em 0 0;
    background: var(--contrast-bright);
}

.processor-options label {
    min-height: 2em;
    display: inline-block;
    vertical-align: middle;
    min-width: 13em;
}

.processor-options .multichoice-wrapper.inline label {
    min-width: 17em;
}

.processor-options .multichoice-wrapper label {
    display: block;
    margin-left: 1em;
    position: relative;
}

.processor-options .multichoice-wrapper:not(.inline) label::before {
    content: '\2022';
    position: absolute;
    left: -.75em;
}

.processor-options .multichoice-wrapper.inline {
    margin-top: .2em;
    margin-bottom: .2em;
}

.processor-options .multichoice-wrapper.inline label {
    display: inline-block;
    margin: 0 0.25em 0 0;
    background: var(--gray);
    font-size: 0.8em;
}

.processor-options-wrap .multi-select-wrapper {
    margin-left: 0.5em;
}

.processor-option-wrap {
    margin: 0.25em;
    padding: 0.5em;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    border-bottom: 1px var(--gray-darker) dotted;
}

.processor-option-wrap:last-child {
    border-bottom: none;
}

.processor-option-wrap > label {
    display: flex;
    align-items: baseline;
}

.processor-option-wrap > label.option-type-toggle {
    min-width: auto;
}

.processor-option-wrap > label.option-type-toggle {
    min-width: auto;
}

.processor-option-wrap > label.option-type-toggle > input[type="checkbox"] {
    margin-top: 0.2em;
}

.processor-option-wrap > *:not(label) {

}

.processor-option-wrap > .processor-tooltip {
    margin-left: auto;
}

.processor-option-wrap button.tooltip-trigger {

}

.processor-options textarea {
    min-width: 25em;
    min-height: 7.5em;
    flex-grow: 0.95;
}

.processor-options select {
    max-width: 100%;
    flex-grow: 0.9;
}

.multi-select-search {
    position: relative;
    display: block;
    width: 75%;
    margin-bottom: 4px;
}

.multi-select-search input {
    width: 18em;
    max-width: 18em;
}

.multi-select-options {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    height: 125px;
    width: 95%;
    overflow-y: scroll;
    overflow-x: hidden;
    background-color: var(--gray);
}

.processor-option-wrap .multi-select-options {
    height: auto;
    max-height: 15em;
    width: 100%;
}

.multi-select-options > label, .form-element .multi-select-options label {
    width: 20em;
    text-align: left;
    cursor: pointer;
    user-select: none;
    min-height: auto;
}

.multi-select-options .no-match {
    font-style: italic;
    width: 20em;
    padding: 7px;
    color: var(--gray-darker);
    cursor: default;
}

.multi-select-selected {
    min-height: 30px;
}

.multi-select-selected .property-badge {
    display: inline-block;
    margin-right: 1px;
    cursor: pointer;
    user-select: none;
}

.processor-option-wrap .property-badge.annotation-label {
    margin-left: 0.3em;
    margin-right: 0.3em;
}

.processor-option-wrap .hidden-annotation-notice {
    font-size: 0.8em;
    margin-left: 0.3em;
    color: var(--gray-darker);
}

.processor-option-wrap .annotation-explainer {
    font-size: 0.8em;
    margin-left: 1.5em;
    flex-basis: 70%;
    line-height: 1em;
}

.processor-option-wrap .annotation-explainer.after-multi {
    margin: 0.2em 0 0em 0;
}

@keyframes child-blink {
    0% {
        color: var(--accent-alternate);
    }
    100% {
        background-color: rgba(25, 176, 163, 0);
        color: var(--text);
    }
}

/** processor result preview **/
iframe.query-result-iframe {
	width: 90%;
	margin: 0 auto;
	height: 90%;
	display: block;
	border: 1px dashed var(--gray-dark);
}

.query-result {
    padding-bottom: 0.5em;
}

body.csv-preview {
    background: var(--always-white);
}

body.csv-preview table td, body.csv-preview table th {
    border: 1px solid var(--gray-light);
}

body.csv-preview table tr:nth-child(2n+1) {
    background: var(--contrast-bright);
}

.colour-preview i {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 1px solid var(--gray-dark);
    position: relative;
    top: -0.1em;
    vertical-align: bottom;
}

body.csv-preview .missing-field {
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcBAMAAACAI8KnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAElBMVEXu7u7v7O3z3uf11eP4y978wNnbft+uAAAARElEQVQY09XJUQmAQBQAwRUrGMASRrDAwfav4seDg43g5zAAwKWqa3S8w/sXSZPkSfIhKcnhzuFOSUpSkpKUpCQlKUk/jndCArsTDbwAAAAASUVORK5CYII=');
    background-attachment: fixed;
}

body.csv-preview .missing-field:hover {
    outline: 1px solid var(--accent);
}

.child.focus:not(.card) > .sub-controls > .query-result > .query-result-iframe {
	display: none;
}

img.details-only, embed.details-only {
	max-width: 75%;
	margin: 0 auto;
    display: block;
}

embed.details-only, embed.details-only svg {
    cursor: grab;
}

embed.details-only {
    border-top: 1px solid var(--gray-light);
}

.csv-preview .warning, .json-preview .warning {
    width: 100%;
    background: var(--gray-light);
    text-align: center;
    font-size: 0.8em;
}

.csv-preview table {
    margin: 0;
    min-width: 100%;
    border: 0;
}

.csv-preview td:first-child, th:first-child {
    border-left: 0;
}

.csv-preview td:last-child, th:last-child {
    border-right: 0;
}

html.image-preview {
    height: 100%;
}

body.image-preview {
    padding: 0;
    height: 100%;
}

.image-preview-container {
    text-align: center;
    height: 100%;
}

#image-zoom {
    display: none;
}

.image-preview img {
    margin: 0 auto;
    max-height: 100%;
    cursor: zoom-in;
}

#image-zoom:checked + label img {
    max-height: none;
    cursor: zoom-out;
}

/* EXPLORER VIEW */
#explorer-controls .metadata-wrapper dd {
    padding: 0
}

#explorer-controls .metadata-wrapper dd .padding {
    padding: 0.5em;
}

#annotation-fields-editor {
    height: 0;
    overflow-y: hidden;
}

#annotation-fields-editor-controls {

}

#annotation-fields-editor-controls li.annotation-field {
    background-color: white;
    position: relative;
    padding: 12px 8px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 60px;
    box-sizing: border-box;
}

#annotation-fields-editor-controls li.annotation-field:not(:last-child) {
    border-bottom: 1px dotted var(--contrast-dark);
}

#explorer-controls .info-row {
    display: grid;
    grid-template-columns: 3fr 1fr;
    padding: 0;
    margin: 0;
}

#explorer-controls .info-row > #tutorial-cell {
    border-left: 1px solid var(--gray);
}

.annotation-field > .annotation-field-icons {
    margin-top: 0.4em;
}

.annotation-field > .annotation-field-icons > .handle {
    flex-shrink: 0;
    cursor: move;
}

.annotation-field-input {
    flex-shrink: 0;
    min-width: 120px;
    margin-right: 1em;
}

.annotation-field-input input {
    width: 100%;
    min-width: 120px;
}

.annotation-field > span:has(.annotation-field-type) {
    flex-shrink: 0;
    min-width: 120px;
}

.annotation-field-type {
    width: 100%;
    padding: 0.35em;
}

.annotation-field .dataset-annotation-field {
    flex: 1;
    min-width: 0; /* Allow shrinking */
}

.annotation-field .dataset-annotation-field h4 {
    margin: 0 0 8px 0;
    display: inline;
}

.annotation-field .dataset-annotation-field .parameters {
    margin-top: 8px;
}

.annotation-field .dataset-annotation-field ul {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.annotation-field .dataset-annotation-field ul li {
    display: inline-flex;
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.annotation-field .parameters .property-badge {
    border: none;
    background: var(--gray, #f0f0f0);
    display: inline-block;
    margin: 0;
    white-space: nowrap;
}

.annotation-field .field-controls {
    margin-left: auto;
}

.annotation-field .field-controls a {
    margin: 0.1em;
}


#edit-annotation-fields #input-warning {
    color: var(--accent-warning)
}

/* Remove all styles for Explorer posts */
/* these ought to be defined specifically, */
/* and 4CAT styles shouldn't interfere. */
#explorer-posts, #explorer-posts > ol li {
    all: initial;
    padding: 0;
}

.explorer-content-container {
    margin-top: 1em;
}

#explorer-content {
    all: initial;
    padding: 0;
}

.post-annotations {
    box-sizing: border-box;
    border-width: 0;
}

.annotation-control-button {
    min-width: 140px;
}

.annotation-field-label.invalid, .option-field > input.invalid {
    border: 1px solid var(--accent-warning);
}

#edit-annotation-fields {
    padding: 0.5em
}

.post-annotations p[role="tooltip"] .property-badge {
    display: inline-block;
    margin: 2px 0px 2px 0px;
    background-color: white;
    border: 1px solid black;
}

#save-annotations-notice {
    position: fixed;
    background-color: var(--accent-okay);
    color: var(--contrast-bright);
    display: none;
    right: 20px;
    bottom: 64px;
    width: 200px;
    text-align: center;
    padding: 10px 5px 10px 5px;
    border-radius: 10px;
}

.delete-input {
    float: right;
}

.spinner {
    animation: fa-spin;
    animation-duration: 1000ms;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
}