.course-map-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 380px;
    min-height: 300px;
    overflow: hidden;
    isolation: isolate;
    border-radius: 10px;
    background: #e7f0f6;
}
.course-map-canvas { width: 100%; flex: 1; min-height: 0; }
.course-map-overlay {
    position: relative;
    z-index: 520;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 8px 12px;
    border-top: 1px solid #d5e3f0;
    background: #fff;
}
.course-map-overlay .course-map-legend { flex: 1 1 100%; margin: 0; gap: 6px 14px; }
.course-map-radius-note { flex: 1; color: #466485; font-size: 11px; line-height: 1.5; }
.course-map-overlay .course-map-action { flex: 0 0 auto; }
.course-map-preview {
    position: absolute;
    inset: 0;
    z-index: 500;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    touch-action: pan-y;
}
.course-map-preview:focus-visible { outline: 3px solid #2475dc; outline-offset: -3px; }
.course-map-state {
    position: absolute;
    inset: 0;
    z-index: 510;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-radius: 10px;
    background: #eef5fa;
    color: #19395f;
    text-align: center;
    font-size: 14px;
}
.course-map-state[hidden], .course-map-preview[hidden], .course-map-action[hidden] { display: none; }
.course-map-state-warning { inset: 10px 12px auto 68px; padding: 8px; border: 1px solid #c5d9ed; background: rgba(255, 255, 255, .94); pointer-events: none; }
.course-map-state-warning button { pointer-events: auto; }
.course-map-canvas .amap-toolbar { transform: scale(1.3); transform-origin: top left; }
.course-map-canvas .amap-info-close { display: grid; place-items: center; width: 44px; height: 44px; right: 0; top: 0; }
.course-map-canvas .amap-info-content { padding-right: 40px; max-width: 300px; }
.course-map-canvas .amap-marker:focus-visible { outline: 2px solid #2475dc; outline-offset: 3px; }
.course-map-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    margin: 12px 0 6px;
    color: #19395f;
    font-size: 12px;
    line-height: 1.5;
}
.course-map-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.course-map-role {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
}
.course-map-role.creator { background: #0d6efd; }
.course-map-role.member { background: #198754; }
.course-map-role.course { background: #dc3545; }
.course-map-role.origin { background: #b7791f; }
.course-map-ring-line { display: inline-block; width: 24px; border-top: 2px solid #52789c; }
.course-map-ring-line.dashed { border-top-style: dashed; }
.course-map-ring-line.dotted { border-top-style: dotted; }
.course-map-marker { border: 0; background: transparent; }
.course-map-marker-content {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    height: 24px;
    background: transparent;
}
.course-map-marker-role {
    position: relative;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    box-sizing: border-box;
    border: 1px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 1px 2px rgba(25, 57, 95, .25);
}
.course-map-marker-role::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: #fff;
}
.course-map-marker-role.creator { background: #0d6efd; }
.course-map-marker-role.member { background: #198754; }
.course-map-marker-role.course { background: #dc3545; }
.course-map-marker-role.origin { background: #b7791f; }
.course-map-radius-icon { border: 0; background: transparent; }
.course-map-radius-label {
    display: block;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(255,255,255,.86);
    color: #315d82;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}
.course-map-popup { min-width: 190px; color: #293b4d; font-size: 13px; line-height: 1.65; }
.course-map-popup-entry + .course-map-popup-entry { margin-top: 9px; padding-top: 8px; border-top: 1px solid #e5ebf0; }
.course-map-popup .course-map-role { width: auto; height: auto; margin-bottom: 3px; padding: 2px 7px; border-radius: 999px; }
.course-map-popup-row { display: flex; gap: 6px; }
.course-map-popup-row b { flex: 0 0 62px; color: #6c7d8d; font-weight: 600; }
.course-map-popup-row span { min-width: 0; overflow-wrap: anywhere; }
.course-map-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
    color: #19395f;
}
.course-map-dialog[open] { display: flex; flex-direction: column; }
.course-map-dialog::backdrop { background: rgba(25, 57, 95, .5); }
.course-map-dialog-head, .course-map-dialog-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
}
.course-map-dialog-head h2 { margin: 0; font-size: 18px; }
.course-map-dialog-body { flex: 1; min-height: 0; }
.course-map-dialog-body .course-map-shell { height: 100%; min-height: 0; border-radius: 0; }
.course-map-dialog-body .course-map-overlay { padding-bottom: 8px; }
.course-map-dialog-foot { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
.course-map-dialog-foot > span { font-size: 12px; }
.course-map-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #c5d9ed;
    border-radius: 8px;
    background: #fff;
    color: #195da8;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.course-map-action:hover { background: #eaf4ff; }
.course-map-action:focus-visible { outline: 2px solid #2475dc; outline-offset: 2px; }
@media (min-width: 769px) {
    .course-map-shell { height: 420px; }
}
@media (max-width: 768px) {
    .course-map-shell { height: 360px; }
    .course-map-dialog-foot { flex-wrap: wrap; }
    .course-map-dialog-head h2 { font-size: 16px; }
}
