/* KITTEAM: the shared team grid (see kitteam.js). Scoped to .ks-team (set by the script on a detected team row); the html:not(#kt):not(#kt2) prefix outranks the
   kits' ID-boosted grid rules. Whole rows: --ks-cols cards per row, the short last row centred; a card never narrower than 200 px (150 px phone). */
html:not(#kt):not(#kt2) .ks-team{display:flex;flex-wrap:wrap;justify-content:center;align-items:stretch;width:100%;box-sizing:border-box;gap:28px 24px;grid-template-columns:none;margin-inline:auto;padding:0;list-style:none}
html:not(#kt):not(#kt2) .ks-team>*{flex:0 0 calc((100% - (var(--ks-cols,3) - 1) * 24px) / var(--ks-cols,3));width:auto;max-width:none;min-width:0;margin:0;grid-column:auto;grid-row:auto}
/* every portrait loaded: the photo is a 4:5 frame, the face kept; name and role follow it (never over it) */
html:not(#kt):not(#kt2) .ks-team>*>.ks-team-photo{order:-1;position:relative;display:block;width:100%;height:auto;aspect-ratio:4/5;margin:0 0 12px;border-radius:6px;overflow:hidden;font-size:0;background:var(--sunk,#eee);box-shadow:none;border:0;flex:none}
html:not(#kt):not(#kt2) .ks-team>*>.ks-team-photo:not(img){visibility:hidden}
/* the kit's initials under the photo stay in the DOM but are never painted (the frame is hidden, its photo shown) */
html:not(#kt):not(#kt2) .ks-team>*>.ks-team-photo img{visibility:visible}
html:not(#kt):not(#kt2) .ks-team>*>.ks-team-photo img,html:not(#kt):not(#kt2) .ks-team>*>img.ks-team-photo{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:50% 20%;border-radius:inherit;margin:0;transform:none}
html:not(#kt):not(#kt2) .ks-team>*>img.ks-team-photo{position:static;aspect-ratio:4/5}
html:not(#kt):not(#kt2) .ks-team>*:has(>.ks-team-photo){display:flex;flex-direction:column;align-items:stretch;text-align:left;padding:0;background:none;border:0;box-shadow:none}
html:not(#kt):not(#kt2) .ks-team>*:has(>.ks-team-photo)>:not(.ks-team-photo){position:static;margin-inline:0}
@media (max-width:599px){html:not(#kt):not(#kt2) .ks-team{gap:22px 14px}html:not(#kt):not(#kt2) .ks-team>*{flex-basis:calc((100% - (var(--ks-cols,2) - 1) * 14px) / var(--ks-cols,2))}}
/* initials only: the kit's own card width, never a bigger placeholder box */
html:not(#kt):not(#kt2) .ks-team.ks-team-initials{max-width:calc(var(--ks-cols,2) * var(--ks-maxw,240px) + (var(--ks-cols,2) - 1) * 24px)}
html:not(#kt):not(#kt2) .ks-team.ks-team-initials>*{max-width:var(--ks-maxw,none)}
/* a portrait that failed after paint: same frame, the card's own initials (kt3) */
html:not(#kt):not(#kt2) .ks-team>*>.ks-team-photo.ks-photo-failed img,html:not(#kt):not(#kt2) .ks-team>*>img.ks-team-photo.ks-photo-failed{visibility:hidden}
/* the bold-monogram tile (muted_placeholder recipe): the failed frame paints its own ground; its text stays at font-size 0, its broken img hidden */
html:not(#kt):not(#kt2) .ks-team>*>.ks-team-photo.ks-photo-failed:not(img){visibility:visible;background:color-mix(in oklab,var(--accent,#888) 12%,var(--surface,#fff))}
html:not(#kt):not(#kt2) .ks-team>*>.ks-team-photo.ks-photo-failed:not(img)::after{content:attr(data-ks-initials);visibility:visible;position:absolute;inset:0;display:grid;place-items:center;font:700 clamp(2rem,1.6rem + 2vw,3.2rem)/1 var(--display,var(--serif,inherit));color:var(--ink)}
/* initials rows whose kit layout starts at the left edge stay left-aligned (kt3, political) */
html:not(#kt):not(#kt2) .ks-team.ks-team-initials.ks-team-left{margin-inline:0;justify-content:flex-start}
