/*
 * SportsPal app UI v2 — WP11 (SPEC-WP11, D32–D37). Explore (type tabs, sport strip, toolbar,
 * chips, landscape cards, sheets), More, Home v2 and the race page's app view.
 *
 * Loaded on every athlete page from partials/app-head.blade.php after app-header.css. The markup
 * these rules style is rendered only in the app view (server-side AppClient::presentsAsApp), so
 * the ordinary web never carries it; the few rules that touch shared markup are scoped to
 * html.is-app. Tokens: teal var(--theme-clr) #00A99D, black var(--dark-page-bg) #040505,
 * ground #F4F6F6, lines #E3E7E7, Borna for names and headings, Inter for meta and controls.
 */

:root {
    --spx-ground: #F4F6F6;
    --spx-card: #FFFFFF;
    --spx-ink: #0B0F0F;
    --spx-ink-2: #2F3636;
    --spx-mute: #5B6565;
    --spx-line: #E3E7E7;
    --spx-teal: var(--theme-clr, #00A99D);
    --spx-teal-deep: #007C74;
    --spx-teal-soft: #E3F5F3;
    --spx-black: var(--dark-page-bg, #040505);
    --spx-warn-soft: #FFF1E2;
    --spx-warn-ink: #9A4A07;
    --spx-bad-soft: #FDECEC;
    --spx-bad-ink: #B42318;
    --spx-head: 'Borna', 'Inter', system-ui, -apple-system, sans-serif;
    --spx-body: 'Inter', system-ui, -apple-system, sans-serif;
    --spx-hdr: calc(52px + env(safe-area-inset-top, 0px));
}

.spx [x-cloak],
.sph [x-cloak] {
    display: none !important;
}
body.spx-locked {
    overflow: hidden;
}
html.is-app body[data-page="website.category.organization"],
html.is-app body[data-page="website.more"],
html.is-app body[data-page="website.event.preview"] {
    background: var(--spx-ground);
}

/* ---- Root header (partials/app-header, tab roots: Home, Explore, More) ------------------- */
html.is-app .sp-apphdr.sp-apphdr--root {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px 0 16px;
}
html.is-app .sp-apphdr--root .sp-apphdr__rtitle {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-family: var(--spx-head);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.1;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
html.is-app .sp-apphdr--root .sp-apphdr__logo {
    flex: 1 1 auto;
}
html.is-app .sp-apphdr--root .sp-apphdr__logo img {
    height: 26px;
}
html.is-app .sp-apphdr__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
}
html.is-app .sp-apphdr__place {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 150px;
    height: 36px;
    padding: 0 10px 0 9px;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font-family: var(--spx-body);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
html.is-app .sp-apphdr__place span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
html.is-app .sp-apphdr__place svg {
    flex: 0 0 auto;
}
html.is-app .sp-apphdr__place:hover,
html.is-app .sp-apphdr__place:focus {
    color: #fff;
}

/* ---- Explore: type tabs + sport strip (partials/app-explore-nav) ------------------------- */
.spx-types {
    display: flex;
    gap: 2px;
    padding: 0 6px;
    background: var(--spx-black);
}
.spx-types__tab {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 2px 8px;
    border-bottom: 3px solid transparent;
    color: rgba(255, 255, 255, 0.62);
    font-family: var(--spx-body);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.spx-types__tab img {
    width: auto;
    height: 22px;
    filter: invert(1) brightness(1.6);
    opacity: 0.7;
}
.spx-types__tab.is-active {
    color: #fff;
    border-bottom-color: var(--spx-teal);
}
.spx-types__tab.is-active img {
    opacity: 1;
    filter: invert(58%) sepia(80%) saturate(1900%) hue-rotate(140deg) brightness(92%);
}
.spx-types__tab:hover,
.spx-types__tab:focus {
    color: #fff;
    text-decoration: none;
}
.spx-sports {
    position: sticky;
    top: var(--spx-hdr);
    z-index: 4;
    display: flex;
    gap: 8px;
    padding: 12px 16px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    background: var(--spx-ground);
}
.spx-sports::-webkit-scrollbar {
    display: none;
}
.spx-sport {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 13px 0 10px;
    border: 1.5px solid var(--spx-line);
    border-radius: 999px;
    background: var(--spx-card);
    color: var(--spx-ink);
    font-family: var(--spx-body);
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.spx-sport:first-child {
    padding: 0 16px;
}
.spx-sport img {
    width: auto;
    height: 18px;
}
.spx-sport.is-active {
    background: var(--spx-ink);
    border-color: var(--spx-ink);
    color: #fff;
}
.spx-sport.is-active img {
    filter: invert(1);
}
.spx-sport:hover,
.spx-sport:focus {
    color: inherit;
    text-decoration: none;
}
.spx-sport.is-active:hover,
.spx-sport.is-active:focus {
    color: #fff;
}

/* ---- Explore: toolbar, search, chips, quick facets --------------------------------------- */
.spx {
    background: var(--spx-ground);
    padding-bottom: 12px;
    min-height: 60vh;
    font-family: var(--spx-body);
    color: var(--spx-ink);
}
.spx-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 16px 4px;
    padding: 0 14px;
    height: 44px;
    border: 1.5px solid var(--spx-line);
    border-radius: 12px;
    background: var(--spx-card);
    color: var(--spx-mute);
}
.spx-search:focus-within {
    border-color: var(--spx-teal);
}
.spx-search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 16px;
    color: var(--spx-ink);
    -webkit-appearance: none;
    appearance: none;
}
.spx-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 4px;
}
.spx-tb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 13px;
    border: 1.5px solid var(--spx-line);
    border-radius: 12px;
    background: var(--spx-card);
    color: var(--spx-ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.spx-tb.is-on {
    border-color: var(--spx-teal);
    background: var(--spx-teal-soft);
    color: var(--spx-teal-deep);
}
.spx-tb__n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--spx-teal);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.spx-seg {
    display: inline-flex;
    margin-left: auto;
    padding: 2px;
    border: 1.5px solid var(--spx-line);
    border-radius: 12px;
    background: var(--spx-card);
}
.spx-seg button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--spx-mute);
}
.spx-seg button.is-on {
    background: var(--spx-ink);
    color: #fff;
}
.spx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px 2px;
}
.spx-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    height: 30px;
    padding: 0 8px 0 11px;
    border: 0;
    border-radius: 999px;
    background: var(--spx-teal-soft);
    color: var(--spx-teal-deep);
    font-size: 13px;
    font-weight: 600;
}
.spx-chip > span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spx-chip__x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--spx-teal-deep);
    color: #fff;
    font-size: 12px;
    line-height: 1;
}
.spx-chip--scope {
    padding: 0 12px 0 10px;
    background: var(--spx-card);
    border: 1.5px solid var(--spx-line);
    color: var(--spx-ink-2);
}
.spx-quick {
    display: flex;
    gap: 7px;
    padding: 8px 16px 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
.spx-quick::-webkit-scrollbar {
    display: none;
}
.spx-q {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 12px;
    border: 1.5px solid var(--spx-line);
    border-radius: 999px;
    background: var(--spx-card);
    color: var(--spx-ink);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.spx-q.is-on {
    background: var(--spx-ink);
    border-color: var(--spx-ink);
    color: #fff;
}
.spx-count {
    margin: 0;
    padding: 10px 16px 6px;
    color: var(--spx-mute);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

/* ---- Explore: the list and the landscape card (components/app-event-card) --------------- */
.spx-results {
    transition: opacity 0.15s ease;
}
.spx-results.is-busy {
    opacity: 0.55;
}
.spx-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 2px 16px 0;
}
.spx-card {
    position: relative;
    display: flex;
    align-items: stretch;
    background: var(--spx-card);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.spx-card__link {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    gap: 11px;
    padding: 9px 42px 9px 9px;
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.spx-card__link:hover,
.spx-card__link:focus {
    color: inherit;
    text-decoration: none;
}
.spx-card__link:active {
    background: #FAFBFB;
    border-radius: 16px;
}
.spx-card__thumb {
    position: relative;
    flex: 0 0 108px;
    width: 108px;
    height: 92px;
    overflow: hidden;
    border-radius: 12px;
    background: #DADFDF;
}
.spx-card__thumb > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.spx-card__sport {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.92);
}
.spx-card__sport img {
    width: 15px;
    height: 15px;
    object-fit: contain;
}
.spx-card__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    flex: 1 1 auto;
    min-width: 0;
}
.spx-card__when {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--spx-teal-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.spx-card__ad {
    padding: 1px 6px;
    border-radius: 5px;
    background: #FFF4D6;
    color: #7A5A00;
    font-size: 10.5px;
    letter-spacing: 0.04em;
}
.spx-card__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--spx-ink);
    font-family: var(--spx-head);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.spx-card__where {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    color: var(--spx-mute);
    font-size: 12px;
}
.spx-card__where svg {
    flex: 0 0 auto;
}
.spx-card__where span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* One row: a tag that does not fit wraps to a second line that is clipped away, never cut in half. */
.spx-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    height: 21px;
    margin-top: 2px;
    overflow: hidden;
}
.spx-tag {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 6px;
    background: var(--spx-ground);
    color: var(--spx-ink-2);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.spx-tag--ok {
    background: var(--spx-teal-soft);
    color: var(--spx-teal-deep);
}
.spx-tag--bad {
    background: var(--spx-bad-soft);
    color: var(--spx-bad-ink);
}
.spx-tag--info {
    background: var(--spx-warn-soft);
    color: var(--spx-warn-ink);
}
.spx-card__heart {
    position: absolute;
    top: 4px;
    right: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #9AA3A3;
    -webkit-tap-highlight-color: transparent;
}
.spx-card__heart.is-on {
    color: #E0245E;
}
.spx-empty {
    padding: 28px 18px;
    border-radius: 16px;
    background: var(--spx-card);
    text-align: center;
    color: var(--spx-mute);
}
.spx-empty p {
    margin: 0 0 12px;
    font-size: 15px;
}
.spx-more {
    display: flex;
    justify-content: center;
    padding: 14px 16px 4px;
}
.spx-cal {
    padding: 0 12px;
}

/* ---- Buttons ---------------------------------------------------------------------------- */
.spx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    background: var(--spx-teal);
    color: #fff;
    font-family: var(--spx-body);
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
}
.spx-btn:hover,
.spx-btn:focus {
    color: #fff;
    text-decoration: none;
}
.spx-btn--ghost {
    background: var(--spx-card);
    border: 1.5px solid var(--spx-line);
    color: var(--spx-ink);
    font-size: 15px;
    font-weight: 600;
}
.spx-btn--ghost:hover,
.spx-btn--ghost:focus {
    color: var(--spx-ink);
}
.spx-link {
    padding: 8px 4px;
    border: 0;
    background: transparent;
    color: var(--spx-teal-deep);
    font-size: 14px;
    font-weight: 600;
}

/* ---- Sheets (filters, sort) ------------------------------------------------------------- */
/* Over the page, the sticky header and the tab bar (1030); under Bootstrap's modals (1050). */
.spx-sheet__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}
.spx-sheet.is-open .spx-sheet__backdrop {
    opacity: 1;
    visibility: visible;
}
.spx-sheet__panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1041;
    display: flex;
    flex-direction: column;
    max-height: calc(100% - 56px - env(safe-area-inset-top, 0px));
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.18);
    visibility: hidden;
    transform: translateY(105%);
    transition: transform 0.28s ease, visibility 0.28s;
}
.spx-sheet.is-open .spx-sheet__panel {
    visibility: visible;
    transform: translateY(0);
}
.spx-sheet__panel--short .spx-sheet__list {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.spx-sheet__grab {
    flex: 0 0 auto;
    width: 40px;
    height: 5px;
    margin: 8px auto 6px;
    border-radius: 3px;
    background: #D5D9D9;
}
.spx-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    padding: 2px 16px 10px 18px;
    border-bottom: 1px solid var(--spx-line);
}
.spx-sheet__head h3 {
    margin: 0;
    font-family: var(--spx-head);
    font-size: 19px;
    font-weight: 600;
    color: var(--spx-ink);
}
.spx-sheet__body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0 18px;
}
.spx-sheet__foot {
    flex: 0 0 auto;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--spx-line);
}
.spx-sheet__foot .spx-btn {
    width: 100%;
}
.spx-grp {
    padding: 13px 0 11px;
    border-bottom: 1px solid var(--spx-line);
}
.spx-grp:last-child {
    border-bottom: 0;
}
.spx-grp__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 8px;
    color: var(--spx-ink);
    font-size: 14px;
    font-weight: 700;
}
.spx-grp__label span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--spx-mute);
    font-size: 13px;
    font-weight: 500;
}
.spx-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.spx-opts--sub {
    margin-top: 8px;
}
.spx-opts--scroll {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-right: -18px;
    padding-right: 18px;
    scrollbar-width: none;
}
.spx-opts--scroll::-webkit-scrollbar {
    display: none;
}
.spx-opt {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 13px;
    border: 1.5px solid var(--spx-line);
    border-radius: 999px;
    background: #fff;
    color: var(--spx-ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
.spx-opt--sm {
    height: 34px;
    padding: 0 12px;
    font-size: 13.5px;
}
.spx-opt small {
    color: var(--spx-mute);
    font-size: 11.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.spx-opt.is-on {
    background: var(--spx-ink);
    border-color: var(--spx-ink);
    color: #fff;
}
.spx-opt.is-on small {
    color: rgba(255, 255, 255, 0.7);
}
.spx-note {
    margin: 8px 0 0;
    color: var(--spx-mute);
    font-size: 13px;
}
.spx-select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1.5px solid var(--spx-line);
    border-radius: 12px;
    background: #fff;
    color: var(--spx-ink);
    font-size: 15px;
}
.spx-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    margin: 0;
    color: var(--spx-ink);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.spx-toggle input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.spx-switch {
    position: relative;
    flex: 0 0 auto;
    width: 48px;
    height: 29px;
    border-radius: 15px;
    background: #D6DBDB;
    transition: background 0.2s ease;
}
.spx-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: left 0.2s ease;
}
.spx-toggle input:checked + .spx-switch {
    background: var(--spx-teal);
}
.spx-toggle input:checked + .spx-switch::after {
    left: 22px;
}
.spx-toggle input:focus-visible + .spx-switch {
    outline: 2px solid var(--spx-teal);
    outline-offset: 2px;
}
.spx-sheet__list {
    padding: 6px 0 10px;
}
.spx-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    background: transparent;
    color: var(--spx-ink);
    font-size: 16px;
    text-align: left;
}
.spx-row svg {
    visibility: hidden;
    color: var(--spx-teal);
}
.spx-row.is-on {
    color: var(--spx-teal-deep);
    font-weight: 600;
}
.spx-row.is-on svg {
    visibility: visible;
}
.spx-row:active {
    background: #F2F4F4;
}

