/*
 * 지도·고도표와 CP 표기의 표시 규칙이다. SVG 좌표와 CSS 크기, 모바일 스크롤/레이블 규칙을 별개로 검토한다.
 */
[data-course-route] {
    margin: 32px 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    min-width: 0;
    overflow: hidden;
}
[data-course-route] h2 {
    font-size: 24px;
}
.route-state {
    font-weight: 600;
    color: #245bff;
}
.route-map {
    height: 420px;
    width: 100%;
    border-radius: 10px;
    background: #f2f5f8;
}
[data-course-route] [hidden] {
    display: none!important;
}
.route-map-message:empty {
    display: none;
}
.route-map-message {
    background: #f2f5f8;
    border-radius: 10px;
    padding: 20px;
}
.route-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0;
}
.route-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 8px;
    font-size: 13px;
}
.route-key:before {
    content: '';
    display: inline-block;
    width: 22px;
    height: 4px;
    vertical-align: middle;
    margin-right: 6px;
    background: #a4aebe;
}
.route-key.observed:before {
    background: #0D99FF;
    height: 4px;
}
.route-key.estimated:before {
    background: #56B8FF;
    height: 3px;
}
.route-elevation {
    width: 100%;
    min-height: 220px;
}
.route-elevation svg {
    display: block;
    width: 100%;
    height: auto;
}
.route-grid {
    stroke: #e5e8ee;
    stroke-width: 1;
}
.route-axis {
    fill: #626976;
    font-size: 11px;
}
.route-area {
    fill: #f4f5f6;
    fill-opacity: 1;
}
.route-area-passed {
    fill: #e6f2eb;
    fill-opacity: 1;
}
.route-profile-line {
    fill: none;
    stroke: #a4aebe;
    stroke-width: 2;
    stroke-dasharray: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.route-profile-passed {
    fill: none;
    stroke: #56B8FF;
    stroke-width: 3;
    stroke-dasharray: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.route-profile-dot {
    fill: var(--nav-accent);
    stroke: none;
}
.route-current-line {
    stroke: var(--nav-accent);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}
.route-cp-line {
    stroke: #9ba7b7;
    stroke-dasharray: 2 5;
}
.route-position {
    font-weight: 600;
}
.route-basis {
    font-size: 13px;
    color: var(--muted);
}
.route-cp-marker {
    display: block;
    background: white;
    border: 1px solid #66758a;
    border-radius: 5px;
    padding: 2px 5px;
    font-size: 11px;
    white-space: nowrap;
    color: #26364a;
}
.route-runner-marker {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--nav-accent);
    pointer-events: none;
}
.route-runner-marker>span {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: currentColor;
}
.route-pulse-ring {
    animation: route-position-pulse 2s infinite ease-out;
    transform-origin: center;
    pointer-events: none;
}
.route-runner-marker>.route-pulse-ring {
    background: color-mix(in srgb,var(--nav-accent) 40%,transparent);
}
.route-profile-pulse .route-pulse-ring {
    fill: var(--nav-accent);
    fill-opacity: .4;
    stroke: none;
    transform-box: fill-box;
}
.route-pulse-ring:nth-child(2) {
    animation-delay: .6s;
}
.route-pulse-ring:nth-child(3) {
    animation-delay: 1.2s;
}
.route-pulse-dot {
    z-index: 1;
}
.route-profile-pulse {
    pointer-events: none;
}
@keyframes route-position-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}
[data-course-route][data-moving="false"] .route-pulse-ring {
    animation: none;
    opacity: 0;
}
@media(prefers-reduced-motion:reduce) {
    [data-course-route] .route-pulse-ring {
        animation: none;
        opacity: 0;
    }
}
[data-course-route] .muted {
    overflow-wrap: anywhere;
}
@media(max-width:600px) {
    [data-course-route] {
        padding: 16px;
        margin: 24px 0;
    }
    [data-course-route] h2 {
        font-size: 21px;
    }
    .route-map {
        height: 330px;
    }
    .route-actions .button {
        padding: 9px 13px;
    }
    .route-position {
        font-size: 14px;
    }
    .route-elevation {
        margin-left: -10px;
        width: calc(100% + 20px);
    }
}
.route-profile-observed {
    fill: none;
    stroke: #0D99FF;
    stroke-width: 4;
    stroke-dasharray: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
body:not(.staff-app-body) .route-course-guide[data-course-route] {
    margin: 40px 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    min-width: 0;
    overflow: hidden;
}
@media(max-width:600px) {
    body:not(.staff-app-body) .route-course-guide[data-course-route] {
        margin: 30px 0;
    }
    body:not(.staff-app-body) .route-course-guide .route-elevation {
        margin-left: 0;
        width: 100%;
    }
}
.route-key.course-map:before {
    background: #0D99FF;
    height: 3px;
}
.route-cp-connector {
    fill: none;
    stroke: #a4aebe;
    stroke-width: 1;
    opacity: .35;
}
.route-cp-label {
    paint-order: stroke;
    stroke: white;
    stroke-width: 3px;
    stroke-linejoin: round;
}
.route-map-frame {
    position: relative;
    min-width: 0;
    height: 420px;
    overflow: hidden;
    border-radius: 10px;
    isolation: isolate;
}
.route-map-frame>.route-map {
    width: 100%!important;
    height: 100%!important;
}
.route-wheel-hint {
    display: none;
}
@media (hover: hover) and (pointer: fine) {
    .route-wheel-hint:not([hidden]) {
        position: absolute;
        inset: 0;
        z-index: 90;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        background: rgba(0,0,0,.45);
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.6;
        text-align: center;
        pointer-events: none;
    }
}
@media(max-width:600px) {
    .route-map-frame {
        height: 330px;
    }
}
.route-fullscreen {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 100;
    width: 40px;
    height: 40px;
    padding: 9px;
    border: 1px solid #ccd1d8;
    border-radius: 6px;
    background: #fff;
    color: #20242b;
    box-shadow: 0 2px 6px #0002;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.route-fullscreen:hover {
    background: #f1f5f9;
}
.route-fullscreen:focus-visible {
    outline: 3px solid var(--blue,#245bff);
    outline-offset: 2px;
}
.route-fullscreen svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}
.route-fullscreen[hidden],.route-fullscreen .route-close-icon {
    display: none;
}
.is-map-fullscreen .route-fullscreen .route-expand-icon {
    display: none;
}
.is-map-fullscreen .route-fullscreen .route-close-icon {
    display: block;
}
.route-map-frame:fullscreen {
    width: 100%;
    height: 100%;
    background: #fff;
}
.route-map-frame.is-map-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 100000;
    width: 100%;
    height: 100%;
    background: #fff;
}
.route-map-frame.is-map-fullscreen .route-map,.route-map-frame:fullscreen .route-map {
    width: 100%;
    height: 100%;
    border-radius: 0;
}
.route-map-frame.is-map-fullscreen .route-fullscreen {
    top: max(12px,env(safe-area-inset-top));
    right: max(12px,env(safe-area-inset-right));
}
@media print {
    .route-fullscreen {
        display: none;
    }
}
.route-cp-marker {
    padding: 1px 4px;
    font-size: 10px;
    line-height: 1.4;
    background: #fff;
    color: #26364a;
    border: 1px solid #66758a;
    border-radius: 3px;
}
@media(min-width:768px) {
    body:not(.staff-app-body) .route-map {
        height: auto;
        min-height: 0;
        aspect-ratio: 16/9;
    }
    body:not(.staff-app-body) .route-map-frame:not(.is-map-fullscreen):not(:fullscreen) {
        height: auto;
        aspect-ratio: 16/9;
    }
    body:not(.staff-app-body) .route-map-frame.is-map-fullscreen .route-map,body:not(.staff-app-body) .route-map-frame:fullscreen .route-map {
        height: 100%;
        aspect-ratio: auto;
    }
}
.route-cp-marker.route-start-marker {
    color: #39ff14;
    border-color: #39ff14;
}
.route-cp-marker:not(.route-start-marker) {
    color: #ff3030;
    border-color: #ff3030;
}
/* Naver wraps HTML markers in a hit area; the decorative runner must not cover CP buttons. */
.route-map div:has(>.route-runner-marker) {
    pointer-events: none!important;
}
.route-km-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    border: 1px solid #26364a;
    border-radius: 50%;
    background: #fff;
    color: #15171b;
    font-family: Arial,sans-serif;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}
