.course-cell-switch {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 40px;
    cursor: pointer;
    margin: 0;
}
.course-cell-box {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--color-surface);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 14px 14px;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}
.course-cell-box:hover { border-color: var(--color-primary); }
.course-cell-box:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.course-cell-box:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-subtle);
}
.course-cell-box:disabled { opacity: .5; cursor: not-allowed; }
.course-cell-legend-row {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    min-height: 28px;
}
.course-cell-legend-row > span { flex: 1; min-width: 0; text-wrap: balance; }
.course-cell-swatch { flex: none; margin-top: .45em; }
.course-cell-legend-row .course-cell-swatch { margin-top: .45em; }
.course-cell-legend-item { display: inline-block; max-width: 100%; }
.course-cell-legend-item-nowrap { white-space: nowrap; }

#course-map .leaflet-bar,
#ccm-map .leaflet-bar {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: none;
    overflow: hidden;
}
#course-map .leaflet-bar a,
#ccm-map .leaflet-bar a {
    background-color: var(--color-surface);
    color: var(--color-text);
    border-bottom-color: var(--color-border);
}
#course-map .leaflet-bar a:hover,
#ccm-map .leaflet-bar a:hover { background-color: var(--color-bg-subtle); }
#course-map .leaflet-control-attribution,
#ccm-map .leaflet-control-attribution {
    background-color: color-mix(in srgb, var(--color-surface) 80%, transparent);
    color: var(--color-text-muted);
    font-size: 10px;
    line-height: 1.3;
    max-width: calc(100% - 12px);
}
#course-map .leaflet-control-attribution a,
#ccm-map .leaflet-control-attribution a { color: var(--color-text-muted); }

.course-plan-pill.leaflet-tooltip {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: 999px;
    padding: 1px 6px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    box-shadow: none;
    pointer-events: none;
}
.course-plan-pill.leaflet-tooltip-top::before {
    display: none;
}
.course-plan-chip {
    position: absolute;
    top: .5rem;
    right: .5rem;
    z-index: 500;
    pointer-events: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: 999px;
    padding: .25rem .75rem;
    font-size: .8rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    max-width: calc(100% - 1rem);
}
.course-plan-aim {
    font-size: .9rem;
    color: var(--color-text-muted);
}

#course-map .leaflet-popup-content a.course-popup-link,
#ccm-map .leaflet-popup-content a.course-popup-link {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
#course-map .leaflet-popup-content a.course-popup-link:hover,
#ccm-map .leaflet-popup-content a.course-popup-link:hover {
    color: var(--color-primary-dark, var(--color-primary));
}
.course-stretch-cue {
    flex: none;
    color: var(--color-text-muted);
    font-size: .9rem;
}

@keyframes course-landed-row {
    from { box-shadow: inset 0 0 0 9999px var(--color-primary-subtle); }
    to { box-shadow: inset 0 0 0 9999px transparent; }
}
tr[id^="station-"]:target > td,
tr[id^="station-"]:target > th {
    background-color: transparent;
    animation: course-landed-row 2s ease-out;
}
@media (prefers-reduced-motion: reduce) {
    tr[id^="station-"]:target > td,
    tr[id^="station-"]:target > th {
        animation: none;
        box-shadow: inset 0 0 0 9999px var(--color-primary-subtle);
    }
}