/* ---- More (livewire/website/more) ------------------------------------------------------- */
.sp-more {
    background: var(--spx-ground);
    min-height: 70vh;
    font-family: var(--spx-body);
    color: var(--spx-ink);
}
.sp-more__wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 14px 16px 28px;
}
.sp-more__me {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    background: var(--spx-card);
    color: inherit;
    text-decoration: none;
}
.sp-more__me:hover,
.sp-more__me:focus {
    color: inherit;
    text-decoration: none;
}
.sp-more__me--guest {
    flex-direction: column;
    align-items: stretch;
}
.sp-more__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--spx-teal);
    color: #fff;
    font-family: var(--spx-head);
    font-size: 19px;
    font-weight: 600;
}
.sp-more__who {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0;
}
.sp-more__name {
    font-family: var(--spx-head);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.25;
}
.sp-more__email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--spx-mute);
    font-size: 13px;
}
.sp-more__me--guest .sp-more__email {
    white-space: normal;
}
.sp-more__auth {
    display: flex;
    gap: 10px;
}
.sp-more__btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1.5px solid var(--spx-line);
    border-radius: 12px;
    background: #fff;
    color: var(--spx-ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}
.sp-more__btn--primary {
    border-color: var(--spx-teal);
    background: var(--spx-teal);
    color: #fff;
}
.sp-more__btn:hover {
    color: var(--spx-ink);
}
.sp-more__btn--primary:hover {
    color: #fff;
}
.sp-more__sect {
    margin: 18px 2px 8px;
    color: var(--spx-mute);
    font-family: var(--spx-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.sp-more__types {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.sp-more__type {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 12px 4px 10px;
    border-radius: 14px;
    background: var(--spx-card);
    color: var(--spx-ink);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}
.sp-more__type:hover,
.sp-more__type:focus {
    color: var(--spx-ink);
    text-decoration: none;
}
.sp-more__type img {
    width: auto;
    height: 26px;
}
.sp-more__list {
    overflow: hidden;
    margin-top: 12px;
    border-radius: 16px;
    background: var(--spx-card);
}
.sp-more__sect + .sp-more__list {
    margin-top: 0;
}
.sp-more__list > a,
.sp-more__list > button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 8px 14px;
    border: 0;
    border-bottom: 1px solid var(--spx-line);
    background: transparent;
    color: var(--spx-ink);
    font-size: 15px;
    font-weight: 500;
    text-align: left;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.sp-more__list > :last-child {
    border-bottom: 0;
}
.sp-more__list > a:hover,
.sp-more__list > a:focus {
    color: var(--spx-ink);
    text-decoration: none;
}
.sp-more__list > a:active,
.sp-more__list > button:active {
    background: #F7F8F8;
}
.sp-more__list > a > span:not(.sp-more__ic),
.sp-more__list > button > span:not(.sp-more__ic) {
    flex: 1 1 auto;
    min-width: 0;
}
.sp-more__ic {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--spx-ground);
    color: var(--spx-ink-2);
}
.sp-more__chev {
    flex: 0 0 auto;
    color: #B5BBBB;
}
.sp-more__signout {
    color: var(--spx-bad-ink) !important;
}
.sp-more__build {
    margin: 16px 0 0;
    color: #A6ADAD;
    font-size: 12px;
    text-align: center;
}
/* The iOS shell has no cookie banner (D10/D25), so no cookie settings either. */
html.is-ios-app .sp-more__cookie {
    display: none !important;
}

/* ---- Profile card variant (components/app-profile-card) --------------------------------- */
.spx-card__thumb--square {
    flex-basis: 92px;
    width: 92px;
    height: 92px;
}
.spx-card__name--one {
    -webkit-line-clamp: 1;
}
.spx-card__sub {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--spx-mute);
    font-size: 12.5px;
    line-height: 1.3;
}

/* ---- Home v2 (landing/app-home) --------------------------------------------------------- */
.sp-apphome__card--next {
    position: relative;
    overflow: hidden;
}
.sp-apphome__card--photo {
    min-height: 170px;
    justify-content: flex-end;
    background: #111 !important;
}
.sp-apphome__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.62;
}
.sp-apphome__card--photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.7) 100%);
}
.sp-apphome__card--next > span {
    position: relative;
    z-index: 1;
}
.sp-apphome__countdown {
    position: absolute !important;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px;
    border-radius: 12px;
    background: #fff;
    color: var(--spx-ink);
    line-height: 1;
}
.sp-apphome__countdown b {
    font-family: var(--spx-head);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}
