/* ═══════════════════════════════════════════════════════════
   Lists — vertical item lists (the "list-group" pattern)
   A card-framed stack of rows used for pickable results and
   multi-select panels: user search results, role assignment,
   product selection. Rows can be plain, links/buttons (hover),
   or selectable (.is-selected, teal). Pair the leading control
   with checks.css for multi-select.
   ═══════════════════════════════════════════════════════════ */

.tn-list {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--tn-border);
    border-radius: var(--tn-radius-lg);
    overflow: hidden;
    background: var(--tn-bg-card);
}

.tn-list-item {
    display: flex;
    align-items: center;
    gap: var(--tn-space-sm);
    width: 100%;
    padding: 10px 14px;
    background: var(--tn-bg-card);
    border: none;
    border-bottom: 1px solid var(--tn-border-light);
    color: var(--tn-text-primary);
    font-size: var(--tn-font-size-sm);
    font-family: inherit;
    text-align: left;
}

.tn-list-item:last-child {
    border-bottom: none;
}

/* Interactive rows (rendered as <button>/<a> or given this class) */
.tn-list-item--action {
    cursor: pointer;
    transition: background var(--tn-transition);
}

.tn-list-item--action:hover {
    background: var(--tn-bg-hover);
}

.tn-list-item--action:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--tn-accent);
}

/* Selected / active row */
.tn-list-item.is-selected,
.tn-list-item.is-active {
    background: var(--tn-accent-light);
    color: var(--tn-accent);
    font-weight: 500;
}

/* Flush variant — no outer frame, for embedding inside a card/section */
.tn-list--flush {
    border: none;
    border-radius: 0;
    background: transparent;
}

/* A title + sub-line stacked inside a row (e.g. name over email) */
.tn-list-item-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.tn-list-item-title {
    font-weight: 600;
    color: var(--tn-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tn-list-item.is-selected .tn-list-item-title {
    color: var(--tn-accent);
}

.tn-list-item-sub {
    font-size: var(--tn-font-size-xs);
    color: var(--tn-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Trailing element (check mark, badge) pushed to the right */
.tn-list-item-trail {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--tn-accent);
}

/* ── Mobile density — rows sit on a 16px gutter rhythm and keep a
   comfortable 44px touch target (Apple HIG min) even when tightened. ── */
@media (max-width: 640px) {
    .tn-list-item {
        padding: 11px var(--tn-space-md);
        min-height: 44px;
    }
}
