#activeTripPane {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

#activeTripHeader {
    flex: 0 0 auto;
    padding: 12px;
    border-bottom: 1px solid var(--color-border);
}

#activeTripTitle {
    font-size: 16px;
    font-weight: 600;
}

#activeTripContent {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.tripSection {
    padding: 12px;
    border-bottom: 1px solid var(--color-border);
}

.tripSection h3 {
    margin: 0 0 10px 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--color-text-secondary);
}

#tripProgressDistance {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 10px;
}

#tripProgressDistance strong {
    font-size: 24px;
}

#tripProgressDistance span {
    color: var(--color-text-secondary);
}

#tripProgressBar {
    height: 8px;
    border-radius: 4px;
    background: var(--color-border);
    overflow: hidden;
}

#tripProgressValue {
    width: 0%;
    height: 100%;
    background: #4caf50;
}

#tripProfilePlaceholder,
#tripEventsContent {
    color: var(--color-text-secondary);
    font-size: 13px;
}

#tripOrientationButtons {
    display: flex;
    gap: 6px;
}

.tripOrientationButton {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
}

.tripOrientationButton.active {
    background: var(--color-border);
    font-weight: 600;
}

/* GPS / Replay choice (REPLAY-01, REPLAY-02) */
.tripSource {
    margin-top: 6px;
    font-size: 0.75rem;
}

.tripSourceRow,
.tripReplaySettings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}

.tripReplaySettings {
    margin-top: 4px;
}

.tripSourceLabel {
    font-weight: 600;
}

.tripReplaySettings input[type="number"] {
    width: 4.5em;
}

/* crosstrainer (TRAIN-01, TRAIN-05) */
.tripTrainer {
    flex-direction: column;
    align-items: stretch;
}

.tripTrainerRow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}

.trainerValues {
    font-variant-numeric: tabular-nums;
}

.trainerCalibrationTable {
    border-collapse: collapse;
    margin: 4px 0;
    font-variant-numeric: tabular-nums;
}

.trainerCalibrationTable th,
.trainerCalibrationTable td {
    padding: 1px 8px 1px 0;
    text-align: left;
}

.tripControls {
    display: flex;
    margin-top: 6px;
}

.tripControls button {
    border: none;
    padding: 6px 10px;
    font-size: 0.75rem;
    cursor: pointer;
}

#tripMainButton {
    flex: 1;
}

.tripStopButton {
    margin-left: 1px;
    opacity: 0.65;
}

.tripStopButton:disabled {
    opacity: 0.25;
    cursor: default;
}

#tripInfo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

/* ============================================================
   TRIP INFO — GPS DASHBOARD
   ============================================================ */

#tripInfo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.tripInfoCard {
    display: flex;
    align-items: center;
    gap: 14px;

    min-height: 74px;
    padding: 12px;

    background: #f5f5f5;
    border-radius: 7px;
}

.tripInfoIcon {
    width: 58px;
    flex: 0 0 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 42px;
    color: #4d5a61;
}

.tripInfoPrimary .tripInfoIcon {
    color: #2fa34a;
}

.tripInfoCard > div {
    min-width: 0;
}

.tripInfoLabel {
    display: block;

    font-size: 0.78rem;
    font-weight: 500;

    text-transform: uppercase;
    letter-spacing: 0.04em;

    color: #18232b;
}

.tripInfoCard strong {
    display: block;

    margin-top: 2px;

    font-size: 1.45rem;
    line-height: 1.1;

    font-weight: 700;
}

.tripInfoPrimary strong {
    font-size: 2rem;
}

.tripInfoElevation {
    grid-column: 1 / -1;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    min-height: 82px;
    padding: 10px 16px;

    background: #f5f5f5;
    border-radius: 7px;
}

.tripElevationValue {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 10px;
    align-items: center;
}

.tripElevationValue strong {
    font-size: 1.55rem;
    line-height: 1;
}

