/* ================================================
   AI Tools Catalog — Public CSS
   ================================================ */

/* === Tool Card === */
.ait-card {
    background: rgba(30, 20, 50, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.ait-card:hover {
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    color: inherit;
}
.ait-card-cover {
    height: 120px;
    background-size: cover;
    background-position: center;
    background-color: rgba(139, 92, 246, 0.08);
    flex-shrink: 0;
}
.ait-card-cover-placeholder {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ait-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}
.ait-icon-sm {
    width: 30px;
    height: 30px;
    background: rgba(139, 92, 246, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ait-icon-sm img { filter: invert(1) opacity(.8); }

.ait-card-title {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    line-height: 1.3;
}
.ait-card-desc {
    font-size: 0.83rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.ait-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.35rem;
}
.ait-price {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fbbf24;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.ait-price .coin-icon { width: 13px; height: 13px; vertical-align: -2px; }
.ait-price-free {
    font-size: 0.82rem;
    color: #34d399;
    font-weight: 700;
}
.ait-time {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
}

/* === Badges === */
.badge.badge-popular { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.35); font-weight: 600; }
.badge.badge-new     { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.35); font-weight: 600; }
.badge.badge-free    { background: rgba(16,185,129,.15); color: #34d399; border: 1px solid rgba(16,185,129,.35); font-weight: 600; }
.badge.badge-fast    { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.35); font-weight: 600; }
.badge.badge-biz     { background: rgba(139,92,246,.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,.35); font-weight: 600; }
.badge.badge-wow     { background: rgba(236,72,153,.15); color: #f9a8d4; border: 1px solid rgba(236,72,153,.35); font-weight: 600; }

/* === Index hero === */
.ait-hero {
    background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(236,72,153,0.12));
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: 22px;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    margin-bottom: 1.75rem;
}
.ait-hero h1 {
    background: linear-gradient(135deg, #c4b5fd 0%, #f9a8d4 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    font-weight: 800;
    font-size: 2rem;
    margin-bottom: 0.6rem;
    line-height: 1.25;
}
.ait-hero-sub {
    color: rgba(255,255,255,0.72);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* === Search bar === */
.ait-search-wrap {
    position: relative;
    max-width: 560px;
    margin: 0 auto 0.75rem;
}
.ait-search-input {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(139,92,246,0.35);
    border-radius: 14px;
    color: #fff;
    font-size: 1rem;
    padding: 0.75rem 3rem 0.75rem 1.1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.ait-search-input::placeholder { color: rgba(255,255,255,0.4); }
.ait-search-input:focus {
    border-color: rgba(139,92,246,0.65);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}
.ait-search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    stroke: rgba(255,255,255,0.4);
    pointer-events: none;
}
.ait-search-clear {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    display: none;
    width: 22px; height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
}
.ait-search-clear:hover { color: #fff; }
.ait-search-clear.visible { display: flex; }

/* === Filter bar === */
.ait-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
}
.ait-filter-select {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 10px;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    padding: 0.45rem 2rem 0.45rem 0.75rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    transition: border-color 0.2s;
    outline: none;
}
.ait-filter-select:focus { border-color: rgba(139,92,246,0.55); }
.ait-filter-select option { background: #1a1230; }

.ait-filter-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
    transition: all 0.18s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.ait-filter-btn:hover { border-color: rgba(139,92,246,0.4); color: #c4b5fd; }
.ait-filter-btn.active {
    background: rgba(139,92,246,0.2);
    border-color: rgba(139,92,246,0.55);
    color: #c4b5fd;
}
.ait-filter-btn svg { width: 14px; height: 14px; }

.ait-filter-reset {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.45rem 0.5rem;
    transition: color 0.15s;
}
.ait-filter-reset:hover { color: #f9a8d4; }

/* === Category pills === */
.ait-cat-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.ait-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: all 0.18s;
    cursor: pointer;
}
.ait-cat-pill:hover, .ait-cat-pill.active {
    background: rgba(139,92,246,0.2);
    border-color: rgba(139,92,246,0.5);
    color: #c4b5fd;
}
.ait-cat-pill.active {
    background: rgba(139,92,246,0.25);
    border-color: rgba(139,92,246,0.6);
    color: #c4b5fd;
    font-weight: 600;
}
.ait-cat-count {
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 1px 6px;
    min-width: 20px;
    text-align: center;
}
.ait-cat-pill.active .ait-cat-count {
    background: rgba(139,92,246,0.35);
}

/* === Recently used strip === */
.ait-recent {
    margin-bottom: 1.5rem;
}
.ait-recent-label {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ait-recent-strip {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.ait-recent-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.9rem 0.4rem 0.6rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.15s;
}
.ait-recent-chip:hover {
    background: rgba(139,92,246,0.15);
    border-color: rgba(139,92,246,0.4);
    color: #c4b5fd;
}
.ait-recent-chip img { width: 16px; height: 16px; filter: invert(1) opacity(.7); border-radius: 3px; }

/* === Section heading === */
.ait-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.ait-section-count {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.4);
    font-weight: 400;
}

/* === Grid spinner & empty === */
.ait-grid-spinner {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: rgba(255,255,255,0.5);
    gap: 0.75rem;
}
.ait-grid-spinner.visible { display: flex; }
.ait-grid-spinner::before {
    content: '';
    width: 24px; height: 24px;
    border: 3px solid rgba(139,92,246,0.3);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: ait-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes ait-spin { to { transform: rotate(360deg); } }

.ait-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255,255,255,0.45);
}
.ait-empty-icon { margin-bottom: 0.75rem; opacity: 0.3; }
.ait-empty-icon svg { width: 48px; height: 48px; }
.ait-empty p { margin: 0; font-size: 0.95rem; }

/* === Pagination === */
.ait-pagination {
    display: flex;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.ait-page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 0.5rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    text-decoration: none;
}
.ait-page-btn:hover { border-color: rgba(139,92,246,0.4); color: #c4b5fd; }
.ait-page-btn.active {
    background: linear-gradient(135deg, rgba(139,92,246,0.35), rgba(236,72,153,0.25));
    border-color: rgba(139,92,246,0.6);
    color: #c4b5fd;
    font-weight: 600;
}
.ait-page-btn:disabled, .ait-page-btn[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}

/* === Detail page === */
.ait-detail-hero {
    background: rgba(30,20,50,0.7);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
}
.ait-detail-cover {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 1.25rem;
}
.ait-detail-cover-placeholder {
    width: 100%;
    height: 200px;
    border-radius: 14px;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ait-icon-lg {
    width: 52px; height: 52px;
    background: rgba(139,92,246,0.18);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.ait-icon-lg img { filter: invert(1) opacity(.85); width: 28px; height: 28px; }

.ait-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}
.ait-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 3px 10px;
}
.ait-meta-chip svg { width: 13px; height: 13px; opacity: 0.7; }

.ait-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* === Steps === */
.ait-steps { margin-bottom: 1.5rem; }
.ait-step-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 1rem;
    height: 100%;
}
.ait-step-num {
    display: inline-flex;
    width: 28px; height: 28px;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: 50%;
    margin-bottom: 0.5rem;
}
.ait-step-text { color: rgba(255,255,255,0.85); font-size: 0.88rem; line-height: 1.45; }

/* === Description === */
.ait-description { color: rgba(255,255,255,0.82); line-height: 1.7; }
.ait-description h2 {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 .75rem;
}
.ait-description h3 { color: rgba(255,255,255,0.9); font-size: 1.05rem; font-weight: 700; margin: 1.25rem 0 .5rem; }
.ait-description p { margin-bottom: 0.9rem; }
.ait-description ul, .ait-description ol { padding-left: 1.5rem; margin-bottom: 0.9rem; }
.ait-description li { margin-bottom: 0.3rem; }

/* === Examples === */
.ait-examples { margin-bottom: 1.5rem; }
.ait-examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.ait-example-item {
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}
.ait-example-item:hover {
    border-color: rgba(139,92,246,0.45);
    transform: translateY(-2px);
}
.ait-example-img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}
.ait-example-before-after {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}
.ait-example-before-after img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.ait-example-ba-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    padding: 2px 4px;
}
.ait-example-caption {
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.4;
}

/* === FAQ === */
.ait-faq-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}
.ait-faq-q {
    padding: 0.9rem 1.1rem;
    cursor: pointer;
    color: rgba(255,255,255,0.92);
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    user-select: none;
}
.ait-faq-q:hover { background: rgba(255,255,255,0.04); }
.ait-faq-arrow {
    flex-shrink: 0;
    transition: transform 0.25s;
    color: #8b5cf6;
    width: 18px; height: 18px;
}
.ait-faq-item.open .ait-faq-arrow { transform: rotate(180deg); }
.ait-faq-a {
    max-height: 0; overflow: hidden;
    padding: 0 1.1rem;
    transition: max-height 0.3s ease, padding 0.3s ease;
    color: rgba(255,255,255,0.68); font-size: 0.9rem; line-height: 1.6;
}
.ait-faq-item.open .ait-faq-a { max-height: 500px; padding: 0 1.1rem 1rem; }

/* === Related tools section === */
.ait-related { margin-bottom: 1.5rem; }
.ait-section-h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1rem;
}

/* === Breadcrumbs === */
.ait-breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.45);
}
.ait-breadcrumbs a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    transition: color 0.15s;
}
.ait-breadcrumbs a:hover { color: #c4b5fd; }
.ait-breadcrumbs-sep {
    color: rgba(255,255,255,0.25);
    font-size: 0.8rem;
}
.ait-breadcrumbs-current { color: rgba(255,255,255,0.75); }

/* === Category page hero === */
.ait-cat-hero {
    background: rgba(30,20,50,0.6);
    border: 1px solid rgba(139,92,246,0.2);
    border-radius: 18px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.ait-cat-hero h1 {
    background: linear-gradient(135deg, #c4b5fd, #f9a8d4);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    font-weight: 800;
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}
.ait-cat-hero p {
    color: rgba(255,255,255,0.65);
    font-size: 0.95rem;
    margin: 0;
}

/* === Sort/count bar === */
.ait-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.ait-toolbar-count {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.5);
}
.ait-sort-select {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.35)' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    outline: none;
}
.ait-sort-select option { background: #1a1230; }

/* === Detail page sidebar (if needed) === */
.ait-detail-info-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 14px;
    padding: 1.1rem;
    margin-bottom: 1rem;
}
.ait-detail-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.88rem;
}
.ait-detail-info-row:last-child { border-bottom: none; padding-bottom: 0; }
.ait-detail-info-label { color: rgba(255,255,255,0.5); }
.ait-detail-info-val { color: rgba(255,255,255,0.85); font-weight: 500; }

