.rtt {
    --rtt-ink: #0e1726;
    --rtt-ink-2: #5b6675;
    --rtt-ink-3: #666f7e;
    --rtt-ico: #818a9b;
    --rtt-line: #e7ebf1;
    --rtt-line-ctrl: #868fa0;
    --rtt-soft: #f5f7fa;
    --rtt-radius: 18px;
    --rtt-gap: 18px;
    --rtt-col: 210px;
    --rtt-media-ratio: 4 / 3;

    --rtt-brand: var(--color_brand, #1a5fb4);
    --rtt-b-ink: oklch(from var(--rtt-brand) min(l, 0.48) c h);
    --rtt-b-ui: oklch(from var(--rtt-brand) min(l, 0.60) c h);
    --rtt-b-08: color-mix(in srgb, var(--rtt-brand) 8%, #fff);
    --rtt-b-16: color-mix(in srgb, var(--rtt-brand) 16%, #fff);
    --rtt-b-30: color-mix(in srgb, var(--rtt-brand) 30%, #fff);
    --rtt-b-deep: color-mix(in srgb, var(--rtt-b-ink) 82%, #0b1220);
    --rtt-b-glow: color-mix(in srgb, var(--rtt-brand) 38%, transparent);
    --rtt-focus: #111827;

    display: block;
    padding: clamp(28px, 4vw, 56px) 0;
    color: var(--rtt-ink);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

@supports not (color: oklch(from #000 l c h)) {
    .rtt {
        --rtt-b-ink: color-mix(in srgb, var(--rtt-brand) 48%, #000);
        --rtt-b-ui: color-mix(in srgb, var(--rtt-brand) 72%, #000);
    }
}

.rtt__srOnly {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---------- шапка ---------- */
.rtt__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 clamp(16px, 2.2vw, 24px);
}

.rtt__title {
    margin: 0;
    font-size: clamp(20px, 2.4vw, 30px);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.02em;
}

.rtt__title em {
    font-style: normal;
    color: var(--rtt-b-ink);
}

/* ---------- поиск ---------- */
.rtt__search {
    position: relative;
    flex: 0 1 300px;
    min-width: 210px;
}

.rtt__searchIco {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 17px;
    height: 17px;
    margin-top: -8.5px;
    color: var(--rtt-ico);
    pointer-events: none;
    transition: color .2s ease;
}

.rtt__field {
    width: 100%;
    height: 44px;
    padding: 0 40px;
    border: 1px solid var(--rtt-line-ctrl);
    border-radius: 999px;
    background: #fff;
    color: var(--rtt-ink);
    font: inherit;
    font-size: 15px;
    line-height: 1;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.rtt__field::placeholder {
    color: var(--rtt-ink-3);
    opacity: 1;
}

.rtt__field::-webkit-search-decoration,
.rtt__field::-webkit-search-cancel-button,
.rtt__field::-webkit-search-results-button {
    -webkit-appearance: none;
    display: none;
}

.rtt__field:focus {
    border-color: var(--rtt-b-ui);
    box-shadow: 0 0 0 3px var(--rtt-b-16);
}

.rtt__field:focus-visible {
    outline: 2px solid var(--rtt-focus);
    outline-offset: 2px;
}

.rtt__search:focus-within .rtt__searchIco {
    color: var(--rtt-b-ui);
}

.rtt__clear {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 26px;
    height: 26px;
    margin-top: -13px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--rtt-soft);
    color: var(--rtt-ink-2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s, background .18s ease, color .18s ease;
}

.rtt__clear svg {
    width: 12px;
    height: 12px;
}

.rtt__clear:hover {
    background: var(--rtt-b-16);
    color: var(--rtt-b-ink);
}

.rtt__clear:focus-visible {
    outline: 2px solid var(--rtt-focus);
    outline-offset: 2px;
}

.rtt.is-searching .rtt__clear {
    opacity: 1;
    visibility: visible;
}

.rtt__found {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.3;
    color: var(--rtt-ink-2);
    min-height: 1.3em;
}

.rtt__found b {
    color: var(--rtt-ink);
    font-weight: 600;
}

/* ---------- сетка ---------- */
.rtt__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--rtt-col), 1fr));
    gap: var(--rtt-gap);
}

.rtt__item {
    min-width: 0;
}

.rtt__item[hidden] {
    display: none;
}

/* ---------- карточка ---------- */
.rtt__card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 16px 16px 18px;
    font: inherit;
    text-align: center;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--rtt-line-ctrl);
    border-radius: var(--rtt-radius);
    background: #fff;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.rtt__card:hover {
    border-color: var(--rtt-b-ui);
    box-shadow: 0 18px 36px -24px var(--rtt-b-glow);
    transform: translateY(-3px);
}

.rtt__card:focus-visible {
    outline: 2px solid var(--rtt-focus);
    outline-offset: 2px;
}

.rtt__card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 18px;
    right: 18px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--rtt-b-ui);
    transform: scaleX(0);
    transition: transform .3s cubic-bezier(.22, .7, .3, 1);
}

.rtt__card:hover::before,
.rtt__card:focus-visible::before {
    transform: scaleX(1);
}

.rtt__media {
    display: block;
    width: 100%;
    margin: 0 0 14px;
    border-radius: 12px;
    background: var(--rtt-soft);
    overflow: hidden;
    pointer-events: none;
    transition: background .22s ease;
}

.rtt__card:hover .rtt__media {
    background: var(--rtt-b-08);
}

.rtt__media img,
.rtt__media svg {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--rtt-media-ratio);
    object-fit: contain;
    padding: 10px;
    transition: transform .38s cubic-bezier(.22, .7, .3, 1);
}

.rtt__card:hover .rtt__media img,
.rtt__card:hover .rtt__media svg {
    transform: scale(1.05);
}

.rtt__media--empty {
    display: grid;
    place-items: center;
    aspect-ratio: var(--rtt-media-ratio);
    color: var(--rtt-ico);
}

.rtt__media--empty svg {
    width: 34%;
    max-width: 56px;
    height: auto;
    aspect-ratio: auto;
    padding: 0;
}

.rtt__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: auto;
    text-align: center;
}

