﻿:root {
    --bg-1: #071018;
    --bg-2: #10251f;
    --card: rgba(255, 255, 255, 0.085);
    --card-2: rgba(255, 255, 255, 0.13);
    --stroke: rgba(255, 255, 255, 0.16);
    --text: #f7fff8;
    --muted: rgba(247, 255, 248, 0.68);
    --green: #43f59e;
    --lime: #c7ff6b;
    --orange: #ffb34e;
    --pink: #ff5e8e;
    --blue: #58c6ff;
    --purple: #b18cff;
    --danger: #ff6c6c;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
    --radius-lg: 34px;
    --radius-md: 22px;
    --radius-sm: 15px;
    --speed: 450ms;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    padding: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 8% 10%, rgba(67, 245, 158, 0.22), transparent 32%), radial-gradient(circle at 88% 18%, rgba(88, 198, 255, 0.14), transparent 26%), radial-gradient(circle at 50% 95%, rgba(255, 179, 78, 0.16), transparent 35%), linear-gradient(135deg, var(--bg-1), var(--bg-2));
    overflow-x: hidden;
}

    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
        background-size: 46px 46px;
        mask-image: radial-gradient(circle at center, black, transparent 78%);
        pointer-events: none;
        opacity: 0.6;
        z-index: -2;
    }

    body::after {
        content: "";
        position: fixed;
        inset: 0;
        background: linear-gradient(115deg, transparent 0 48%, rgba(255, 255, 255, 0.06) 48% 49%, transparent 49% 100%), linear-gradient(125deg, transparent 0 56%, rgba(255, 255, 255, 0.035) 56% 57%, transparent 57% 100%);
        pointer-events: none;
        z-index: -1;
    }

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.app {
    min-height: 100vh;
    width: min(1800px, 100%);
    margin: 0 auto;
    padding: 28px;
}

.intro-view {
    min-height: calc(100vh - 56px);
    display: grid;
    place-items: center;
    transition: opacity var(--speed), transform var(--speed);
}

.intro-shell {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 28px;
    align-items: stretch;
}

.hero-card,
.form-card {
    border: 1px solid var(--stroke);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.hero-card {
    border-radius: var(--radius-lg);
    padding: clamp(28px, 5vw, 58px);
    position: relative;
    overflow: hidden;
    min-height: 620px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

    .hero-card::after {
        content: "";
        position: absolute;
        width: 520px;
        height: 520px;
        border: 1px solid rgba(199, 255, 107, 0.28);
        border-radius: 50%;
        right: -190px;
        bottom: -220px;
        box-shadow: inset 0 0 80px rgba(67, 245, 158, 0.06);
    }

.mini-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 10px 14px;
    border: 1px solid rgba(199, 255, 107, 0.32);
    border-radius: 999px;
    background: rgba(199, 255, 107, 0.09);
    color: var(--lime);
    font-weight: 700;
    letter-spacing: 0.2px;
    margin-bottom: 28px;
}

.hero-card h1 {
    margin: 0;
    font-size: clamp(44px, 6vw, 76px);
    line-height: 0.92;
    letter-spacing: -3.7px;
    max-width: 620px;
}

    .hero-card h1 span {
        color: var(--green);
        text-shadow: 0 0 36px rgba(67, 245, 158, 0.28);
    }

.hero-copy {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
    max-width: 600px;
    margin: 28px 0 0;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    position: relative;
    z-index: 1;
    margin-top: 48px;
}

.hero-metric {
    padding: 17px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.13);
}

    .hero-metric strong {
        display: block;
        font-size: 23px;
        margin-bottom: 5px;
    }

    .hero-metric small {
        color: var(--muted);
    }

.form-card {
    border-radius: var(--radius-lg);
    padding: clamp(24px, 4vw, 44px);
    min-height: 620px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

    .form-card::before {
        content: "";
        position: absolute;
        inset: 18px;
        border: 1px dashed rgba(255, 255, 255, 0.14);
        border-radius: 26px;
        pointer-events: none;
    }

.form-inner {
    position: relative;
    z-index: 1;
}

.section-kicker {
    color: var(--green);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.17em;
    text-transform: uppercase;
    margin: 0 0 10px;
}

.form-card h2 {
    margin: 0 0 12px;
    font-size: 30px;
    letter-spacing: -1px;
}

.subtext {
    color: var(--muted);
    margin: 0 0 28px;
    line-height: 1.6;
}

.input-grid {
    display: grid;
    gap: 16px;
}

.field {
    position: relative;
}

    .field label {
        display: block;
        margin: 0 0 8px;
        font-size: 13px;
        color: rgba(247, 255, 248, 0.75);
        font-weight: 800;
    }

    .field input {
        width: 100%;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 18px;
        background: rgba(0, 0, 0, 0.22);
        color: var(--text);
        outline: 0;
        padding: 16px 17px;
        transition: border-color 180ms, box-shadow 180ms, transform 180ms;
    }

        .field input:focus {
            border-color: rgba(67, 245, 158, 0.82);
            box-shadow: 0 0 0 4px rgba(67, 245, 158, 0.12);
            transform: translateY(-1px);
        }

        .field input::placeholder {
            color: rgba(247, 255, 248, 0.36);
        }

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border-radius: 18px;
    font-weight: 900;
    color: #071018;
    background: linear-gradient(135deg, var(--green), var(--lime));
    box-shadow: 0 18px 45px rgba(67, 245, 158, 0.22);
    transition: transform 180ms, box-shadow 180ms, opacity 180ms;
    margin-top: 22px;
    width: 100%;
    padding: 18px 20px;
    font-size: 16px;
}

    .primary-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 22px 52px rgba(67, 245, 158, 0.26);
    }

    .primary-btn:disabled {
        opacity: 0.65;
        cursor: not-allowed;
        transform: none;
    }

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(3, 8, 11, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: opacity 360ms ease, visibility 360ms ease;
}

    .loading-screen.show {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

.panel-title {
    margin: 0px;
}

.loader-card {
    width: min(420px, calc(100% - 40px));
    padding: 40px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.11);
    box-shadow: var(--shadow);
}

.spinner {
    width: 82px;
    height: 82px;
    margin: 0 auto 22px;
    border: 7px solid rgba(255, 255, 255, 0.13);
    border-top-color: var(--green);
    border-right-color: var(--lime);
    border-radius: 50%;
    animation: spin 900ms linear infinite;
}

.response-box {
    display: none;
    margin-top: 16px;
    padding: 13px 14px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: rgba(0, 0, 0, 0.22);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

    .response-box.show {
        display: block;
    }

    .response-box.success {
        color: var(--lime);
        border-color: rgba(199, 255, 107, 0.28);
    }

    .response-box.error {
        color: #ff8a8a;
        border-color: rgba(255, 108, 108, 0.35);
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .app {
        padding: 16px;
    }

    .intro-shell {
        grid-template-columns: 1fr;
    }

    .hero-card,
    .form-card {
        min-height: auto;
    }

    .hero-metrics {
        grid-template-columns: 1fr;
    }
}

html,
body {
    height: 100%;
    overflow: hidden;
}

.app {
    height: 100svh;
    min-height: 100svh;
    padding: 12px;
    overflow: hidden;
}

.intro-view {
    height: calc(100svh - 24px);
    min-height: 0;
}

.intro-shell {
    width: min(980px, 100%);
    height: 100%;
    gap: 16px;
}

.hero-card,
.form-card {
    height: 100%;
    min-height: 0;
    padding: 24px;
    border-radius: 26px;
}

    .hero-card h1 {
        font-size: clamp(34px, 4.4vw, 54px);
        letter-spacing: -2.5px;
    }

.hero-copy {
    font-size: 14px;
    line-height: 1.52;
    margin-top: 18px;
}

.hero-metrics {
    gap: 10px;
    margin-top: 22px;
}

.hero-metric {
    padding: 12px;
    border-radius: 16px;
}

    .hero-metric strong {
        font-size: 17px;
    }

    .hero-metric small {
        font-size: 11px;
    }

.form-card h2 {
    font-size: 22px;
    margin-bottom: 8px;
}

.subtext {
    font-size: 12.5px;
    line-height: 1.45;
    margin-bottom: 14px;
}

.input-grid {
    gap: 9px;
}

.field label {
    font-size: 11px;
    margin-bottom: 5px;
}

.field input {
    padding: 10px 12px;
    border-radius: 13px;
    font-size: 13px;
}

.primary-btn {
    margin-top: 13px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 13px;
}

.mini-badge {
    padding: 8px 12px;
    font-size: 12px;
    margin-bottom: 18px;
}

.pace-picker {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.22);
}

    .pace-picker input {
        border: 0;
        background: rgba(255, 255, 255, 0.08);
        text-align: center;
        padding: 10px 8px;
        border-radius: 12px;
    }

        .pace-picker input:focus {
            transform: none;
        }

.pace-separator {
    color: var(--lime);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

.pace-caption {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    color: rgba(247, 255, 248, 0.48);
    font-size: 10px;
    font-weight: 800;
}

.experience-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
}

.experience-option input {
    display: none;
}

.experience-option span {
    display: grid;
    place-items: center;
    min-height: 38px;
    border-radius: 13px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(247, 255, 248, 0.78);
    font-weight: 900;
    cursor: pointer;
    transition: 180ms;
}

.experience-option input:checked + span {
    color: #071018;
    background: linear-gradient(135deg, var(--green), var(--lime));
    border-color: transparent;
    box-shadow: 0 12px 28px rgba(67, 245, 158, 0.18);
}

.experience-help {
    margin-top: 7px;
    display: flex;
    justify-content: space-between;
    color: rgba(247, 255, 248, 0.5);
    font-size: 10.5px;
    font-weight: 800;
}

@media (max-height: 760px) {
    .hero-card,
    .form-card {
        padding: 20px;
    }

        .hero-card h1 {
            font-size: clamp(30px, 4vw, 46px);
        }

    .hero-copy {
        font-size: 12.5px;
        line-height: 1.42;
    }

    .form-card h2 {
        font-size: 20px;
    }

    .field input {
        padding: 8px 10px;
    }

    .pace-picker input {
        padding: 8px;
    }

    .experience-option span {
        min-height: 34px;
    }

    .primary-btn {
        padding: 10px 12px;
    }
}

@media (max-width: 900px) {
    html,
    body {
        height: auto;
        overflow: auto;
    }

    .app {
        height: auto;
        min-height: 100svh;
        overflow: visible;
        padding: 16px;
    }

    .intro-view {
        height: auto;
        min-height: calc(100svh - 32px);
    }

    .intro-shell {
        height: auto;
        grid-template-columns: 1fr;
    }

    .hero-card,
    .form-card {
        height: auto;
        min-height: auto;
    }

    .experience-options {
        grid-template-columns: repeat(5, 1fr);
    }
}

.results-view {
    height: calc(100svh - 24px);
    display: none;
    grid-template-columns: minmax(280px, 360px) minmax(320px, 1fr);
    gap: 16px;
    align-items: stretch;
}

body.results-mode .intro-view {
    display: none;
}

body.results-mode .results-view {
    display: grid;
}

.side-column,
.preview-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    min-height: 0;
}

.glass-card {
    border: 1px solid var(--stroke);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 22px;
    padding: 11px;
}

.profile-head {
    display: flex;
    gap: 12px;
    align-items: center;
}

.avatar {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 27px;
    color: #071018;
    background: linear-gradient(135deg, var(--green), var(--lime));
    box-shadow: 0 15px 35px rgba(67, 245, 158, 0.2);
    flex: 0 0 auto;
}

.profile-head h3 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.profile-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin-top: 16px;
}

    .profile-stats div {
        padding: 12px 10px;
        border-radius: 16px;
        background: rgba(0, 0, 0, 0.19);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .profile-stats strong {
        display: block;
        font-size: 15px;
    }

    .profile-stats small {
        color: var(--muted);
        font-size: 10.5px;
    }

.prediction-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.prediction-guide {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.prediction-card--hidden {
    visibility: hidden;
}

.prediction-spotlight {
    position: fixed;
    z-index: 30;
    margin: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.96);
    transition: opacity 260ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1), left 900ms cubic-bezier(0.22, 1, 0.36, 1), top 900ms cubic-bezier(0.22, 1, 0.36, 1), width 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

    .prediction-spotlight.is-visible {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    .prediction-spotlight.is-moving {
        box-shadow: var(--shadow);
    }

.prediction {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 58px;
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055));
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

    .prediction::before {
        content: "";
        position: absolute;
        inset: 0 auto 0 0;
        width: 5px;
        background: var(--accent, var(--green));
    }

    .prediction b {
        display: block;
        font-size: 16px;
    }

    .prediction span {
        color: var(--muted);
        font-weight: 800;
        font-size: 12px;
    }

    .prediction strong {
        font-size: 18px;
        color: var(--accent, var(--text));
    }

.preview-card {
    height: 100%;
    display: grid;
    place-items: center;
    text-align: center;
    border-style: dashed;
}

    .preview-card h2 {
        margin: 0 0 8px;
        font-size: 28px;
        letter-spacing: -1px;
    }

    .preview-card p {
        max-width: 560px;
        color: var(--muted);
        line-height: 1.6;
        margin: 0;
    }

.back-btn {
    margin-top: 14px;
    width: 100%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 900;
    color: var(--text);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.17);
}