/* === Quick tags === */
.ait-quick-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.25rem;
}
.ait-quick-tags-label {
    color: rgba(255,255,255,0.4);
    font-size: .8rem;
    white-space: nowrap;
}
.ait-quick-tag {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: rgba(255,255,255,0.7);
    font-size: .82rem;
    padding: .3rem .85rem;
    cursor: pointer;
    transition: background .18s, border-color .18s, color .18s;
}
.ait-quick-tag:hover {
    background: rgba(168,85,247,0.18);
    border-color: rgba(168,85,247,0.4);
    color: #fff;
}

/* === Card CTA button === */
.ait-card-cta {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin-top: .6rem;
    padding: .4rem .85rem;
    border-radius: 8px;
    background: linear-gradient(135deg,#7c3aed,#db2777);
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
    transition: opacity .18s, transform .15s;
}
.ait-card:hover .ait-card-cta {
    opacity: .92;
    transform: translateY(-1px);
}

/* === Examples placeholder === */
.ait-examples-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    padding: 2.5rem 1rem;
    border: 1.5px dashed rgba(255,255,255,0.1);
    border-radius: 12px;
    color: rgba(255,255,255,0.3);
    font-size: .9rem;
}

/* === Bottom CTA === */
.ait-cta-bottom {
    margin: 2.5rem 0 1rem;
    background: linear-gradient(135deg,rgba(124,58,237,0.18),rgba(219,39,119,0.18));
    border: 1px solid rgba(168,85,247,0.2);
    border-radius: 16px;
    padding: 1.75rem 2rem;
}
.ait-cta-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.ait-cta-bottom-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: .3rem;
}
.ait-cta-bottom-sub {
    color: rgba(255,255,255,0.6);
    font-size: .88rem;
    line-height: 1.5;
}

