@media screen and (max-width: 900px) {
.category-btn div {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.85rem;
}
}

@media screen and (max-width: 768px) {

 .toolbar {
        display: flex !important;
        flex-direction: row !important; /* Locks them side-by-side */
        flex-wrap: nowrap !important;   /* Prevents dropping to a new row */
        justify-content: space-between !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .toolbar h2 {
        margin: 0 !important;
        font-size: 1.2rem !important; /* Slightly downsizes title on small screens if needed */
        white-space: nowrap !important; /* Prevents title text itself from wrapping messily */
        overflow: hidden !important;
        text-overflow: ellipsis !important; /* Adds '...' if the category title is too long */
    }

    /* Compress the grid spacing for mobile screens */
    #toolsGrid, #favoritesGrid {
        gap: 8px !important;
        padding: 4px !important;
    }

    /* Make the card a tight, low-profile row container */
    .tool-card {
        padding: 0 !important;
        margin-bottom: 0 !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }

    /* Set up the horizontal structural layout */
    .tool-card-link {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 10px 40px 10px 10px !important; /* Right padding protects the Pin button area */
        text-align: left !important;
        width: 100%;
        box-sizing: border-box;
    }

    /* Compact, left-aligned icon box matching style positioning */
    .tool-icon {
        margin: 0 !important;
        flex-shrink: 0 !important;
        font-size: 1.2rem !important;
        width: 36px !important;
        height: 36px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Text details layout column */
    .tool-info {
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        width: 100% !important;
        justify-content: center !important;
        min-width: 0 !important; /* Essential fallback to prevent flex items from forcing overflow */
    }

    /* Card header text wraps cleanly without causing horizontal scroll */
    .tool-info h3 {
        margin: 0 0 4px 0 !important;
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
        white-space: normal !important; /* Allows text wrapping */
        word-wrap: break-word !important; /* Breaks exceptionally long string fragments if necessary */
        overflow: visible !important;
    }

    /* Strictly limit the description text to 1 line for maximum compactness */
    .tool-info p {
        margin: 0 !important;
        font-size: 0.8rem !important;
        line-height: 1.2 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 1 !important; /* Hard constraint to one line */
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        opacity: 0.85;
    }
    
    /* Keep the pin/star button neat and out of the text flow */
    .fav-btn {
        top: 50% !important;
        right: 12px !important;
        transform: translateY(-50%) !important; /* Centers it perfectly vertically */
        margin: 0 !important;
    }
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.features-list li {
    margin-bottom: 12px;
    padding-left: 28px;
    position: relative;
}

/* Custom checkmark bullets */
.features-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.features-list strong {
    color: #0f172a;
}