@media (max-width: 900px) {
    .results-view {
        height: auto;
        grid-template-columns: 1fr;
    }

    body.results-mode .app {
        height: auto;
        overflow: visible;
    }

    .profile-stats {
        grid-template-columns: 1fr 1fr;
    }
}

.app {
    transition: opacity 420ms ease, transform 420ms ease, filter 420ms ease;
}

    .app.view-fade-out {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
        filter: blur(6px);
    }

    .app.view-fade-in {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }

body.prediction-focus::after,
body.prediction-focus-releasing::after {
    content: "";
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    pointer-events: none;
    background: rgba(3, 8, 11, 0.46);
    transition: opacity 360ms ease, backdrop-filter 360ms ease;
}

/* Compact race picker in the results sidebar. */
.race-studio {
    grid-template-columns: minmax(0, 1fr);
}

.side-column .race-library--sidebar {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    max-height: 250px;
    min-height: 0;
    padding: 13px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 16px;
    color: #fff;
    background: rgba(255, 255, 255, .055);
}

.side-column .race-library--sidebar .race-library__header {
    align-items: center;
    padding: 0 1px 9px;
}

.side-column .race-library--sidebar .race-library__header h2 {
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-column .race-library--sidebar .section-kicker {
    margin-bottom: 3px;
    font-size: 8px;
}

.side-column .race-library--sidebar .favorite-count {
    padding: 4px 6px;
    border-color: rgba(85, 197, 238, .25);
    color: #74d0f1;
    background: rgba(85, 197, 238, .09);
    font-size: 8px;
}

.side-column .race-library--sidebar .race-search {
    min-height: 34px;
    border-color: rgba(255, 255, 255, .12);
    background: rgba(0, 0, 0, .12);
}

.side-column .race-library--sidebar .race-search:focus-within {
    border-color: rgba(85, 197, 238, .7);
    background: rgba(0, 0, 0, .18);
    box-shadow: 0 0 0 3px rgba(85, 197, 238, .1);
}

.side-column .race-library--sidebar .race-search svg {
    width: 15px;
    height: 15px;
    stroke: #86a7bd;
}

.side-column .race-library--sidebar .race-search input {
    height: 32px;
    color: #fff;
    font-size: 10px;
}

.side-column .race-library--sidebar .race-search input::placeholder {
    color: #7895a9;
}

.side-column .race-library--sidebar .race-search kbd {
    display: none;
}

.side-column .race-library--sidebar .race-library__mode {
    padding: 8px 2px 5px;
    color: #86a7bd;
    font-size: 8px;
}

.side-column .race-library--sidebar .race-library__mode small {
    color: #6f8da1;
    font-size: 8px;
}

.side-column .race-library--sidebar .race-course-list {
    gap: 5px;
    max-height: 142px;
    padding: 0 1px 2px;
    overflow-y: auto;
}

.side-column .race-library--sidebar .race-course-item {
    padding: 8px 9px;
    border-color: rgba(255, 255, 255, .09);
    border-radius: 9px;
    color: #fff;
    background: rgba(255, 255, 255, .055);
    box-shadow: none;
}

.side-column .race-library--sidebar .race-course-item:hover {
    background: rgba(255, 255, 255, .09);
    box-shadow: none;
}

.side-column .race-library--sidebar .race-course-item.is-selected {
    background: color-mix(in srgb, var(--item-accent) 16%, rgba(255, 255, 255, .055));
    box-shadow: inset 3px 0 0 var(--item-accent);
}

.side-column .race-library--sidebar .race-course-item__top {
    align-items: center;
    margin-bottom: 5px;
}

.side-column .race-library--sidebar .race-course-item__name {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-column .race-library--sidebar .race-course-item__favorite {
    flex: 0 0 auto;
}

.side-column .race-library--sidebar .race-course-item__location,
.side-column .race-library--sidebar .race-library__hint {
    display: none;
}

.side-column .race-library--sidebar .race-course-item__meta {
    overflow: hidden;
    color: #86a7bd;
    font-size: 8px;
    line-height: 1;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .side-column .race-library--sidebar {
        max-height: 290px;
    }

    .side-column .race-library--sidebar .race-course-list {
        max-height: 180px;
    }
}

body.prediction-focus::after {
    opacity: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: prediction-focus-in 220ms ease-out both;
}

body.prediction-focus-releasing::after {
    opacity: 0;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
}

@keyframes prediction-focus-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .prediction-spotlight {
        transition: none;
    }
}

/* Race course selection and temporary GPX simulator */

.race-studio {
    --course-accent: var(--green);
    display: grid;
    grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    text-align: left;
    border-style: solid;
    background: radial-gradient( circle at 78% 8%, color-mix(in srgb, var(--course-accent) 16%, transparent), transparent 28% ), linear-gradient( 145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045) );
    transition: background 260ms ease;
}

.race-library {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 18px 15px 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient( 180deg, rgba(2, 10, 14, 0.33), rgba(2, 10, 14, 0.16) );
}

.race-library__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 3px 15px;
}

    .race-library__header h2 {
        margin: 0;
        font-size: 20px;
        line-height: 1.08;
        letter-spacing: -0.65px;
    }

.favorite-count {
    flex: 0 0 auto;
    padding: 6px 8px;
    border: 1px solid rgba(199, 255, 107, 0.22);
    border-radius: 999px;
    color: var(--lime);
    background: rgba(199, 255, 107, 0.08);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.race-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.2);
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

    .race-search:focus-within {
        border-color: rgba(67, 245, 158, 0.7);
        background: rgba(0, 0, 0, 0.3);
        box-shadow: 0 0 0 3px rgba(67, 245, 158, 0.1);
    }

    .race-search svg {
        width: 17px;
        height: 17px;
        flex: 0 0 auto;
        fill: none;
        stroke: rgba(247, 255, 248, 0.52);
        stroke-width: 1.8;
        stroke-linecap: round;
    }

    .race-search input {
        width: 100%;
        min-width: 0;
        height: 40px;
        padding: 0;
        border: 0;
        outline: 0;
        color: var(--text);
        background: transparent;
        font-size: 12px;
    }

        .race-search input::placeholder {
            color: rgba(247, 255, 248, 0.38);
        }

    .race-search kbd {
        display: grid;
        place-items: center;
        width: 22px;
        height: 22px;
        flex: 0 0 auto;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 7px;
        color: rgba(247, 255, 248, 0.42);
        background: rgba(255, 255, 255, 0.06);
        font-size: 10px;
        font-family: inherit;
    }

.race-library__mode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 3px 9px;
    color: rgba(247, 255, 248, 0.55);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

    .race-library__mode small {
        color: rgba(247, 255, 248, 0.32);
        font-size: 9px;
    }

.race-course-list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    padding: 1px 3px 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.race-course-item {
    --item-accent: var(--green);
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    color: var(--text);
    background: linear-gradient( 135deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035) );
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

    .race-course-item:hover {
        transform: translateY(-1px);
        border-color: color-mix( in srgb, var(--item-accent) 48%, transparent );
        background: rgba(255, 255, 255, 0.1);
    }

    .race-course-item.is-selected {
        border-color: color-mix( in srgb, var(--item-accent) 66%, transparent );
        background: linear-gradient( 135deg, color-mix( in srgb, var(--item-accent) 15%, rgba(255, 255, 255, 0.06) ), rgba(255, 255, 255, 0.045) );
        box-shadow: inset 3px 0 0 var(--item-accent), 0 12px 28px rgba(0, 0, 0, 0.16);
    }

.race-course-item__top,
.race-course-item__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.race-course-item__top {
    align-items: flex-start;
    margin-bottom: 7px;
}

.race-course-item__name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
}

.race-course-item__favorite {
    color: var(--orange);
    font-size: 12px;
    line-height: 1;
}

.race-course-item__location {
    display: block;
    margin-bottom: 10px;
    overflow: hidden;
    color: rgba(247, 255, 248, 0.47);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.race-course-item__meta {
    justify-content: flex-start;
    color: rgba(247, 255, 248, 0.62);
    font-size: 9px;
    font-weight: 750;
}

    .race-course-item__meta span {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

        .race-course-item__meta span + span::before {
            width: 3px;
            height: 3px;
            margin-right: 5px;
            border-radius: 50%;
            background: var(--item-accent);
            content: "";
        }

.race-course-empty {
    padding: 30px 14px;
    border: 1px dashed rgba(255, 255, 255, 0.13);
    border-radius: 16px;
    color: var(--muted);
    text-align: center;
    font-size: 11px;
    line-height: 1.55;
}

    .race-course-empty strong {
        display: block;
        margin-bottom: 4px;
        color: var(--text);
        font-size: 12px;
    }

.race-library__hint {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: auto;
    padding: 12px 4px 0;
    color: rgba(247, 255, 248, 0.36);
    font-size: 9px;
    line-height: 1.45;
}

.hint-dot {
    width: 6px;
    height: 6px;
    margin-top: 3px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 12px rgba(67, 245, 158, 0.5);
}

.course-stage {
    display: grid;
    grid-template-rows: auto minmax(220px, 1fr) auto auto;
    gap: 10px;
    min-width: 0;
    min-height: 0;
    padding: 16px;
}

.course-stage__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    min-width: 0;
}

.selected-course-title {
    flex: 1 1 260px;
    min-width: 0;
    max-width: 100%;
}

.selected-course-kicker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.selected-course-kicker-row .section-kicker {
    margin: 0;
}

.share-course-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 26px;
    padding: 0 9px;
    border: 1px solid rgba(7, 140, 203, .28);
    border-radius: 8px;
    color: #087fb5;
    background: rgba(232, 246, 252, .92);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .01em;
    transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.share-course-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: #d9f1fb;
}

.share-course-button:disabled {
    cursor: default;
    opacity: .5;
}

.share-course-button svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.selected-course-title > div {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
}

.selected-course-title h2 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    overflow: visible;
    font-size: clamp(18px, 2vw, 25px);
    line-height: 1.1;
    letter-spacing: -0.8px;
    overflow-wrap: break-word;
    text-overflow: clip;
    word-break: normal;
    white-space: normal;
}

    .selected-course-title > p:last-child {
        margin: 4px 0 0 19px;
        color: var(--muted);
        font-size: 10px;
    }

.selected-course-color {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border: 3px solid color-mix( in srgb, var(--course-accent) 23%, transparent );
    border-radius: 50%;
    background: var(--course-accent);
    box-shadow: 0 0 17px var(--course-accent);
}

.simulation-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}

.simulation-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 39px;
    padding: 0 13px;
    border-radius: 13px;
    font-size: 10px;
    font-weight: 900;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

    .simulation-btn:hover {
        transform: translateY(-1px);
    }

    .simulation-btn svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.simulation-btn--secondary {
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(247, 255, 248, 0.74);
    background: rgba(255, 255, 255, 0.07);
}

    .simulation-btn--secondary:hover {
        border-color: rgba(255, 255, 255, 0.25);
        background: rgba(255, 255, 255, 0.11);
    }

.simulation-btn--primary {
    min-width: 132px;
    color: #071018;
    background: linear-gradient( 135deg, var(--course-accent), color-mix( in srgb, var(--course-accent) 45%, var(--lime) ) );
    box-shadow: 0 12px 30px color-mix( in srgb, var(--course-accent) 24%, transparent );
}

    .simulation-btn--primary svg {
        fill: currentColor;
        stroke: currentColor;
    }

.course-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

    .course-metrics article {
        min-width: 0;
        padding: 9px 11px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 13px;
        background: rgba(0, 0, 0, 0.17);
    }

    .course-metrics span {
        display: block;
        margin-bottom: 3px;
        color: rgba(247, 255, 248, 0.43);
        font-size: 8px;
        font-weight: 850;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .course-metrics strong {
        display: block;
        overflow: hidden;
        color: var(--text);
        font-size: 13px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.route-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.19);
}

