body.tools-page {
    display: flex;
    flex-direction: column;
    padding: 60px 20px 12px;
}

body.tools-page .tools-main.width-wide-1,
body.tools-page .tools-main#tools {
    flex: 1 0 auto;
    max-width: 1100px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 36px;
    min-width: 0;
    box-sizing: border-box;
}

body.tools-page > .site-footer {
    margin-top: 8px;
}

.tools-page-header {
    text-align: center;
    margin-bottom: 28px;
    padding: 8px 0 20px;
    border-bottom: none;
    position: relative;
}

.tools-page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(148, 163, 184, 0.35) 15%,
        rgba(148, 163, 184, 0.35) 85%,
        transparent 100%
    );
}

[data-theme="dark"] .tools-page-header::after {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(148, 163, 184, 0.22) 15%,
        rgba(148, 163, 184, 0.22) 85%,
        transparent 100%
    );
}

.tools-page-title {
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    color: var(--text-dark);
}

.tools-page-subtitle {
    margin: 0 auto;
    color: var(--text-medium);
    font-size: 1.05rem;
    line-height: 1.5;
    max-width: 36em;
}

.tools-catalog {
    width: 100%;
}

.tools-section {
    margin-bottom: 48px;
}

.tools-catalog > .tools-section:last-child,
.tools-catalog > :last-child {
    margin-bottom: 24px;
}

body.tools-page .category-title {
    display: block;
    width: 100%;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 16px;
    padding: 0;
    border-bottom: none;
    letter-spacing: -0.01em;
}

body.tools-page .tools-catalog > .category-title ~ .category-title {
    margin-top: 36px;
}

body.tools-page .tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    padding: 0;
    max-width: none;
    width: 100%;
    margin: 0;
}

body.tools-page .tool-card {
    position: relative;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px 16px 18px;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    border-top-width: 2px;
}

[data-theme="dark"] body.tools-page .tool-card {
    background: rgba(30, 41, 59, 0.85);
    border-color: #334155;
}

body.tools-page .category-title--games + .tools-grid .tool-card {
    border-top-color: #ec4899;
}

body.tools-page .category-title--images + .tools-grid .tool-card {
    border-top-color: #3b82f6;
}

body.tools-page .category-title--technical + .tools-grid .tool-card {
    border-top-color: #22c55e;
}

body.tools-page .category-title--calculators + .tools-grid .tool-card {
    border-top-color: #8b5cf6;
}

body.tools-page .category-title--converters + .tools-grid .tool-card {
    border-top-color: #f97316;
}

body.tools-page .category-title--misc + .tools-grid .tool-card {
    border-top-color: #0ea5e9;
}

body.tools-page .tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

body.tools-page .category-title--games + .tools-grid .tool-card:hover {
    border-top-color: #ec4899;
}

body.tools-page .category-title--images + .tools-grid .tool-card:hover {
    border-top-color: #3b82f6;
}

body.tools-page .category-title--technical + .tools-grid .tool-card:hover {
    border-top-color: #22c55e;
}

body.tools-page .category-title--calculators + .tools-grid .tool-card:hover {
    border-top-color: #8b5cf6;
}

body.tools-page .category-title--converters + .tools-grid .tool-card:hover {
    border-top-color: #f97316;
}

body.tools-page .category-title--misc + .tools-grid .tool-card:hover {
    border-top-color: #0ea5e9;
}

body.tools-page .tool-icon {
    font-size: 2.25rem;
    margin-bottom: 12px;
    height: 48px;
    line-height: 1;
}

body.tools-page .tool-icon svg,
body.tools-page .tool-icon img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

body.tools-page .tool-name {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.25;
}

body.tools-page .tool-description {
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0;
}

@media (max-width: 600px) {
    body.tools-page .tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.tools-page .tool-card {
        padding: 16px 12px 14px;
    }

    body.tools-page .tool-icon {
        font-size: 1.75rem;
        height: 40px;
        margin-bottom: 8px;
    }

    body.tools-page .tool-name {
        font-size: 0.92rem;
    }

    body.tools-page .tool-description {
        font-size: 0.75rem;
    }

    .category-title {
        font-size: 1.05rem;
    }
}

@media (max-width: 400px) {
    body.tools-page .tools-grid {
        grid-template-columns: 1fr;
    }
}
