.grtoc {
    margin: 0 0 28px;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.grtoc__title {
    margin: 0 0 12px;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 800;
    color: inherit;
}

.grtoc__items {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 14px 28px;
}

.grtoc__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 106px;
    min-height: 38px;
    padding: 9px 18px;
    border: 2px solid var(--grtoc-border, #ff2d3d);
    border-radius: 9px;
    background: var(--grtoc-bg, transparent);
    color: var(--grtoc-text, inherit);
    text-decoration: none !important;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 700;
    text-align: center;
    box-sizing: border-box;
    transition: transform .18s ease, background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.grtoc__item:hover,
.grtoc__item:focus-visible {
    transform: translateY(-2px);
    background: var(--grtoc-hover-bg, #ff2d3d);
    color: var(--grtoc-hover-text, #ffffff);
    border-color: var(--grtoc-hover-bg, #ff2d3d);
    box-shadow: 0 7px 18px rgba(0, 0, 0, .18);
    outline: none;
}

.grtoc__item--h2 { min-width: 102px; }
.grtoc__item--h3 { min-width: 96px; opacity: .96; }
.grtoc__item--h4 { min-width: 90px; opacity: .92; }

.grtoc-anchor-heading {
    scroll-margin-top: 90px;
}

@media (max-width: 700px) {
    .grtoc__items {
        gap: 10px;
    }

    .grtoc__item,
    .grtoc__item--h2,
    .grtoc__item--h3,
    .grtoc__item--h4 {
        flex: 1 1 calc(50% - 10px);
        min-width: 0;
        padding: 9px 12px;
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .grtoc__item,
    .grtoc__item--h2,
    .grtoc__item--h3,
    .grtoc__item--h4 {
        flex-basis: 100%;
    }
}