.route-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

    .route-card__header > div:first-child {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

.route-card__status {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    max-width: 36%;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
    color: rgba(247, 255, 248, 0.56);
    background: rgba(255, 255, 255, 0.055);
    font-size: 8px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    color: var(--course-accent);
    font-size: 8px;
    font-weight: 950;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

    .live-indicator i {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: var(--course-accent);
        box-shadow: 0 0 0 4px color-mix( in srgb, var(--course-accent) 13%, transparent );
    }

.route-clock {
    flex: 0 0 auto;
    text-align: right;
}

    .route-clock strong {
        display: block;
        font-size: 12px;
        font-variant-numeric: tabular-nums;
        letter-spacing: 0.04em;
    }

.route-map {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    contain: layout paint;
    isolation: isolate;
    background: #102f49;
}

    .route-map > svg {
        position: absolute;
        z-index: 2;
        inset: 0;
        display: block;
        width: 100%;
        max-width: none;
        height: 100%;
        min-height: 0;
        pointer-events: none;
    }

.terrain-map {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-width: 0;
    background: #102f49;
}

.terrain-map .terrain-slope-tile {
    image-rendering: auto;
}

.terrain-slope-legend {
    position: absolute;
    z-index: 4;
    right: 10px;
    bottom: 24px;
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 4px 9px;
    padding: 8px 9px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    color: #173a53;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 22px rgba(7, 31, 48, 0.18);
    backdrop-filter: blur(8px);
    font-size: 8px;
    line-height: 1.15;
    pointer-events: none;
}

.terrain-slope-legend strong {
    grid-column: 1 / -1;
    margin-bottom: 1px;
    font-size: 9px;
}

.terrain-slope-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.terrain-slope-dot {
    width: 7px;
    height: 7px;
    border-radius: 2px;
}

.terrain-slope-dot--flat {
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(16, 47, 73, 0.2);
}

.terrain-slope-dot--low {
    background: #fee2e2;
}

.terrain-slope-dot--medium {
    background: #fca5a5;
}

.terrain-slope-dot--high {
    background: #f87171;
}

.terrain-slope-dot--extreme {
    background: #dc2626;
}

.route-map.has-terrain-map .map-background {
    fill: rgba(9, 30, 43, 0.16);
}

.route-map.has-terrain-map .map-grid-line,
.route-map.has-terrain-map .map-contours {
    opacity: 0;
}

.terrain-map .leaflet-control-zoom {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(7, 31, 48, 0.22);
}

.terrain-map .leaflet-control-zoom a {
    border-color: #d9e5ec;
    color: #173a53;
    background: rgba(255, 255, 255, 0.92);
}

.terrain-map .leaflet-control-attribution {
    max-width: calc(100% - 12px);
    padding: 2px 5px;
    color: #496579;
    background: rgba(255, 255, 255, 0.86);
    font-size: 7px;
    line-height: 1.25;
}

.terrain-map .leaflet-control-attribution a {
    color: #176f9a;
}

.map-background {
    fill: rgba(4, 14, 17, 0.93);
}

.map-grid-line {
    fill: none;
    stroke: rgba(255, 255, 255, 0.045);
    stroke-width: 1;
}

.map-contours path {
    fill: none;
    stroke: rgba(255, 255, 255, 0.055);
    stroke-width: 1.4;
    stroke-dasharray: 5 9;
}

.course-route-shadow,
.course-route,
.course-slope-segment,
.course-route-progress {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.course-route-shadow {
    stroke: rgba(0, 0, 0, 0.5);
    stroke-width: 10;
}

.course-route {
    stroke: rgba(255, 255, 255, 0.72);
    stroke-width: 7;
}

.course-slope-segment {
    stroke-width: 5;
    vector-effect: non-scaling-stroke;
}

.course-route-progress {
    stroke: rgba(255, 255, 255, 0.92);
    stroke-width: 2;
    filter: drop-shadow(0 0 4px rgba(4, 20, 31, 0.72));
}

.route-terminal circle {
    stroke-width: 3;
}

.route-terminal text {
    font-size: 9px;
    font-weight: 950;
}

.route-terminal--start circle {
    fill: #0b1a1a;
    stroke: var(--green);
}

.route-terminal--start text {
    fill: var(--green);
}

.route-terminal--finish circle {
    fill: #0b1a1a;
    stroke: var(--pink);
}

.route-terminal--finish text {
    fill: var(--pink);
}

.route-terminal--finish.is-current circle {
    stroke: var(--lime);
    stroke-width: 4;
    filter: drop-shadow(0 0 7px rgba(199, 255, 107, 0.72));
}

.map-checkpoint circle {
    fill: #10211f;
    stroke: rgba(247, 255, 248, 0.8);
    stroke-width: 2.5;
    transition: fill 180ms ease, stroke 180ms ease, transform 180ms ease;
}

.map-checkpoint text {
    fill: rgba(247, 255, 248, 0.8);
    font-size: 8px;
    font-weight: 900;
}

.map-checkpoint.is-passed circle {
    fill: var(--course-accent);
    stroke: var(--course-accent);
}

.map-checkpoint.is-current circle {
    stroke: var(--lime);
    stroke-width: 4;
}

.map-runner {
    color: #071018;
}

.runner-halo {
    fill: var(--course-accent);
    stroke: color-mix( in srgb, var(--course-accent) 42%, white );
    stroke-width: 2;
}

.runner-head {
    fill: #071018;
}

.runner-body {
    fill: none;
    stroke: #071018;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.map-legend {
    position: absolute;
    left: 10px;
    bottom: 9px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    color: rgba(247, 255, 248, 0.45);
    background: rgba(3, 11, 13, 0.75);
    backdrop-filter: blur(8px);
    font-size: 8px;
    font-weight: 750;
    z-index: 3;
}

    .map-legend span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        white-space: nowrap;
    }

.legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.legend-dot--runner {
    background: var(--course-accent);
    box-shadow: 0 0 8px var(--course-accent);
}

.legend-dot--checkpoint {
    border: 1px solid rgba(247, 255, 248, 0.8);
    background: #10211f;
}

.legend-line {
    width: 12px;
    height: 3px;
    border-radius: 999px;
    background: var(--course-accent);
}

.slope-legend {
    gap: 4px !important;
}

.slope-legend b,
.slope-legend small {
    font-size: 7px;
    font-weight: 850;
}

.slope-legend__gradient {
    width: 54px;
    height: 6px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        #0369a1 0%,
        #38bdf8 24%,
        #22c55e 45%,
        #84cc16 57%,
        #eab308 70%,
        #f97316 84%,
        #ef4444 100%);
}

.checkpoint-timeline {
    min-width: 0;
    padding: 11px 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.16);
}

    .checkpoint-timeline > header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        margin-bottom: 11px;
    }

    .checkpoint-timeline h3 {
        margin: 0;
        font-size: 13px;
        letter-spacing: -0.3px;
    }

    .checkpoint-timeline > header > .next-checkpoint-button {
        display: inline-flex;
        align-items: center;
        min-height: 26px;
        max-width: 50%;
        padding: 5px 9px;
        border: 1px solid color-mix( in srgb, var(--course-accent) 24%, transparent );
        border-radius: 999px;
        overflow: hidden;
        color: var(--course-accent);
        background: color-mix( in srgb, var(--course-accent) 7%, transparent );
        font-size: 9px;
        font-weight: 850;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.timeline-scroll {
    min-width: 0;
    overflow: hidden;
    overflow-y: hidden;
    padding: 3px 42px 8px;
}

.timeline-track {
    --timeline-line-y: 58px;
    position: relative;
    height: 118px;
    margin: 0;
}

.timeline-scrubber {
    position: absolute;
    z-index: 6;
    inset: 0;
    border-radius: 10px;
    cursor: ew-resize;
    outline: none;
    touch-action: none;
    user-select: none;
}

.timeline-scrubber::before {
    position: absolute;
    top: calc(var(--timeline-line-y) - 15px);
    right: 0;
    left: 0;
    height: 34px;
    border-radius: 999px;
    background: transparent;
    content: "";
    transition: background 160ms ease, box-shadow 160ms ease;
}

.timeline-scrubber:hover::before,
.timeline-track.is-scrubbing .timeline-scrubber::before {
    background: color-mix(in srgb, var(--course-accent) 8%, transparent);
}

.timeline-scrubber:focus-visible::before {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--course-accent) 55%, white);
}

.timeline-scrubber[aria-disabled="true"] {
    cursor: not-allowed;
}

.timeline-track.is-scrubbing .timeline-runner {
    transform: translateX(-50%) scale(1.08);
}

.timeline-track::before {
    position: absolute;
    z-index: 2;
    top: var(--timeline-line-y);
    right: 0;
    left: 0;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    content: "";
}

.timeline-fill {
    position: absolute;
    z-index: 3;
    top: var(--timeline-line-y);
    left: 0;
    width: 0;
    height: 4px;
    border-radius: 999px;
    background: var(--course-accent);
    box-shadow: 0 0 9px color-mix( in srgb, var(--course-accent) 62%, transparent );
}

.timeline-runner {
    position: absolute;
    z-index: 5;
    top: calc(var(--timeline-line-y) - 14px);
    left: 0;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 2px solid color-mix( in srgb, var(--course-accent) 50%, white );
    border-radius: 50%;
    background: var(--course-accent);
    box-shadow: 0 7px 17px color-mix( in srgb, var(--course-accent) 26%, transparent );
    font-size: 14px;
    transform: translateX(-50%);
    transition: transform 160ms ease;
}

.timeline-points {
    position: absolute;
    z-index: 4;
    inset: 0;
}

.timeline-point {
    position: absolute;
    top: calc(var(--timeline-line-y) - 6px);
    width: 1px;
    color: rgba(247, 255, 248, 0.45);
    text-align: center;
    transform: translateX(-50%);
}

.timeline-elevation-profile {
    position: absolute;
    z-index: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--timeline-line-y);
    overflow: visible;
    pointer-events: none;
}

.timeline-elevation-area {
    fill: url(#timelineElevationGradient);
}

#timelineElevationGradient stop:first-child {
    stop-color: color-mix(in srgb, var(--course-accent) 28%, transparent);
}

#timelineElevationGradient stop:last-child {
    stop-color: color-mix(in srgb, var(--course-accent) 3%, transparent);
}

