
/* Base font override — race.css loads after base.css, so this wins by source order */
* {
    font-family: var(--race-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

ul,
p {
    margin: 1em;
    padding: 0;

    list-style: none;
}

/* Site and Race name */
#header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;

    text-align: center;

    z-index: 1000;
}
    #login_logout {
        position: absolute;
        right: 60px;
        top: 0;
        bottom: 0;
        float: none;

        display: flex;
        align-items: center;
        gap: 0.3em;
    }
    /* Remove floats — flex handles alignment */
    #login_logout:before {
        display: none;
    }
    #login_logout .panel-form {
        float: none;
    }
    #login_logout #notifications {
        float: none;
        height: auto;
        margin: 0;
    }
    #logout_icon {
        height: auto;
        min-height: 0;
    }
    /* Log button — fit snugly in header */
    #login_logout .panel-form button {
        min-height: 0;
        margin: 0 !important;
        padding: 0.3em 0.75em;
        font-size: var(--race-text-xs);
    }
    /* Slightly smaller icons for header */
    #login_logout .runner .icon,
    #login_logout .runner .icon img {
        height: 45px;
        width: 45px;
    }

    #race-title {
        margin: 0;
        padding: 0 7em 0 2.5em;

        font-family: var(--race-font-display);
        font-size: 1.8em;
        font-weight: 700;
        letter-spacing: 1px;
        line-height: 1.75em;

        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #site,
    #mobile-menu {
        position: absolute;
        left: .85em;
        top: .15em;

        font-size: 1.2em;
        line-height: 2.4em;

        opacity: .9;
    }

    #site {
        line-height: 0;

        opacity: 1;
        transition: opacity .6s;
    }
    #site img {
        max-height: 2.5em;
    }
        #site:hover {
            opacity: .7;
            transition: opacity .15s;
        }

/* Floating panel box */
#panels {
    position: fixed;
    left: 1em;
    top: 4em;

    color: var(--race-text);
    border: 1px solid #adadad;
    border-width: 0 1px 1px;
    box-shadow: none;

    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 350px;
    max-height: calc(100vh - 5em);
    z-index: 75;

    transition: opacity .6s;
}
    #panels:hover {
        opacity: 1;

        transition: opacity .15s;
    }

    .panel {
        display: block;
        position: relative;
        flex-shrink: 0;

        background: var(--race-panel-bg);
        box-shadow: var(--race-panel-shadow);

        overflow: hidden;
    }
    .panel.active {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    .panel + .panel {
        margin-top: 0;
        border-top: 1px solid var(--race-panel-border);
    }

    .panel.recent .success {
        padding: .5em;

        background: var(--race-primary-15);

        font-size: 1.1em;
        line-height: 1.5em;
        text-align: center;
        width: 80%;
        margin: 10px auto;
    }

    .panel.recent .logged-miles {
        width: 302px;
    }

    .panel.my-runs .success {
        padding: .5em;

        background: var(--race-primary-15);

        font-size: 1.1em;
        line-height: 1.5em;
        text-align: center;
        width: 80%;
        margin: 10px auto;
    }

    .panel .header {
        margin: 0;
        padding: .4em .8em;

        font-weight: normal;
        font-size: .9375em;
        text-transform: uppercase;
        overflow: hidden;

        display: flex;
        align-items: center;

        cursor: pointer;
        transition: background-color .6s;
    }
        .panel .header:hover {
            transition: background-color .15s;
        }

        .panel .header:before {
            content: "\25BE";
            display: inline-block;
            flex-shrink: 0;
            margin-right: .4em;
            font-size: .85em;
            opacity: .7;
            transition: transform .2s ease;
        }

    .panel .header .notification {
        margin-left: auto;
        font-size: .8em;
        text-transform: lowercase;
    }

    .panel .lastupdate {
        display: none;
    }

    .panel.active .lastupdate {
        display: block;
    }

    .panel > .content {
        display: none;
    }
        .panel.active > .content.my-runs {
            display: none;
        }
        .panel.my-runs > .content {
            padding: 0 .5em;
        }
        .panel.active > .content {
            display: block;
            flex: 1;
            min-height: 0;
            overflow-y: auto;
        }
        .panel.active .header {
            padding-bottom: .4em;
            flex-shrink: 0;
        }

        .panel.active .header:before {
            transform: rotate(180deg);
        }


/* First Panel */
#race-info {
    color: var(--race-primary);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5em;
}
    #race-info li {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
        #race-info li.about-end-date { margin-bottom: 0; }

    #race-info span {
        display: block;

        color: var(--race-text-muted);

        font-size: .85em;
        text-transform: uppercase;
    }

.panel-block,
#race-info,
.panel-form,
#about-race,
.charity-header,
#quizlab-frame,
#log-miles-form {
    margin: var(--race-space-sm);
    padding: var(--race-space-sm);

    background: var(--race-panel-content-bg);
    border: 1px solid var(--race-panel-border);
    border-radius: 0;
}
@media (max-width: 320px) {
    .panel-block,
    #race-info,
    .panel-form,
    #about-race,
    .charity-header,
    #log-miles-form {
        margin: .5em 0;
    }
}

#about-race img {
    max-width: 100%;
}

