.tmsr-wrap,
.tmsr-wrap * {
    box-sizing: border-box;
}

.tmsr-wrap {
    --tmsr-rose: #c99191;
    --tmsr-rose-dark: #986970;
    --tmsr-blush: #fde3da;
    --tmsr-cream: #fbf5f1;
    --tmsr-cream-deep: #f4ebe5;
    --tmsr-ink: #3c3335;
    --tmsr-muted: #7d7071;
    --tmsr-border: rgba(201, 145, 145, .28);
    width: 100%;
    color: var(--tmsr-ink);
    font-family: inherit;
}

.tmsr-heading {
    max-width: 830px;
    margin: 0 auto 30px;
    text-align: center;
}

.tmsr-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-bottom: 12px;
    padding: 6px 16px;
    border: 1px solid var(--tmsr-border);
    border-radius: 999px;
    background: linear-gradient(135deg, #fff, var(--tmsr-cream));
    color: var(--tmsr-rose-dark);
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 8px 25px rgba(169, 111, 118, .08);
}

.tmsr-heading h2 {
    margin: 0 0 10px;
    color: var(--tmsr-ink);
    font-size: clamp(28px, 3.2vw, 42px);
    line-height: 1.5;
    font-weight: 900;
}

.tmsr-heading > p {
    margin: 0;
    color: var(--tmsr-muted);
    font-size: 15px;
    line-height: 2;
}

.tmsr-trust-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 17px;
}

.tmsr-trust-row span {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(253, 227, 218, .58);
    color: var(--tmsr-rose-dark);
    font-size: 11px;
    font-weight: 800;
}

.tmsr-trust-row span::before {
    content: "✓";
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: var(--tmsr-rose-dark);
    font-size: 10px;
}

.tmsr-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin: 0 auto 28px;
}

.tmsr-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 45px;
    padding: 9px 15px 9px 10px;
    border: 1px solid var(--tmsr-border);
    border-radius: 999px;
    background: #fff;
    color: var(--tmsr-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 7px 22px rgba(68, 48, 51, .045);
    transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.tmsr-filter b {
    display: grid;
    min-width: 25px;
    height: 25px;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--tmsr-cream);
    color: var(--tmsr-rose-dark);
    font-size: 10px;
    line-height: 1;
    transition: inherit;
}

.tmsr-filter:hover {
    transform: translateY(-1px);
    border-color: var(--tmsr-rose);
    box-shadow: 0 10px 27px rgba(169, 111, 118, .11);
}

.tmsr-filter.is-active {
    border-color: var(--tmsr-rose);
    background: var(--tmsr-rose);
    color: #fff;
    box-shadow: 0 11px 28px rgba(169, 111, 118, .23);
}

.tmsr-filter.is-active b {
    background: rgba(255, 255, 255, .23);
    color: #fff;
}

.tmsr-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
}

.tmsr-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(169, 111, 118, .14);
    border-radius: 23px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(68, 48, 51, .075);
    transition: transform .28s ease, box-shadow .28s ease, opacity .2s ease;
}

.tmsr-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 19px 48px rgba(68, 48, 51, .13);
}

.tmsr-card.is-hidden {
    display: none;
}

.tmsr-image-button {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.tmsr-image-frame {
    position: relative;
    display: grid;
    width: 100%;
    aspect-ratio: 4 / 5;
    place-items: center;
    overflow: hidden;
    padding: 10px;
    background:
        radial-gradient(circle at 20% 15%, rgba(253,227,218,.8), transparent 35%),
        linear-gradient(145deg, #fff, var(--tmsr-cream));
}

.tmsr-image-frame img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 13px;
    object-fit: contain;
    object-position: center;
    filter: saturate(.98);
    transition: transform .4s ease, filter .3s ease;
}

.tmsr-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    background: linear-gradient(180deg, rgba(55, 39, 42, .01), rgba(55, 39, 42, .52));
    color: #fff;
    opacity: 0;
    transition: opacity .25s ease;
}