/* === Mobile tweaks === */
@media (max-width: 576px) {
    .ait-hero { padding: 1.75rem 1rem 1.5rem; }
    .ait-hero h1 { font-size: 1.5rem; }
    .ait-hero-sub { font-size: 0.9rem; }
    .ait-cat-hero h1 { font-size: 1.3rem; }
    .ait-examples-grid { grid-template-columns: 1fr 1fr; }
    .ait-cta-bottom-inner { flex-direction: column; align-items: flex-start; }
    .ait-cta-bottom { padding: 1.25rem 1rem; }
}

/* ============================================================
   === Каталог v2 — редизайн главной каталога (ai-tools/index)
   === Скоуп: body.ait-catalog-page
   ============================================================ */
body.ait-catalog-page {
    --page-bg: #080611;
    --surface-1: rgba(24, 19, 41, 0.82);
    --surface-2: rgba(34, 27, 55, 0.72);
    --surface-hover: rgba(43, 33, 68, 0.86);
    --border-soft: rgba(255, 255, 255, 0.065);
    --border-hover: rgba(176, 93, 255, 0.25);
    --text-primary: #f5f2fb;
    --text-secondary: rgba(232, 226, 241, 0.62);
    --text-muted: rgba(224, 217, 236, 0.43);
    --purple: #8545ed;
    --purple-light: #ae63ff;
    --pink: #e94abd;
    --radius-sm: 8px;
    --radius-md: 11px;
    --radius-lg: 15px;
}

