/*
 * Shared seller rows. All selectors are scoped to .csr-*.
 * Rows carry their own light tokens; a .dark-theme ancestor flips them.
 */
.csr-row {
    --csr-surface: #ffffff;
    --csr-alt: #eef4f9;
    --csr-ink: #17354b;
    --csr-muted: #4a5666;
    --csr-border: #cfdae3;
    --csr-blue: #08699f;
    --csr-green: #168042;
    --csr-selected: #ecf8f1;
    --csr-star: #a45a00;
    --csr-avatar-bg: #e6f3fc;
    --csr-check-mark: #ffffff;
    --csr-focus: #0da9ef;
    display: block;
    position: relative;
    min-width: 0;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--csr-border);
    background: var(--csr-surface);
    color: var(--csr-ink);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    color-scheme: light;
}

.csr-row,
.csr-row *,
.csr-row *::before,
.csr-row *::after {
    box-sizing: border-box;
}

.csr-row:nth-child(even) {
    background: var(--csr-alt);
}

.csr-row.is-selected {
    background: var(--csr-selected);
    box-shadow: inset 3px 0 0 var(--csr-green);
}

.dark-theme .csr-row,
.csr-row.dark-theme {
    --csr-surface: #202c3b;
    --csr-alt: #293747;
    --csr-ink: #e4edf5;
    --csr-muted: #bccbd9;
    --csr-border: #506579;
    --csr-blue: #8cd0f5;
    --csr-green: #2dd4a7;
    --csr-selected: #153e37;
    --csr-star: #ffc369;
    --csr-avatar-bg: #153e55;
    --csr-check-mark: #102333;
    --csr-focus: #8cd0f5;
    color-scheme: dark;
}

.csr-surface {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 44px;
    gap: 10px;
    align-items: start;
    min-width: 0;
    margin: 0;
    padding: 10px 12px;
}

.csr-picker .csr-surface {
    cursor: pointer;
}

.csr-recipient .csr-surface {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    min-height: 60px;
    padding: 8px 12px;
    cursor: default;
}

.csr-avatar {
    display: block;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: 1px solid var(--csr-border);
    border-radius: 50%;
    background: var(--csr-avatar-bg);
    object-fit: cover;
    overflow: hidden;
}

.csr-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--csr-blue);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.csr-recipient .csr-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 11px;
}

.csr-identity {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.csr-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 10px;
    min-width: 0;
}

.csr-name {
    min-width: 0;
    color: var(--csr-ink);
    font-size: 14px;
    font-weight: 700;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.csr-level {
    min-width: 0;
    color: var(--csr-muted);
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.csr-rating {
    --csr-rating-muted: var(--csr-muted, #4a5666);
    --csr-rating-star: var(--csr-star, #a45a00);
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 5px;
    min-width: 0;
    color: var(--csr-rating-muted);
    font-size: 12px;
    line-height: 1.3;
}

.csr-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    color: var(--csr-rating-star);
    font-size: 14px;
    line-height: 1;
}

.csr-rating-stars .fa-star {
    color: var(--csr-rating-star);
}

.csr-rating-count,
.csr-rating-note {
    min-width: 0;
    color: var(--csr-rating-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.dark-theme .csr-rating,
.csr-rating.dark-theme {
    --csr-rating-muted: var(--csr-muted, #bccbd9);
    --csr-rating-star: var(--csr-star, #ffc369);
}

.csr-title {
    display: block;
    min-width: 0;
    margin-top: 3px;
    overflow: hidden;
    color: var(--csr-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

.csr-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 12px;
    min-width: 0;
    margin-top: 6px;
}

.csr-fact {
    display: block;
    min-width: 0;
}

.csr-fact-label {
    display: block;
    color: var(--csr-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.csr-fact-value {
    display: block;
    color: var(--csr-ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.csr-check-target {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    align-self: center;
    width: 44px;
    height: 44px;
    border-radius: 4px;
}

.csr-checkbox {
    position: relative;
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
    padding: 0;
    border: 2px solid var(--csr-muted);
    border-radius: 4px;
    background: var(--csr-surface);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.csr-checkbox:checked {
    border-color: var(--csr-green);
    background: var(--csr-green);
}

.csr-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid var(--csr-check-mark);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.csr-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.csr-checkbox:focus-visible,
.csr-check-target[tabindex="0"]:focus-visible {
    outline: 3px solid var(--csr-focus);
    outline-offset: 2px;
}

.csr-recipient .csr-name {
    font-size: 13px;
}

.csr-recipient .csr-heading {
    gap: 2px 10px;
}

.csr-recipient .csr-rating {
    margin-top: 1px;
}

@media (max-width: 575px) {
    .csr-picker .csr-surface {
        grid-template-columns: 32px minmax(0, 1fr) 44px;
        gap: 8px;
        align-items: start;
        padding: 10px;
    }

    .csr-picker .csr-avatar {
        grid-column: 1;
        grid-row: 1;
    }

    .csr-picker .csr-identity {
        display: contents;
    }

    .csr-picker .csr-heading {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .csr-picker .csr-heading .csr-rating {
        flex-basis: 100%;
    }

    .csr-picker .csr-title {
        grid-column: 1 / -1;
        display: -webkit-box;
        white-space: normal;
        overflow: hidden;
        text-overflow: clip;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .csr-picker .csr-facts {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px 8px;
        margin-top: 2px;
    }

    .csr-picker .csr-check-target {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
        justify-self: end;
    }

    .csr-recipient .csr-surface {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 8px;
        padding: 8px 10px;
    }

    .csr-recipient .csr-heading .csr-rating {
        flex-basis: auto;
    }
}