.timeline-elevation-line {
    fill: none;
    stroke: color-mix(in srgb, var(--course-accent) 42%, white);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.timeline-elevation-line--progress {
    stroke: var(--course-accent);
    stroke-width: 2.25;
    filter: drop-shadow(0 0 4px color-mix(in srgb, var(--course-accent) 55%, transparent));
}

.timeline-elevation-scale {
    position: absolute;
    z-index: 1;
    top: 0;
    right: 0;
    left: 0;
    height: var(--timeline-line-y);
    overflow: hidden;
    pointer-events: none;
}

.timeline-elevation-scale.is-empty {
    display: none;
}

.timeline-elevation-scale__level {
    position: absolute;
    top: var(--elevation-level-y);
    right: 0;
    left: 0;
    height: 1px;
    border-top: 1px dashed rgba(247, 255, 248, 0.13);
}

.timeline-elevation-scale__level strong {
    position: absolute;
    top: -7px;
    left: 4px;
    min-width: 34px;
    padding: 2px 4px;
    border-radius: 4px;
    color: rgba(247, 255, 248, 0.66);
    background: rgba(4, 13, 16, 0.72);
    font-size: 7px;
    font-weight: 800;
    line-height: 1;
    text-align: right;
}

.timeline-elevation-range {
    position: absolute;
    z-index: 1;
    top: 3px;
    right: 5px;
    padding: 3px 6px;
    border: 1px solid color-mix(in srgb, var(--course-accent) 22%, transparent);
    border-radius: 999px;
    color: color-mix(in srgb, var(--course-accent) 75%, white);
    background: rgba(4, 13, 16, 0.72);
    font-size: 7px;
    font-weight: 800;
    line-height: 1;
    pointer-events: none;
}

.timeline-elevation-range.is-empty {
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(247, 255, 248, 0.38);
}

.timeline-point__dot {
    display: block;
    width: 12px;
    height: 12px;
    margin-left: -5px;
    border: 2px solid rgba(247, 255, 248, 0.55);
    border-radius: 50%;
    background: #10211f;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.timeline-point__label {
    display: block;
    width: var(--timeline-label-width, 82px);
    margin-top: 7px;
    overflow: hidden;
    color: rgba(247, 255, 248, 0.5);
    font-size: var(--timeline-label-font-size, 7.5px);
    font-weight: 750;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateX(-50%);
}

    .timeline-point__label strong {
        display: block;
        color: rgba(247, 255, 248, 0.8);
        font-size: 8px;
    }

.timeline-point__cutoff {
    display: block;
    margin-top: 2px;
    color: #dc3f4c;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.timeline-point.has-cutoff .timeline-point__dot {
    box-shadow: 0 0 0 3px rgba(220, 63, 76, 0.14);
}

.timeline-point.is-passed .timeline-point__dot {
    border-color: var(--course-accent);
    background: var(--course-accent);
}

.timeline-point.is-current .timeline-point__dot {
    border-color: var(--lime);
    transform: scale(1.35);
    box-shadow: 0 0 10px rgba(199, 255, 107, 0.55);
}

.timeline-point.is-after-cutoff .timeline-point__dot {
    border-color: #dc3f4c;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(220, 63, 76, 0.18);
}

@media (max-width: 1250px) {
    .race-studio {
        grid-template-columns: minmax(205px, 235px) minmax(0, 1fr);
    }

    .course-stage {
        padding: 13px;
    }

    .race-library {
        padding: 15px 12px 12px;
    }

    .simulation-btn--secondary {
        width: 39px;
        padding: 0;
        font-size: 0;
    }

    .course-metrics article {
        padding: 8px;
    }

    .map-legend {
        display: none;
    }
}

@media (max-width: 1050px) {
    .course-stage__header {
        align-items: flex-start;
    }

    .simulation-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .simulation-btn--secondary {
        width: auto;
        font-size: 10px;
    }

    .course-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .course-metric--race-time {
        grid-column: 1 / -1;
    }

    .route-map svg {
        min-height: 190px;
    }
}

@media (max-width: 900px) {
    .race-studio {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .race-library {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .race-course-list {
        display: grid;
        overflow-x: hidden;
        overflow-y: visible;
        padding-bottom: 8px;
    }

    .race-course-item {
        min-width: 0;
    }

    .race-library__hint {
        display: none;
    }

    .course-stage {
        grid-template-rows: auto minmax(300px, auto) auto auto;
    }

    .route-map svg {
        height: 320px;
    }
}

@media (max-width: 620px) {
    .course-stage__header {
        flex-direction: column;
    }

    .simulation-actions,
    .simulation-btn {
        width: 100%;
    }

    .simulation-actions {
        flex-direction: row;
    }

    .course-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .route-card__header {
        align-items: flex-start;
    }

        .route-card__header > div:first-child {
            align-items: flex-start;
            flex-direction: column;
            gap: 4px;
        }

    .route-card__status {
        display: none;
    }

    .route-map svg {
        height: 250px;
        min-height: 250px;
    }

    .checkpoint-timeline > header {
        flex-direction: column;
    }

        .checkpoint-timeline > header > .next-checkpoint-button {
            max-width: 100%;
        }

    .timeline-scroll {
        padding-right: 36px;
        padding-left: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .race-course-item,
    .simulation-btn,
    .map-checkpoint circle,
    .timeline-point__dot {
        transition: none;
    }
}

/* 2026 portal visual system */
:root {
    --bg-1: #f3f7fb;
    --bg-2: #eef4f8;
    --card: #ffffff;
    --card-2: #f7fafc;
    --stroke: #d9e4ee;
    --text: #08233f;
    --muted: #73899e;
    --green: #0c9bd8;
    --lime: #55c5ee;
    --orange: #f2a640;
    --pink: #e15e68;
    --blue: #078ccb;
    --purple: #607fa0;
    --danger: #df3d49;
    --shadow: 0 22px 55px rgba(26, 56, 82, .1);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 11px;
}

html,
body {
    color: var(--text);
    background: var(--bg-1);
}

body::before,
body::after {
    display: none;
}

.app {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.intro-view {
    min-height: 100vh;
}

.intro-shell {
    width: 100%;
    min-height: 100vh;
    grid-template-columns: minmax(420px, 1.05fr) minmax(520px, .95fr);
    gap: 0;
}

.hero-card,
.form-card,
.glass-card {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.hero-card {
    min-height: 100vh;
    justify-content: space-between;
    padding: clamp(34px, 6vw, 82px) clamp(34px, 7vw, 112px);
    border: 0;
    border-radius: 0;
    color: #fff;
    background: linear-gradient(145deg, #174a68 0%, #102f49 45%, #0b253a 100%);
    box-shadow: none;
}

.hero-card::before,
.hero-card::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(45, 166, 219, .13);
    border-radius: 50%;
    pointer-events: none;
}

.hero-card::before {
    right: -320px;
    bottom: -380px;
    width: 820px;
    height: 820px;
}

.hero-card::after {
    right: -220px;
    bottom: -280px;
    width: 620px;
    height: 620px;
    box-shadow: inset 0 0 0 90px rgba(8, 126, 181, .035);
}

.runner-brand {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 13px;
    margin-bottom: clamp(72px, 14vh, 160px);
    color: #fff;
    text-decoration: none;
}

.runner-brand > span {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, #1aa8e7, #047db8);
    box-shadow: 0 13px 30px rgba(0, 145, 211, .25);
    font-size: 22px;
    font-weight: 950;
}

.runner-brand strong,
.runner-brand small {
    display: block;
}

.runner-brand strong {
    font-size: 22px;
    letter-spacing: .04em;
}

.runner-brand small {
    margin-top: 3px;
    color: #8eb6d0;
    font-size: 10px;
    letter-spacing: .19em;
}

.mini-badge {
    margin-bottom: 24px;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #16a8e8;
    background: transparent;
    font-size: 12px;
    letter-spacing: .16em;
}

.hero-card h1 {
    max-width: 720px;
    color: #fff;
    font-size: clamp(44px, 4.8vw, 72px);
    line-height: 1.03;
    letter-spacing: -.055em;
}

.hero-card h1 span {
    display: block;
    color: #55c5ee;
    text-shadow: none;
}

.hero-copy {
    max-width: 650px;
    margin-top: 26px;
    color: #a9c4d6;
    font-size: 17px;
    line-height: 1.75;
}

.hero-metrics {
    max-width: 650px;
    margin-top: clamp(55px, 10vh, 120px);
    gap: 0;
}

.hero-metric {
    padding: 5px 24px;
    border: 0;
    border-right: 1px solid rgba(255,255,255,.11);
    border-radius: 0;
    background: transparent;
}

.hero-metric:first-child { padding-left: 0; }
.hero-metric:last-child { border-right: 0; }
.hero-metric strong { color: #fff; font-size: 21px; }
.hero-metric small { color: #7ea5be; font-size: 11px; }

.form-card {
    min-height: 100vh;
    padding: clamp(28px, 5vw, 70px);
    border: 0;
    border-radius: 0;
    background: #eef4f8;
    box-shadow: none;
    overflow-y: auto;
}

.form-card::before { display: none; }

.form-inner {
    width: min(610px, 100%);
    margin: auto;
    padding: clamp(28px, 3vw, 42px);
    border: 1px solid #d6e1ea;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(24, 55, 82, .11);
}

.section-kicker {
    color: #078ccb;
    font-size: 11px;
    letter-spacing: .16em;
}

.form-card h2 {
    color: #08233f;
    font-size: clamp(25px, 2.2vw, 34px);
    letter-spacing: -.035em;
}

.subtext {
    margin-bottom: 24px;
    color: #73899e;
    font-size: 13px;
}

.input-grid { gap: 14px; }

.field label {
    margin-bottom: 7px;
    color: #18334d;
    font-size: 12px;
    font-weight: 800;
}

.field input,
.pace-picker input {
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #ccd9e4;
    border-radius: 10px;
    color: #102f49;
    background: #fff;
}

.field input:focus,
.pace-picker input:focus {
    border-color: #078ccb;
    box-shadow: 0 0 0 3px rgba(7, 140, 203, .12);
    transform: none;
}

.field input::placeholder,
.pace-picker input::placeholder { color: #a1b1bf; }
.pace-picker { gap: 9px; }
.pace-separator { color: #70879b; }
.pace-caption, .experience-help { color: #8aa0b2; }
.experience-option span {
    min-height: 43px;
    border: 1px solid #d4e0e9;
    border-radius: 10px;
    color: #557086;
    background: #f8fafc;
}
.experience-option input:checked + span {
    border-color: #078ccb;
    color: #fff;
    background: #078ccb;
    box-shadow: 0 8px 18px rgba(7, 140, 203, .19);
}

.primary-btn {
    min-height: 52px;
    margin-top: 20px;
    padding: 13px 18px;
    border-radius: 10px;
    color: #fff;
    background: #078ccb;
    box-shadow: 0 13px 28px rgba(7, 140, 203, .2);
}
.primary-btn:hover { background: #057caf; box-shadow: 0 15px 32px rgba(7,140,203,.25); }

.loading-screen {
    z-index: 50;
    background: rgba(230, 239, 246, .74);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.loader-card {
    width: min(440px, calc(100% - 32px));
    padding: 42px 38px 32px;
    border: 1px solid #d7e3ec;
    border-radius: 20px;
    color: #08233f;
    background: #fff;
    box-shadow: 0 28px 70px rgba(22, 53, 80, .18);
}

.loader-card h2 { margin: 0 0 7px; font-size: 24px; }
.loader-card .subtext { margin-bottom: 24px; }
.spinner {
    width: 64px;
    height: 64px;
    margin-bottom: 22px;
    border: 5px solid #deedf5;
    border-top-color: #078ccb;
    border-right-color: #53bfe8;
    box-shadow: none;
}
.loader-progress { height: 5px; overflow: hidden; border-radius: 999px; background: #e6eef4; }
.loader-progress span {
    display: block;
    width: 45%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #078ccb, #55c5ee);
    animation: loader-progress 1.2s ease-in-out infinite alternate;
}
.loader-steps { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; color: #8297a9; font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
@keyframes loader-progress { from { transform: translateX(-8%); } to { transform: translateX(132%); } }

body.results-mode { background: #f3f7fb; }
body.results-mode .app { padding: 0; }
.results-view {
    min-height: 100vh;
    height: 100vh;
    grid-template-columns: 330px minmax(0, 1fr);
    gap: 0;
    background: #f3f7fb;
}

.side-column {
    gap: 16px;
    padding: 26px 18px;
    overflow-y: auto;
    color: #fff;
    background: linear-gradient(180deg, #102f49, #0b253a);
}

.side-column::before {
    display: block;
    margin: 0 8px 18px;
    color: #fff;
    content: "RACE  ESTIMATOR";
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .08em;
}

.side-column .glass-card {
    padding: 18px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    color: #fff;
    background: rgba(255,255,255,.055);
    box-shadow: none;
}

.side-column .section-kicker { color: #55c5ee; }
.side-column .profile-head p,
.side-column .prediction-guide,
.side-column .profile-stats small,
.side-column .prediction span { color: #86a7bd; }
.avatar { color: #fff; background: #078ccb; box-shadow: none; border-radius: 12px; }
.profile-stats div { border: 1px solid rgba(255,255,255,.08); border-radius: 11px; background: rgba(0,0,0,.12); }
.back-btn { border: 1px solid rgba(255,255,255,.14); border-radius: 10px; color: #dce8ef; background: rgba(255,255,255,.07); }

.prediction {
    min-height: 56px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 11px;
    color: #fff;
    background: rgba(255,255,255,.06);
}
.prediction::before { width: 3px; }
.prediction b { font-size: 14px; }
.prediction strong { font-size: 16px; }

.prediction-spotlight {
    padding: 22px !important;
    border: 1px solid rgba(255,255,255,.1) !important;
    border-radius: 16px !important;
    color: #fff !important;
    background: linear-gradient(180deg, #1b3d56, #16354b) !important;
    box-shadow: 0 30px 80px rgba(8,31,49,.34) !important;
}
.prediction-spotlight .section-kicker { color: #55c5ee; }
.prediction-spotlight .prediction-guide,
.prediction-spotlight .prediction span { color: #86a7bd; }
.prediction-spotlight .prediction {
    border-color: rgba(255,255,255,.09);
    color: #fff;
    background: rgba(255,255,255,.06);
}
body.prediction-focus::after,
body.prediction-focus-releasing::after { background: rgba(15, 43, 65, .3); }

.preview-column { min-height: 0; padding: 22px; background: #f3f7fb; }
.race-studio {
    border: 1px solid #dbe5ed;
    border-radius: 18px;
    color: #08233f;
    background: #fff;
    box-shadow: 0 18px 46px rgba(27, 58, 83, .08);
}
.race-library { border-right: 1px solid #e1e9ef; background: #f8fafc; }
.race-library__header h2, .selected-course-title h2, .checkpoint-timeline h3 { color: #08233f; }
.favorite-count { border-color: #cbe9f6; color: #047fb8; background: #e8f6fc; }
.race-search { border-color: #d7e2ea; border-radius: 10px; background: #fff; }
.race-search:focus-within { border-color: #078ccb; background: #fff; box-shadow: 0 0 0 3px rgba(7,140,203,.1); }
.race-search svg { stroke: #8196a7; }
.race-search input { color: #102f49; }
.race-search input::placeholder { color: #9cafbc; }
.race-search kbd { border-color: #dbe5ec; color: #8499a9; background: #f2f6f9; }
.race-library__mode { color: #617a8e; }
.race-library__mode small { color: #98a9b6; }
.race-course-item { border-color: #dee7ee; border-radius: 11px; color: #08233f; background: #fff; box-shadow: 0 4px 14px rgba(30,61,85,.035); }
.race-course-item:hover { background: #fff; box-shadow: 0 8px 20px rgba(30,61,85,.08); }
.race-course-item.is-selected { background: color-mix(in srgb, var(--item-accent) 7%, white); box-shadow: inset 3px 0 0 var(--item-accent), 0 8px 20px rgba(30,61,85,.07); }
.race-course-item__name { color: #102f49; }
.race-course-item__location, .race-course-item__meta { color: #7890a3; }
.race-library__hint { color: #8499a9; }
.course-stage { padding: 18px; }
.simulation-btn { border-radius: 9px; }
.simulation-btn--secondary { border-color: #d5e1e9; color: #527087; background: #fff; }
.simulation-btn--primary { color: #fff; background: #078ccb; box-shadow: 0 10px 22px rgba(7,140,203,.18); }

.simulation-btn--pdf {
    border-color: #d92d20;
    color: #fff;
    background: #d92d20;
    box-shadow: 0 8px 18px rgba(217, 45, 32, .2);
}

.simulation-btn--pdf:hover {
    border-color: #b42318;
    color: #fff;
    background: #b42318;
    box-shadow: 0 10px 22px rgba(180, 35, 24, .26);
}

.simulation-btn--excel {
    border-color: #16834f;
    color: #fff;
    background: #16834f;
    box-shadow: 0 8px 18px rgba(22, 131, 79, .2);
}

.simulation-btn--excel:hover {
    border-color: #116a40;
    color: #fff;
    background: #116a40;
    box-shadow: 0 10px 22px rgba(17, 106, 64, .26);
}

.simulation-btn--km {
    border-color: #6941c6;
    color: #fff;
    background: #6941c6;
    box-shadow: 0 8px 18px rgba(105, 65, 198, .2);
}

.simulation-btn--km:hover {
    border-color: #5335a3;
    color: #fff;
    background: #5335a3;
    box-shadow: 0 10px 22px rgba(83, 53, 163, .26);
}

.simulation-btn--pdf:focus-visible,
.simulation-btn--excel:focus-visible,
.simulation-btn--km:focus-visible {
    outline: 3px solid color-mix(in srgb, currentColor 35%, transparent);
    outline-offset: 2px;
}

.simulation-btn--pdf:disabled,
.simulation-btn--excel:disabled,
.simulation-btn--km:disabled {
    cursor: wait;
    opacity: .68;
    transform: none;
}
.course-metrics article { border-color: #dce6ed; border-radius: 10px; background: #f7fafc; }
.course-metrics span, .route-clock span { color: #8095a6; }
.course-metrics strong { color: #102f49; }
.route-card { border-color: #dbe5ed; border-radius: 14px; background: #f8fafc; }
.route-card__header { border-bottom-color: #dfe7ed; }
.route-card__status { border-color: #d8e3ea; color: #617a8d; background: #fff; }
.route-clock strong { color: #102f49; }
.map-background { fill: #102f49; }
.checkpoint-timeline { border-color: #dbe5ed; border-radius: 13px; background: #f8fafc; }
.timeline-track::before { background: #d4e0e8; }
.timeline-point { color: #6f8799; }
.timeline-point__dot { border-color: #8ea2b1; background: #fff; }
.timeline-point__label { color: #71899b; }
.timeline-point__label strong { color: #18344d; }
.timeline-elevation-range { background: rgba(255,255,255,.88); }
.timeline-elevation-scale__level { border-top-color: rgba(69, 98, 119, .16); }
.timeline-elevation-scale__level strong { color: #527087; background: rgba(255,255,255,.88); }

/* Minetti kilometer analysis */
.kilometer-analysis {
    display: none;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #dbe5ed;
    border-radius: 14px;
    background: #f8fafc;
}

.course-stage.is-km-view {
    grid-template-rows: auto auto minmax(0, 1fr);
}

.course-stage.is-km-view .route-card,
.course-stage.is-km-view .checkpoint-timeline {
    display: none;
}

.course-stage.is-km-view .kilometer-analysis {
    display: flex;
    flex-direction: column;
}

.simulation-btn[aria-pressed="true"] {
    border-color: #87cde9;
    color: #047fb8;
    background: #e8f6fc;
}

.simulation-btn--km[aria-pressed="true"] {
    border-color: #5335a3;
    color: #fff;
    background: #5335a3;
    box-shadow: 0 0 0 3px rgba(105, 65, 198, .18),
        0 10px 22px rgba(83, 53, 163, .24);
}

.kilometer-analysis__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 17px 13px;
    border-bottom: 1px solid #dfe7ed;
    background: #fff;
}

.kilometer-analysis__header h3 {
    margin: 0;
    color: #08233f;
    font-size: 15px;
    letter-spacing: -.25px;
}

.kilometer-analysis__description {
    margin: 3px 0 0;
    color: #617a8e;
    font-size: 11px;
    line-height: 1.45;
}

.kilometer-table-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    scrollbar-color: #b9cbd7 transparent;
    scrollbar-width: thin;
}

.kilometer-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    color: #17344c;
    background: #fff;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.kilometer-table th {
    position: sticky;
    z-index: 2;
    top: 0;
    padding: 10px 12px;
    border-bottom: 1px solid #dce6ed;
    color: #7890a3;
    background: #f3f7fa;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .06em;
    width: 20%;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
}

.route-card__status:empty {
    display: none;
}

.kilometer-table td {
    width: 20%;
    padding: 9px 12px;
    border-bottom: 1px solid #e5ecf1;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kilometer-table th:first-child,
.kilometer-table td:first-child {
    color: #047fb8;
    font-weight: 900;
    text-align: center;
}

.kilometer-table th:first-child {
    background: #f3f7fa;
}

.kilometer-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.kilometer-table tbody tr:nth-child(even) td:first-child {
    background: #f8fafc;
}

.kilometer-table tbody tr:hover td {
    background: #edf7fb;
}

.kilometer-table td[colspan] {
    height: 160px;
    color: #7890a3;
    text-align: center;
    white-space: normal;
}

.kilometer-table__positive {
    color: #d06c34;
}

.kilometer-table__negative {
    color: #158865;
}

@media (max-width: 1100px) {
    .intro-shell { grid-template-columns: minmax(360px, .85fr) minmax(500px, 1.15fr); }
    .hero-card { padding-inline: 48px; }
    .runner-brand { margin-bottom: 80px; }
    .results-view { grid-template-columns: 285px minmax(0,1fr); }
}

@media (max-width: 900px) {
    html, body { height: auto; overflow: auto; }
    .intro-shell { grid-template-columns: 1fr; }
    .hero-card { min-height: 560px; padding: 34px clamp(24px,7vw,60px) 46px; }
    .runner-brand { margin-bottom: 65px; }
    .form-card { min-height: auto; padding: 42px 20px; }
    .results-view { height: auto; grid-template-columns: 1fr; }
    .side-column { overflow: visible; }
    .preview-column { padding: 14px; }
    .race-library { border-right: 0; border-bottom: 1px solid #e1e9ef; }
    .kilometer-analysis { min-height: 430px; }
}

@media (max-width: 560px) {
    .hero-card { min-height: 500px; }
    .hero-card h1 { font-size: 38px; }
    .hero-copy { font-size: 14px; }
    .hero-metrics { grid-template-columns: 1fr; gap: 14px; margin-top: 48px; }
    .hero-metric { padding: 0; border: 0; }
    .form-inner { padding: 24px 18px; }
    .loader-steps { display: none; }
    .side-column { padding: 20px 14px; }
    .course-stage { padding: 13px; }
    .kilometer-analysis__header { flex-direction: column; }
}

/* Clearer runner onboarding */
.intro-view .hero-card {
    background:
        radial-gradient(circle at 12% 18%, rgba(24, 151, 205, .16), transparent 28%),
        linear-gradient(145deg, #174b69 0%, #102f49 48%, #0a263c 100%);
}

.intro-view .form-card {
    background:
        linear-gradient(rgba(20, 66, 96, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 66, 96, .025) 1px, transparent 1px),
        #dce7ee;
    background-size: 34px 34px;
}

.intro-view .form-inner {
    width: min(630px, 100%);
    border-color: #c7d5df;
    background: #edf3f7;
    box-shadow: 0 25px 65px rgba(18, 50, 75, .16);
}

.setup-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 26px;
    padding: 0 0 20px;
    border-bottom: 1px solid #cfdae3;
}

.setup-progress > div {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8a9daa;
}

.setup-progress > div > span {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid #c6d3dc;
    border-radius: 50%;
    background: #e2eaf0;
    font-size: 10px;
    font-weight: 900;
}

.setup-progress > div > strong {
    font-size: 11px;
    white-space: nowrap;
}

.setup-progress > div.is-active {
    color: #075f8c;
}

.setup-progress > div.is-active > span {
    border-color: #078ccb;
    color: #fff;
    background: #078ccb;
    box-shadow: 0 6px 15px rgba(7, 140, 203, .2);
}

.setup-progress > i {
    width: clamp(28px, 5vw, 68px);
    height: 1px;
    background: #c4d1db;
}

.intro-view .form-card h2 {
    max-width: 470px;
    margin-bottom: 9px;
    color: #0b2b45;
}

.intro-view .subtext {
    max-width: 500px;
    margin-bottom: 16px;
    color: #60798c;
}

.form-purpose {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px 13px;
    border: 1px solid #bcd9e7;
    border-radius: 10px;
    color: #41667d;
    background: #dfeef5;
}

.form-purpose > span {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #fff;
    background: #078ccb;
    font-family: Georgia, serif;
    font-size: 12px;
    font-weight: 800;
}

.form-purpose p {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
}

.intro-view .input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 14px;
}

.intro-view .input-grid > .field:first-child,
.intro-view .input-grid > .field:last-child {
    grid-column: 1 / -1;
}

.intro-view .field label {
    color: #24465f;
}

.intro-view .field input,
.intro-view .pace-picker input {
    border-color: #c4d2dc;
    background: #f8fbfd;
    box-shadow: inset 0 1px 2px rgba(18, 51, 76, .035);
}

.intro-view .field input:hover,
.intro-view .pace-picker input:hover {
    border-color: #aebfcb;
}

.value-input {
    position: relative;
}

.value-input input {
    padding-right: 90px !important;
}

.value-input > span {
    position: absolute;
    top: 50%;
    right: 13px;
    padding-left: 10px;
    border-left: 1px solid #d1dce4;
    color: #718899;
    font-size: 10px;
    font-weight: 800;
    pointer-events: none;
    transform: translateY(-50%);
}

.field-guidance {
    display: block;
    margin-top: 6px;
    color: #72899a;
    font-size: 9px;
    line-height: 1.4;
}

.intro-view .experience-option span {
    border-color: #c8d5de;
    background: #e5edf2;
}

.intro-view .experience-option input:checked + span {
    border-color: #078ccb;
    background: #078ccb;
}

.intro-view .primary-btn {
    margin-top: 18px;
    background: linear-gradient(135deg, #078ccb, #087cad);
}

@media (max-width: 1180px) {
    .intro-view .input-grid {
        grid-template-columns: 1fr;
    }

    .intro-view .input-grid > .field:first-child,
    .intro-view .input-grid > .field:last-child {
        grid-column: auto;
    }
}

@media (max-width: 900px) {
    .intro-view .form-card {
        background-color: #dce7ee;
    }
}

@media (max-width: 520px) {
    .setup-progress > div > strong {
        font-size: 10px;
    }

    .setup-progress > i {
        width: 20px;
    }

    .form-purpose {
        margin-bottom: 18px;
    }
}

/* Compact, centered login-style onboarding shell */
body:not(.results-mode) {
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(circle at 15% 10%, rgba(20, 114, 160, .12), transparent 30%),
        linear-gradient(145deg, #cbd9e3, #e6edf2 52%, #d6e2ea);
}

body:not(.results-mode) .app {
    height: auto;
    min-height: 100vh;
    padding: clamp(18px, 4vh, 42px) clamp(16px, 4vw, 56px);
    overflow: visible;
}

body:not(.results-mode) .intro-view {
    width: 100%;
    min-height: calc(100vh - clamp(36px, 8vh, 84px));
    height: auto;
    padding: 0;
}

body:not(.results-mode) .intro-shell {
    width: min(1160px, 100%);
    min-height: 720px;
    height: auto;
    margin: auto;
    grid-template-columns: minmax(380px, .88fr) minmax(540px, 1.12fr);
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 24px;
    overflow: hidden;
    background: #e8eff4;
    box-shadow: 0 30px 85px rgba(18, 49, 73, .2);
}

body:not(.results-mode) .hero-card,
body:not(.results-mode) .form-card {
    height: auto;
    min-height: 720px;
    border-radius: 0;
}

body:not(.results-mode) .hero-card {
    padding: clamp(34px, 4vw, 56px);
}

body:not(.results-mode) .runner-brand {
    margin-bottom: clamp(48px, 8vh, 76px);
}

body:not(.results-mode) .hero-card h1 {
    max-width: 510px;
    font-size: clamp(36px, 3.4vw, 50px);
    line-height: 1.08;
    letter-spacing: -.045em;
}

body:not(.results-mode) .hero-copy {
    max-width: 510px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.65;
}

body:not(.results-mode) .hero-metrics {
    margin-top: 48px;
}

body:not(.results-mode) .hero-metric {
    padding-inline: 14px;
}

body:not(.results-mode) .hero-metric:first-child {
    padding-left: 0;
}

body:not(.results-mode) .hero-metric strong {
    font-size: 17px;
}

body:not(.results-mode) .hero-metric small {
    font-size: 9px;
}

body:not(.results-mode) .form-card {
    padding: clamp(28px, 3.5vw, 48px);
    background: #e5edf2;
    background-image: none;
}

body:not(.results-mode) .form-inner {
    width: min(560px, 100%);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.language-switch,
.unit-switch {
    display: flex;
    width: fit-content;
    margin: 0;
    padding: 3px;
    border: 1px solid #c5d4df;
    border-radius: 10px;
    background: rgba(247, 250, 252, .72);
}

.setup-preferences {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.language-switch button,
.unit-switch button {
    min-width: 42px;
    min-height: 34px;
    padding: 5px 10px;
    border: 0;
    border-radius: 7px;
    color: #668096;
    background: transparent;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.language-switch button:hover,
.unit-switch button:hover {
    color: #075f8c;
}

.language-switch button.is-active,
.unit-switch button.is-active {
    color: #fff;
    background: #078ccb;
    box-shadow: 0 5px 13px rgba(7, 140, 203, .22);
}

.language-switch button:focus-visible,
.unit-switch button:focus-visible {
    outline: 3px solid rgba(7, 140, 203, .2);
    outline-offset: 2px;
}

@media (max-width: 520px) {
    body:not(.results-mode) .setup-progress {
        flex-wrap: wrap;
        gap: 7px;
        min-width: 0;
    }

    body:not(.results-mode) .setup-progress > div:not(.setup-preferences) {
        min-width: 0;
        gap: 5px;
    }

    body:not(.results-mode) .setup-progress > div:not(.setup-preferences) > strong {
        overflow: hidden;
        font-size: 9px;
        text-overflow: ellipsis;
    }

    body:not(.results-mode) .setup-progress > i {
        flex: 1 1 14px;
        width: 14px;
        min-width: 7px;
    }

    body:not(.results-mode) .setup-preferences {
        order: -1;
        width: 100%;
        justify-content: flex-end;
        gap: 4px;
        margin-bottom: 2px;
    }

    body:not(.results-mode) .setup-preferences button {
        min-width: 34px;
        min-height: 32px;
        padding: 4px 7px;
        font-size: 10px;
    }

    body:not(.results-mode) .setup-preferences .language-switch,
    body:not(.results-mode) .setup-preferences .unit-switch {
        padding: 2px;
    }
}

body:not(.results-mode) .setup-progress {
    margin-bottom: 22px;
    padding-bottom: 16px;
}

body:not(.results-mode) .form-card h2 {
    font-size: clamp(24px, 2.2vw, 30px);
}

body:not(.results-mode) .form-purpose {
    background: #d8e8f0;
}

body:not(.results-mode) .field input,
body:not(.results-mode) .pace-picker input {
    background: #f7fafc;
}

@media (max-width: 980px) {
    body:not(.results-mode) .intro-shell {
        grid-template-columns: minmax(310px, .8fr) minmax(460px, 1.2fr);
    }

    body:not(.results-mode) .hero-card {
        padding: 34px;
    }

    body:not(.results-mode) .hero-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    body:not(.results-mode) .hero-metric {
        padding: 0;
        border: 0;
    }
}

@media (max-width: 780px) {
    body:not(.results-mode) .app {
        padding: 14px;
    }

    body:not(.results-mode) .intro-view {
        min-height: calc(100vh - 28px);
    }

    body:not(.results-mode) .intro-shell {
        grid-template-columns: 1fr;
        border-radius: 18px;
    }

    body:not(.results-mode) .hero-card,
    body:not(.results-mode) .form-card {
        min-height: auto;
    }

    body:not(.results-mode) .hero-card {
        padding: 30px 26px 34px;
    }

    body:not(.results-mode) .runner-brand {
        margin-bottom: 42px;
    }

    body:not(.results-mode) .hero-metrics {
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
        margin-top: 34px;
    }

    body:not(.results-mode) .hero-metric {
        padding: 0 12px;
        border-right: 1px solid rgba(255,255,255,.1);
    }

    body:not(.results-mode) .form-card {
        padding: 34px 24px 38px;
    }
}

@media (max-width: 500px) {
    body:not(.results-mode) .hero-card h1 {
        font-size: 34px;
    }

    body:not(.results-mode) .hero-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    body:not(.results-mode) .hero-metric {
        padding: 0;
        border: 0;
    }

    body:not(.results-mode) .form-card {
        padding-inline: 18px;
    }
}

/* Fit the onboarding panel inside common laptop viewports */
@media (min-width: 781px) {
    body:not(.results-mode) .app {
        padding: 16px 28px;
    }

    body:not(.results-mode) .intro-view {
        min-height: calc(100vh - 32px);
    }

    body:not(.results-mode) .intro-shell {
        width: min(1080px, 100%);
        height: min(660px, calc(100vh - 32px));
        min-height: 600px;
        grid-template-columns: minmax(350px, .86fr) minmax(500px, 1.14fr);
        border-radius: 20px;
    }

    body:not(.results-mode) .hero-card,
    body:not(.results-mode) .form-card {
        height: 100%;
        min-height: 0;
    }

    body:not(.results-mode) .hero-card {
        padding: clamp(30px, 3.5vw, 46px);
    }

    body:not(.results-mode) .runner-brand {
        margin-bottom: clamp(32px, 5vh, 48px);
    }

    body:not(.results-mode) .runner-brand > span {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    body:not(.results-mode) .hero-card h1 {
        font-size: clamp(32px, 3.1vw, 44px);
    }

    body:not(.results-mode) .hero-copy {
        margin-top: 16px;
        font-size: 13px;
        line-height: 1.55;
    }

    body:not(.results-mode) .hero-metrics {
        margin-top: 30px;
    }

    body:not(.results-mode) .form-card {
        padding: 24px clamp(28px, 3.5vw, 42px);
    }

    body:not(.results-mode) .form-inner {
        width: min(520px, 100%);
    }

    body:not(.results-mode) .setup-progress {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }

    body:not(.results-mode) .section-kicker {
        margin-bottom: 7px;
        font-size: 9px;
    }

    body:not(.results-mode) .form-card h2 {
        margin-bottom: 6px;
        font-size: clamp(21px, 2vw, 27px);
    }

    body:not(.results-mode) .subtext {
        margin-bottom: 10px;
        font-size: 11px;
        line-height: 1.45;
    }

    body:not(.results-mode) .form-purpose {
        margin-bottom: 12px;
        padding: 9px 10px;
    }

    body:not(.results-mode) .form-purpose p {
        font-size: 9px;
    }

    body:not(.results-mode) .input-grid {
        gap: 10px 12px;
    }

    body:not(.results-mode) .field label {
        margin-bottom: 5px;
        font-size: 10px;
    }

    body:not(.results-mode) .field input,
    body:not(.results-mode) .pace-picker input {
        min-height: 41px;
        padding-top: 9px;
        padding-bottom: 9px;
    }

    body:not(.results-mode) .experience-option span {
        min-height: 36px;
    }

    body:not(.results-mode) .experience-help,
    body:not(.results-mode) .pace-caption,
    body:not(.results-mode) .field-guidance {
        margin-top: 3px;
        font-size: 8px;
    }

    body:not(.results-mode) .primary-btn {
        min-height: 44px;
        margin-top: 12px;
        padding: 10px 15px;
        font-size: 13px;
    }
}

@media (min-width: 781px) and (max-height: 650px) {
    body:not(.results-mode) .intro-shell {
        min-height: 560px;
    }

    body:not(.results-mode) .form-purpose,
    body:not(.results-mode) .field-guidance {
        display: none;
    }

    body:not(.results-mode) .runner-brand {
        margin-bottom: 26px;
    }
}

body:not(.results-mode) .pace-picker {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

body:not(.results-mode) .input-grid {
    grid-template-columns: 1fr;
}

body:not(.results-mode) .input-grid > .field {
    grid-column: 1;
}

/* Keep the result sidebar inside the viewport */
@media (min-width: 901px) {
    body.results-mode .race-library {
        min-height: 0;
        overflow: hidden;
    }

    body.results-mode .race-course-list {
        flex: 1 1 0;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.results-mode .side-column {
        height: 100vh;
        gap: 10px;
        padding: 16px 13px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body.results-mode .side-column::before {
        margin: 0 6px 7px;
        font-size: 14px;
        line-height: 1.2;
    }

    body.results-mode .side-column .glass-card {
        padding: 12px;
        border-radius: 13px;
    }

    body.results-mode .side-column .section-kicker {
        margin-bottom: 6px;
        font-size: 9px;
    }

    body.results-mode .profile-head {
        gap: 9px;
    }

    body.results-mode .avatar {
        width: 43px;
        height: 43px;
        border-radius: 10px;
        font-size: 21px;
    }

    body.results-mode .profile-head h3 {
        font-size: 17px;
    }

    body.results-mode .profile-stats {
        gap: 6px;
        margin-top: 10px;
    }

    body.results-mode .profile-stats div {
        padding: 7px 8px;
        border-radius: 9px;
    }

    body.results-mode .profile-stats strong {
        font-size: 13px;
    }

    body.results-mode .profile-stats small {
        font-size: 9px;
    }

    body.results-mode .back-btn {
        margin-top: 8px;
        padding: 8px 10px;
        font-size: 11px;
    }

    body.results-mode .prediction-guide {
        margin-top: 3px;
        font-size: 10px;
        line-height: 1.35;
    }

    body.results-mode .prediction-list {
        gap: 5px;
        margin-top: 8px;
    }

    body.results-mode .prediction {
        min-height: 42px;
        padding: 7px 10px;
        border-radius: 9px;
    }

    body.results-mode .prediction b {
        font-size: 13px;
    }

    body.results-mode .prediction strong {
        font-size: 15px;
    }
}

/* Unified phone and tablet layout */
@media (max-width: 900px) {
    html,
    body,
    .app,
    .intro-view,
    .results-view {
        width: 100%;
        max-width: 100%;
    }

    body.results-mode .app {
        min-height: 100svh;
        padding: 0;
    }

    body.results-mode .results-view {
        gap: 0;
        min-height: 100svh;
    }

    body.results-mode .side-column {
        gap: 10px;
        padding: 16px;
        overflow: visible;
    }

    body.results-mode .side-column::before {
        margin: 0 4px 2px;
        font-size: 15px;
    }

    body.results-mode .side-column .glass-card {
        padding: 14px;
        border-radius: 14px;
    }

    body.results-mode .prediction-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-top: 9px;
    }

    body.results-mode .prediction {
        min-width: 0;
        min-height: 44px;
        gap: 6px;
        padding: 8px 10px;
        border-radius: 10px;
    }

    body.results-mode .prediction:nth-child(5) {
        grid-column: 1 / -1;
    }

    body.results-mode .prediction b,
    body.results-mode .prediction strong {
        white-space: nowrap;
    }

    .next-checkpoint-button:not(:disabled) {
        cursor: pointer;
        transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
    }

    .next-checkpoint-button:not(:disabled):hover {
        border-color: var(--course-accent);
        background: color-mix(in srgb, var(--course-accent) 14%, transparent);
        transform: translateY(-1px);
    }

    .next-checkpoint-button:disabled {
        cursor: default;
        opacity: .78;
    }

    body.results-mode .side-column .race-library--sidebar {
        flex: none;
        width: 100%;
        min-height: 252px;
        max-height: 340px;
    }

    body.results-mode .side-column .race-library--sidebar .race-course-list {
        min-height: 104px;
        max-height: 190px;
        overflow-y: auto;
    }

    body.results-mode .preview-column {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 12px;
    }

    body.results-mode .race-studio {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        border-radius: 16px;
    }

    body.results-mode .course-stage,
    body.results-mode .route-card,
    body.results-mode .route-map,
    body.results-mode .terrain-map {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    body.results-mode .course-stage:not(.is-km-view) {
        grid-template-rows: auto minmax(330px, auto) auto auto;
        gap: 9px;
        padding: 12px;
    }

    body.results-mode .course-stage.is-km-view {
        grid-template-rows: auto auto minmax(430px, auto);
        gap: 9px;
        padding: 12px;
    }

    body.results-mode .course-stage__header {
        gap: 12px;
    }

    body.results-mode .simulation-actions {
        width: 100%;
    }

    body.results-mode .simulation-btn {
        min-height: 44px;
    }

    body.results-mode .route-map {
        min-height: 320px;
        height: 320px;
    }

    body.results-mode .route-map > svg {
        min-height: 0;
        height: 100%;
    }

    body.results-mode .terrain-slope-legend {
        display: none;
    }

    body.results-mode .course-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    body.results-mode .course-metrics article {
        min-height: 58px;
        padding: 9px 10px;
    }

    body.results-mode .checkpoint-timeline {
        padding: 12px 10px;
    }

    body.results-mode .timeline-scroll {
        padding-right: 30px;
        padding-left: 30px;
    }

    body.results-mode .kilometer-analysis {
        min-height: 430px;
    }

    body.results-mode .kilometer-table {
        min-width: 480px;
    }

    body.results-mode .kilometer-table-wrap {
        max-width: 100%;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 780px) {
    body:not(.results-mode) .app {
        min-height: 100svh;
        padding: 0;
    }

    body:not(.results-mode) .intro-view {
        min-height: 100svh;
        place-items: stretch;
    }

    body:not(.results-mode) .intro-shell {
        width: 100%;
        min-height: 100svh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    body:not(.results-mode) .hero-card {
        padding: 25px 20px 28px;
    }

    body:not(.results-mode) .runner-brand {
        margin-bottom: 28px;
    }

    body:not(.results-mode) .hero-card h1 {
        font-size: clamp(30px, 9vw, 38px);
        line-height: 1.08;
    }

    body:not(.results-mode) .hero-copy {
        margin-top: 14px;
        font-size: 13px;
        line-height: 1.55;
    }

    body:not(.results-mode) .hero-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
        margin-top: 26px;
    }

    body:not(.results-mode) .hero-metric {
        min-width: 0;
        padding: 0 8px;
        border-right: 1px solid rgba(255, 255, 255, .1);
    }

    body:not(.results-mode) .hero-metric:first-child {
        padding-left: 0;
    }

    body:not(.results-mode) .hero-metric:last-child {
        padding-right: 0;
        border-right: 0;
    }

    body:not(.results-mode) .hero-metric strong {
        font-size: 14px;
    }

    body:not(.results-mode) .hero-metric small {
        font-size: 7px;
        line-height: 1.3;
    }

    body:not(.results-mode) .form-card {
        padding: 28px 18px 34px;
    }

    body:not(.results-mode) .form-inner {
        width: 100%;
    }

    body:not(.results-mode) .setup-progress {
        margin-bottom: 18px;
        padding-bottom: 14px;
    }

    body:not(.results-mode) .field input,
    body:not(.results-mode) .pace-picker input,
    body:not(.results-mode) .primary-btn {
        min-height: 48px;
    }

    body:not(.results-mode) input,
    body:not(.results-mode) select,
    body:not(.results-mode) textarea {
        font-size: 16px;
    }

    body:not(.results-mode) .experience-option {
        min-height: 46px;
    }
}

@media (max-width: 520px) {
    body.results-mode .side-column {
        padding: 13px;
    }

    body.results-mode .preview-column {
        padding: 8px;
    }

    body.results-mode .race-studio {
        border-radius: 13px;
    }

    body.results-mode .course-stage__header {
        align-items: stretch;
    }

    body.results-mode .selected-course-title h2 {
        font-size: 22px;
        overflow-wrap: break-word;
    }

    body.results-mode .simulation-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    body.results-mode .simulation-actions .simulation-btn {
        width: 100%;
        min-width: 0;
        padding-inline: 9px;
        font-size: 10px;
    }

    body.results-mode .simulation-actions .simulation-btn--primary {
        grid-column: 1 / -1;
    }

    body.results-mode .route-card__header {
        gap: 8px;
        padding: 9px 10px;
    }

    body.results-mode .route-clock strong {
        font-size: 10px;
    }

    body.results-mode .route-map {
        min-height: 280px;
        height: 280px;
    }

    body.results-mode .route-map > svg {
        min-height: 0;
        height: 100%;
    }

    body.results-mode .checkpoint-timeline > header {
        gap: 7px;
        margin-bottom: 8px;
    }

    body.results-mode .checkpoint-timeline > header > .next-checkpoint-button {
        width: 100%;
        max-width: 100%;
    }

    body.results-mode .timeline-scroll {
        padding-right: 25px;
        padding-left: 25px;
    }

    body:not(.results-mode) .form-card h2 {
        font-size: 25px;
    }

    body:not(.results-mode) .form-purpose {
        font-size: 12px;
    }

    body:not(.results-mode) .pace-picker {
        gap: 8px;
    }

    .prediction-spotlight {
        max-width: calc(100vw - 24px);
    }

    .loader-panel {
        width: calc(100vw - 24px);
        padding: 24px 18px;
    }
}

@media (min-width: 901px) and (max-height: 760px) {
    body.results-mode .prediction-guide {
        display: none;
    }

    body.results-mode .profile-head p {
        display: none;
    }
}

/* Printable race report */
.pdf-report {
    display: none;
}

@media (min-width: 621px) and (max-width: 1050px) {
    .simulation-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(105px, 1fr));
        align-items: stretch;
    }

    .simulation-actions .simulation-btn {
        width: auto;
    }

    .simulation-actions .simulation-btn--primary {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .simulation-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .simulation-actions .simulation-btn--primary {
        grid-column: 1 / -1;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 9mm 10mm;
    }

    html,
    body {
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        color: #102f49 !important;
        background: #fff !important;
    }

    body > *:not(.pdf-report) {
        display: none !important;
    }

    .pdf-report {
        display: block !important;
        width: 100%;
        color: #102f49;
        background: #fff;
        font-family: Inter, "Segoe UI", Arial, sans-serif;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pdf-report *,
    .pdf-report *::before,
    .pdf-report *::after {
        box-sizing: border-box;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .pdf-report__visual-page {
        min-height: 185mm;
        break-after: page;
        page-break-after: always;
    }

    .pdf-report__header,
    .pdf-report__table-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10mm;
        padding-bottom: 4mm;
        border-bottom: .35mm solid #d8e4ec;
    }

    .pdf-report__brand {
        display: flex;
        align-items: center;
        gap: 3mm;
    }

    .pdf-report__brand > span {
        display: grid;
        place-items: center;
        width: 11mm;
        height: 11mm;
        border-radius: 3mm;
        color: #fff;
        background: #078ccb;
        font-size: 16pt;
        font-weight: 900;
    }

    .pdf-report__brand div,
    .pdf-report__generated,
    .pdf-report__table-header > div:last-child {
        display: flex;
        flex-direction: column;
    }

    .pdf-report__brand strong {
        font-size: 12pt;
        letter-spacing: .04em;
    }

    .pdf-report__brand small,
    .pdf-report__generated span,
    .pdf-report__table-header span {
        margin-top: 1mm;
        color: #7890a3;
        font-size: 7.5pt;
    }

    .pdf-report__generated,
    .pdf-report__table-header > div:last-child {
        align-items: flex-end;
        text-align: right;
    }

    .pdf-report__generated strong,
    .pdf-report__table-header > div:last-child strong {
        max-width: 105mm;
        font-size: 10pt;
        overflow-wrap: anywhere;
    }

    .pdf-report__identity {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 3mm;
        margin-top: 3.5mm;
    }

    .pdf-report__identity > div {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: baseline;
        gap: 1mm 3mm;
        min-width: 0;
        padding: 2.5mm 3mm;
        border: .3mm solid #dce6ed;
        border-radius: 2.5mm;
        background: #f7fafc;
    }

    .pdf-report__identity small {
        grid-row: 1 / span 2;
        color: #078ccb;
        font-size: 6.5pt;
        font-weight: 900;
        letter-spacing: .08em;
    }

    .pdf-report__identity strong {
        min-width: 0;
        font-size: 9pt;
        overflow-wrap: anywhere;
    }

    .pdf-report__identity span {
        overflow: hidden;
        color: #7890a3;
        font-size: 7pt;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pdf-report__metrics {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 2mm;
        margin-top: 3mm;
    }

    .pdf-report__metrics > div {
        padding: 2.5mm 3mm;
        border: .3mm solid #dce6ed;
        border-radius: 2.5mm;
        background: #f3f7fa;
    }

    .pdf-report__metrics span {
        display: block;
        margin-bottom: 1mm;
        color: #7890a3;
        font-size: 6pt;
        font-weight: 800;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .pdf-report__metrics strong {
        font-size: 9pt;
        font-variant-numeric: tabular-nums;
    }

    .pdf-report__panel {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .pdf-report__map-panel {
        margin-top: 3.5mm;
    }

    .pdf-report__timeline-panel {
        margin-top: 3mm;
    }

    .pdf-report__section-title {
        display: flex;
        align-items: center;
        gap: 2.5mm;
        margin-bottom: 1.5mm;
    }

    .pdf-report__section-title > span {
        display: grid;
        place-items: center;
        width: 7mm;
        height: 7mm;
        border-radius: 2mm;
        color: #fff;
        background: #078ccb;
        font-size: 7pt;
        font-weight: 900;
    }

    .pdf-report__section-title div {
        display: flex;
        flex-direction: column;
    }

    .pdf-report__section-title small {
        color: #078ccb;
        font-size: 5.5pt;
        font-weight: 900;
        letter-spacing: .08em;
    }

    .pdf-report__section-title strong {
        margin-top: .2mm;
        font-size: 8pt;
    }

    .pdf-report__map-mount {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 73mm;
        overflow: hidden;
        border: .3mm solid #d7e3eb;
        border-radius: 3mm;
        background: #f3f7fa;
    }

    .pdf-course-map {
        display: block;
        width: 168mm;
        height: 73mm;
    }

    .pdf-report .map-background {
        fill: #102f49;
    }

    .pdf-report__timeline-mount {
        overflow: hidden;
        border: .3mm solid #d7e3eb;
        border-radius: 3mm;
        background: #f8fafc;
    }

    .pdf-checkpoint-timeline {
        display: block !important;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .pdf-checkpoint-timeline > header {
        display: none;
    }

    .pdf-checkpoint-timeline .timeline-scroll {
        padding: 1.5mm 13mm 2mm;
    }

    .pdf-checkpoint-timeline .timeline-track {
        --timeline-line-y: 16mm;
        --timeline-label-width: 22mm;
        --timeline-label-font-size: 6pt;
        height: 29mm;
    }

    .pdf-checkpoint-timeline .timeline-track::before,
    .pdf-checkpoint-timeline .timeline-fill {
        height: 1mm;
    }

    .pdf-checkpoint-timeline .timeline-elevation-profile {
        height: 16mm;
    }

    .pdf-checkpoint-timeline .timeline-elevation-scale {
        height: 16mm;
    }

    .pdf-checkpoint-timeline .timeline-elevation-scale__level strong {
        top: -1.5mm;
        min-width: 9mm;
        padding: .4mm .8mm;
        color: #527087;
        background: rgba(255, 255, 255, .9);
        font-size: 5pt;
    }

    .pdf-checkpoint-timeline .timeline-elevation-profile stop:first-child {
        stop-color: color-mix(in srgb, var(--course-accent) 28%, transparent);
    }

    .pdf-checkpoint-timeline .timeline-elevation-profile stop:last-child {
        stop-color: color-mix(in srgb, var(--course-accent) 3%, transparent);
    }

    .pdf-checkpoint-timeline .timeline-elevation-range {
        top: 1mm;
        right: 1mm;
        color: #527087;
        background: rgba(255, 255, 255, .9);
        font-size: 5.5pt;
    }

    .pdf-checkpoint-timeline .timeline-point {
        top: calc(var(--timeline-line-y) - 1.6mm);
    }

    .pdf-checkpoint-timeline .timeline-point__dot {
        width: 3.2mm;
        height: 3.2mm;
        margin-left: -1.35mm;
        border-width: .5mm;
        background: #fff;
    }

    .pdf-checkpoint-timeline .timeline-point__label {
        margin-top: 1.5mm;
        color: #617a8e;
        line-height: 1.2;
    }

    .pdf-checkpoint-timeline .timeline-point__label strong {
        color: #18344d;
        font-size: 6.2pt;
    }

    .pdf-report__table-page {
        width: 100%;
    }

    .pdf-report__table-header {
        margin-bottom: 4mm;
    }

    .pdf-report__table-header small {
        color: #078ccb;
        font-size: 7pt;
        font-weight: 900;
        letter-spacing: .08em;
    }

    .pdf-report__table-header h1 {
        margin: 1mm 0 0;
        color: #102f49;
        font-size: 18pt;
        letter-spacing: -.03em;
    }

    .pdf-report__table-header p {
        margin: 1mm 0 0;
        color: #7890a3;
        font-size: 8pt;
    }

    .pdf-report__table {
        width: 100%;
        table-layout: fixed;
        border-collapse: collapse;
        color: #18344d;
        font-size: 7.5pt;
        font-variant-numeric: tabular-nums;
    }

    .pdf-report__table thead {
        display: table-header-group;
    }

    .pdf-report__table tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .pdf-report__table th {
        width: 20%;
        padding: 2.3mm 3mm;
        border: .3mm solid #d5e2ea;
        color: #527087;
        background: #eaf3f8;
        font-size: 6.5pt;
        font-weight: 900;
        letter-spacing: .06em;
        text-align: center;
        text-transform: uppercase;
    }

    .pdf-report__table td {
        width: 20%;
        padding: 2mm 3mm;
        border: .3mm solid #e1e9ef;
        text-align: center;
    }

    .pdf-report__table tbody tr:nth-child(even) td {
        background: #f7fafc;
    }

    .pdf-report__table td:first-child,
    .pdf-report__table td:last-child {
        color: #047fb8;
        font-weight: 900;
    }

    .pdf-report__footer {
        margin-top: 4mm;
        padding-top: 2.5mm;
        border-top: .3mm solid #d8e4ec;
        color: #7890a3;
        font-size: 6.5pt;
        text-align: center;
    }
}

/* The race picker now lives in the left results column. */
.results-view .race-studio {
    grid-template-columns: minmax(0, 1fr);
}

/* Keep the distance summary compact and reserve room for at least two races. */
@media (min-width: 901px) {
    body.results-mode .prediction-card {
        padding: 11px 12px;
    }

    body.results-mode .prediction-card .panel-title {
        font-size: 20px;
        line-height: 1.1;
    }

    body.results-mode .prediction-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-top: 8px;
    }

    body.results-mode .prediction {
        min-width: 0;
        min-height: 40px;
        gap: 6px;
        padding: 7px 9px;
        border-radius: 9px;
    }

    body.results-mode .prediction:nth-child(5) {
        grid-column: 1 / -1;
    }

    body.results-mode .prediction b {
        font-size: 11px;
        white-space: nowrap;
    }

    body.results-mode .prediction strong {
        font-size: 13px;
        white-space: nowrap;
    }

    body.results-mode .side-column .race-library--sidebar {
        flex: 1 0 224px;
        min-height: 224px;
        max-height: none;
        padding: 12px;
    }

    body.results-mode .side-column .race-library--sidebar .race-course-list {
        flex: 1 1 auto;
        min-height: 94px;
        max-height: none;
    }
}

/* Race finder launcher and searchable modal */
.race-finder-launch {
    display: grid;
    gap: 12px;
    flex: 0 0 auto;
}

.race-finder-launch--hidden {
    visibility: hidden;
}

.race-finder-launch__copy {
    min-width: 0;
}

.race-finder-launch__copy > span {
    display: block;
    margin-bottom: 3px;
    color: #86a7bd;
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.race-finder-launch__copy > strong {
    display: block;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.race-finder-launch__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid rgba(85, 197, 238, .55);
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, #078ccb, #169dd9);
    box-shadow: 0 10px 24px rgba(7, 140, 203, .24);
    font-size: 12px;
    font-weight: 900;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.race-finder-launch__button:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #047fb8, #078ccb);
    box-shadow: 0 13px 28px rgba(7, 140, 203, .3);
}

.race-finder-launch__button svg,
.race-finder-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

body.race-finder-open {
    overflow: hidden;
}

.race-finder-modal[hidden] {
    display: none;
}

.race-finder-modal {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    overflow: hidden;
    background: rgba(8, 30, 47, .62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.race-finder-dialog {
    display: flex;
    flex-direction: column;
    width: min(1180px, calc(100vw - 48px));
    height: min(820px, calc(100svh - 48px));
    max-height: calc(100svh - 48px);
    padding: 26px;
    overflow: hidden;
    border: 1px solid #d5e2ea;
    border-radius: 18px;
    color: #102f49;
    background: #edf4f8;
    box-shadow: 0 30px 90px rgba(6, 28, 45, .36);
    opacity: 0;
    transform: translateY(14px) scale(.985);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(.22, 1, .36, 1);
}

.race-finder-modal.is-open .race-finder-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.race-finder-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.race-finder-dialog__header h2 {
    margin: 0;
    color: #08233f;
    font-size: 24px;
    letter-spacing: -.03em;
}

.race-finder-dialog__actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

.race-finder-close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #d4e1e9;
    border-radius: 10px;
    color: #527087;
    background: #fff;
}

.race-finder-dialog .race-search {
    flex: 0 0 auto;
}

.race-finder-dialog .race-course-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex: 1 1 auto;
    max-height: none;
    padding: 2px 4px 6px;
}

.race-finder-dialog .race-library__hint {
    flex: 0 0 auto;
    margin-top: 4px;
}

@media (max-width: 980px) {
    .race-finder-dialog .race-course-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .race-finder-modal {
        align-items: end;
        padding: 10px;
    }

    .race-finder-dialog {
        width: 100%;
        height: calc(100svh - 20px);
        max-height: calc(100svh - 20px);
        padding: 17px 14px 14px;
        border-radius: 18px 18px 12px 12px;
    }

    .race-finder-dialog__header h2 {
        font-size: 21px;
    }

    .race-finder-dialog__actions .favorite-count {
        display: none;
    }

    .race-finder-dialog .race-course-list {
        grid-template-columns: minmax(0, 1fr);
        max-height: none;
    }

    .race-finder-dialog .race-library__hint {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .race-finder-dialog,
    .race-finder-launch__button {
        transition: none;
    }
}

/* Custom race submission and mobile elevation zoom */
.race-finder-launch__course {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.race-finder-launch__course > strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.race-finder-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #c9deea;
    color: #087fb5;
    background: #fff;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 850;
}

.race-finder-add svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.race-course-item--request {
    --item-accent: #078ccb;
    display: grid;
    align-content: center;
    min-height: 132px;
    border-style: dashed;
    color: #0b6f9d;
    background: linear-gradient(135deg, #f7fcff, #eaf6fb);
}

.race-course-item--request strong {
    display: block;
    margin-bottom: 7px;
    color: #0b5277;
    font-size: 14px;
}

.race-course-item--request span {
    color: #66879a;
    font-size: 11px;
    line-height: 1.5;
}

.race-course-item__pending {
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 999px;
    color: #9b5a06;
    background: #fff0c7;
    font-size: 8px;
    font-weight: 900;
    white-space: nowrap;
}

body.user-race-open {
    overflow: hidden;
}

.user-race-modal[hidden] {
    display: none;
}

.user-race-modal {
    position: fixed;
    z-index: 1200;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(6, 27, 43, .58);
    backdrop-filter: blur(9px);
}

.user-race-dialog {
    display: flex;
    flex-direction: column;
    width: min(940px, calc(100vw - 44px));
    max-height: calc(100svh - 44px);
    overflow: hidden;
    border: 1px solid #d4e3eb;
    border-radius: 20px;
    color: #102f49;
    background: #edf4f8;
    box-shadow: 0 30px 100px rgba(4, 25, 41, .42);
    opacity: 0;
    transform: translateY(15px) scale(.985);
    transition: opacity 180ms ease, transform 220ms cubic-bezier(.22, 1, .36, 1);
}

.user-race-modal.is-open .user-race-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.user-race-dialog__header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 17px;
    border-bottom: 1px solid #d7e5ec;
}

.user-race-dialog__header h2 {
    margin: 0;
    color: #08233f;
    font-size: 24px;
}

.user-race-dialog__header p:last-child {
    max-width: 620px;
    margin: 6px 0 0;
    color: #6f8798;
    font-size: 12px;
    line-height: 1.5;
}

.user-race-form {
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px 0;
}

.user-race-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.user-race-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.user-race-field--wide {
    grid-column: 1 / -1;
}

.user-race-field > span {
    color: #294c64;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.user-race-field input,
.user-race-field select,
.user-race-field textarea {
    width: 100%;
    min-height: 43px;
    padding: 10px 12px;
    border: 1px solid #ccdde6;
    border-radius: 10px;
    outline: none;
    color: #102f49;
    background: #fff;
    font: inherit;
    font-size: 13px;
}

.user-race-field textarea {
    min-height: 76px;
    resize: vertical;
}

.user-race-field input:focus,
.user-race-field select:focus,
.user-race-field textarea:focus {
    border-color: #078ccb;
    box-shadow: 0 0 0 3px rgba(7, 140, 203, .11);
}

.user-race-input-suffix {
    position: relative;
}

.user-race-input-suffix input {
    padding-right: 48px;
}

.user-race-input-suffix b {
    position: absolute;
    top: 50%;
    right: 12px;
    color: #7990a1;
    font-size: 11px;
    transform: translateY(-50%);
}

.user-race-upload {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 11px;
    padding: 15px;
    border: 1px dashed #9fc7db;
    border-radius: 12px;
    color: #31586f;
    background: #f8fcfe;
    cursor: pointer;
}

.user-race-upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.user-race-upload svg {
    grid-row: 1 / span 2;
    width: 28px;
    fill: none;
    stroke: #078ccb;
    stroke-width: 1.8;
}

.user-race-upload strong {
    font-size: 12px;
}

.user-race-upload span {
    margin-top: 3px;
    color: #71899a;
    font-size: 10px;
}

.user-race-checkpoints {
    margin-top: 17px;
    padding: 15px;
    border: 1px solid #d5e3ea;
    border-radius: 14px;
    background: #f8fbfd;
}

.user-race-checkpoints > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 11px;
}

.user-race-checkpoints > header div {
    display: grid;
    gap: 3px;
}

.user-race-checkpoints > header strong {
    color: #173b54;
    font-size: 13px;
}

.user-race-checkpoints > header span {
    color: #7890a0;
    font-size: 10px;
}

#addUserCheckpointButton {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid #b9d9e8;
    border-radius: 9px;
    color: #077dad;
    background: #eaf7fc;
    font-size: 10px;
}

.user-checkpoint-list {
    display: grid;
    gap: 9px;
}

.user-checkpoint-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 32px;
    align-items: end;
    gap: 9px;
}

.user-checkpoint-row__number {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-bottom: 7px;
    border-radius: 8px;
    color: #087cab;
    background: #dff2fa;
    font-size: 10px;
    font-weight: 900;
}

.user-checkpoint-remove {
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
    border: 1px solid #f0cccc;
    border-radius: 8px;
    color: #c64242;
    background: #fff3f3;
    font-size: 18px;
}

.user-race-form__message {
    margin-top: 14px;
    padding: 11px 13px;
    border-radius: 10px;
    color: #9d2f2f;
    background: #fff0f0;
    font-size: 11px;
}

.user-race-dialog__footer {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin: 20px -24px 0;
    padding: 14px 24px;
    border-top: 1px solid #d6e4eb;
    background: rgba(247, 251, 253, .96);
}

.user-race-dialog__footer button {
    min-height: 40px;
    padding: 0 17px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 850;
}

.user-race-cancel {
    border: 1px solid #ccdde6;
    color: #527087;
    background: #fff;
}

.user-race-submit {
    border: 1px solid #078ccb;
    color: #fff;
    background: #078ccb;
    box-shadow: 0 9px 22px rgba(7, 140, 203, .2);
}

.user-race-submit:disabled {
    cursor: wait;
    opacity: .65;
}

.timeline-zoom-controls {
    display: none;
}

@media (max-width: 900px) {
    body.results-mode .course-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    body.results-mode .course-metric--race-time {
        grid-column: auto;
    }

    body.results-mode .course-metrics article {
        min-height: 56px;
        padding: 8px 7px;
    }

    body.results-mode .course-metrics span {
        font-size: 7px;
    }

    body.results-mode .course-metrics strong {
        font-size: 11px;
    }

    .timeline-zoom-controls {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 5px;
        margin: -3px 2px 3px;
    }

    .timeline-zoom-controls button,
    .timeline-zoom-controls span {
        display: grid;
        place-items: center;
        min-width: 29px;
        height: 29px;
        border: 1px solid #d4e2ea;
        border-radius: 8px;
        color: #31586f;
        background: #fff;
        font-size: 12px;
        font-weight: 850;
    }

    .timeline-zoom-controls span {
        min-width: 48px;
        font-size: 9px;
    }

    body.results-mode .timeline-scroll {
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
        touch-action: pan-x pan-y;
        -webkit-overflow-scrolling: touch;
    }

    body.results-mode .timeline-track {
        min-width: 100%;
        transition: width 180ms ease;
    }

    body.results-mode .timeline-track.is-zoomed .timeline-scrubber {
        cursor: grab;
        touch-action: pan-x pan-y;
    }
}

@media (max-width: 620px) {
    .race-finder-add span {
        display: none;
    }

    .race-finder-add {
        width: 38px;
        padding: 0;
    }

    .user-race-modal {
        align-items: end;
        padding: 8px;
    }

    .user-race-dialog {
        width: 100%;
        max-height: calc(100svh - 16px);
        border-radius: 18px 18px 10px 10px;
    }

    .user-race-dialog__header {
        padding: 18px 16px 14px;
    }

    .user-race-dialog__header h2 {
        font-size: 21px;
    }

    .user-race-form {
        padding: 16px 16px 0;
    }

    .user-race-form__grid {
        grid-template-columns: 1fr;
        gap: 11px;
    }

    .user-race-field--wide {
        grid-column: auto;
    }

    .user-checkpoint-row {
        grid-template-columns: 28px 1fr 32px;
        align-items: start;
        padding: 10px;
        border: 1px solid #dbe7ed;
        border-radius: 11px;
        background: #fff;
    }

    .user-checkpoint-row .user-race-field {
        grid-column: 2;
    }

    .user-checkpoint-row__number {
        grid-row: 1;
        grid-column: 1;
    }

    .user-checkpoint-remove {
        grid-row: 1;
        grid-column: 3;
        margin: 0;
    }

    .user-race-dialog__footer {
        margin: 17px -16px 0;
        padding: 12px 16px;
    }
}