.tripElevationValue > span:last-child {
    grid-column: 2;

    margin-top: 3px;

    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tripElevationArrow {
    grid-row: 1 / 3;

    font-size: 2rem;
    font-weight: 700;
}

.tripElevationGain .tripElevationArrow {
    color: #2fa34a;
}

.tripElevationLoss .tripElevationArrow {
    color: #e53935;
}

.tripElevationDivider {
    width: 1px;
    height: 48px;
    background: #c8c8c8;
}

#tripProgressDistance {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.tripProgressDistanceValue {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.tripProgressDistanceValue strong {
    font-size: 1.7rem;
    line-height: 1;
}

.tripProgressDistanceValue span {
    font-size: 1rem;
}

#tripProgressPercentage {
    font-size: 1.7rem;
    line-height: 1;
    color: #238b3d;
}

.tripInfoIconSvg {
    width: 48px;
    height: 48px;
    color: #45545d;
    flex: 0 0 48px;
}

.tripInfoPrimary .tripInfoIconSvg {
    color: #2fa34a;
}

@media (max-width: 600px) {

    #tripInfo {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .tripInfoCard {
        gap: 8px;
        min-height: 68px;
        padding: 9px;
    }

    .tripInfoIconSvg {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
    }

    .tripInfoLabel {
        font-size: 0.65rem;
        line-height: 1.15;
    }

    .tripInfoCard strong {
        font-size: 1.25rem;
    }

    .tripInfoPrimary strong {
        font-size: 1.55rem;
    }

    .tripInfoElevation {
        min-height: 68px;
        padding: 8px 10px;
    }

    .tripElevationValue strong {
        font-size: 1.25rem;
    }

    .tripElevationArrow {
        font-size: 1.6rem;
    }
}

.tripEventRow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.tripEventStatus {
    width: 16px;
    text-align: center;
}

.tripCacheIcon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 10px;
    cursor: pointer;
    border: 2px solid currentColor;
}

.tripEventLabel {
    flex: 1;
}

.tripEventDistance {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tripEventRow.passed {
    opacity: 0.55;
}

.tripEventRow {
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    gap: 8px;
    padding: 6px 0;
    cursor: pointer;
}

.tripEventStatus {
    width: 16px;
    flex: 0 0 16px;
    text-align: center;
}

.tripCacheIcon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: 0 0 10px;
    border: 2px solid currentColor;
}

.tripEventText {
    min-width: 0;
    flex: 1;
}

.tripEventTitle {
    display: flex;
    gap: 6px;
    min-width: 0;
}

.tripEventTitle strong {
    flex: 0 0 auto;
}

.tripEventTitle span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tripEventMeta {
    font-size: 0.85em;
    opacity: 0.7;
    margin-top: 2px;
}

.tripEventDistance {
    flex: 0 0 auto;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.tripEventRow.passed {
    opacity: 0.55;
}

.tripEventRow.approaching {
    background: rgba(255, 193, 7, 0.12);
    border-left: 3px solid #f0b400;
    padding-left: 5px;
}

.tripEventRow.reached {
    background: rgba(34, 197, 94, 0.18);
    border-left: 3px solid #22c55e;
    padding-left: 5px;
    font-weight: 600;
    transition:
        background 0.2s ease,
        transform 0.15s ease;
}

#tripEventsContent {
    display: flex;
    flex-direction: column;
}

/* own position and trip map controls (UI-GO-01) */
.trailq-position svg {
    width: 40px;
    height: 40px;
    transition: transform .3s ease-out;
}

.trailq-position-halo {
    fill: #2f6db3;
    opacity: .18;
}

.trailq-position-arrow {
    fill: #2f6db3;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linejoin: round;
}

.trailq-position-dot {
    display: none;
    fill: #2f6db3;
    stroke: #ffffff;
    stroke-width: 3;
}

/* no direction yet: a dot instead of the arrow */
.trailq-position svg.no-heading .trailq-position-arrow {
    display: none;
}

.trailq-position svg.no-heading .trailq-position-dot {
    display: inline;
}

.trailq-trip-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.trailq-compass {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
    cursor: pointer;
    display: grid;
    place-items: center;
}

.trailq-compass img {
    width: 40px;
    height: 40px;
    display: block;
    transition: transform .3s ease-out;
    user-select: none;
}

