.tlb-grades-widget {
    direction: rtl;
    display: grid;
    gap: 14px;
    width: 100%;
    font-family: inherit;
}

.tlb-grades-course {
    overflow: hidden;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

.tlb-grades-course__button {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 72px;
    padding: 8px 16px;
    color: #151515;
    text-align: right;
    background: #fff;
    border: 0;
    cursor: pointer;
}

.tlb-grades-course__button:hover{
    background: #b41e8f13;
    color: #151515;
    cursor: pointer;
}

.tlb-grades-course__button:focus{
    background: #fff;
    color: #151515;
    cursor: pointer;
}

.tlb-grades-course__identity {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.tlb-grades-course__image {
    display: block;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 50% !important;
}

.tlb-grades-course__image--empty {
    background: #eee;
}

.tlb-grades-course__titles {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.tlb-grades-course__title {
    overflow: hidden;
    font-size: 20px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tlb-grades-course__total {
    color: #aaa;
    font-size: 14px;
}

.tlb-grades-course__icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #d21a93;
    transition:
        transform var(--tlb-rotation-duration, 250ms)
        var(--tlb-rotation-easing, ease);
}

.tlb-grades-course.is-open .tlb-grades-course__icon {
    transform: rotate(180deg);
}

.tlb-grades-course__panel {
    background: #eee;
}

.tlb-grades-grid {
    overflow: hidden;
}

.tlb-grades-grid__headers,
.tlb-grades-grid__body {
    display: grid;
    grid-template-columns:
        minmax(72px, 0.55fr)
        minmax(180px, 1.25fr)
        repeat(
            calc(var(--tlb-column-count) - 2),
            minmax(140px, 1fr)
        );
}

.tlb-grades-grid__headers {
    background: #e4e4e4;
}

.tlb-grades-category__head {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    min-height: 86px;
    padding: 0px 10px;
    text-align: center;
    border-inline-start: 1px solid rgba(0, 0, 0, 0.06);
}

.tlb-grades-category__title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tlb-grades-category__icon {
    color: var(--tlb-category-color, #d21a93);
}

.tlb-grades-category--lesson .tlb-grades-category__head {
    gap: 0;
}

.tlb-grades-category--lesson .tlb-grades-category__grade,
.tlb-grades-category--lesson .tlb-grades-progress,
.tlb-grades-category--lesson .tlb-grades-category__percent-only {
    display: none !important;
}

.tlb-grades-category__percent-only {
    color: #777;
    font-size: 13px;
    text-align: center;
    direction: ltr;
}

.tlb-grades-progress {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    overflow: hidden;
    background: #bdbdbd;
    border-radius: 999px;
}

.tlb-grades-progress__fill {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 0;
    display: block;
    height: 100%;
    background: var(--tlb-category-color, #d21a93);
    border-radius: inherit;
}

.tlb-grades-progress__label {
    position: relative;
    top: 2px;
    z-index: 1;
    width: 100%;
    color: rgba(0, 0, 0, 0.48);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    direction: ltr;
}

.tlb-grades-category--website {
    --tlb-category-color: #ff0400;
}

.tlb-grades-category--movies {
    --tlb-category-color: #0046ff;
}

.tlb-grades-category--weekly {
    --tlb-category-color: #00a138;
}

.tlb-grades-category--class {
    --tlb-category-color: #d85100;
}

.tlb-grades-category--final {
    --tlb-category-color: #3dacac;
}

.tlb-grades-grid__body {
    position: relative;
    display: grid;
    grid-template-rows:
        repeat(
            var(--tlb-row-count),
            minmax(54px, auto)
        );
    background: #ededed;
}

.tlb-grades-body-cell {
    grid-column: var(--tlb-col);
    grid-row: var(--tlb-row);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 10px 12px;
    background: #f5f5f5;
    /*border-top: 7px solid #e0e0e0;*/
    border-inline-start: 1px solid rgba(0, 0, 0, 0.06);
}

.tlb-grades-body-cell:nth-child(even) {
    background: #ededed;
}

.tlb-grades-body-cell--span {
    grid-row:
        var(--tlb-row)
        / span var(--tlb-span);
}

.tlb-grades-body-cell--lesson {
    justify-content: flex-start;
}

.tlb-grades-body-cell--weekly,
.tlb-grades-body-cell--class,
.tlb-grades-body-cell--final {
    font-size: 20px;
}

.tlb-grades-item__name {
    overflow: hidden;
    max-width: 100%;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tlb-grades-item__grade {
    color: #d21a93;
    font-weight: 700;
}

.tlb-grades-body-cell--website .tlb-grades-item__grade {
    color: #ff0400;
}

.tlb-grades-body-cell--movies .tlb-grades-item__grade {
    color: #0046ff;
}

.tlb-grades-body-cell--weekly .tlb-grades-item__grade {
    color: #00a138;
}

.tlb-grades-body-cell--class .tlb-grades-item__grade {
    color: #d85100;
}

.tlb-grades-body-cell--final .tlb-grades-item__grade {
    color: #3dacac;
}

.tlb-grades-state {
    padding: 24px;
    color: #666;
    text-align: center;
    background: #f7f7f7;
    border-radius: 16px;
}

@media (max-width: 767px) {
    .tlb-grades-widget {
        gap: 12px;
    }

    .tlb-grades-course {
        border-radius: 30px;
    }


    .tlb-grades-course__button {
        min-height: 72px;
        padding: 8px 16px;
    }

    .tlb-grades-course__title {
        font-size: 21px;
    }

    .tlb-grades-course__panel {
        padding: 10px 14px 18px;
    }

    .tlb-grades-grid__headers {
        display: block;
        background: transparent;
    }

    .tlb-grades-category--number,
    .tlb-grades-category--lesson {
        display: none;
    }

    .tlb-grades-category {
        border-bottom: 1px solid #d6d6d6;
    }

    .tlb-grades-category__head {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        min-height: 62px;
        padding: 12px 0;
        text-align: right;
        border: 0;
    }

    .tlb-grades-category__title-row {
        justify-content: flex-start;
    }

    .tlb-grades-progress {
        grid-column: 1 / -1;
    }

    .tlb-grades-progress__label {
        font-size: 12px;
    }

    .tlb-grades-grid__body {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tlb-grades-course__icon {
        transition: none !important;
    }
}