body.ait-catalog-page {
    background:
        radial-gradient(700px 500px at 22% 32%, rgba(73, 53, 181, 0.13), transparent 70%),
        radial-gradient(650px 500px at 82% 68%, rgba(180, 39, 137, 0.08), transparent 72%),
        var(--page-bg);
}

.catalog-container {
    width: min(1280px, calc(100% - 40px));
    margin: 0 auto;
}

/* --- Первый экран --- */
.catalog-head {
    padding-top: 42px;
    text-align: center;
}
.catalog-title {
    font-size: 34px;
    line-height: 1.15;
    font-weight: 750;
    letter-spacing: -0.04em;
    text-align: center;
    margin: 0;
    background: linear-gradient(90deg, #e6d4ff 0%, #9b63ff 46%, #ef5fc9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.catalog-subtitle {
    margin: 10px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(232, 228, 245, 0.58);
    text-align: center;
}

/* --- Поиск --- */
.catalog-search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(620px, 100%);
    height: 48px;
    margin: 22px auto 0;
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
    border: 1px solid rgba(181, 112, 255, 0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 12px 35px rgba(0,0,0,0.18);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.catalog-search:focus-within {
    border-color: rgba(197, 103, 255, 0.58);
    box-shadow: 0 0 0 3px rgba(155, 78, 255, 0.09), 0 14px 38px rgba(0,0,0,0.22);
}
.catalog-search input {
    height: 100%;
    flex: 1;
    min-width: 0;
    padding: 0 48px 0 44px;
    background: transparent;
    border: 0;
    outline: 0;
    color: #f4f1fa;
    font-size: 14px;
}
.catalog-search input::placeholder { color: var(--text-muted); }
.catalog-search .cs-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(221, 211, 241, 0.62);
    pointer-events: none;
}
.catalog-search .cs-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}
.catalog-search .cs-clear:hover { color: #fff; }
.catalog-search .cs-clear.visible { display: flex; }

/* --- Популярные запросы --- */
.search-suggestions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
}
.search-suggestions .ss-label {
    font-size: 11px;
    color: var(--text-muted);
}
.search-chip {
    min-height: 28px;
    padding: 0 11px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.07);
    background: rgba(255,255,255,0.045);
    color: rgba(239, 235, 248, 0.67);
    font-size: 11px;
    cursor: pointer;
    transition: 180ms ease;
}
.search-chip:hover {
    color: #fff;
    border-color: rgba(172, 96, 255, 0.28);
    background: rgba(138, 74, 224, 0.12);
    transform: translateY(-1px);
}

/* --- Недавно использовали --- */
.recent-block { margin-top: 24px; }
.section-caption {
    font-size: 11px;
    font-weight: 600;
    color: rgba(229, 224, 241, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.recent-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.recent-row::-webkit-scrollbar { display: none; }
.recent-tool {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    height: 30px;
    margin-top: 8px;
    padding: 0 12px;
    border-radius: 999px;
    color: rgba(245, 241, 251, 0.77);
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.07);
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
    transition: 180ms ease;
}
.recent-tool:hover {
    color: #fff;
    border-color: var(--border-hover);
    background: rgba(138, 74, 224, 0.12);
}
.recent-tool img { width: 15px; height: 15px; filter: invert(1) opacity(.7); }

/* --- Категории --- */
.category-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    margin-top: 22px;
    padding: 4px;
    border-radius: 13px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.075);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}
.category-tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 40px;
    border-radius: 9px;
    color: rgba(237, 232, 246, 0.58);
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: 180ms ease;
    /* button reset */
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: inherit;
    -webkit-appearance: none;
}
.cat-tab-cnt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.22);
    color: rgba(200,180,255,0.8);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}