.panel-block h4,
.panel-form h4,
.spectator-listing-label {
    margin: .3em 0 .5em;

    font-size: 1.1em;
    text-align: center;
}
.panel-block ul {
    margin: 0;
}

    #race-signup .remaining {
        color: var(--race-primary);
    }

    .panel-form form {
        font-size: var(--race-text-sm);
        line-height: var(--race-leading-relaxed);
    }

    .panel-form .form_message_for_user {
        font-weight: 700;
        line-height: 1.3em;
        text-align: center;
    }

    .panel-form .label {
        text-align: center;
    }

    .panel-form .group + .group {
        display: none;
    }

    .panel-form .field {
        position: relative;
        width: 78%;

        margin: 0 auto .5em;
    }
        .panel-form .field .field {
            margin-bottom: 0;
            width: 90%;
        }

    .search-form input[type=text],
    .panel-form form .field > input,
    .panel-form select,
    .panel-form textarea,
    .panel-form .completable,
    .panel .groupedbuttons {
        display: block;
        padding: 0 1%;
        width: 98%;
        max-width: 98%;

        border: 1px solid var(--race-input-border);
        color: var(--race-input-text);
        line-height: 1.5em;
    }
    .panel-form form .field > input[disabled],
    .panel-form textarea[disabled] {
        opacity: .7;
        background: var(--race-input-disabled-bg);
        border-color: var(--race-disabled-border);
        color: var(--race-input-disabled-text);
    }
        .panel-form select {
            background: transparent;
            border-radius: 0;
            width: 100%;
            max-width: 100%;
        }
        .panel-form .completable {
            padding: 0;
            width: calc(100% - 1px);
        }

        .panel .groupedbuttons {
            padding: 0;
            max-width: 100%;
            width: 100%;

            line-height: 1em;
            text-align: center;
        }
            .panel .groupedbuttons-items {
                overflow: hidden;
            }
            .panel .groupedbuttons-item {
                float: left;
                padding: 0.3em 0 .2em;

                border-right: 1px solid var(--race-input-border);
                color: var(--race-input-text);
                cursor: pointer;
                text-decoration: none;
                transition: background-color var(--race-transition-slow), color var(--race-transition-slow);
            }
                .panel .groupedbuttons-item:hover {
                    background: var(--race-input-hover-bg);
                    transition: background-color var(--race-transition-fast), color var(--race-transition-fast);
                }
                .panel .groupedbuttons-item.selected {
                    background: var(--race-primary);
                    color: var(--race-on-primary);
                    text-shadow: 0 0 1px rgba(0,0,0,.3);
                    transition: background-color var(--race-transition-fast), color var(--race-transition-fast);
                }
                .panel .groupedbuttons-item:last-child {
                    border-right: none;
                }

            .panel .groupedbuttons-item:nth-child(1) { width: 54%; }
            .panel .groupedbuttons-item:nth-child(2) { display: none; }
            .panel .groupedbuttons-item:nth-child(3) { width: 45.5%; }

            .panel .has_teams .groupedbuttons-item:nth-child(1) { width: 38%; }
            .panel .has_teams .groupedbuttons-item:nth-child(2) { width: 35%; display: block; }
            .panel .has_teams .groupedbuttons-item:nth-child(3) { width: 26%; }

        #race-signup #field_team_select + #field_team_name,
        #race-signup #field_team_name + #field_private_team {
            height: 0;
            margin-bottom: 0;
            opacity: 0;
            transition: all .5s;
            overflow: hidden;
        }
            #race-signup #field_team_select + #field_team_name.visible {
                height: 1.5em;
                margin-bottom: .5em;
                opacity: 1;
                transition: all .5s;
                overflow: visible;
            }
            #race-signup #field_team_name + #field_private_team.visible {
                height: 1.2em;
                line-height: 1.2em;
                margin-bottom: 0;
                opacity: 1;
                transition: all .5s;
                overflow: visible;
            }
            #race-signup #field_team_select + #field_team_name.visible.has_error {
                height: 3em;
            }
            #race-signup #field_team_name.visible.has_error + #field_private_team.visible {
                margin-top: 3em;
            }

    .panel-form .agreement {
        line-height: var(--race-leading-normal);
        font-size: var(--race-text-xs);
        text-align: center;
    }
        .panel-form .agreement a {
            color: var(--race-accent);
            font-size: 1.05em;

            transition: color .6s;
        }
            .panel-form .agreement a:hover {
                color: var(--race-link-hover);
                text-decoration: none;

                transition: color .15s;
            }

    .panel-form .help {
        position: absolute;
        right: 4px;
        bottom: 5px;

        color: var(--race-on-primary);

        cursor: help;
        overflow: hidden;
    }
        .panel-form .help:hover {
            overflow: visible;
        }

        .panel-form .help,
        .panel-form .help .icon {
            height: 14px;
            width: 14px;
        }

        .panel-form .help .icon {
            background-color: var(--race-disabled-bg);
            border-radius: 13px;

            font-size: 13px;
            font-weight: bold;
            line-height: 14px;
            text-align: center;

            opacity: .6;
        }
            .panel-form .help .icon:before {
                content: "?";
                display: block;
            }

        .panel-form .help .tooltip {
            position: absolute;
            top: 25px;
            right: -40px;

            padding: .35em .5em .25em;
            width: 12em;

            background: var(--race-header-bg);
            border-radius: .5em;
            box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
            font-size: .95em;
            line-height: 1.25em;

            opacity: 0;
            z-index: 10;
        }
            .panel-form .help .tooltip:before {
                content: "";
                display: block;

                position: absolute;
                right: 41px;
                top: -12px;

                border: 6px solid var(--race-header-bg);
                border-color: transparent transparent var(--race-header-bg) transparent;
                cursor: default;
            }

            .panel-form .help:hover .tooltip {
                opacity: 1;
                transition: opacity .15s;
            }

    .panel-form button,
    .panel-form input.button,
    .charity-back-me,
    .charity-back-us,
    .team-join-button,
    .group-recruit-invite-email button,
    #result-share-container button,
    #charity-footer button,
    .charity-header .button {
        clear: both;
        display: block;
        margin: 1.5em auto 0;
        padding: .35em 1.75em .3em;

        font-size: 14px;
        cursor: pointer;

        background-color: var(--race-primary);
        color: var(--race-on-primary);

        border: 1px solid var(--race-primary-border);
        text-shadow: 0 0 1px rgba(0,0,0,.3);

        line-height: 1em;
        text-transform: uppercase;

        transition: background-color .6s, box-shadow .6s, text-shadow .6s, opacity .6s;
    }
    .charity-edit-me {
        display: none;
    }
    #result-share-container button {
        margin: 0;
        margin-bottom: 4px;
        position: relative;
        text-transform: lowercase;
        width: 100%;
    }
    #result-share-container .image-generator-spinner {
        position: absolute;
        width: 100%;
        height: calc(100% - 0.35em);
        top: 0;
        left: 0;
        background: var(--race-accent);
        z-index: 9999;
        padding-top: 0.35em;
        text-align: center;
        cursor: default;
    }
    #charity-footer button {
        margin: 0.8em auto;
    }
        .panel-form input.button[disabled],
        .panel-form button[disabled] {
            background-color: var(--race-disabled-bg);
            border-color: var(--race-disabled-border);
            opacity: .7;

            box-shadow: none;
            transition: background-color var(--race-transition-fast), opacity var(--race-transition-fast);
        }
        .panel-form input.button[disabled],
        .panel-form button[disabled] * {
            cursor: default;
        }

        .panel-form input.button:not([disabled]):hover,
        .panel-form button:not([disabled]):hover,
        .charity-back-me:hover,
        .charity-back-us:hover,
        .charity-header .button:hover,
        .team-join-button:hover,
        #result-share-container button:hover,
        #charity-footer button:hover {
            background-color: var(--race-primary-hover);
            box-shadow: 0 0 2px rgba(0,0,0,.3);
            text-shadow: 0 0 2px rgba(0,0,0,.3);

            transition: background-color .15s, box-shadow .15s, text-shadow .15s, opacity .15s;
        }

    .panel-form button.with-extra-text {
        padding: .5em 1.25em 0;
        font-size: 1.05em;
    }
        .panel-form .button-extra {
            display: block;
            font-size: .7em;
            text-transform: none;
        }

    #race-signup #forgot-nickname {
        margin-top: 1.3em;

        font-size: .8em;
        text-align: center;
    }
        #forgot-nickname a {
            display: inline-block;

            border-bottom: 1px solid transparent;
            color: var(--race-link);
            line-height: .85em;

            transition: color .6s, border .6s;
        }
            #forgot-nickname  a:hover {
                border-color: var(--race-link-hover);
                color: var(--race-link-hover);

                transition: color .15s, border .15s;
            }


