/* TEPLOHODIKI: /ship-map route with dated itinerary (V3). Only linked on /ship-map. */
html body #prtmx-v59-initial-header,
html body #prtmx-v59-initial-dock,
html body #prtmx-ui-v52-header,
html body #prtmx-v511-mapbar,
html body #prtmx-v510-mapbar,
html body .prtmx-ui-header,
html body .prtmx-ui-dock,
html body .bottom-nav,
html body .board-bottom-nav,
html body .vessel-head,
html body .vessel-panel,
html body .brief-bar { display:none !important; visibility:hidden !important; }
html,html body {margin:0!important;padding:0!important;height:100%!important;overflow:hidden!important}
html body #map {position:fixed!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;border:0!important;border-radius:0!important}
html body #prtmx-route-v3-topbar {
  position:fixed!important;top:calc(env(safe-area-inset-top,0px) + 10px)!important;
  left:50%!important;right:auto!important;transform:translateX(-50%)!important;
  box-sizing:border-box!important;z-index:2147483000!important;
  display:flex!important;visibility:visible!important;opacity:1!important;
  justify-content:space-between!important;align-items:center!important;gap:10px!important;
  width:min(390px,calc(100vw - 18px))!important;min-height:54px!important;
  background:rgba(255,255,255,.98)!important;border:1px solid #d2e1f0!important;
  border-radius:18px!important;box-shadow:0 6px 20px rgba(15,59,101,.17)!important;
  padding:7px 10px!important;color:#18354d!important;pointer-events:auto!important;
  font:600 14px/1.25 system-ui,sans-serif!important;
}
html body #prtmx-route-v3-topbar * {box-sizing:border-box!important}
html body #prtmx-route-v3-topbar .prtmx-route-v3-brand {display:flex!important;align-items:center!important;min-width:0!important;max-width:200px!important;flex:0 1 155px!important;overflow:hidden!important}
html body #prtmx-route-v3-topbar .prtmx-route-v3-brand img {display:block!important;object-fit:contain!important;object-position:left center!important;width:100%!important;max-width:165px!important;height:auto!important;max-height:40px!important}
html body #prtmx-route-v3-topbar details {position:relative!important;display:block!important;flex:none!important}
html body #prtmx-route-v3-topbar details>summary {list-style:none!important;cursor:pointer!important;display:flex!important;align-items:center!important;gap:5px!important;background:#eaf5ff!important;border-radius:12px!important;padding:10px 13px!important;color:#1b557f!important;font:700 14px/1.25 system-ui,sans-serif!important;white-space:nowrap!important}
html body #prtmx-route-v3-topbar details>summary::-webkit-details-marker{display:none!important}
html body #prtmx-route-v3-topbar details:not([open]) nav {display:none!important}
html body #prtmx-route-v3-topbar details[open] nav {display:flex!important;flex-direction:column!important;gap:3px!important;position:absolute!important;right:0!important;top:calc(100% + 9px)!important;min-width:min(235px,calc(100vw - 32px))!important;padding:8px!important;background:#fff!important;border:1px solid #d2e1f0!important;border-radius:13px!important;box-shadow:0 10px 25px rgba(17,55,84,.22)!important;z-index:2147483001!important}
html body #prtmx-route-v3-topbar nav a{display:block!important;padding:11px 10px!important;font:600 13px/1.35 system-ui,sans-serif!important;text-decoration:none!important;color:#193e5e!important;background:transparent!important;border-radius:9px!important}
html body #prtmx-route-v3-topbar nav a:hover{background:#eaf5ff!important}
html body #prtmx-route-v3-actions {position:fixed!important;top:calc(env(safe-area-inset-top,0px) + 80px)!important;left:12px!important;right:12px!important;z-index:1750!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:7px!important;pointer-events:none!important;box-sizing:border-box!important}
html body #prtmx-route-v3-actions .prtmx-route-v3-state,html body #prtmx-route-v3-actions button{pointer-events:auto!important;background:rgba(255,255,255,.97)!important;box-shadow:0 2px 11px rgba(23,62,93,.14)!important;border:1px solid #d4e4ef!important;border-radius:11px!important;padding:9px 11px!important;font:600 12px/1.35 system-ui,sans-serif!important;color:#2a5879!important}
html body #prtmx-route-v3-actions .prtmx-route-v3-state{max-width:min(55vw,340px)!important;min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
html body #prtmx-route-v3-actions button{cursor:pointer!important;white-space:nowrap!important;color:#1671ae!important}
html body #prtmx-route-v3-actions #prtmx-route-v3-focus[hidden]{display:none!important}
html body .leaflet-top.leaflet-left{top:118px!important}
html body #prtmx-route-v3-sheet[hidden]{display:none!important}
html body #prtmx-route-v3-sheet{position:fixed!important;inset:0!important;display:flex!important;align-items:flex-end!important;justify-content:center!important;z-index:2147483100!important;pointer-events:auto!important;font-family:system-ui,-apple-system,Arial,sans-serif!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-backdrop{position:absolute!important;inset:0!important;background:rgba(11,37,62,.4)!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-panel{position:relative!important;z-index:1!important;width:min(600px,100vw)!important;max-height:min(74dvh,760px)!important;min-height:220px!important;background:#f8fbff!important;border-radius:22px 22px 0 0!important;box-shadow:0 -8px 30px rgba(18,46,74,.28)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;color:#193d59!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-panel-head{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:12px!important;padding:17px 17px 10px!important;flex:none!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-panel-head strong{display:block!important;font-size:18px!important;line-height:1.25!important;color:#173956!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-panel-head small{display:block!important;color:#71899b!important;font-size:12px!important;margin-top:3px!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-close{background:#e7f1f9!important;color:#256184!important;border:0!important;border-radius:50%!important;width:36px!important;height:36px!important;flex:none!important;font:26px/1 system-ui!important;cursor:pointer!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-content{overflow:auto!important;overscroll-behavior:contain!important;padding:0 16px calc(22px + env(safe-area-inset-bottom,0px))!important;flex:1!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-current{background:#e8f3ff!important;border:1px solid #cadfed!important;padding:11px 12px!important;border-radius:13px!important;margin:3px 0 15px!important;color:#285776!important;font-size:13px!important;line-height:1.55!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-current b{display:block!important;color:#153e62!important;margin:0 0 3px!important;font-size:13px!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-section-label{display:block!important;margin:12px 0 8px!important;color:#153e62!important;font-size:14px!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-stops{margin:0!important;padding:0!important;list-style:none!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-stop{display:grid!important;grid-template-columns:18px 1fr!important;gap:9px!important;margin:0!important;padding:0!important;position:relative!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-stop::before{content:""!important;position:absolute!important;left:8px!important;top:20px!important;bottom:-3px!important;width:2px!important;background:#d0e4f6!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-stop:last-child::before{display:none!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-dot{display:block!important;position:relative!important;z-index:1!important;width:11px!important;height:11px!important;background:#2d9ed9!important;border-radius:50%!important;margin:15px 0 0 3px!important;box-shadow:0 0 0 3px #e2f2fb!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-stop-content{background:#fff!important;border:1px solid #dfeaf3!important;border-radius:11px!important;padding:10px 12px!important;margin-bottom:9px!important;min-width:0!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-stop-date{font-size:11px!important;color:#71899b!important;margin-bottom:3px!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-stop-name{font-size:14px!important;font-weight:750!important;color:#173956!important;overflow-wrap:anywhere!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-stop-time{display:flex!important;gap:10px!important;flex-wrap:wrap!important;margin-top:5px!important;font-size:12px!important;color:#456d87!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-stop-time span{white-space:nowrap!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-note{padding:12px 0!important;font-size:11px!important;color:#748e9f!important;line-height:1.5!important}
html body #prtmx-route-v3-sheet .prtmx-route-v3-link{color:#1674b3!important;font-size:13px!important;font-weight:700!important;text-decoration:none!important}
@media(max-width:400px){html body #prtmx-route-v3-topbar{min-height:51px!important}html body #prtmx-route-v3-topbar .prtmx-route-v3-brand{flex-basis:137px!important}html body #prtmx-route-v3-actions{gap:4px!important}html body #prtmx-route-v3-actions .prtmx-route-v3-state,html body #prtmx-route-v3-actions button{padding:8px!important;font-size:11px!important}}


/* TEPLO_ROUTE_V4 */

html body #prtmx-route-v3-actions{
    display:block!important;
    top:calc(env(safe-area-inset-top,0px) + 80px)!important;
    left:12px!important;
    right:auto!important;
    width:320px!important;
    max-width:calc(100vw - 24px)!important;
    padding:14px!important;
    background:#fbfdfff7!important;
    border:1px solid #d4e4ef!important;
    border-radius:14px!important;
    box-shadow:0 4px 20px #173e5d22!important;
    pointer-events:auto!important;
}

