#panel {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 400px;
    max-width: 92vw;
    display: none;
    flex-direction: column;
    border-radius: 40px;
    background: rgba(20, 20, 20, 0.5);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(50px) saturate(200%);
    -webkit-backdrop-filter: blur(50px) saturate(200%);
    box-shadow: 0 30px 100px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.08);
    color: white;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", Arial;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    transition: 0.35s cubic-bezier(.2,.9,.2,1);
}
#panel.show { opacity: 1; transform: translateY(0) scale(1); }

#panel_img {
    height: 180px;
    position: relative;
    background: #111;
    background-size: cover;
    background-position: center;
}
#panel_img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0), rgba(0,0,0,0.85));
}

#panel_top_info {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
    display: flex;
    gap: 8px;
}

#p_zadanie_badge,
#p_taborowy_badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 6px 14px;
    border-radius: 14px;

    font-size: 12px;
    font-weight: 800;

    line-height: 1;
}

#p_zadanie_badge {
    background: #ffd500;
    color: black;
}

#p_taborowy_badge {
    background: #baffba;
    color: black;
}

#panel_title {
    position: absolute;
    bottom: 16px;
    left: 20px;
    z-index: 2;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

#p_id {
    margin: 16px 20px 4px 20px;
    font-size: 15px;
    font-weight: 600;
    opacity: 0.7;
    letter-spacing: 0.5px;
}

.status_bar {
    display: flex;
    justify-content: space-between;
    margin: 8px 20px 0 20px;
    padding: 12px 16px;
    border-radius: 20px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    font-weight: 600;
}

.section {
    margin: 12px 20px;
    opacity: 0;
}
.section_title {
    font-size: 11px;
    opacity: 0.5;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

#stops_container {
    cursor: pointer;
}

#stops_preview, #full_stops_list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#full_stops_list {
    display: none;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 6px;
}

#full_stops_list::-webkit-scrollbar { width: 4px; }
#full_stops_list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; }

#panel.show-full-route #stops_preview { display: none; }
#panel.show-full-route #full_stops_list { display: flex; }
#panel.show-full-route #stats_section { display: none; }

.stop_item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    opacity: 0.5;
    transition: 0.2s;
    padding: 4px 0;
}
.stop_item.active {
    opacity: 1;
    color: #4facfe;
    font-weight: 700;
}
.stop_dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
}
.stop_item.active .stop_dot {
    background: #4facfe;
    box-shadow: 0 0 12px #4facfe;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.box {
    padding: 16px;
    border-radius: 24px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
}
.box.full { grid-column: span 2; }

.icon {
    font-size: 12px;
    opacity: 0.5;
    margin-bottom: 6px;
    font-weight: 600;
}

#close {
    position: absolute;
    top: 14px;
    right: 14px;
    cursor: pointer;
    font-size: 22px;
    opacity: 0.6;
    z-index: 10;
    transition: 0.2s;
}
#close:hover { opacity: 1; transform: scale(1.1); }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
#panel.show .section {
    animation: fadeUp 0.5s cubic-bezier(.2,.9,.2,1) forwards;
    animation-delay: var(--d);
}

@media (max-width:700px){

    #panel{
        left:0;
        right:0;
        bottom:0;
        width:100%;
        max-width:100%;
        height:65%;
        border-radius:28px 28px 0 0;
        box-shadow:0 -20px 80px rgba(0,0,0,0.6);
        overflow-y:auto;
        -webkit-overflow-scrolling: touch;
        max-height:100vh;
    }

    #panel_img{
        height:150px;
    }

    #p_id{
        font-size:18px;
        margin:14px 16px 4px 16px;
    }

    .section{
        margin:12px 16px;
    }

    .status_bar{
        margin:8px 16px 0 16px;
    }

    .box{
        padding:14px;
        border-radius:20px;
    }

    .stop_item{
        font-size:14px;
    }

}

.stop_item{
    display:flex;
    align-items:center;
    gap:8px;
}

.stop_name{
    flex:1;
}

.stop_meta{
    font-size:12px;
    opacity:.75;
    white-space:nowrap;
}