.panel-form .loading {
    opacity: .9;
}
    .panel-form .loading button,
    .panel-form .loading button:hover {
        background: var(--race-input-disabled-text);
        border-color: var(--race-disabled-border);
        color: transparent;
        position: relative;

        box-shadow: none;
        cursor: default;
    }
    .panel-form .loading button::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        margin-top: -8px;
        margin-left: -8px;
        width: 16px;
        height: 16px;
        border: 2px solid rgba(255,255,255,.3);
        border-top-color: #fff;
        border-radius: 50%;
        animation: race-spin 0.6s linear infinite;
    }

.race-recruit-invite-email input,
.group-recruit-invite-email input {
    width: 99%;
}

#race-recruit-invite-email,
.group-recruit-invite-email {
    display: none;
}

#race-finished-join {
    display: none;
}

.panel-message {
    text-align: center;
}

.panel-message a {
    color: var(--race-link);
    font-weight: bold;
    opacity: 1;
    text-decoration: none;
    text-transform: uppercase;
    transition: opacity .6s;
}

.panel-message a:hover {
    opacity: .7;
    transition: opacity .15s;
}

.panel-form .success,
.panel .info {
    padding: .5em;

    background: var(--race-primary-15);

    font-size: 1.1em;
    line-height: 1.5em;
    text-align: center;
}
.panel .info {
    font-size: .9em;
    background: var(--race-info-bg);
}
    .panel .info a {
        color: var(--race-text-muted);
        transition: opacity .6s;
    }
        .panel .info a:hover {
            opacity: .7;
            transition: opacity .15s;
        }