.route-km-marker.route-km-wide {
    width: 26px;
    height: 26px;
}
.route-map div:has(>.route-km-marker) {
    pointer-events: none!important;
}
.route-km-key:before {
    content: '1';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    margin-right: 5px;
    border: 1px solid #26364a;
    border-radius: 50%;
    background: #fff;
    color: #15171b;
    font: 600 10px Arial,sans-serif;
    vertical-align: middle;
}
button.route-cp-marker {
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}
button.route-cp-marker:focus-visible {
    outline: 3px solid #0D99FF;
    outline-offset: 2px;
}
.route-cp-link {
    position: absolute;
    inset: 0;
    z-index: 109;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}
.route-cp-link polyline {
    fill: none;
    stroke: #EE5D44;
    stroke-width: 2;
    stroke-linecap: butt;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
.route-cp-info {
    position: absolute;
    z-index: 110;
    left: 10px;
    top: 56px;
    width: 160px;
    max-width: none;
    max-height: none;
    overflow: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    padding: 10px;
    background: #fff;
    color: #20242b;
    border: 1px solid #cdd5df;
    border-radius: 10px;
    box-shadow: 0 4px 18px #0003;
    text-align: left;
    font-size: 12px;
    line-height: 1.5;
}
.route-cp-info[hidden] {
    display: none;
}
.route-cp-info {
    touch-action: none;
    cursor: grab;
    user-select: none;
}
.route-cp-info.is-dragging {
    cursor: grabbing;
}
.route-cp-info h3 {
    margin: 0 28px 3px 0;
    font-size: 15px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    white-space: nowrap;
    overflow: hidden;
}
.route-cp-info-close {
    position: absolute;
    right: 1px;
    top: 5px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 5px;
    background: #fff;
    color: #394454;
    font-size: 18px;
    cursor: pointer;
}
.route-cp-info-close:focus-visible {
    outline: 2px solid #0D99FF;
}
.route-cp-info dl {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    gap: 0;
    margin: 0;
}
.route-cp-info dt,.route-cp-info dd {
    margin: 0;
    padding: 4px 0;
    border-bottom: 1px solid #edf0f3;
    overflow-wrap: anywhere;
}
.route-cp-info dd {
    text-align: right;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    padding-left: 10px;
}
.route-cp-info p {
    margin: 10px 0 0;
    color: #697586;
    font-size: 11px;
    overflow-wrap: anywhere;
}
@media print {
    .route-cp-info,.route-cp-link {
        display: none;
    }
}