.rtt__name {
    margin: 0;
    font-size: 15px;
    line-height: 1.32;
    font-weight: 600;
    letter-spacing: -.01em;
    transition: color .22s ease;
}

.rtt__card:hover .rtt__name {
    color: var(--rtt-b-ink);
}

.rtt__hit {
    background: var(--rtt-b-16);
    border-radius: 3px;
    color: var(--rtt-ink);
    padding: 0 1px;
}

/* ---------- пустой результат ---------- */
.rtt__empty {
    margin: 0;
    padding: 28px 16px;
    border: 1px dashed var(--rtt-line);
    border-radius: var(--rtt-radius);
    text-align: center;
    color: var(--rtt-ink-2);
    font-size: 15px;
    line-height: 1.5;
}

.rtt__empty[hidden] {
    display: none;
}

.rtt__emptyBtn {
    display: inline-block;
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--rtt-b-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rtt__emptyBtn:focus-visible {
    outline: 2px solid var(--rtt-focus);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- кнопка «показать все» ---------- */
.rtt__more {
    display: flex;
    justify-content: center;
    margin-top: clamp(16px, 2.2vw, 24px);
}

.rtt__more[hidden] {
    display: none;
}

.rtt__moreBtn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 26px;
    border: 0;
    border-radius: 999px;
    background: var(--rtt-b-ink);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.rtt__moreBtn:hover {
    background: var(--rtt-b-deep);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -14px var(--rtt-b-glow);
}

.rtt__moreBtn:active {
    transform: translateY(0);
}

.rtt__moreBtn:focus-visible {
    outline: 2px solid var(--rtt-focus);
    outline-offset: 3px;
}

.rtt__moreBtn b {
    font-weight: 700;
}

.rtt__moreIco {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    transition: transform .28s cubic-bezier(.22, .7, .3, 1);
}

.rtt__moreBtn[aria-expanded="true"] .rtt__moreIco {
    transform: rotate(180deg);
}

.rtt__item--extra {
    opacity: 0;
    transform: translateY(10px);
}

.rtt__item--extra.is-in {
    opacity: 1;
    transform: none;
    transition: opacity .35s ease, transform .35s cubic-bezier(.22, .7, .3, 1);
}

/* ---------- адаптив ---------- */
@media (max-width:680px) {
    .rtt__head {
        gap: 12px;
    }

    .rtt__title {
        flex: 1 1 100%;
    }

    .rtt__search {
        flex: 1 1 100%;
    }
}

@media (max-width:520px) {
    .rtt {
        --rtt-gap: 12px;
        --rtt-col: 140px;
        --rtt-radius: 14px;
    }

    .rtt__card {
        padding: 12px 12px 14px;
    }

    .rtt__media {
        margin-bottom: 10px;
    }

    .rtt__name {
        font-size: 13.5px;
    }

    .rtt__moreBtn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-contrast: more) {
    .rtt {
        --rtt-ink-2: #3d4756;
        --rtt-ink-3: #3d4756;
        --rtt-ico: #5b6675;
        --rtt-line-ctrl: #5b6675;
        --rtt-b-ink: oklch(from var(--rtt-brand) min(l, 0.40) c h);
        --rtt-b-ui: oklch(from var(--rtt-brand) min(l, 0.50) c h);
    }
}

@media (prefers-reduced-motion:reduce) {
    .rtt * {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }

    .rtt__card:hover {
        transform: none;
    }

    .rtt__item--extra {
        opacity: 1;
        transform: none;
    }
}

@media (forced-colors: active) {

    .rtt__field,
    .rtt__card {
        border-color: CanvasText;
    }

    .rtt__moreBtn {
        background: ButtonFace;
        color: ButtonText;
        border: 1px solid ButtonText;
    }

    .rtt__card::before {
        background: Highlight;
    }

    .rtt__searchIco,
    .rtt__clear,
    .rtt__media--empty {
        color: CanvasText;
    }

    .rtt__hit {
        background: Mark;
        color: MarkText;
    }

    .rtt *:focus-visible {
        outline-color: Highlight;
    }
}