.panel .filtered-content,
.panel .show-filtered .unfiltered-content {
    display: none;
}
    .panel .show-filtered .filtered-content,
    .panel :not(.show-filtered) .unfiltered-content {
        display: block;
    }


#race-recruit,
.group-recruit {
    text-align: center;
}

.social_invite {
    margin: 10px 0px 10px 0px;
}

.smaller {
    font-size: 70%;
}

.panel-form .error:not(.nofield) {
    width: 98%;
    margin: 0 auto;
    padding: .15em 1%;

    background: var(--race-error-bg);
    border: 1px solid rgba(169, 68, 66, 0.39);
    border-bottom: 0;
    box-shadow: inset 0px -10px 5px -10px rgba(0, 0, 0, 0.3);

    font-size: .9em;
    line-height: 1.25em;
}
    .panel-form .group .error,
    .panel-form .completable .error {
        margin: -1px 0 0 -1px;
    }

.panel-form #field_team_name .error {
    max-height: 3.75em;
    overflow-y: scroll;
}

.panel-form .error.nofield {
    margin: .5em 0 0;
    padding: .5em;

    background: rgba(188, 73, 73, .2);

    line-height: 1.25em;
}
    .panel-form form .field .error + input,
    .panel-form .error + select,
    .panel-form .error + .completable {
        border-color: var(--race-error-border);
    }

.panel-form .assurance:not(.nofield) {
    width: 98%;
    margin: 0 auto;
    padding: .15em 1%;

    background: var(--race-success-bg);
    border: 1px solid rgba(102, 102, 102, 0.39);
    border-bottom: 0;
    box-shadow: inset 0px -10px 5px -10px rgba(0, 0, 0, 0.3);

    font-size: .9em;
    line-height: 1.25em;
}

