.tests-index {
    padding-block: clamp(2rem, 4vw, 3.5rem);
}

.tests-index .test-breadcrumb {
    margin-bottom: 1.25rem;
}

.tests-index [hidden] {
    display: none !important;
}

.tests-index__hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .65fr);
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid #dce5ef;
    border-radius: 22px;
    background: linear-gradient(110deg, #fff 35%, #f0f7f8);
}

.tests-index__heading {
    min-width: 0;
}

.tests-index__heading::before {
    display: block;
    width: 2rem;
    height: 3px;
    margin-bottom: 1rem;
    border-radius: 2px;
    background: #d92f5a;
    content: "";
}

.tests-index__heading h1 {
    margin: 0;
    color: #102e56;
    font-size: clamp(1.65rem, 2.6vw, 2.25rem);
    line-height: 1.3;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.tests-index__counts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .75rem;
    margin: 1rem 0 0;
    color: #52667d;
    font-size: .875rem;
    line-height: 1.5;
}

.tests-index__count-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #bdcbd8;
}

.tests-index__search {
    min-width: 0;
}

.tests-index__search label {
    display: block;
    margin-bottom: .6rem;
    color: #16345a;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.5;
}

.tests-index__search-field {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-height: 52px;
    padding-inline: .9rem;
    border: 1px solid #bacbd9;
    border-radius: 12px;
    background: #fff;
    color: #087ba5;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.tests-index__search-field:focus-within {
    border-color: #087ba5;
    box-shadow: 0 0 0 3px #087ba51a;
}

.tests-index__search-field svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
}

.tests-index__search-field input {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    margin: 0;
    padding: .65rem 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #16345a;
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
}

.tests-index__search-field input::placeholder {
    color: #6b7f95;
    opacity: 1;
}

.tests-index__clear {
    display: block;
    min-width: 44px;
    min-height: 44px;
    margin: .5rem 0 0 auto;
    padding: .25rem 0;
    border: 0;
    background: transparent;
    color: #087ba5;
    font: inherit;
    font-size: .875rem;
    line-height: 1.5;
    text-decoration: underline;
    text-underline-offset: .2em;
    cursor: pointer;
}

.tests-index__groups {
    display: grid;
    gap: 1.25rem;
}

.tests-index__group {
    min-width: 0;
    padding: clamp(1.15rem, 2.5vw, 1.75rem);
    border: 1px solid #dce5ef;
    border-radius: 20px;
    background: #fff;
}

.tests-index__group-heading {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1rem;
}

.tests-index__group-number {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    place-items: center;
    border-radius: 10px;
    background: #fceef2;
    color: #b72a51;
    font-size: .8rem;
    font-weight: 700;
}

.tests-index__group-heading h2 {
    flex: 1;
    min-width: 0;
    margin: 0;
    color: #16345a;
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tests-index__group-count {
    display: grid;
    min-width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    padding-inline: .3rem;
    place-items: center;
    border-radius: 50%;
    background: #edf3f8;
    color: #52667d;
    font-size: .75rem;
    font-weight: 700;
}

.tests-index__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tests-index__list li {
    min-width: 0;
}

.tests-index__card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 94px;
    height: 100%;
    padding: 1rem 1.15rem;
    border: 1px solid #e0e8ed;
    border-radius: 12px;
    background: #f8fafc;
    color: #16345a;
    text-decoration: none;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.tests-index__card-content {
    display: grid;
    justify-items: start;
    gap: .5rem;
    min-width: 0;
}

.tests-index__name {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tests-index__abbreviation {
    display: inline-block;
    max-width: 100%;
    padding: .15rem .5rem;
    border-radius: 6px;
    background: #eaf3f6;
    color: #086b8c;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tests-index__arrow {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    place-items: center;
    border-radius: 50%;
    background: #e6f2ed;
    color: #16866f;
}

.tests-index__arrow .ui-icon {
    width: 1rem;
    height: 1rem;
}

.tests-index__card:hover {
    border-color: #16866f;
    background: #f2f8f7;
    color: #16345a;
    transform: translateY(-1px);
}

.tests-index__card:focus-visible,
.tests-index__clear:focus-visible {
    outline: 3px solid #d92f5a;
    outline-offset: 3px;
}

.tests-index__empty {
    margin: 0;
    padding: 2rem 1.5rem;
    border: 1px solid #dce5ef;
    border-radius: 16px;
    background: #fff;
    color: #52667d;
    text-align: center;
    line-height: 1.6;
}

@media (max-width: 850px) {
    .tests-index__hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    .tests-index__hero,
    .tests-index__group {
        border-radius: 16px;
    }

    .tests-index__list {
        grid-template-columns: minmax(0, 1fr);
    }

    .tests-index__group-heading {
        gap: .6rem;
    }

    .tests-index__card {
        min-height: 90px;
        padding: .9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tests-index__card,
    .tests-index__search-field {
        transition: none;
    }

    .tests-index__card:hover {
        transform: none;
    }
}
