/* Rows separated by dividers: installations, workspaces. */
.list {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* A list inside a row of another: a server's connections. */
.list--nested {
    padding-left: var(--spacing-xl);
}

.list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    padding-block: var(--spacing-md);
    border-bottom: var(--border-width) solid var(--color-divider-subtle);
}

/* A row whose content runs the full width, one part under another (a skill and its file). */
.list__item--stacked {
    flex-direction: column;
    align-items: stretch;
}

.list__item:first-child {
    padding-top: 0;
}

.list__item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.list__main {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 0;
}

.list__icon {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    object-fit: contain;
    color: var(--color-on-surface-muted);
}

.list__title {
    font-weight: var(--font-weight-medium);
}

/* A title that opens what it names: quiet until pointed at. */
.list__link {
    color: inherit;
    text-decoration: none;
}

.list__link:hover {
    text-decoration: underline;
}

.list__meta {
    color: var(--color-on-surface-muted);
    font-size: var(--font-size-sm);
}

/* Keep the action at the right edge while long content wraps in its own column. */
.list__item--with-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}

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

.list__action {
    justify-self: end;
    grid-column: 2;
    grid-row: 1;
}

/* Installation controls may wrap within their column without squeezing the identity. */
.list__item--responsive-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

.list__main--top {
    align-items: flex-start;
}

.list__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    min-width: 0;
}

@media (min-width: 48rem) {
    .list__item--responsive-actions {
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    }
}

/* SVG preserves its aspect ratio and centers within the name's first text line. */
.list__icon--first-line {
    height: 1lh;
}

/* Identity details use the full row on narrow screens beneath the header action. */
.list__details {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    overflow-wrap: anywhere;
}

@media (min-width: 48rem) {
    .list__details {
        grid-column: 1;
    }
}

/* Separate records whose details and actions need to read as one unit. */
/* Audit history is secondary to the record's current state. */
.list__audit {
    color: var(--color-on-surface-muted);
    font-size: var(--font-size-sm);
    overflow-wrap: anywhere;
}

/* On a phone the action goes under the row's content, which then keeps the full width. */
@media (max-width: 47.99rem) {
    .list__item--with-action {
        grid-template-columns: minmax(0, 1fr);
    }

    .list__action {
        grid-column: 1;
        grid-row: auto;
        justify-self: start;
    }
}