#teplo-route-info>summary{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
    cursor:pointer;
    list-style:none;
}

#teplo-route-info>summary::-webkit-details-marker{
    display:none;
}

#teplo-route-info>summary::after{
    content:"⌄";
    color:#3279ac;
    font-size:22px;
}

#teplo-route-info[open]>summary::after{
    transform:rotate(180deg);
}

.teplo-route-heading{
    display:flex;
    flex-direction:column;
    gap:4px;
}

#teplo-route-name{
    font-size:18px;
    color:#18354d;
}

html body #prtmx-route-v3-actions #prtmx-route-v3-state{
    background:none!important;
    border:0!important;
    box-shadow:none!important;
    padding:0!important;
    color:#1677e8!important;
    font-size:12px!important;
}

.teplo-route-leg{
    display:grid;
    grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr);
    gap:7px;
    align-items:center;
}

#teplo-route-points{
    margin:12px 0 8px;
    padding:10px;
    background:#eaf3fb;
    border-radius:9px;
}

.teplo-route-point{
    display:flex;
    flex-direction:column;
    gap:4px;
    overflow-wrap:anywhere;
}

.teplo-route-point small{
    font-size:10px;
    color:#71899b;
}

.teplo-route-point strong{
    font-size:13px;
    color:#18354d;
}