.category-tab.active .cat-tab-cnt {
    background: rgba(139, 92, 246, 0.35);
    color: #fff;
}
.category-tab:hover { color: #f8f5ff; background: rgba(255,255,255,0.04); }
.category-tab.active {
    color: #f8f5ff;
    background: linear-gradient(180deg, rgba(141, 77, 232, 0.17), rgba(86, 46, 157, 0.08));
    box-shadow: inset 0 0 0 1px rgba(180, 101, 255, 0.24), 0 8px 24px rgba(76, 35, 139, 0.12);
}
.category-tab.active::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: 1px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, #a54cff 35%, #ed4fc7 65%, transparent);
    box-shadow: 0 0 12px rgba(202, 68, 255, 0.75);
}

/* --- Популярные инструменты --- */
.popular-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 32px 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.popular-head svg { width: 17px; height: 17px; flex: 0 0 auto; }
.popular-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.popular-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: linear-gradient(155deg, rgba(31, 25, 55, 0.96), rgba(20, 16, 37, 0.96));
    border: 1px solid rgba(255,255,255,0.075);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.025), 0 16px 35px rgba(0,0,0,0.18);
    text-decoration: none;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.popular-card:hover {
    transform: translateY(-3px);
    border-color: rgba(173, 91, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 20px 44px rgba(0,0,0,0.27), 0 0 30px rgba(119, 55, 207, 0.07);
    text-decoration: none;
}
.popular-card__media {
    position: relative;
    height: 116px;
    margin: 8px 8px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #171326;
}
.popular-card__media img,
.popular-card__media .pc-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    transition: transform 500ms cubic-bezier(.2, .8, .2, 1);
}
.popular-card:hover .popular-card__media img,
.popular-card:hover .popular-card__media .pc-cover {
    transform: scale(1.035);
}
.popular-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(5,4,12,0.16) 0%, transparent 20%, transparent 80%, rgba(5,4,12,0.2) 100%),
        linear-gradient(180deg, transparent 52%, rgba(7,5,15,0.24) 100%);
}
.popular-card__media::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: -30%;
    left: -45%;
    width: 22%;
    height: 160%;
    border-radius: 999px;
    transform: rotate(14deg);
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.04) 20%, rgba(221,167,255,0.45) 50%, rgba(255,255,255,0.07) 78%, transparent 100%);
    filter: blur(5px);
}
.popular-card:hover .popular-card__media::before {
    opacity: 1;
    animation: image-shine 850ms cubic-bezier(.2, .7, .25, 1);
}
@keyframes image-shine {
    from { left: -45%; }
    to   { left: 125%; }
}
.popular-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 10px 12px 11px;
}
.popular-card__title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    color: #f6f2fb;
}
.popular-card__desc {
    font-size: 11px;
    line-height: 1.35;
    color: rgba(230, 224, 240, 0.58);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.popular-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 9px;
}
.pc-meta-left {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

/* --- Цена и время (общие) --- */
.tool-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 650;
    color: #d9c7ff;
    white-space: nowrap;
}
.tool-price .coin-icon { width: 13px; height: 13px; vertical-align: -2px; }
.tool-price-free {
    font-size: 11px;
    font-weight: 650;
    color: #4ade80;
    white-space: nowrap;
}
.tool-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}
.tool-time svg { width: 14px; height: 14px; }