/* own direction up: a ring in the primary colour */
.trailq-compass.heading {
    box-shadow: 0 0 0 3px var(--color-primary), 0 1px 4px rgba(0, 0, 0, .3);
}

.trailq-follow {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: grid;
    place-items: center;
    color: #2f6db3;
}

.trailq-follow svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.trailq-follow-dot {
    fill: currentColor;
    stroke: none;
}

@media (prefers-reduced-motion: reduce) {
    .trailq-position svg,
    .trailq-compass img {
        transition: none;
    }
}

/* Go dashboard: indicators, then the player controls (UI-GO-02) */
#tripIndicators {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.tripIndicator {
    background: var(--color-background);
    border-radius: 6px;
    padding: 6px 8px;
    display: grid;
    min-width: 0;
}

.tripIndicator strong {
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tripIndicator > span {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#tripDashboard #tripProgressBar {
    margin-top: 6px;
}

#tripControlRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.tripTransport {
    display: flex;
    gap: 8px;
}

.tripTransportButton {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}

.tripTransportButton svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.tripTransportButton.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-surface);
}

.tripTransportButton:disabled:not(.active) {
    opacity: 0.4;
    cursor: default;
}

.tripTransportButton:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.tripRecord {
    color: #c4462a;
}

/* ⏺ on: the trip is recorded (UI-SESSION-03) */
.tripTransportButton.tripRecord.recording {
    background: #c4462a;
    border-color: #c4462a;
    color: #fff;
}

.tripTransportButton.tripRecord.recording:disabled {
    opacity: 0.75;
}

.tripWakeLock {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}


/* elevation profile in Go (UI-GO-03) */
#tripProfileSvg {
    width: 100%;
    height: 120px;
    display: block;
}

#tripProfileSection.empty #tripProfileSvg {
    display: none;
}

.tripProfileArea {
    fill: #dcebe0;
}

.tripProfileCovered {
    fill: #2f6db3;
    opacity: .2;
}