.runner {
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 56px;
    position: relative;

    cursor: default;
    transition: color .6s, background 3s ease-out;
}

    .runner-link {
        cursor: pointer;
        color: inherit;
        opacity: 1;
        text-decoration: none;
    }
    .runner-link:hover {
        opacity: .7;
        transition: color .15s, background 3s ease-out;
    }
    .runner-link-uniteam {
        cursor: default;
    }
    .runner.noimage {
        min-height: 2em;
    }

    .runner .icon,
    .marker-tooltip .icon {
        height: 50px;
        width: 50px;

        display: block;
        overflow: hidden;

        border-radius: 0;
    }
        .runner .icon img,
        .marker-tooltip .icon img {
            height: 50px;
            width: 50px;
        }

    .runner .icon img {
        position: absolute;
    }

    .runner .icon .spectator {
        background-image: url("../img/megaphone-50x50-horizontal.e5c92d1cb528.png");
        position: absolute;
        width: 50px;
        height: 50px;
    }

    .runner .icon {
        position: relative;
        flex-shrink: 0;
        margin-right: 0.4em;
    }


    .runner .name {
        flex: 1;
        min-width: 0;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 500;
        line-height: var(--race-leading-tight);
    }
        .runner .name.multirow {
            white-space: normal;
            line-height: var(--race-leading-normal);
        }
    .runner .name.captain::after {
        content: '(captain)';
        display: block;
        font-size: .8em;
        line-height: var(--race-leading-tight);
        font-weight: 400;
    }
    .runner.spectator .name {
        flex: 1;
    }
    .spectator-listing-label {
        display: none;
    }
    .runner .team {
        display: block;
        margin-left: .4em;
        flex: 0 1 auto;
        max-width: 55%;

        font-size: .9em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .runner .team_of_runner {
        position: absolute;
        bottom: 2px;
        left: 55px;
        display: block;
        font-size: .75em;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        line-height: 1em;
        max-width: 50%;
    }

    .runner .place_number {
        display: block;
        flex-shrink: 0;
        text-align: right;
        margin-right: .4em;
        min-width: 30px;
    }

    .place_number.place-number-hidden {
        visibility: hidden;
    }

/* Common between first and second panel */
.distance {
    flex-shrink: 0;
    white-space: nowrap;
    text-align: right;
    margin-left: auto;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: var(--race-leading-tight);
}
    .distance.multirow,
    .distance.doublerow {
        line-height: var(--race-leading-normal);
    }
    .spectatorcount {
        font-size: 80%;
    }

.race-group-stats .runner.noimage {
    line-height: 1.5em;
    margin-bottom: .3em;
}
.race-group-stats .runner {
    flex-wrap: wrap;
}
.race-group-stats .runner .place_number {
    height: 2em;
}
.race-group-stats .runner .name {
    flex: 1;
    min-width: 0;
}
.race-group-stats .runner .distance {
    text-align: left;
    margin-left: 0;
}


.panel-block,
#race-info,
.panel-form {
    border: 1px solid var(--race-panel-border);
}

.search-form {
    margin: .5em .5em 1.5em;
}


/* Second Panel */
#chat-list {
    margin: .5em .5em;
    position: relative;
}

    #chat-comment-form {
        display: none;
    }

    #chat-form {
        margin: .5em .5em 1.5em;
    }

    .modal .submission_distance {
        font-weight: bold;
    }

    .log-miles-form .field {
        margin-top: 2px;
    }
        /*
        .log-miles-form .field:last-child {
            margin-bottom: 0;
        }
        */
        .log-miles-form input {
            height: 26px;
            padding: 0 2px 0 2px;

            border: 1px solid var(--race-input-border);
            border-radius: 0;
            -webkit-appearance: none;
        }
        .log-miles-form select {
            height: 28px;
            padding: 0 2px 0 2px;
            border: 1px solid var(--race-input-border);
            border-radius: 0;
        }
        .log-miles-form .date-input {
            width: 40px;
            text-align: center;
            margin-right: 2px;
        }
        .log-miles-form .activity-input {
            width: 118px;
            margin-right: 2px;
        }
        .log-miles-form .distance-input {
            width: 60px;
            margin-right: 2px;
        }
        .log-miles-form .unit-input {
            width: calc(100% - 236px);
        }
        .log-miles-form .comment-input {
            height: 3em;
        }
        .log-miles-form .location-input {
            width: calc(100% - 6px);
        }
        .log-miles-form .log-separator {
            clear: both;
            padding-top: 1px;
        }
        .log-miles-form .selected-image-container {
            text-align: center;
            margin-top: 6px;
        }
        .log-miles-form .selected-image-container a,
        .log-miles-form .selected-image-container .error,
        .log-miles-form .selected-image-container img {
            display: none;
        }
        .log-miles-form .selected-image {
            width: 100%;
            height: auto;
        }
        .log-miles-form .selected-image-group {
            position: relative;
            width: 60%;
            margin: 0 auto;
        }
        .log-miles-form .delete-selector {
            text-decoration: none;
            background-color: white;
            position: absolute;
            top: 4px;
            right: 4px;
            color: grey;
            border: 1px solid grey;
            border-radius: 4px;
        }
        .log-miles-form .rotate-selector {
            text-decoration: none;
            background-color: white;
            position: absolute;
            bottom: 8px;
            right: 4px;
            color: grey;
            border: 1px solid grey;
            border-radius: 4px;
        }
        .log-miles-form .initially-hidden {
            position: absolute;
            top: -1000px;
        }
        .log-miles-form .icon-camera-full {
            width: auto;
            margin-right: 4px;
        }
        .log-miles-form .icon-camera-full.turned-on {
            background-color: var(--race-input-hover-bg);
        }
        .log-miles-form .icon-camera-full.turned-on:hover {
            background-color: var(--race-panel-border);
        }
        .log-miles-form .button-add-remove {
            background: var(--race-panel-content-bg);
            border: 1px solid var(--race-input-border);
            width: auto;
            padding: 3px 6px;
        }
        .log-miles-form .button-add-remove.remove-log {
            float: left;
        }
        .log-miles-form .button-add-remove:hover {
            background: var(--race-input-hover-bg);
        }
        .log-miles-form .button-add-remove .icon-cancel {
            color: red;
        }
        .log-miles-form .button-add-remove .icon-plus-circle {
            color: var(--race-segment-selected);
        }
        .log-miles-form .button-submit {
            float: right;
        }
        .log-miles-form .hide-button {
            display: none;
        }

    .log-miles-form form.loading {
        position: relative;
    }
        .loading-message {
            display: none;
            position: absolute;
            bottom: -1px; /* form buttons are outside of form by 1 px; Who can tell me why?? */
            left: 0;
            right: 0;
            top: 0;
            padding-top: 2em;

            background: var(--race-panel-content-bg);
        }
            .loading-message p {
                margin-left: 75px;

                color: var(--race-text);
                font-size: .9em;
                text-shadow: 0 0 3px #fff;
            }

        .log-miles-form form.loading .loading-message {
            display: block;
        }

    .log-miles-form .error {
        margin-bottom: 0;
        padding: .1em .3em;
    }
        .log-miles-form .error.nofield {
            margin: .5em 0 0;
        }

    .log-miles-form textarea {
        -webkit-appearance: none;
        border-radius: 0;
    }

.panel p.empty {
    padding: .15em .4em 0em;
    margin: .5em;

    background: var(--race-panel-content-bg);
}


#header {
    background: var(--race-header-bg);
    color: var(--race-on-primary);
}
#panels .header,
.marker-tooltip {
    background: var(--race-header-bg);
    color: var(--race-on-primary);
}

    #panels .header:hover {
        background: var(--race-header-hover);
    }

    .marker-tooltip {
        color: var(--race-text);
    }

    .marker-tooltip .content {
        padding: .5em;
        background: var(--race-panel-content-bg);
        line-height: 50px;
    }

    .marker-tooltip .extra {
        padding: .5em;
        background: var(--race-success-bg);
        border-top: 1px solid var(--race-panel-border);
    }

    .marker-tooltip .extra .result-image {
        width: 290px;
        max-height: 128px;
        padding-top: 2px;
        text-align: center;
    }
        .marker-tooltip .extra .result-image img {
            max-width: 100%;
            max-height: 128px;
        }

    .marker-tooltip .extra-line {
        line-height: 36px;
        padding-left: 7px;
    }

        .marker-tooltip .extra-line .icon,
        .marker-tooltip .extra-line img {
            width: 36px;
            height: 36px;
        }

    .marker-tooltip .name {
        font-weight: bold;
        vertical-align: middle;
        display: inline-block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .marker-tooltip .content .name {
            width: 140px;
            font-size: 1.8em;
        }

        .marker-tooltip .content .distance {
            position: absolute;
            right: 0.8em;
        }

        .marker-tooltip .extra-line .icon {
            background-color: var(--race-input-disabled-text);
        }

        .marker-tooltip .extra-line .time {
            vertical-align: middle;
        }

    .marker-tooltip .extra-line .distance {
        position: relative;
        top: 2px;
    }


        .marker-tooltip .extra-line .name {
            max-width: 120px;
        }

        .marker-tooltip .extra .latest-text {
            text-align: center;
        }

        .marker-tooltip .extra-loading {
            height: 2em;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .marker-tooltip .extra-loading::after {
            content: "";
            display: block;
            width: 16px;
            height: 16px;
            border: 2px solid var(--race-panel-border);
            border-top-color: var(--race-primary);
            border-radius: 50%;
            animation: race-spin 0.6s linear infinite;
        }

#marker-tooltip-template {
    display: none;
}

#race-title,
#panels .header {
    text-shadow: 0 0 3px rgba(0,0,0,.5);
}