.sp-apphome__countdown small {
    margin-top: 2px;
    color: var(--spx-mute);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.sph-sports {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.sph-sport {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--spx-ink);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}
.sph-sport:hover,
.sph-sport:focus {
    color: var(--spx-ink);
    text-decoration: none;
}
.sph-sport__c {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: 1.5px solid var(--spx-line);
    border-radius: 50%;
    background: #fff;
}
.sph-sport__c img {
    width: auto;
    height: 28px;
}
.sph-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.sph-all {
    flex: 0 0 auto;
    color: var(--spx-teal-deep);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.sph-h2 {
    margin-bottom: 10px !important;
}
.sph-block {
    display: block;
}
.sp-apphome__card--photo .sp-apphome__eyebrow {
    color: #fff;
    opacity: 0.85;
}
.sp-apphome__card--photo .sp-apphome__go {
    color: #7FE8DE;
}
.sph-strip {
    display: flex;
    gap: 10px;
    margin: 0 -16px;
    padding: 0 16px 4px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.sph-strip::-webkit-scrollbar {
    display: none;
}
.sph-tile {
    flex: 0 0 200px;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    color: var(--spx-ink);
    text-decoration: none;
    scroll-snap-align: start;
}
.sph-tile:hover,
.sph-tile:focus {
    color: var(--spx-ink);
    text-decoration: none;
}
.sph-tile__im {
    display: block;
    height: 96px;
    background: #DADFDF;
}
.sph-tile__im img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sph-tile__b {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px 10px;
}
.sph-tile__when {
    color: var(--spx-teal-deep);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
}
.sph-tile__name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: 2.4em;
    font-family: var(--spx-head);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}
.sph-tile__where {
    overflow: hidden;
    color: var(--spx-mute);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sph-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.sph-type {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 66px;
    padding: 0 12px;
    overflow: hidden;
    border-radius: 14px;
    background: #1B2222;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
}
.sph-type:hover,
.sph-type:focus {
    color: #fff;
    text-decoration: none;
}
.sph-type__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}
.sph-type__ic {
    position: relative;
    width: auto;
    height: 24px;
    filter: invert(1);
}
.sph-type span {
    position: relative;
}
.sph-months {
    display: flex;
    gap: 8px;
    margin: 0 -16px;
    padding: 0 16px 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
.sph-months::-webkit-scrollbar {
    display: none;
}
.sph-month {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    min-width: 96px;
    padding: 10px 14px;
    border: 1.5px solid var(--spx-line);
    border-radius: 12px;
    background: #fff;
    color: var(--spx-ink);
    text-align: center;
    text-decoration: none;
}
.sph-month:hover,
.sph-month:focus {
    color: var(--spx-ink);
    text-decoration: none;
}
.sph-month b {
    font-family: var(--spx-head);
    font-size: 15px;
}
.sph-month small {
    color: var(--spx-mute);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* ---- Race page (partials/app-event-hero) ------------------------------------------------ */
.spe-hero {
    position: relative;
    height: calc(260px + env(safe-area-inset-top, 0px));
    overflow: hidden;
    background: #1B2222;
}
.spe-hero__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.spe-hero__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.66) 100%);
}
.spe-hero__title {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    color: #fff;
}
.spe-hero__title h1 {
    margin: 8px 0 0;
    color: #fff;
    font-family: var(--spx-head);
    font-size: 24px;
    font-weight: 600;
    line-height: 1.15;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
.spe-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 4px 9px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--spx-ink);
    font-family: var(--spx-body);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.spe-kicker img {
    width: auto;
    height: 14px;
}
.spe-top {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: 10px;
    right: 10px;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}
.spe-round {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.38);
    color: #fff;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.spe-top.is-scrolled .spe-round {
    background: rgba(255, 255, 255, 0.96);
    color: var(--spx-ink);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
}
.spe-round.is-copied::after {
    content: "Link copied";
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    padding: 5px 10px;
    border-radius: 8px;
    background: #fff;
    color: var(--spx-ink);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}