/* --- Бейджи --- */
.tool-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}
.tool-badge.badge-new {
    color: #d8fff1;
    background: rgba(25, 182, 122, 0.82);
    border: 0;
}
.tool-badge.badge-popular {
    color: #fff;
    background: linear-gradient(110deg, #7545ec, #dc48be);
    border: 0;
}

/* --- Кнопка «Попробовать» --- */
.tool-button {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    height: 30px;
    padding: 0 13px;
    border-radius: 8px;
    border: 0;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
    background: linear-gradient(112deg, #7134e8 0%, #9844ef 43%, #e747bd 100%);
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.22),
        inset 0 -1px 0 rgba(77, 15, 111, 0.24),
        0 7px 18px rgba(164, 49, 211, 0.2);
    transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}
.tool-button::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(27,5,55,0.16) 0%, transparent 18%, transparent 78%, rgba(77,4,67,0.18) 100%);
    pointer-events: none;
}
.tool-button::before {
    content: "";
    position: absolute;
    z-index: 1;
    top: -55%;
    left: -50%;
    width: 34%;
    height: 210%;
    border-radius: 999px;
    transform: rotate(16deg);
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 18%, rgba(255,255,255,0.52) 50%, rgba(255,214,250,0.14) 76%, transparent 100%);
    filter: blur(4px);
    opacity: 0;
    pointer-events: none;
}
.popular-card:hover .tool-button::before,
.tool-card:hover .tool-button::before,
.tool-button:hover::before {
    opacity: 1;
    animation: button-shine 650ms cubic-bezier(.25, .75, .25, 1);
}
@keyframes button-shine {
    from { left: -50%; }
    to   { left: 125%; }
}
.popular-card:hover .tool-button,
.tool-card:hover .tool-button,
.tool-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 9px 24px rgba(183, 57, 221, 0.3);
}
.tool-button:active { transform: translateY(0) scale(0.98); }
.tool-button svg { width: 12px; height: 12px; transition: transform 180ms ease; }
.popular-card:hover .tool-button svg,
.tool-card:hover .tool-button svg,
.tool-button:hover svg { transform: translateX(2px); }

/* --- Основной каталог: браузер --- */
.tools-browser {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    margin-top: 16px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: rgba(18, 14, 32, 0.75);
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.025), 0 18px 45px rgba(0,0,0,0.18);
}

/* --- Левая панель фильтров --- */
.filters-sidebar {
    padding: 16px 12px;
    border-right: 1px solid rgba(255,255,255,0.065);
    background: rgba(255,255,255,0.012);
    overflow-x: hidden;
}
.filters-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
}
.filters-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.filter-select {
    width: 100%;
    height: 38px;
    padding: 0 30px 0 10px;
    border-radius: 9px;
    background: rgba(255,255,255,0.035) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(240, 236, 248, 0.85);
    font-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color 180ms ease;
}
.filter-select:focus { border-color: rgba(139, 92, 246, 0.55); }
.filter-select option { background: #1a1230; }
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.filter-option {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border-radius: 9px;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.055);
    color: rgba(237, 232, 246, 0.62);
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    transition: 180ms ease;
}
.filter-option svg { width: 15px; height: 15px; flex: 0 0 auto; color: rgba(221, 211, 241, 0.62); }
.filter-option:hover { border-color: rgba(139, 92, 246, 0.4); color: #e8ddfb; }
.filter-option.active {
    color: #f5efff;
    border-color: rgba(180, 101, 255, 0.35);
    background: rgba(138, 74, 224, 0.14);
}
.filter-option.active svg {
    color: #b36aff;
    filter: drop-shadow(0 0 7px rgba(178, 91, 255, 0.35));
}
.filter-reset-link {
    display: inline-block;
    margin-top: 14px;
    padding: 4px 2px;
    border: 0;
    background: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: color 180ms ease;
}
.filter-reset-link:hover { color: #f9a8d4; }
.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.sheet-close { display: none; }
.sheet-apply-wrap { display: none; }

/* --- Правая часть каталога --- */
.tools-content { padding: 14px; min-width: 0; }
.tools-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    min-height: 34px;
    margin-bottom: 10px;
}
.tools-count {
    font-size: 12px;
    color: var(--text-secondary);
}
.tools-count strong { color: var(--text-primary); font-weight: 700; }
.sort-select {
    height: 34px;
    padding: 0 28px 0 10px;
    border-radius: 9px;
    background: rgba(255,255,255,0.035) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 9px center;
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(240, 236, 248, 0.85);
    font-size: 12px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
}
.sort-select:focus { border-color: rgba(139, 92, 246, 0.55); }
.sort-select option { background: #1a1230; }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

/* --- Карточка инструмента (вертикальная, крупное превью) --- */
.tool-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, rgba(34, 27, 55, 0.74), rgba(23, 18, 39, 0.78));
    border: 1px solid rgba(255,255,255,0.065);
    text-decoration: none;
    transition: 180ms ease;
}
.tool-card:hover {
    transform: translateY(-2px);
    border-color: rgba(167, 89, 244, 0.22);
    background: linear-gradient(145deg, rgba(42, 32, 68, 0.86), rgba(25, 19, 43, 0.9));
    text-decoration: none;
}
.tool-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 9px;
    overflow: hidden;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: rgba(20, 15, 35, 0.7);
}
.tool-card__image .tc-ph {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-card__image .tc-ph svg { width: 28px; height: 28px; }
.tool-card__image .tool-badge {
    top: 5px;
    right: 5px;
    height: 18px;
    padding: 0 6px;
    font-size: 9px;
}
.tool-card__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.tool-card__title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}
.tool-card__desc {
    font-size: 10.5px;
    line-height: 1.35;
    color: var(--text-secondary);
    margin-top: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tool-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 7px;
}
/* Длинная CTA-кнопка (напр. «Заказать поздравление») не обрезается —
   при нехватке места переносится на свою строку во всю ширину */
