.h500-stats {
    --h500-red: var(--global-palette1, #d71d24);
    --h500-black: var(--global-palette3, #000);
    --h500-white: var(--global-palette9, #fff);
    --h500-muted: var(--global-palette4, #4d4d4d);
    --h500-ink: #222;
    --h500-stripe: #f5f5f5;
    --h500-rule: #dedede;
    --h500-gutter: clamp(14px, 2vw, 30px);
    --h500-body: industry, Roboto, sans-serif;
    --h500-display: industry, Roboto, sans-serif;
    --h500-label: industry, Roboto, sans-serif;
    color: var(--h500-ink);
    background: var(--h500-white);
    margin: 0 auto;
    min-width: 0;
    padding-bottom: clamp(24px, 4vw, 56px);
    font-family: var(--h500-body);
    font-size: 16px;
    font-weight: 300;
    line-height: 1.5;
    box-sizing: border-box;
}

.h500-stats *, .h500-stats *::before, .h500-stats *::after { box-sizing: border-box; }
.h500-stats [hidden] { display: none !important; }
.h500-stats a { color: var(--h500-red); text-decoration: underline; text-underline-offset: .18em; }
.h500-stats a:hover { text-decoration-thickness: 2px; }
.h500-stats :is(a, button, input, summary, [tabindex]):focus-visible { outline: 2px solid var(--h500-red); outline-offset: 3px; }
.h500-stats :is(h1, h2, h3, p, dl, dd) { margin: 0; }
.h500-stats :is(h1, h2, h3) { color: inherit; line-height: 1.15; }

.h500-mast {
    color: #fff;
    background:
        radial-gradient(ellipse at 2% 118%, #9a131c 0%, transparent 65%),
        radial-gradient(ellipse at 108% 0%, #5c1118 0%, transparent 53%),
        linear-gradient(115deg, #270b0f 0%, #151010 51%, #0a0808 100%);
    padding: clamp(36px, 6vw, 78px) var(--h500-gutter);
    border-bottom: 4px solid var(--h500-red);
}
.h500-mast-content { max-width: 1160px; margin-inline: auto; }
.h500-mast .h500-kicker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: #fff;
    font: 700 .8rem/1.3 var(--h500-label);
    text-transform: uppercase;
    letter-spacing: .11em;
}
.h500-mast .h500-wordmark {
    display: block;
    width: clamp(128px, 24vw, 236px);
    max-width: 100%;
    height: auto;
}
.h500-mast h1 {
    color: #fff;
    margin: 10px 0 12px;
    font: 900 clamp(2.2rem, 5.5vw, 4.6rem)/1.06 var(--h500-display);
    letter-spacing: .008em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.h500-mast .h500-deck { color: #f5f5f5; font-size: clamp(.96rem, 1.6vw, 1.13rem); max-width: 64ch; }

.h500-nav, .h500-tabs, .h500-session-links, .h500-card-links { display: flex; gap: 8px; flex-wrap: wrap; }
.h500-nav { padding: 10px var(--h500-gutter); background: var(--h500-black); }
.h500-stats .h500-nav a, .h500-stats .h500-tabs a, .h500-stats .h500-session-links a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 15px;
    color: var(--h500-ink);
    background: var(--h500-white);
    border: 1px solid #ccc;
    border-radius: 6px;
    text-decoration: none;
    font: 700 .85rem/1.2 var(--h500-label);
    letter-spacing: .02em;
}
.h500-stats .h500-nav a {
    color: #fff;
    background: transparent;
    border-color: transparent;
    border-radius: 999px;
    text-transform: uppercase;
}
.h500-stats .h500-nav a:hover { background: #252525; }
.h500-stats :is(.h500-nav,.h500-tabs) a[aria-current="page"], .h500-stats .h500-session-links a.is-current {
    color: #fff;
    background: var(--h500-red);
    border-color: var(--h500-red);
}
.h500-stats :is(.h500-tabs,.h500-session-links) a:hover { border-color: var(--h500-red); }
.h500-stats .h500-tabs { margin: 24px var(--h500-gutter) 0; }

.h500-stats .h500-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-inline: var(--h500-gutter);
    border-bottom: 1px solid var(--h500-rule);
}
.h500-facts div { padding: 15px clamp(10px, 2vw, 22px); border-right: 1px solid var(--h500-rule); }
.h500-facts div:last-child { border-right: 0; }
.h500-facts dt, .h500-inline-facts dt {
    color: var(--h500-muted);
    font: 700 .75rem/1.3 var(--h500-label);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.h500-facts dd {
    margin-top: 4px;
    color: var(--h500-black);
    font: 700 clamp(1.15rem, 2.5vw, 1.85rem)/1.15 var(--h500-label);
    overflow-wrap: anywhere;
}
.h500-panel { margin: 26px var(--h500-gutter) 0; min-width: 0; }
.h500-section-head { margin-bottom: 14px; }
.h500-section-head h2 {
    font: 900 clamp(1.55rem, 3vw, 2.1rem)/1.15 var(--h500-display);
    text-transform: uppercase;
    letter-spacing: .01em;
}
.h500-section-head p { color: var(--h500-muted); max-width: 83ch; margin-top: 5px; }
.h500-events, .h500-feature-grid, .h500-profile-grid, .h500-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.h500-event-card, .h500-feature-grid article, .h500-profile-grid > div {
    background: var(--h500-stripe);
    border: 1px solid var(--h500-rule);
    border-radius: 6px;
    padding: 16px;
    min-width: 0;
}
.h500-event-card { border-top: 3px solid var(--h500-red); }
.h500-event-identity { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.h500-event-logo { display: block; width: clamp(64px, 22%, 108px); max-height: 84px; object-fit: contain; flex: 0 0 auto; }
.h500-event-card .h500-card-year {
    color: var(--h500-red);
    font: 700 2.2rem/1.05 var(--h500-display);
    letter-spacing: .02em;
}
.h500-event-card .h500-card-label {
    color: var(--h500-muted);
    font: 700 .72rem/1.3 var(--h500-label);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 8px 0 3px;
}
.h500-event-card h3, .h500-feature-grid h3 { font: 700 1.13rem/1.2 var(--h500-label); }
.h500-card-links { margin-top: 11px; gap: 5px 15px; }
.h500-card-links a { font: 700 .88rem/1.35 var(--h500-label); }
.h500-feature-grid p { color: var(--h500-muted); margin-top: 7px; }
.h500-stats .h500-inline-facts { display: flex; flex-wrap: wrap; gap: 12px 27px; margin-bottom: 15px; }
.h500-inline-facts dd { font: 700 1.2rem/1.35 var(--h500-label); }
.h500-stats .h500-subtitle { font: 700 1.08rem/1.2 var(--h500-label); margin: 17px 0 8px; }
.h500-session-links { margin-bottom: 13px; }
.h500-stats .h500-empty { padding: 14px; color: var(--h500-muted); background: var(--h500-stripe); border: 1px solid var(--h500-rule); border-radius: 6px; }

.h500-table-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 14px;
    color: var(--h500-muted);
    font: 300 .85rem/1.4 var(--h500-label);
}
.h500-stats .h500-table-tools input {
    flex: 1 1 230px;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 11px 14px;
    font: 300 15px/1.5 var(--h500-label);
    background: #fff;
    color: #222;
    border: 1px solid #ccc;
    border-radius: 6px;
}
.h500-table-scroll { max-width: 100%; overflow-x: auto; border: 2px solid #b0b0b0; border-radius: 6px; }
.h500-stats .h500-table-scroll table {
    border-collapse: collapse;
    width: 100%;
    margin: 0;
    border: 0;
    color: #222;
    font: 300 14px/1.4 var(--h500-body);
}
.h500-stats .h500-table-scroll :is(th,td) {
    text-align: left;
    vertical-align: middle;
    padding: 9px 10px;
    border: 0;
    border-bottom: 1px solid var(--h500-rule);
    white-space: nowrap;
}
.h500-stats .h500-table-scroll thead { background: #252525; color: #fff; }
.h500-stats .h500-table-scroll th {
    background: #252525;
    color: #fff;
    border-bottom: 0;
    font: 700 12px/1.4 var(--h500-label);
    letter-spacing: .04em;
    text-transform: uppercase;
}
.h500-stats .h500-table-scroll th button {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    text-align: left;
    text-transform: inherit;
    box-shadow: none;
    cursor: pointer;
}
.h500-stats .h500-table-scroll th button:hover { text-decoration: underline; }
.h500-stats th[aria-sort="ascending"] button::after { content: " ▲"; font-size: .65em; }
.h500-stats th[aria-sort="descending"] button::after { content: " ▼"; font-size: .65em; }
.h500-stats .h500-table-scroll tbody tr:nth-child(even) { background: var(--h500-stripe); }
.h500-stats .h500-table-scroll tbody tr:hover { background: #fff1f1; }
.h500-stats .h500-table-scroll tbody tr:last-child td { border-bottom: 0; }
.h500-num { font-variant-numeric: tabular-nums; }
.h500-lap-speed { display: block; color: var(--h500-muted); font-size: .8rem; line-height: 1.25; }
.h500-stats .h500-driver-link { color: #222; font: 700 14px/1.35 var(--h500-label); }
.h500-stats .h500-driver-link:hover { color: var(--h500-red); }
.h500-car-badge {
    display: inline-grid;
    place-items: center;
    min-width: 43px;
    min-height: 34px;
    padding: 5px 7px;
    color: #fff;
    background: var(--h500-red);
    border-radius: 4px;
    font: 900 17px/1 var(--h500-label);
}
.h500-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.h500-picker {
    margin: 24px var(--h500-gutter) 0;
    border: 1px solid #ccc;
    background: var(--h500-white);
    border-radius: 6px;
}
.h500-picker summary { cursor: pointer; padding: 12px 15px; font: 700 1rem/1.35 var(--h500-label); }
.h500-picker summary span { color: var(--h500-red); margin-left: .55rem; font-size: .9rem; }
.h500-picker-grid { padding: 0 15px 15px; }
.h500-picker-grid > div { border-top: 2px solid var(--h500-red); padding-top: 8px; }
.h500-picker-grid h3, .h500-profile-grid h3 { font: 700 1rem/1.2 var(--h500-label); margin-bottom: 7px; }
.h500-picker-grid a { display: block; padding: 4px 6px; font-size: .88rem; }
.h500-picker-grid a.is-current { background: #fff0f0; font-weight: 700; }
.h500-profile-grid dl > div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--h500-rule); padding: 5px 0; }
.h500-profile-grid dl > div:last-child { border-bottom: 0; }
.h500-profile-grid dt { color: var(--h500-muted); font-size: .86rem; }
.h500-profile-grid dd { font: 700 .86rem/1.4 var(--h500-label); text-align: right; }
.h500-stats .h500-winner-banner {
    margin: 18px var(--h500-gutter) 0;
    padding: 11px 15px;
    color: #fff;
    background: var(--h500-red);
    font: 900 clamp(.95rem, 2.1vw, 1.25rem)/1.25 var(--h500-display);
    text-transform: uppercase;
    letter-spacing: .045em;
}
.h500-profile-actions { margin: 18px var(--h500-gutter) 0; }
.h500-stats .h500-back-button {
    display: inline-block;
    padding: 8px 15px;
    border: 1px solid var(--h500-red);
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
}
.h500-stats .h500-back-button:hover { background: #fff1f1; }

@media (max-width: 850px) {
    .h500-events, .h500-feature-grid, .h500-profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 590px) {
    .h500-stats .h500-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .h500-facts div:nth-child(even) { border-right: 0; }
    .h500-facts div:nth-child(-n+2) { border-bottom: 1px solid var(--h500-rule); }
    .h500-events, .h500-feature-grid, .h500-profile-grid, .h500-picker-grid { grid-template-columns: 1fr; }
    .h500-nav, .h500-tabs, .h500-session-links { gap: 5px; }
    .h500-stats :is(.h500-nav,.h500-tabs,.h500-session-links) a { padding: 7px 9px; font-size: .8rem; }
    .h500-stats .h500-table-scroll :is(th,td) { padding: 7px 8px; }
}
