.code-block {
    border: 1px solid rgba(34, 36, 38, .15);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5em;
}

.code-block-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 4px 8px;
    background: #f7f7f7;
    border-bottom: 1px solid rgba(34, 36, 38, .15);
}

.code-block-toolbar .code-copy-btn.copied {
    color: #21ba45;
}

.code-block-body {
    max-height: 340px;
    overflow: auto;
    margin: 0;
    padding: 10px 14px;
    background: #fbfbfb;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85em;
}

.record-statistics {
    display: flex;
    gap: 1.5em;
    flex-wrap: wrap;
}

.record-statistic .icon {
    color: rgba(0, 0, 0, .55);
    margin-right: .35em;
}

.record-statistic-value {
    font-weight: bold;
}

/* Nodes section: one row per node, with what is not label, role or
   description behind the row's toggle. */
.node-list-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .5em 1em;
    margin-bottom: .75em;
}

.node-expand-all {
    border: 0;
    padding: 0;
    background: none;
    font: inherit;
    color: #2f6fa7;
    cursor: pointer;
}

.node-expand-all:hover {
    text-decoration: underline;
}

.node-list {
    border: 1px solid rgba(34, 36, 38, .15);
    border-radius: 4px;
}

.node-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.node-list-head,
.node-summary {
    display: grid;
    grid-template-columns: minmax(14em, 1.5fr) minmax(0, 2.5fr) 7.5em;
    gap: 1em;
    align-items: start;
    padding: .7em .8em;
}

.node-list-head {
    background: #f9fafb;
    font-weight: bold;
    border-bottom: 1px solid rgba(34, 36, 38, .15);
}

.node-row + .node-row {
    border-top: 1px solid rgba(34, 36, 38, .1);
}

.node-row[hidden] {
    display: none;
}

summary.node-summary {
    cursor: pointer;
    list-style: none;
}

summary.node-summary::-webkit-details-marker {
    display: none;
}

summary.node-summary:hover,
.node-row details[open] {
    background: #f7f9fb;
}

/* Inline, so a chip follows the last line of a wrapped label instead of
   dropping to a line of its own. */
.node-name {
    min-width: 0;
}

.node-label {
    font-weight: bold;
    overflow-wrap: anywhere;
}

.node-description {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* graph_theme.ROLE_COLORS, so the chips read as the figure's legend.
   NodeDetailsTests holds the two together. */
.node-chip {
    display: inline-block;
    padding: .15em .55em;
    border-radius: 3px;
    color: #fff;
    font-size: .8em;
    font-weight: bold;
    line-height: 1.4;
    white-space: nowrap;
    vertical-align: .1em;
}

.node-chip.exposure { background: #009E73; }
.node-chip.outcome { background: #D55E00; }
.node-chip.unmeasured { background: #8c9096; }

.node-more {
    justify-self: end;
    color: #2f6fa7;
    font-size: .9em;
    white-space: nowrap;
}

.node-more .dropdown.icon {
    margin: 0;
    transition: transform .15s ease;
}

.node-row details[open] .node-more .dropdown.icon {
    transform: rotate(180deg);
}

.node-details {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: .4em 1.5em;
    margin: 0 .8em .8em;
    padding: .75em 1em;
    background: #fff;
    border: 1px solid rgba(34, 36, 38, .1);
    border-radius: 4px;
}

.node-details dt {
    color: rgba(0, 0, 0, .55);
}

.node-details dd {
    margin: 0;
    min-width: 0;
}

.node-identifiers {
    display: flex;
    flex-wrap: wrap;
    gap: .2em 1.2em;
}

.node-identifiers a,
.node-unit {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: .9em;
    overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
    .node-more .dropdown.icon {
        transition: none;
    }
}

@media (max-width: 600px) {
    .node-list-head {
        display: none;
    }

    .node-summary {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .35em .75em;
    }

    .node-description {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .node-details {
        grid-template-columns: minmax(0, 1fr);
        gap: .1em;
    }

    .node-details dd + dt {
        margin-top: .5em;
    }
}