.tripProfileLine {
    fill: none;
    stroke: var(--color-primary);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.tripProfilePosition {
    stroke: #2f6db3;
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.tripProfileDot {
    fill: #2f6db3;
    stroke: #ffffff;
    stroke-width: 2;
}

.tripProfileCache {
    fill: #d99a1e;
    stroke: #ffffff;
    stroke-width: 1;
}

.tripProfileLayers {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* slope indicator on the map (UI-GO-04) */
.trailq-slope {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 6px 10px 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 2px;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.trailq-slope svg {
    width: 104px;
    height: 56px;
    display: block;
}

.trailq-slope strong {
    font-size: 0.85rem;
}

.trailq-slope span {
    color: var(--color-text-secondary);
    font-size: 0.7rem;
}

.trailq-slope .trailq-slope-rest {
    color: var(--color-text);
    font-size: 0.8rem;
}

.trailq-slope {
    width: max-content;
}

.trailq-slope-base {
    stroke: var(--color-border);
    stroke-dasharray: 3 3;
}

.trailq-slope-line {
    stroke-width: 5;
    stroke-linecap: round;
    stroke: var(--color-text-secondary);
}

.trailq-slope.up .trailq-slope-line {
    stroke: #c4462a;
}

.trailq-slope.down .trailq-slope-line {
    stroke: #2f6db3;
}

.trailq-slope-end {
    fill: var(--color-surface);
    stroke: currentColor;
    stroke-width: 3;
}

.trailq-slope.up .trailq-slope-end {
    stroke: #c4462a;
}

.trailq-slope.down .trailq-slope-end {
    stroke: #2f6db3;
}

/* no zoom buttons in Go: pinch or scroll to zoom (UI-GO-01) */
body.phase-go .leaflet-control-zoom {
    display: none;
}

/* the percentage belongs to the small line of the first indicator */
.tripIndicator #tripProgressPercentage {
    font-size: inherit;
    font-weight: 600;
    color: var(--color-primary);
}

@media (max-width: 700px) and (orientation: portrait) {

    .tripIndicator strong {
        font-size: 1.25rem;
    }

    .tripIndicator {
        padding: 5px 8px;
    }
}

/* the chosen crosstrainer traject on the Go profile (UI-TRAJ-03) */
.tripProfileTraject {
    fill: var(--color-primary);
    fill-opacity: .18;
}

/* ===== Own events (UI-EVENT-03/04) ===== */

.tripProfilePlot {
    position: relative;
}

.tripProfileIcons {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tripProfileOwnIcon {
    position: absolute;
    transform: translate(-50%, -110%);
    font-size: 15px;
    line-height: 1;
    pointer-events: auto;
}

.tripProfileStretch {
    fill: none;
    stroke: #c2410c;
    stroke-width: 5;
    stroke-opacity: .55;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
}

.tripProfileLayers label {
    white-space: nowrap;
}

/* the switches in one "lagen" menu (UI-GO-10) */
.tripProfileLayersMenu summary {
    cursor: pointer;
    color: var(--color-primary);
}

.tripProfileLayersList {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 0 2px;
    font-size: 0.8rem;
    color: var(--color-text);
}

.tripOwnEventIcon {
    flex: 0 0 auto;
    width: 20px;
    text-align: center;
    font-size: 15px;
}

.tripAddEvent {
    margin-left: auto;
    font: inherit;
    font-size: 0.85rem;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    background: var(--color-surface);
    white-space: nowrap;
}

.tripAddEvent:disabled {
    opacity: .45;
    cursor: default;
}

.walkEventForm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}

.walkEventKinds {
    display: flex;
    gap: 4px;
}

.walkEventKinds input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.walkEventKinds label > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 17px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
}

.walkEventKinds input:checked + span {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary);
}

.walkEventForm input[type="text"] {
    flex: 1 1 140px;
    min-width: 0;
    font: inherit;
}

.walkEventFormButtons {
    display: flex;
    gap: 6px;
}

.walkEventFormButtons button {
    font: inherit;
    font-size: 0.85rem;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    background: var(--color-surface);
}

.walkEventFormButtons .walkEventPrimary {
    background: var(--color-primary);
    color: var(--color-surface);
}

.walkEventFormInfo {
    font-size: 0.8rem;
    color: var(--color-text-muted, #666);
}

/* the map marker of an own event */
.walkEventMapIcon {
    background: none;
    border: none;
}

.walkEventMapButton {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #c2410c;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.walkEventStretch {
    stroke: #c2410c;
}

/* stored or not stored at Stop (UI-SESSION-03) */
.tripSessionNotice {
    margin: 4px 0;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--color-border);
    font-size: 0.85rem;
}

/* ===== Burndown (UI-GO-07) ===== */

.burndownSvg {
    width: 100%;
    height: auto;
    max-height: 220px;
    display: block;
}

.burnGrid {
    stroke: var(--color-border);
    stroke-width: 1;
}

.burnAxis {
    stroke: var(--color-text-secondary, #666);
    stroke-width: 1;
}

.burnTick {
    fill: var(--color-text-secondary, #666);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.burndownSvg polyline {
    fill: none;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.burnProfile {
    stroke: #2f6db3;
    stroke-width: 2;
}

.burnGoal {
    stroke: #c2410c;
    stroke-width: 2;
    stroke-dasharray: 6 4;
}

.burnBest {
    stroke: #7c3aed;
    stroke-width: 2;
    stroke-dasharray: 2 3;
}

.burnSession {
    stroke: var(--color-text-secondary, #666);
    stroke-width: 1.5;
    opacity: .55;
}

.burnActual {
    stroke: var(--color-primary);
    stroke-width: 3.5;
}

.burnDot {
    fill: var(--color-primary);
}

.burnLead {
    margin: 0 0 4px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.burnEmpty {
    margin: 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary, #666);
}

.burnLegend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    font-size: 0.8rem;
    color: var(--color-text-secondary, #666);
}

.burnLegend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* a short sample of the line's stroke */
.burnLegend i {
    display: inline-block;
    width: 18px;
    height: 0;
    border-top: 3px solid currentColor;
}

.burnLegend i.burnProfile { border-top-color: #2f6db3; }
.burnLegend i.burnGoal { border-top: 3px dashed #c2410c; }
.burnLegend i.burnBest { border-top: 3px dotted #7c3aed; }
.burnLegend i.burnSession { border-top-color: var(--color-text-secondary, #666); }
.burnLegend i.burnActual { border-top: 4px solid var(--color-primary); }

/* ===== Photos on the way (UI-GO-06) ===== */

#leftPane {
    position: relative;
}

.tripPhotoCard {
    position: absolute;
    right: 12px;
    bottom: 28px;
    z-index: 900;
    width: 260px;
    max-width: 45%;
    padding: 6px;
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

body:not(.phase-go) .tripPhotoCard {
    display: none;
}

.photoAhead {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.photoAheadImage {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary, #666);
}

.photoAheadImage img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 6px;
}

.photoAheadLabel {
    font-size: 0.85rem;
    font-weight: 600;
}

.photoMapIcon {
    background: none;
    border: none;
}

/* a photo of another time of the same route: lighter (ROUTE-SAME-05) */
.photoMapIcon.otherTime .photoMapButton,
.tripProfilePhoto.otherTime {
    opacity: 0.55;
}

.photoMapIcon.otherTime .photoMapButton {
    border-style: dashed;
}

.photoMapButton {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #2f6db3;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

/* the phone screen only */
#tripPhotoSection {
    display: none;
}

@media (max-width: 700px) and (orientation: portrait) {

    .tripPhotoCard {
        display: none;
    }

    body[data-mobile-screen="photos"] #activeTripContent > :not(#tripPhotoSection) {
        display: none;
    }

    body[data-mobile-screen="photos"] #tripPhotoSection {
        display: block;
    }

    /* Go screens (UI-GO-08): the dashboard with figures, race and
       schema; the route with the profile and what is on the way */
    body[data-mobile-screen="dashboard"] #tripProfileSection,
    body[data-mobile-screen="dashboard"] #tripEventsSection {
        display: none;
    }

    body[data-mobile-screen="route"] #activeTripContent > :not(#tripProfileSection):not(#tripEventsSection):not(#tripRouteSummary) {
        display: none;
    }
}

/* the photo in a map popup (UI-GO-06) */
.photoPopup img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 50vh;
    object-fit: contain;
    border-radius: 4px;
}


/* ============================================================
   Opponents (UI-GHOST-01/02): map runner, profile dot, "Wedstrijd"
   ============================================================ */

.ghost-goal { --ghost-color: #c2410c; }
.ghost-profile { --ghost-color: #2f6db3; }
.ghost-best { --ghost-color: #7c3aed; }

.ghostBadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ghost-color, #666);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex: none;
}

.ghostBadge.ghostOwn {
    background: var(--color-primary);
}

.ghostMarker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ghost-color, #666);
    border: 2px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
    font-size: 15px;
    box-sizing: border-box;
}

.ghostMarker b {
    position: absolute;
    right: -6px;
    bottom: -6px;
    min-width: 15px;
    height: 15px;
    border-radius: 8px;
    background: #ffffff;
    color: var(--ghost-color, #666);
    font-size: 10px;
    line-height: 15px;
    text-align: center;
}

.tripProfileGhosts {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.ghostOnProfile {
    position: absolute;
    transform: translate(-50%, -50%);
    border: 1.5px solid #ffffff;
    box-sizing: border-box;
}

.tripRace {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-top: 8px;
    font-size: 13px;
}

.tripRaceTitle {
    font-weight: 600;
}

.tripRaceChoice {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tripRaceRanking {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-basis: 100%;
    margin: 0;
    padding-left: 22px;
}

.tripRaceRanking li span {
    vertical-align: middle;
}

.tripRaceRanking small {
    color: var(--color-text-secondary, #666);
    font-variant-numeric: tabular-nums;
}

.tripRaceOwn {
    font-weight: 600;
}

/* sessions as opponents, numbered 1-5 (UI-GHOST-01) */
.ghost-s1 { --ghost-color: #0f766e; }
.ghost-s2 { --ghost-color: #be185d; }
.ghost-s3 { --ghost-color: #b45309; }
.ghost-s4 { --ghost-color: #15803d; }
.ghost-s5 { --ghost-color: #475569; }

.burnSession1, .burnSession2, .burnSession3, .burnSession4, .burnSession5 {
    stroke-width: 2;
    opacity: 1;
}

.burnSession1 { stroke: #0f766e; }
.burnSession2 { stroke: #be185d; }
.burnSession3 { stroke: #b45309; }
.burnSession4 { stroke: #15803d; }
.burnSession5 { stroke: #475569; }

.burnLegend i.burnSession1 { border-top-color: #0f766e; }
.burnLegend i.burnSession2 { border-top-color: #be185d; }
.burnLegend i.burnSession3 { border-top-color: #b45309; }
.burnLegend i.burnSession4 { border-top-color: #15803d; }
.burnLegend i.burnSession5 { border-top-color: #475569; }

.tripRaceBody {
    display: contents;
}

.tripRaceSession {
    padding: 1px 2px 1px 4px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-variant-numeric: tabular-nums;
}

.tripRaceRemove {
    border: none;
    background: none;
    padding: 0 4px;
    cursor: pointer;
    color: var(--color-text-secondary, #666);
}

#tripRaceAddSession {
    max-width: 100%;
    font-size: 13px;
}

.tripRaceVibrate {
    color: var(--color-text-secondary, #666);
}

/* overtaking (UI-GHOST-04) */
.tripRaceNotice {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-basis: 100%;
    margin: 4px 0 0;
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--color-border);
    font-weight: 600;
}

.tripRaceNotice .ghostBadge {
    width: 10px;
    height: 10px;
    vertical-align: middle;
}

.tripRace[hidden],
.tripRaceNotice[hidden] {
    display: none;
}


/* ============================================================
   Before the start: a checklist (UI-GO-09)
   ============================================================ */

#activeTripPane[data-trip-state="idle"] #tripDashboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#activeTripPane[data-trip-state="idle"] #tripIndicators,
#activeTripPane[data-trip-state="idle"] #tripProgressBar,
#activeTripPane[data-trip-state="idle"] #tripRunLine,
#activeTripPane[data-trip-state="idle"] #tripFigureLine,
#activeTripPane[data-trip-state="idle"] #tripPauseButton,
#activeTripPane[data-trip-state="idle"] #tripStopButton,
#activeTripPane[data-trip-state="idle"] #tripAddEventButton,
#activeTripPane[data-trip-state="idle"] #tripAddEventForm {
    display: none;
}

#activeTripPane[data-trip-state="idle"] #tripSource { order: 1; }
#activeTripPane[data-trip-state="idle"] #tripRace { order: 2; }
#activeTripPane[data-trip-state="idle"] #tripExpect { order: 3; }
#activeTripPane[data-trip-state="idle"] #tripControlRow { order: 4; margin-top: 0; }
#activeTripPane[data-trip-state="idle"] #tripSessionNotice { order: 5; }

#activeTripPane:not([data-trip-state="idle"]) #tripExpect {
    display: none;
}

#activeTripPane[data-trip-state="idle"] .tripSource {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
    font-size: 0.9rem;
}

/* the source as three buttons side by side */
.tripSourceSeg {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.tripSourceSeg label {
    position: relative;
    display: block;
    text-align: center;
    cursor: pointer;
}

.tripSourceSeg label + label {
    border-left: 1px solid var(--color-border);
}

.tripSourceSeg input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tripSourceSeg span {
    display: block;
    padding: 7px 4px;
}

.tripSourceSeg input:checked + span {
    background: var(--color-primary);
    color: var(--color-surface);
    font-weight: 600;
}

.tripSourceSeg input:focus-visible + span {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.tripSourceSeg input:disabled + span {
    opacity: 0.45;
    cursor: default;
}

/* the source card: summary, settings behind "Wijzigen" */
.tripSourceCard {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--color-background, #f4f4f2);
}

.tripSourceCardHead {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tripSourceCardStatus {
    color: var(--color-text-secondary);
}

.tripSourceCardStatus.connected {
    color: var(--color-primary);
}

.tripSourceConnect {
    margin-left: auto;
}

.tripSourceCardSummary {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

/* a real button like "Verbinden", a link was overlooked (UI-GO-09) */
.tripSourceEdit {
    align-self: flex-start;
    cursor: pointer;
    font-size: 0.85rem;
}

.tripSourceSettings {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--color-border);
    font-size: 0.8rem;
}

.tripSourceSettings[hidden] {
    display: none;
}

/* connecting is in the card head */
.tripSourceSettings .tripTrainer > .tripTrainerRow:first-child {
    display: none;
}

/* traject and goal as rows of the checklist */
.tripChecklistRow label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.tripChecklistRow select {
    max-width: 65%;
}

#activeTripPane[data-trip-state="idle"] .tripChecklistRow:not(.hidden) {
    padding-bottom: 6px;
    border-bottom: 1px solid var(--color-border);
}

/* the expected trip */
.tripExpect {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--color-background, #f4f4f2);
    font-size: 0.85rem;
}

.tripExpect[hidden] {
    display: none;
}

.tripExpectLabel {
    flex-basis: 100%;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.tripExpectMain {
    font-weight: 600;
}

.tripExpectMore {
    color: var(--color-text-secondary);
}

/* ⏺ and a wide Start */
.tripPlayLabel {
    display: none;
}

#activeTripPane[data-trip-state="idle"] #tripControls {
    flex: 1;
}

#activeTripPane[data-trip-state="idle"] #tripPlayButton {
    flex: 1;
    width: auto;
    border-radius: 21px;
    display: flex;
    justify-content: center;
    gap: 6px;
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-surface);
    font-weight: 600;
}

#activeTripPane[data-trip-state="idle"] .tripPlayLabel {
    display: inline;
}


/* ============================================================
   During the trip (UI-GO-10)
   ============================================================ */

#activeTripPane:not([data-trip-state="idle"]) #tripDashboard {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#activeTripPane:not([data-trip-state="idle"]) #tripControlRow { order: 1; margin-top: 0; }
#activeTripPane:not([data-trip-state="idle"]) #tripAddEventForm { order: 2; }
#activeTripPane:not([data-trip-state="idle"]) #tripRunLine { order: 3; }
#activeTripPane:not([data-trip-state="idle"]) #tripIndicators { order: 4; }
#activeTripPane:not([data-trip-state="idle"]) #tripFigureLine { order: 5; }
#activeTripPane:not([data-trip-state="idle"]) #tripProgressBar { order: 6; margin-top: 0; }
#activeTripPane:not([data-trip-state="idle"]) #tripRace { order: 7; }
#activeTripPane:not([data-trip-state="idle"]) #tripSessionNotice { order: 8; }

/* the checklist and ⏺ are settled during the trip */
#activeTripPane:not([data-trip-state="idle"]) #tripSource,
#activeTripPane:not([data-trip-state="idle"]) #tripRecordButton {
    display: none;
}

.tripRunLine,
.tripFigureLine {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.tripFigureLine {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    font-variant-numeric: tabular-nums;
}

.tripFigureLine span span {
    color: var(--color-text);
}

#tripLead[data-kind="ahead"] { color: var(--color-primary); }
#tripLead[data-kind="behind"] { color: #c2410c; }

/* ⏹ armed: a second tap stops */
.tripStopLabel {
    display: none;
}

#tripStopButton.confirm {
    width: auto;
    padding: 0 12px;
    border-radius: 21px;
    display: flex;
    gap: 6px;
    border-color: #c2410c;
    color: #c2410c;
    font-weight: 600;
}

#tripStopButton.confirm .tripStopLabel {
    display: inline;
}

/* the Route screen's line: only on the phone during the trip */
#tripRouteSummary {
    display: none;
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.tripRouteSlope {
    font-weight: normal;
    color: var(--color-text-secondary);
}

@media (max-width: 700px) and (orientation: portrait) {

    body[data-mobile-screen="route"] #activeTripPane:not([data-trip-state="idle"]) #tripRouteSummary {
        display: block;
    }

    body[data-mobile-screen="dashboard"] #tripRouteSummary {
        display: none;
    }
}