.tool-card__meta .tool-button {
    flex: 0 0 auto;
    max-width: 100%;
    white-space: nowrap;
}
.tc-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* --- Мобильная sticky-строка --- */
.mobile-tools-controls { display: none; }
.sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1049;
    background: rgba(4, 2, 10, 0.6);
    backdrop-filter: blur(3px);
}
.sheet-overlay.open { display: block; }

/* --- Категории-фильтр: чипы в сайдбаре --- */
.filter-cats-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(229, 224, 241, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 14px 0 6px;
}
/* Десктоп: список категорий на всю высоту, без внутреннего скролла
   (скролл нужен только в мобильном bottom-sheet — см. media <768px) */
.filter-cat-chips {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.filter-cat-chips::-webkit-scrollbar { width: 4px; }
.filter-cat-chips::-webkit-scrollbar-track { background: transparent; }
.filter-cat-chips::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.25); border-radius: 4px; }
.filter-cat-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    color: rgba(237, 232, 246, 0.62);
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    transition: 170ms ease;
    position: relative;
    overflow: hidden;
}
.filter-cat-chip:hover {
    border-color: rgba(139, 92, 246, 0.32);
    color: #e8ddfb;
    background: rgba(138, 74, 224, 0.08);
}
.filter-cat-chip.active {
    color: #f0eaff;
    border-color: rgba(180, 101, 255, 0.4);
    background: rgba(138, 74, 224, 0.16);
}
.filter-cat-chip__check {
    display: none;
    flex: 0 0 auto;
    margin-left: auto;
    width: 16px;
    height: 16px;
    border-radius: 5px;
    background: linear-gradient(112deg, #7134e8, #e747bd);
    align-items: center;
    justify-content: center;
}
.filter-cat-chip__check svg { width: 10px; height: 10px; }
.filter-cat-chip.active .filter-cat-chip__check { display: flex; }
.filter-cats-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 5px;
    background: rgba(139, 92, 246, 0.22);
    color: #c4a8ff;
    font-size: 10px;
    font-weight: 700;
    margin-left: auto;
}
.filter-cat-chip.active .filter-cats-count { display: none; }
.filter-cat-chip.subcat {
    margin-left: 14px;
    /* width 100% + margin-left выталкивал чип на 14px за правый край сайдбара
       (sidebar overflow-x: hidden подрезал его) — вписываем в оставшуюся ширину */
    width: calc(100% - 14px);
    min-height: 30px;
    font-size: 11.5px;
    border-left: 2px solid rgba(139, 92, 246, 0.28);
    border-radius: 0 8px 8px 0;
}