.tmsr-overlay i {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.52);
    border-radius: 50%;
    background: rgba(255,255,255,.16);
    font-style: normal;
    font-size: 25px;
    backdrop-filter: blur(8px);
}

.tmsr-overlay em {
    font-style: normal;
    font-size: 11px;
    font-weight: 800;
}

.tmsr-card:hover .tmsr-image-frame img {
    transform: scale(1.018);
    filter: saturate(1.04);
}

.tmsr-card:hover .tmsr-overlay,
.tmsr-image-button:focus-visible .tmsr-overlay {
    opacity: 1;
}

.tmsr-card-body {
    min-height: 123px;
    padding: 15px 17px 18px;
    text-align: right;
}

.tmsr-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
}

.tmsr-category-badge,
.tmsr-course {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.tmsr-category-badge {
    background: var(--tmsr-blush);
    color: var(--tmsr-rose-dark);
}

.tmsr-course {
    border: 1px solid var(--tmsr-border);
    background: #fff;
    color: var(--tmsr-muted);
}

.tmsr-card-body h3 {
    margin: 0;
    color: var(--tmsr-ink);
    font-size: 14px;
    line-height: 1.85;
    font-weight: 900;
}

.tmsr-student,
.tmsr-description {
    margin: 6px 0 0;
    color: var(--tmsr-muted);
    font-size: 12px;
    line-height: 1.8;
}

.tmsr-description {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tmsr-empty {
    margin-top: 22px;
    padding: 27px;
    border: 1px dashed var(--tmsr-border);
    border-radius: 19px;
    background: var(--tmsr-cream);
    color: var(--tmsr-muted);
    text-align: center;
}

.tmsr-lightbox[hidden] {
    display: none;
}

.tmsr-lightbox {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(31, 24, 25, .89);
    backdrop-filter: blur(8px);
}

.tmsr-lightbox-inner {
    display: flex;
    width: min(95vw, 1150px);
    max-height: 90vh;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tmsr-lightbox img {
    display: block;
    max-width: 100%;
    max-height: calc(90vh - 58px);
    border-radius: 18px;
    object-fit: contain;
    box-shadow: 0 25px 75px rgba(0, 0, 0, .39);
}

.tmsr-lightbox p {
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
}

.tmsr-lightbox-close {
    position: fixed;
    top: 18px;
    left: 18px;
    display: grid;
    width: 47px;
    height: 47px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.36);
    border-radius: 50%;
    background: rgba(255,255,255,.13);
    color: #fff;
    font: inherit;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

body.tmsr-lightbox-open {
    overflow: hidden;
}

@media (max-width: 980px) {
    .tmsr-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .tmsr-heading {
        margin-bottom: 23px;
    }

    .tmsr-heading h2 {
        font-size: 28px;
    }

    .tmsr-heading > p {
        font-size: 13px;
        line-height: 1.9;
    }

    .tmsr-trust-row {
        gap: 6px;
    }

    .tmsr-trust-row span {
        padding: 6px 9px;
        font-size: 10px;
    }

    .tmsr-filters {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-inline: -2px;
        padding: 2px 2px 10px;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .tmsr-filters::-webkit-scrollbar {
        display: none;
    }

    .tmsr-filter {
        flex: 0 0 auto;
        min-height: 42px;
        scroll-snap-align: start;
        font-size: 12px;
    }

    .tmsr-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tmsr-card {
        border-radius: 20px;
    }

    .tmsr-image-frame {
        aspect-ratio: 4 / 5;
        padding: 8px;
    }

    .tmsr-card-body {
        min-height: 0;
        padding: 14px 15px 17px;
    }

    .tmsr-lightbox {
        padding: 16px;
    }

    .tmsr-lightbox-close {
        top: 12px;
        left: 12px;
        width: 42px;
        height: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tmsr-card,
    .tmsr-filter,
    .tmsr-image-frame img,
    .tmsr-overlay {
        transition: none !important;
    }
}
