.ios-ts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin: 32px 0;
}

body.ios-template-showcase-page .ios-page > .ios-container {
    max-width: 1180px;
}

.ios-ts-card {
    min-width: 0;
    overflow: hidden;
    background: var(--ios-surface, #fff);
    border: 1px solid var(--ios-border, #e5e7eb);
    border-radius: var(--ios-radius, 18px);
    box-shadow: var(--ios-shadow, 0 10px 30px rgba(15, 23, 42, .08));
    transition: transform .2s ease, box-shadow .2s ease;
}

.ios-ts-card:hover,
.ios-ts-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, .14);
}

.ios-ts-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.ios-ts-card-link:focus-visible {
    outline: 3px solid var(--ios-accent, #2563eb);
    outline-offset: -3px;
}

.ios-ts-card-media {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--ios-surface-soft, #f8fafc);
}

.ios-ts-card-img,
.ios-ts-placeholder {
    display: block;
    width: 100%;
    height: 100%;
}

.ios-ts-card-img {
    object-fit: cover;
    transition: transform .35s ease;
}

.ios-ts-card:hover .ios-ts-card-img {
    transform: scale(1.025);
}

.ios-ts-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--ios-surface-soft, #eef2ff), #fff);
    color: var(--ios-accent, #2563eb);
    font-size: clamp(42px, 7vw, 68px);
    font-weight: 800;
}

.ios-ts-card-body {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
    flex: 1;
}

.ios-ts-category {
    color: var(--ios-text-soft, #64748b);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.ios-ts-layout-badge {
    margin-top: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ios-accent, #2563eb) 12%, #fff);
    color: var(--ios-accent, #2563eb);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ios-ts-card-title {
    margin: 7px 0 18px;
    color: var(--ios-text, #0f172a);
    font-size: 21px;
    font-weight: 800;
    line-height: 1.25;
}

/* Everything below is scoped to the catalogue, not the site's page layout. */
.ios-ts-catalogue [hidden] { display: none !important; }
.ios-ts-catalogue .ios-ts-card { display: flex; flex-direction: column; }
.ios-ts-catalogue .ios-ts-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 22px;
    margin: 28px 0 16px;
    border: 1px solid var(--ios-border, #e5e7eb);
    border-radius: var(--ios-radius, 18px);
    background: var(--ios-surface, #fff);
}
.ios-ts-catalogue .ios-ts-filters label { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ios-ts-catalogue .ios-ts-filters label > span { color: var(--ios-text, #0f172a); font-size: 13px; font-weight: 700; }
.ios-ts-catalogue .ios-ts-filters input,
.ios-ts-catalogue .ios-ts-filters select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--ios-border, #cbd5e1);
    border-radius: 8px;
    color: var(--ios-text, #0f172a);
    background: var(--ios-surface, #fff);
    font: inherit;
    font-size: 14px;
}
.ios-ts-catalogue .ios-ts-clear { align-self: end; min-height: 44px; padding: 10px 16px; border: 1px solid var(--ios-accent, #2563eb); border-radius: 8px; color: var(--ios-text, #0f172a); background: var(--ios-surface, #fff); cursor: pointer; font: inherit; font-size: 14px; }
.ios-ts-catalogue :is(input, select, button, a):focus-visible { outline: 3px solid var(--ios-accent, #2563eb); outline-offset: 3px; }
.ios-ts-catalogue .ios-ts-results { margin: 12px 0; color: var(--ios-text-soft, #475569); font-size: 14px; }
.ios-ts-catalogue .ios-ts-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ios-ts-catalogue .ios-ts-industry { margin: -6px 0 16px; color: var(--ios-text-soft, #64748b); font-size: 13px; }
.ios-ts-catalogue .ios-ts-demo-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 8px; }
.ios-ts-catalogue .ios-ts-style-group { display: grid; gap: 6px; width: 100%; }
.ios-ts-catalogue .ios-ts-style-label { color: var(--ios-text-soft, #64748b); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ios-ts-catalogue .ios-ts-style-links { display: flex; flex-wrap: wrap; gap: 8px; }
.ios-ts-catalogue a.ios-ts-demo-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 14px; font-size: 13px; line-height: 1.4; text-decoration: none; }
.ios-ts-catalogue .ios-ts-list-edition { display: block; padding-top: 6px; color: var(--ios-text-soft, #64748b); font-size: 12px; }
.ios-ts-catalogue .ios-ts-catalogue-note { margin-top: 22px; color: var(--ios-text-soft, #64748b); font-size: 13px; line-height: 1.6; }

.ios-ts-button {
    width: auto;
    margin-top: auto;
    pointer-events: none;
}

.ios-ts-empty {
    padding: 18px 20px;
    background: var(--ios-surface-soft, #f8fafc);
    border: 1px solid var(--ios-border, #e5e7eb);
    border-radius: var(--ios-radius, 12px);
    color: var(--ios-text-soft, #475569);
}

.ios-ts-list {
    margin: 32px 0;
}

.ios-ts-list-group + .ios-ts-list-group {
    margin-top: 42px;
}

.ios-ts-list-heading {
    margin: 0 0 16px;
    color: var(--ios-text, #0f172a);
    font-size: clamp(24px, 3vw, 32px);
}

.ios-ts-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--ios-border, #e5e7eb);
    border-radius: var(--ios-radius, 18px);
    background: var(--ios-surface, #fff);
    box-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

.ios-ts-table {
    width: 100%;
    min-width: 620px;
    border: 0;
    border-collapse: collapse;
    text-align: left;
}

.ios-ts-table th,
.ios-ts-table td {
    padding: 15px 18px;
    border: 0;
    border-bottom: 1px solid var(--ios-border, #e5e7eb);
    vertical-align: middle;
}

.ios-ts-table thead th {
    background: var(--ios-surface-soft, #f8fafc);
    color: var(--ios-text-soft, #475569);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.ios-ts-table tbody th {
    color: var(--ios-text, #0f172a);
    font-weight: 700;
}

.ios-ts-table tbody tr:last-child th,
.ios-ts-table tbody tr:last-child td {
    border-bottom: 0;
}

.ios-ts-table tbody tr:hover {
    background: var(--ios-surface-soft, #f8fafc);
}

.ios-ts-table code {
    color: var(--ios-text-soft, #475569);
    font-size: 13px;
}

.ios-ts-table a {
    color: var(--ios-accent, #2563eb);
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 980px) {
    .ios-ts-catalogue .ios-ts-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ios-ts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .ios-ts-catalogue .ios-ts-filters { grid-template-columns: 1fr; padding: 16px; }
    .ios-ts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ios-ts-card,
    .ios-ts-card-img {
        transition: none;
    }
}