#map {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 3.15em; /* 1.8 * 1.75 // from .race-title */

    border: none;

    z-index: 50;
}

.marker-tooltip {
    position: absolute;
    padding: .5em .5em;
    font-size: .9em;
    width: 300px;
    z-index: 100;
    position: fixed;
}
    .marker-tooltip .header {
        margin: 0;

        font-size: 1.05em;
    }

.gmnoprint.control-type {
    right: 30px !important;
    top: 1px !important;
    bottom: initial !important;
}


/* team input label */
#completable_id_team_select {
    width: 100%;
    max-width: 100%;
}

form input[id^=id_team_name]:focus {
    padding-left:20%;
    width: 79%;
    max-width: 79%;
}

#id_field_team_name_helper {
    display: none;
    position: absolute;
    left: 4px;
    line-height: 1.5em;    
}

#id_user_type {
    margin: 0;
}

/* special views */
.route #header,
.route #djDebug,
.route #panels,
.route #footer,
.route.hidecontrols .gmnoprint,
.route.hidecontrols .gm-style-cc,
.route.hidecontrols .gm-style a { display: none !important; }
.route #map { top: 0; }
.route #map .gmnoprint:last-child { margin-top: auto }

/* mobile views */
#mobile-menu {
    left: .4em;
    top: .3em;

    font-size: 1.5em;
    font-weight: bold;
    line-height: 1.6em;

    cursor: pointer;
    text-transform: uppercase;
    transition: opacity .6s;
}
    #mobile-menu:hover {
        opacity: .7;
        transition: opacity .15s;
    }

.mobile-only { display: none; }

@media (max-width: 800px) {
    #race-title {
        padding: 0 7em 0 3.5em;
    }

    input, select, textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 640px) {
    #header {
        font-size: .8em;
    }

    #race-title {
        padding: 0 6em 0 2em;
    }

    #site img {
        height: 28px;
    }

    #site {
        top: .2em;
    }

    #map {
        top: 2.5em;
    }
    #login_logout {
        right: .7em;
    }
        #login_logout .runner .icon{
            height: 30px;
            width: 30px;
        }
}

@media (max-width: 480px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }

    #djDebug #djDebugToolbarHandle {
        display: none !important;
    }

    #logout_icon img {
        vertical-align: sub;
    }

    #login_logout .login_logout_container {
        height: 100%;
        display: flex;
        align-items: center;
    }

    #race-title {
        padding: 0;
        width: 55%;
        margin: 0 auto;
    }

    #header,
    #panels {
        position: relative;
    }

    #panels {
        display: none;

        left: 0;
        top: 0;
        width: auto;

        border: none;
        font-size: 0.95em;
        opacity: 1;
    }
        #panels.opened {
            margin: 0;
        }

    #panels,
    .panel {
        overflow: initial;
    }

    .panel + .panel {
        border-top: none;
    }

    #panels {
        flex-direction: initial;
    }

    .panel {
        background: transparent;
        box-shadow: none;
        flex-shrink: initial;
    }
    .panel.active {
        flex: initial;
        display: block;
    }

    .panel .header:before {
        display: none;
    }

    #panels.opened .header {
        display: none;
    }
    .panel.active .header {
        font-weight: 700;
    }
    #panels.opened .active .header {
        cursor: default;
        display: block;
        outline: none;
    }
        #panels.opened .active .header:hover {
            opacity: .9;
        }

        #panels.opened .active .header,
        #panels.opened .active .header:hover {
            transition: none;
        }

        #panels *:active {
            -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
               -moz-tap-highlight-color: rgba(0,0,0,0) !important;
                    tap-highlight-color: rgba(0,0,0,0) !important;
        }

    #panels.opened .map.active .header {
        display: none;
    }

    .panel.active > .content {
        display: none;
        position: relative;
    }
    #panels.opened .panel.active > .content {
        display: block;
        margin: 1em .5em;
    }

    .panel-form .completable {
        width: 100%;
    }

    .panel-block,
    #race-info,
    .panel-form {
        margin-left: 0;
        margin-right: 0;
        padding-left: 1em;
        padding-right: 1em;
    }
        .panel-form .field {
            width: 90%;
        }
            .panel-form .field .field {
                width: 78%;
            }

    .runner:hover {
        color: var(--race-text-muted);
    }
    .runner,
    .runner:hover {
        transition: none;
    }
        .runner .team {
            line-height: 1.6em;
        }

    .panel p.empty {
        margin: .5em 0 0;
    }

    .runner .name {
        flex: 1;
        min-width: 0;
    }

    .marker-tooltip {
        left: 5% !important;
        right: 5% !important;
        margin-top: 15px;
        width: auto;
    }

    .log-miles-form #field_date {
        width: 30%;
    }
    .log-miles-form #field_distance {
        width: 50%;
        margin: 0 .5em;
    }
    .log-miles-form #field_result_image {
        width: 15%;
    }
}

