.public-route-panel {
    position: absolute;
    z-index: 8;
    inset-inline-start: 1rem;
    bottom: 2.25rem;
    width: min(22rem, calc(100% - 6rem));
    max-height: 50%;
    overflow: auto;
    overscroll-behavior: contain;
    padding: .8rem 1rem;
    border: 1px solid #d6c8df;
    border-radius: .85rem;
    background: #fffcf7;
    color: #2d2336;
    box-shadow: 0 5px 20px #271b3224;
}
.public-route-panel header { display: flex; align-items: center; gap: .6rem; justify-content: space-between; }
.public-route-panel h2 { font-size: 1rem; margin: .25rem 0; }
.public-route-panel h3 { font-size: .96rem; }
.public-route-panel p { margin: .35rem 0; }
.public-route-panel button, .public-route-panel summary { cursor: pointer; min-height: 2rem; }
.public-route-icon { display: inline-grid; place-items: center; line-height: 1; }
.public-route-icon--stop { width: .8rem; height: .8rem; border-radius: .12rem; background: currentColor; }
.public-route-button-label { display: inline; }
.public-route-panel button[aria-current="true"] { font-weight: bold; }
.public-route-panel ol { padding-inline-start: 1.6rem; }
.public-route-marker {
    width: 2rem;
    height: 2rem;
    border: 2px solid white;
    border-radius: 50%;
    background: #61359b;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 5px #271b3266;
    cursor: pointer;
}
.public-route-marker[data-endpoint="start"] { background: #286447; }
.public-route-marker[data-endpoint="finish"] { background: #842a4e; border-style: dashed; }
.public-route-marker[aria-current="true"] { outline: 3px solid #271b32; }
@media (max-width: 640px) {
    .public-route-panel { bottom: calc(2rem + env(safe-area-inset-bottom)); max-height: 40%; }
    .public-route-panel header h2 { min-width: 0; flex: 1 1 auto; }
    .public-route-panel [data-route-panel-toggle],
    .public-route-panel [data-route-close] {
        flex: 0 0 auto;
        min-height: 2.75rem;
        min-width: 2.75rem;
        border: 1px solid #d6c8df;
        border-radius: .4rem;
        background: transparent;
        color: inherit;
        padding: .25rem .55rem;
    }
    .public-route-panel--compact {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: .35rem;
        row-gap: .1rem;
        max-height: none;
        overflow: visible;
        padding: .45rem .6rem .5rem;
        width: min(24rem, calc(100% - 2rem));
    }
    .public-route-panel--compact header {
        grid-column: 1 / -1;
        gap: .25rem;
    }
    .public-route-panel--compact h2 {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .875rem;
        margin: 0;
    }
    .public-route-panel--compact .public-route-button-label { display: none; }
    .public-route-panel--compact .public-route-icon { font-size: 1.1rem; }
    .public-route-panel--compact [data-route-compact-summary] {
        grid-column: 1;
        grid-row: 2;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .8rem;
        margin: .15rem 0 .2rem;
        line-height: 1.2;
    }
    .public-route-panel--compact [data-public-gps-controls] {
        display: contents;
    }
    .public-route-panel--compact [data-public-gps-controls][hidden] { display: none; }
    .public-route-panel--compact .public-gps-actions {
        grid-column: 2;
        grid-row: 2;
        align-items: center;
        gap: .25rem;
        justify-content: end;
        margin-top: 0;
    }
    .public-route-panel--compact .public-gps-actions button {
        display: inline-grid;
        place-items: center;
        flex: 0 0 2.75rem;
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        border-radius: .55rem;
    }
    .public-route-panel--compact [data-public-gps-status] {
        grid-column: 1 / -1;
        grid-row: 3;
        display: block;
        max-width: 100%;
        margin: .1rem 0 0;
        font-size: .72rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }
    .public-route-panel--compact [data-public-gps-status]:empty { display: none; }
    .public-route-panel--compact [data-public-gps-recenter] .public-route-button-label { display: none; }
    .public-route-panel--compact [data-public-gps-recenter] { margin: 0; }
    .public-route-panel--compact [data-public-gps-recenter][hidden] { display: none; }
    .public-route-panel--compact button:focus-visible { outline: 3px solid #f1a208; outline-offset: 2px; }
    .public-route-panel--compact [data-route-panel-toggle] .public-route-icon--chevron {
        transform: rotate(180deg);
    }
}

[data-public-gps-controls][hidden], [data-public-gps-recenter][hidden] { display: none; }
.public-gps-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .55rem; }
.public-gps-actions button, [data-public-gps-recenter] { min-width: 44px; min-height: 44px; padding: .55rem .75rem; border: 1px solid #61359b; border-radius: .45rem; background: #61359b; color: #fff; font-weight: 700; }
.public-gps-actions button:disabled { opacity: .55; cursor: not-allowed; }
[data-public-gps-stop] { background: #842a4e; border-color: #842a4e; }
[data-public-gps-recenter] { background: transparent; color: #61359b; margin-top: .45rem; }