.teplo-route-point span{
    font-size:11px;
    color:#526c83;
}

.teplo-route-arrow{
    text-align:center;
    color:#1677e8;
    font-size:18px;
}

.teplo-route-note{
    font-size:10px;
    color:#8298aa;
    margin:8px 0;
}

.teplo-route-buttons{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:7px;
}

html body #prtmx-route-v3-actions button{
    box-shadow:none!important;
    background:#e7f2fb!important;
    white-space:normal!important;
}

#teplo-route-calendar{
    display:block;
    text-align:center;
    color:#1677e8;
    font-size:12px;
    font-weight:650;
    margin-top:12px;
    text-decoration:none;
}

.teplo-route-no-data{
    font-size:12px;
    color:#526c83;
}

html body .leaflet-top.leaflet-right{
    top:80px!important;
    margin-top:0!important;
}

/* Маркер теплохода */

#map .ship-marker.teplo-route-ship{
    font-size:0!important;
    position:relative!important;
}

#map .teplo-route-ship>span{
    position:absolute;
    inset:3px;
    border-radius:50%;
    background:url('/static/prtmx-v59r2-voxel-map-192.png')
        center/contain no-repeat;
    pointer-events:none;
}

/* Названия портов */

#map .teplo-route-port-tooltip{
    border:1px solid #d4e4ef!important;
    border-radius:8px!important;
    background:white!important;
    box-shadow:0 2px 8px #173e5d22!important;
    padding:5px 8px!important;
}

.teplo-route-port-label{
    text-align:center;
    line-height:1.35;
}