@media (max-width: 400px) {
    .log-miles-form input,
    .log-miles-form .qq-upload-button {
        height: 25px;
    }

    .log-miles-form #field_date {
        width: auto;
    }
    .log-miles-form #field_date .side-label {
        margin: 0 -6px;
        background-size: 32px;
    }
    .log-miles-form #field_distance {
        margin: 0 .6em;
        width: auto;
    }
        .log-miles-form #field_distance input {
            width: 2.75em;
        }
        .log-miles-form #field_distance .side-label select {
            padding-top: .15em;
            padding-bottom: .05em;
            font-size: 1em !important;
        }
    .log-miles-form #field_result_image {
        width: 14%;
    }
    .log-miles-form .qq-upload-button {
        padding: 0 0 0 1px;
        font-size: 17px;
    }
}

.meta.chat-like,
.meta.chat-comment,
.meta.like,
.meta.comment {
    transition: background 3s ease-out;
}

#signup-form-bottom-spacer {
    margin-bottom: 2.5em;
}

#field_entry_fee {
    width: 25%;
    margin-top: 1.5em;
}

.currency-input {
    font-size: 1.5em;
    margin: 0 auto;
    color: var(--race-input-text);
    text-align: center;
}

.currency-input span:not([class*=normal-span]) {
    position: absolute;
    left: 0.26em;
}

.currency-input input {
    display: inline;
    width: 82%;
    padding: 0 0 0 0.8em;
    border: 1px solid var(--race-input-border);
}

#field_entry_fee_caption_text {
    line-height: 1.2em;
    margin-bottom: 2em;
}

#field_promo_code {
    width: 78%;
    font-size: 0.7em;
    margin-bottom: 12px;
    margin-top: 12px;
}

#field_promo_code input,
#field_promo_code input.button {
    margin-top: 0;
    font-size: inherit;
    padding: 0 3px;
    display: inline-block;
    width:50%;
    box-sizing: border-box;
}
#field_promo_code input.button {
    color: var(--race-on-primary);
}
#field_promo_code input.button[disabled] {
    background-color: var(--race-disabled-bg);
    border-color: var(--race-disabled-border);
    opacity: .7;
}

.donate-fields,
.before-button-fields {
    line-height: normal;
}

#field_donate_text,
#field_address_text {
    font-weight: bold;
    margin-top: 1.5em;
}

#field_donate_text .html-display {
    text-align: center;
}

#donation-form #address-group-container,
#donation-form #address-group-2-container {
    margin-bottom: 0;
}

    #address-group-container .field,
    #address-group-2-container .field {
        display: inline-block;
        vertical-align: top;
    }

    #address-group-container .field input,
    #address-group-2-container .field input {
        padding: 0 2px;
    }

#field_city {
    width: 49%;
}

#field_state {
    width: 49%;
    left: 4px;
}

#field_region {
    width: 48%;
    left: 3px;
}

#field_country select,
#field_state select {
    padding: 0;
    width: 99%;
    height: 1.58em;
}

#field_country select:invalid,
#field_state select:invalid {
    color: var(--race-input-disabled-text);
}

#field_country select:invalid option,
#field_state select:invalid option {
    color: black;
}

#field_country {
    width: 50%;
}

#field_zip_code {
    width: 48%;
}

.total-amount {
    border: 1px solid var(--race-panel-border);
    display: inline;
    padding: 0 20px;
}

.referer_link {
    padding: 0.5em 1em 1em 0.5em;
    border: 1px solid var(--race-input-border);
    margin: 10px;
    word-break: break-word;
}

.choice-with-other-widget ul {
    margin: 1px;
    column-count: 2;
    -moz-column-count: 2;
    list-style: none;
}

.choice-with-other-widget ul li {
    line-height: 1.5em;
}

.choice-with-other-widget input[type="radio"] {
    margin-right: 0.2em;
}

.choice-with-other-widget input[type="number"] {
    padding: 0px 2px;
    width: 50%;
}

.about_rules {
    padding-left: 1em;
}

.race-bib .image {
    max-height: 218px;
    line-height: 157px;
    width: 100%;
    overflow: hidden;
}
.race-bib .image img {
    min-height: 157px;
    width:100%;
    margin: 1em auto;
    cursor: pointer;
}
.race-bib .image img.error,
.race-bib .image img.loading {
    display: none;
}
.race-bib .image::after {
    content: "\A\A patience human,\00a0 please do\A 10 pushups\A while we build your bib.";
    white-space: pre;
    line-height: 1.3em;
    color: var(--race-text-muted);
    display: block;
    position: relative;
    width: 100%;
    height: 157px;
    background: var(--race-panel-content-bg);
    border-radius: 5px;
    margin: 1em auto;
}