.spe {
    padding: 12px 16px 8px;
    background: var(--spx-ground);
    font-family: var(--spx-body);
    color: var(--spx-ink);
}
.spe-facts {
    display: grid;
    grid-template-columns: repeat(var(--spe-n, 4), minmax(0, 1fr));
    gap: 4px;
    padding: 12px 8px;
    border-radius: 16px;
    background: #fff;
    text-align: center;
}
.spe-facts b {
    display: block;
    font-family: var(--spx-head);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
}
.spe-facts small {
    color: var(--spx-mute);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.spe-h2 {
    margin: 18px 0 10px;
    font-family: var(--spx-head);
    font-size: 19px;
    font-weight: 600;
}
.spe-dist {
    display: flex;
    gap: 8px;
    margin: 0 -16px;
    padding: 0 16px 2px;
    overflow-x: auto;
    scrollbar-width: none;
}
.spe-dist::-webkit-scrollbar {
    display: none;
}
.spe-dist__card {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
    max-width: 220px;
    padding: 10px 12px;
    border: 1.5px solid var(--spx-line);
    border-radius: 12px;
    background: #fff;
}
.spe-dist__card b {
    font-family: var(--spx-head);
    font-size: 15px;
}
.spe-dist__card small {
    color: var(--spx-mute);
    font-size: 12px;
    white-space: nowrap;
}
.spe-dist__price {
    color: var(--spx-teal-deep) !important;
    font-weight: 600;
}
.spe-lines {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}
.spe-line {
    display: flex;
    align-items: center;
    gap: 12px;
}
.spe-line__ic {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff;
    color: var(--spx-ink-2);
}
.spe-line__t {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 14.5px;
}
.spe-line__t b {
    font-weight: 600;
    color: var(--spx-ink);
}
.spe-line__t a {
    color: var(--spx-teal-deep);
    text-decoration: none;
}
.spe-line__t small {
    color: var(--spx-mute);
    font-size: 12.5px;
}
.spe-more {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}
.spe-more a {
    color: var(--spx-teal-deep);
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
}
.spe-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--spx-line);
    background: #fff;
    font-family: var(--spx-body);
}
.spe-bar__info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}
.spe-bar__info b {
    overflow: hidden;
    color: var(--spx-ink);
    font-family: var(--spx-head);
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spe-bar__info small {
    overflow: hidden;
    color: var(--spx-mute);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.spe-bar__heart {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 1.5px solid var(--spx-line);
    border-radius: 14px;
    background: #fff;
    color: var(--spx-ink);
}
.spe-bar__heart.is-on {
    color: #E0245E;
}
.spe-bar__cta {
    flex: 0 0 auto;
    min-width: 140px;
    height: 50px;
    padding: 0 22px;
    border: 0;
    border-radius: 14px;
    background: var(--spx-teal);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}
.spe-bar__cta[disabled] {
    opacity: 0.6;
}
/* The race page body clears the sticky bar instead of the tab bar it replaces. */
html.is-app body[data-page="website.event.preview"] {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}