.teplo-route-port-label strong{
    display:block;
    font-size:12px;
    color:#18354d;
}

.teplo-route-port-label small{
    display:block;
    font-size:10px;
    color:#526c83;
}

/* Окно стоянок */

html body #prtmx-route-v3-sheet{
    align-items:center!important;
    padding:12px!important;
    box-sizing:border-box!important;
}

html body #prtmx-route-v3-sheet .prtmx-route-v3-panel{
    max-height:calc(100dvh - 24px)!important;
    border-radius:18px!important;
}

.teplo-route-filters{
    display:grid;
    grid-template-columns:1fr 1.5fr;
    gap:8px;
    margin:10px 0;
}

.teplo-route-filters label{
    display:flex;
    flex-direction:column;
    gap:4px;
    font-size:11px;
    color:#71899b;
}

.teplo-route-filters select{
    width:100%;
    min-height:36px;
    padding:6px;
    border:1px solid #d2e1f0;
    border-radius:8px;
    background:white;
    color:#18354d;
    font:inherit;
}

#prtmx-route-v3-sheet .teplo-current-stop
.prtmx-route-v3-stop-content{
    border-color:#8bbbea!important;
    background:#eaf4ff!important;
}

@media(min-height:650px){

    html body #prtmx-route-v3-sheet
    .prtmx-route-v3-content{
        display:flex!important;
        flex-direction:column!important;
        overflow:hidden!important;
        min-height:0!important;
    }

    #prtmx-route-v3-sheet .prtmx-route-v3-stops{
        overflow-y:auto!important;
        min-height:80px!important;
        flex:1 1 auto!important;
    }

    #prtmx-route-v3-sheet
    .prtmx-route-v3-content>*:not(ol){
        flex-shrink:0;
    }
}

@media(max-width:700px){

    html body #prtmx-route-v3-actions{
        top:auto!important;
        bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;
        left:10px!important;
        width:calc(100vw - 20px)!important;
        max-height:48dvh!important;
        overflow:auto!important;
        padding:10px!important;
    }

    #teplo-route-name{
        font-size:16px;
    }

    #teplo-route-points{
        margin:8px 0;
        padding:8px;
    }

    html body #prtmx-route-v3-sheet{
        align-items:flex-end!important;
        padding:0!important;
    }

    html body #prtmx-route-v3-sheet .prtmx-route-v3-panel{
        max-height:90dvh!important;
        border-radius:18px 18px 0 0!important;
    }
}



/* TEPLO_ROUTE_CONTROLS_V5 */

/* Текстовая кнопка вместо стрелки. */

html body #teplo-route-info > summary::after{
    content:"Развернуть"!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:none!important;
    transform:none!important;
    background:#e5f1fa!important;
    border:1px solid #d5e5f1!important;
    border-radius:9px!important;
    padding:8px 10px!important;
    color:#246ca5!important;
    font:650 12px/1.2 system-ui,sans-serif!important;
    white-space:nowrap!important;
}

html body #teplo-route-info[open] > summary::after{
    content:"Свернуть"!important;
    transform:none!important;
}

#teplo-route-info > summary{
    gap:10px!important;
    min-height:34px!important;
}

.teplo-route-heading{
    flex:1!important;
    min-width:0!important;
}

/* Название теплохода и компания. */

html body #teplo-route-name,
html body #prtmx-route-v3-sheet #prtmx-route-v3-name{
    display:flex!important;
    align-items:center!important;
    flex-wrap:wrap!important;
    column-gap:8px!important;
    row-gap:5px!important;
    min-width:0!important;
}

html body #prtmx-route-v3-sheet
.prtmx-route-v3-panel-head > div{
    min-width:0!important;
    flex:1!important;
}

@media(max-width:700px){

    html body #teplo-route-info > summary::after{
        font-size:11px!important;
        padding:9px 10px!important;
    }

    html body #teplo-route-name{
        font-size:15px!important;
        line-height:1.35!important;
    }
}
