.tools-widget {
    width: 100%;
    margin: 1.5rem 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.09);
}

.tools-widget-header {
    padding: 15px 20px 9px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

.tools-widget-header h2 {
    margin: 0;
    color: #111827;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.tools-widget-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 16px;
}

.tools-widget-card {
    display: flex;
    min-width: 0;
    min-height: 58px;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border: 1px solid #e1e3e8;
    border-radius: 11px;
    background: #f8f8fa;
    color: #111827;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.tools-widget-card:hover,
.tools-widget-card:focus-visible {
    border-color: #b8c4d5;
    background: #fff;
    color: #111827;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.09);
    text-decoration: none;
    transform: translateY(-2px);
}

.tools-widget-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--tools-widget-icon-bg, #e5e7eb);
    color: #4b5563;
    font-size: 18px;
    line-height: 1;
    text-align: center;
}

.tools-widget-icon i {
    font-size: 17px;
}

.tools-widget-name {
    min-width: 0;
    color: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

/* Shortcode-selectable global variants: style="compact|wide|minimal|features" */
.tools-widget--compact .tools-widget-grid {
    gap: 8px;
    padding: 12px;
}

.tools-widget--compact .tools-widget-card {
    min-height: 50px;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 8px;
}

.tools-widget--compact .tools-widget-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 7px;
    font-size: 15px;
}

.tools-widget--compact .tools-widget-name {
    font-size: 13px;
}

.tools-widget--wide {
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);
}

.tools-widget--wide .tools-widget-grid {
    gap: 14px;
    padding: 20px;
}

.tools-widget--wide .tools-widget-card {
    min-height: 66px;
    border-radius: 8px;
}

.tools-widget--minimal {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.tools-widget--minimal .tools-widget-header {
    padding-right: 0;
    padding-left: 0;
    border-bottom: 0;
}

.tools-widget--minimal .tools-widget-grid {
    padding: 8px 0;
}

.tools-widget--minimal .tools-widget-card {
    background: transparent;
}

.tools-widget--features {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.tools-widget--features .tools-widget-header {
    padding-right: 0;
    padding-left: 0;
    border-bottom: 0;
}

.tools-widget--features .tools-widget-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    padding: 20px 0;
}

.tools-widget--features .tools-widget-card {
    min-height: 285px;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
    padding: 31px 27px 28px;
    border-color: #dbe3ec;
    border-radius: 17px;
    background: #fff;
    text-align: center;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

.tools-widget--features .tools-widget-card:hover,
.tools-widget--features .tools-widget-card:focus-visible {
    border-color: #c4d4e8;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
    transform: translateY(-3px);
}

.tools-widget--features .tools-widget-icon {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
    margin-bottom: 25px;
    border-radius: 16px;
    background: #eef5ff;
    color: #2563eb;
    font-size: 29px;
}

.tools-widget--features .tools-widget-name {
    display: block;
    margin-bottom: 12px;
    color: #111827;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.25;
}

.tools-widget--features .tools-widget-description {
    display: block;
    max-width: 310px;
    color: #31577e;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
}

@media (max-width: 991.98px) {
    .tools-widget:not(.tools-widget--features) .tools-widget-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tools-widget--features .tools-widget-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .tools-widget {
        border-radius: 11px;
    }

    .tools-widget-grid {
        gap: 8px;
        padding: 11px;
    }

    .tools-widget-card {
        min-height: 54px;
        gap: 8px;
        padding: 8px;
    }

    .tools-widget-icon {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
        border-radius: 8px;
        font-size: 16px;
    }

    .tools-widget-name {
        font-size: 13px;
    }

    .tools-widget--features .tools-widget-grid {
        gap: 14px;
    }

    .tools-widget--features .tools-widget-card {
        min-height: 245px;
        padding: 23px 15px 20px;
    }

    .tools-widget--features .tools-widget-icon {
        width: 54px;
        height: 54px;
        flex-basis: 54px;
        margin-bottom: 18px;
        border-radius: 14px;
        font-size: 24px;
    }

    .tools-widget--features .tools-widget-name {
        font-size: 17px;
    }

    .tools-widget--features .tools-widget-description {
        font-size: 13px;
    }
}

@media (max-width: 359.98px) {
    .tools-widget-grid {
        grid-template-columns: 1fr;
    }
}
