.bivb-tools__toolbar {
    display: grid;
    gap: 1.25em;
    margin-bottom: 1.875em;
}

.bivb-tools__count {
    margin: 0;
    color: var(--bivb-color-text-muted);
    font-size: 0.8125em;
    font-weight: var(--bivb-font-weight-medium);
}

.bivb-tools__controls {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 0.625em;
}

.bivb-tools__controls .bivb-listing-field:nth-child(1) {
    flex: 0 0 12.5em;
}

.bivb-tools__controls .bivb-listing-field:nth-child(2) {
    flex: 0 0 8.625em;
}

.bivb-tools__controls .bivb-listing-field:nth-child(3) {
    flex: 0 1 21.25em;
}

.bivb-tools__item-link:focus-visible,
.bivb-tools__action:focus-visible {
    outline: var(--bivb-control-focus-width) solid var(--bivb-color-primary);
    outline-offset: var(--bivb-control-focus-offset);
}

.bivb-tools__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25em;
}

.bivb-tools__item {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 8.75em;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8125em;
    padding: 1.25em 1.1875em;
    border: 1px solid var(--bivb-color-border-soft);
    border-radius: var(--bivb-radius-6);
    background: var(--bivb-color-surface);
}

.bivb-tools__item[hidden],
.bivb-tools__empty[hidden] {
    display: none;
}

.bivb-tools__item-body {
    display: grid;
    min-width: 0;
    grid-template-columns: 3.75em minmax(0, 1fr);
    align-items: center;
    gap: 0.9375em;
    color: var(--bivb-color-text);
}

.bivb-tools__item-link {
    position: absolute;
    z-index: 1;
    inset: 0;
    border-radius: inherit;
}

.bivb-tools__item:has(.bivb-tools__item-link:hover) .bivb-tools__item-title {
    color: var(--bivb-color-primary);
}

.bivb-tools__icon {
    display: grid;
    width: 3.75em;
    height: 3.75em;
    place-items: center;
    overflow: hidden;
    border-radius: var(--bivb-radius-full);
    background: var(--bivb-tool-icon-background, #48a17b);
}

.bivb-tools__icon img {
    display: block;
    width: 3em;
    height: 3em;
    object-fit: contain;
}

.bivb-tools__content {
    display: grid;
    min-width: 0;
    gap: 0.1875em;
}

.bivb-tools__item-title {
    font-size: 1.125em;
    font-weight: var(--bivb-font-weight-medium);
    line-height: 1.25;
}

.bivb-tools__description {
    color: var(--bivb-color-text-muted);
    font-size: 0.875em;
    line-height: 1.3;
}

.bivb-tools__action {
    position: relative;
    z-index: 2;
    display: inline-grid;
    width: 1.875em;
    height: 1.875em;
    place-items: center;
    padding: 0;
    border: 0;
    appearance: none;
    background: transparent;
    font: inherit;
    line-height: 0;
    cursor: pointer;
}

.bivb-tools__action > img {
    display: block;
    width: 100%;
    height: 100%;
}

.bivb-tools__new {
    position: absolute;
    top: -0.5em;
    left: -0.5em;
    z-index: 1;
    padding: 0.25em 0.625em;
    border-radius: var(--bivb-radius-4);
    background: var(--bivb-color-accent);
    color: var(--bivb-color-text-inverse);
    font-size: 0.625em;
    font-weight: var(--bivb-font-weight-semibold);
    text-transform: uppercase;
}

.bivb-tools__empty {
    margin: 0;
    padding: 2em;
    background: var(--bivb-color-surface-muted);
    color: var(--bivb-color-text-muted);
}

/* phone */
@media (max-width: 767px) {
    .bivb-tools__item {
        min-height: 7.5em;
        padding: 0.9375em;
    }

    .bivb-tools__item-body {
        grid-template-columns: 3.75em minmax(0, 1fr);
        gap: 0.75em;
    }

    .bivb-tools__icon {
        width: 3.75em;
        height: 3.75em;
    }

    .bivb-tools__action {
        margin-right: 0;
    }
}

/* mobile and tablet */
@media (max-width: 1023px) {
    .bivb-tools__toolbar {
        margin-bottom: 1em;
    }

    .bivb-tools__controls {
        display: none;
    }

    .bivb-tools__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 1em;
    }

    .bivb-tools__item {
        border-color: var(--bivb-color-border-soft);
        border-radius: var(--bivb-radius-6);
    }
}

/* Tool compatibility uses the explicit product threshold: <= 1024px. */
@media (max-width: 1024px) {
    .bivb-tools__item[data-bivb-tool-availability="desktop-only"] {
        border-color: var(--bivb-color-border-soft);
        background: var(--bivb-color-surface-muted);
    }

    .bivb-tools__item[data-bivb-tool-availability="desktop-only"] .bivb-tools__icon {
        background: var(--bivb-color-text-disabled);
    }

    .bivb-tools__item[data-bivb-tool-availability="desktop-only"] .bivb-tools__icon img {
        filter: grayscale(1);
        opacity: 0.85;
    }

    .bivb-tools__item[data-bivb-tool-availability="desktop-only"] :is(.bivb-tools__item-title, .bivb-tools__description) {
        color: var(--bivb-color-text-muted);
    }
}

/* desktop */
@media (min-width: 1025px) {
    .bivb-tools__action {
        align-self: start;
    }
}

/* laptop 1 */
@media (min-width: 1024px) and (max-width: 1439px) {
    .bivb-tools__grid {
        gap: 1.25em;
    }
}