.pager-control {
    cursor: pointer;
}

.user-type-caption-text {
    font-weight: bold;
    margin-top: 0.2em;
}

#field_user_type_caption_text, #field_user_type {
    line-height: normal;
    margin-bottom: 1em;
}

#field_user_type_caption_text {
    margin-bottom: 0.2em;
}

.bling-offer {
    text-align: center;
    width: 78%;
    margin: 0 auto .5em;
}

.bling-offer .bling-offer-caption-text {
    font-weight: bold;
    margin-bottom: 0.2em;
    text-align: left;
}

.bling-offer .blings-container + .blings-container {
    margin-top: 1em;
}

.bling-offer .blings-container select {
    display: inline-block;
    width: 14em;
}

.bling-offer .blings-container .blings-radio {
    text-align: left;
}

.bling-offer .buy-button-container button {
    background-color: var(--race-bling-button);
    color: var(--race-on-primary);
    border: 1px solid transparent;
    border-width: 1px 0;
    font-weight: bold;
    border-radius: 2px;
    margin-top: 0.4em;
}

.bling-offer .samples, .bling-offer .eligible-blings {
    margin-top: 0.8em;
}

.bling-offer .bling-image {
    width: 100%;
    margin-top: 0.2em;
}

.bling-offer .samples img {
    display: none;
}

.bling-extra-html {
    display: none;
}

.blings-radio input[type=radio],
.blings-radio input[type=checkbox] {
    margin-top: 8px;
}

#race-signup {
    display: none;
}

#signup_form_show_button {
    margin:0 auto 0;
}

.image-thumbnail:hover {
    cursor: pointer;
}

.participation_and_achievements-content {
    text-align: center;
    margin: 1em;
}

.participation_and_achievements-content p, .participation_and_achievements-content h1 {
    margin: 0;
}

.participation_and_achievements-content .bold {
    font-weight: bold;
}

.panel .segments {
    padding: 0;
    max-width: 100%;
    width: 100%;
    line-height: 1em;
    text-align: center;
}

.panel .segments-items {
    overflow: hidden;
    border: none;
}

.panel .segments button {
    float: left;
    width: 50%;
    padding: 0.3em 0 .2em;
    border: 1px solid var(--race-input-border);
    border-right-width: 0;
    color: var(--race-input-text);
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--race-transition-slow), color var(--race-transition-slow);
    outline: none;
}
.panel .segments button:hover {
    background: var(--race-panel-content-bg);
}

.panel .segments button.selected {
    background: var(--race-segment-selected);
    color: var(--race-on-primary);
    text-shadow: 0 0 1px rgba(0,0,0,.3);
    transition: background-color var(--race-transition-fast), color var(--race-transition-fast);
}
.panel .segments button.selected:hover {
    background: var(--race-segment-selected);
}

.panel .segments button:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.panel .segments button:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    border-right-width: 1px;
}

/* ===========================================
   Accessibility: Focus Indicators
   =========================================== */
:focus {
    outline: none;
}
:focus-visible {
    outline: var(--race-focus-ring-width) solid var(--race-focus-ring);
    outline-offset: var(--race-focus-ring-offset);
    border-radius: var(--race-radius-sm);
}

/* Buttons — tighter offset + glow */
.panel-form button:focus-visible,
.panel-form input.button:focus-visible,
.charity-back-me:focus-visible,
.charity-back-us:focus-visible,
.team-join-button:focus-visible,
.panel .groupedbuttons-item:focus-visible,
.panel .segments button:focus-visible,
.bling-offer .buy-button-container button:focus-visible,
#result-share-container button:focus-visible,
#charity-footer button:focus-visible {
    outline-offset: 1px;
    box-shadow: 0 0 0 4px var(--race-primary-15);
}

/* Links within panels */
.panel a:focus-visible,
.runner-link:focus-visible {
    outline-offset: 1px;
}

/* Form inputs — border highlight instead of outline */
.panel-form form .field > input:focus-visible,
.panel-form select:focus-visible,
.panel-form textarea:focus-visible,
.search-form input:focus-visible,
.log-miles-form input:focus-visible,
.log-miles-form select:focus-visible,
.comment-form textarea:focus-visible,
.currency-input input:focus-visible {
    outline: none;
    border-color: var(--race-focus-ring);
    box-shadow: 0 0 0 3px var(--race-primary-15);
}

/* Panel headers (accordion toggles) */
.panel .header:focus-visible {
    outline-offset: -2px;
    background-color: var(--race-header-hover);
}


/* Shrink panels when charity footer banner is present */
body:has(#charity-footer) #panels {
    max-height: calc(100vh - 5em - 3.5em);
}


/* Dark mode glass morphism — disabled while dark mode is off
@media (min-width: 1024px) and (prefers-color-scheme: dark) {
    #panels {
        background: rgba(30, 33, 40, 0.88);
    }
}
*/