/* --- Подвал: отступ и разделитель --- */
/* .footer имеет bootstrap mt-auto (!important), поэтому отступ даём снизу каталога */
body.ait-catalog-page .tools-browser { margin-bottom: 90px; }
body.ait-catalog-page .footer {
    margin-top: 90px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ============ Планшет 768–1100 ============ */
@media (min-width: 768px) and (max-width: 1100px) {
    .catalog-container { width: calc(100% - 32px); }
    .popular-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tools-browser { grid-template-columns: 225px minmax(0, 1fr); }
    .tools-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* ============ Мобильная версия ============ */
@media (max-width: 767px) {
    .catalog-container { width: calc(100% - 28px); }
    .catalog-head {
        padding-top: 26px;
        text-align: left;
    }
    .catalog-title { font-size: 28px; text-align: left; }
    .catalog-subtitle { font-size: 13px; text-align: left; }
    .catalog-search { width: 100%; margin-top: 18px; }
    .search-suggestions {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    .search-suggestions::-webkit-scrollbar { display: none; }
    .search-chip { flex: 0 0 auto; }

    .category-tabs {
        display: flex;
        overflow-x: auto;
        gap: 6px;
        padding: 4px;
        scrollbar-width: none;
    }
    .category-tabs::-webkit-scrollbar { display: none; }
    .category-tab { flex: 0 0 auto; padding: 0 14px; height: 38px; }

    .popular-grid {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
        padding-bottom: 6px;
    }
    .popular-grid::-webkit-scrollbar { display: none; }
    .popular-card { flex: 0 0 84%; scroll-snap-align: start; }
    .popular-card__media { height: 140px; }

    /* Sticky строка управления */
    .mobile-tools-controls {
        position: sticky;
        top: 58px;
        z-index: 15;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 8px 0;
        margin-top: 14px;
        background: rgba(8, 6, 17, 0.88);
        backdrop-filter: blur(14px);
    }
    .mtc-filters-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        height: 38px;
        border-radius: 9px;
        border: 1px solid rgba(255,255,255,0.08);
        background: rgba(255,255,255,0.035);
        color: rgba(240, 236, 248, 0.85);
        font-size: 12px;
        cursor: pointer;
    }
    .mtc-filters-btn svg { width: 15px; height: 15px; color: rgba(221, 211, 241, 0.62); }
    .mobile-tools-controls .sort-select { width: 100%; height: 38px; }

    /* Каталог: один контейнер без сайдбара */
    .tools-browser {
        display: block;
        margin-top: 0;
        border-radius: 13px;
    }
    .tools-content { padding: 12px 10px; }
    .tools-content-header .sort-select { display: none; }

    /* Bottom sheet фильтров */
    .filters-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1050;
        max-height: 82vh;
        overflow-y: auto;
        border-radius: 22px 22px 0 0;
        border-right: 0;
        border-top: 1px solid rgba(255,255,255,0.09);
        background: #14101f;
        padding: 14px 16px calc(76px + env(safe-area-inset-bottom));
        transform: translateY(105%);
        transition: transform 220ms ease;
        visibility: hidden;
    }
    .filters-sidebar.open { transform: translateY(0); visibility: visible; }
    .sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
    }
    .sheet-head .filters-title { margin: 0; font-size: 15px; }
    .sheet-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        background: rgba(255,255,255,0.06);
        color: var(--text-secondary);
        width: 32px;
        height: 32px;
        border-radius: 9px;
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
    }
    .filter-select { height: 44px; font-size: 13px; }
    .filter-option { min-height: 44px; font-size: 13px; }
    /* В bottom-sheet список категорий ограничен и скроллится внутри */
    .filter-cat-chips {
        max-height: 260px;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(139, 92, 246, 0.25) transparent;
        padding-right: 2px;
    }
    .sheet-apply-wrap {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1051;
        padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
        background: #14101f;
        border-top: 1px solid rgba(255,255,255,0.07);
        transform: translateY(105%);
        transition: transform 220ms ease;
        visibility: hidden;
    }
    .filters-sidebar.open ~ .sheet-apply-wrap,
    .sheet-apply-wrap.open { transform: translateY(0); visibility: visible; }
    .sheet-apply {
        width: 100%;
        height: 46px;
        border: 0;
        border-radius: 12px;
        color: #fff !important;
        -webkit-text-fill-color: #fff !important;
        font-size: 14px;
        font-weight: 650;
        cursor: pointer;
        background: linear-gradient(112deg, #7134e8 0%, #9844ef 43%, #e747bd 100%);
        background-clip: padding-box;
        -webkit-background-clip: padding-box;
    }

    /* Список инструментов одной колонкой */
    .tools-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
    body.ait-catalog-page *,
    body.ait-catalog-page *::before,
    body.ait-catalog-page *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ── SEO-блок «Каталог звёзд» на странице инструмента star-greeting ── */
.sg-det-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.sg-det-card {
    position: relative; overflow: hidden; display: block; text-decoration: none;
    aspect-ratio: 4/5; border-radius: 13px; background: #100d22;
    border: 1px solid rgba(153, 112, 235, 0.16);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.sg-det-card:hover { transform: translateY(-3px); border-color: rgba(182, 113, 255, 0.42); box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3); }
.sg-det-card img { width: 100%; height: 100%; object-fit: contain; display: block; background: radial-gradient(circle at 50% 30%, #1a1430, #0a0716 75%); }
.sg-det-card-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; opacity: 0.3; background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.1)); }
.sg-det-card-name {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    padding: 30px 11px 10px; font-weight: 650; font-size: 13px; line-height: 1.25; color: #f6f3ff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: linear-gradient(to bottom, transparent, rgba(9, 6, 20, 0.92) 55%);
}
@media (max-width: 1024px) { .sg-det-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 576px) { .sg-det-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
