html,
body {
    height:100%;
}

#header_wrap {
    position:relative;
    flex:0 0 auto;
    width:100%;
    height:auto;
}

#header {
    position:static;
    display:flex;
    flex-wrap:wrap;
    align-items:stretch;
    height:auto;
    background:#fff;
}

#map_canvas {
    flex:1 1 auto;
    min-height:0;
    height:auto !important;
    margin-top:0;
}

#header h1 {
    flex:0 0 230px;
    display:flex;
    align-items:center;
    box-sizing:border-box;
    min-height:29px;
    height:auto;
    margin:0;
    line-height:29px;
}

#header #nv {
    position:static;
    flex:1 1 0;
    min-width:0;
    width:auto;
    height:auto;
    box-sizing:border-box;
    padding:3px 10px;
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:4px 14px;
    line-height:24px;
}

#header #nv .vehicle-map-description {
    flex:1 1 auto;
    min-width:0;
    white-space:normal;
    overflow-wrap:anywhere;
    text-align:left;
    color:#2d2d2d;
    font-size:12px;
}

#header #nv #info_box,
#header #nv #display_box,
#header #nv #btn_update_v {
    position:static;
    flex:0 0 auto;
}

#header #nv #info_box {
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:4px 10px;
    flex:0 1 auto;
    max-width:100%;
    width:auto;
    margin:0;
    white-space:normal;
}

#header #nv #info_box .conditions {
    white-space:nowrap;
}

.vehicle-map-time-controls {
    display:flex;
    align-items:center;
    gap:6px;
    max-width:100%;
    min-width:0;
}

.vehicle-map-current-time {
    min-width:0;
}

#header #nv .vehicle-map-legend {
    display:flex;
    flex:0 1 auto;
    align-items:flex-start;
    justify-content:flex-start;
    gap:4px 10px;
    min-width:0;
    max-width:100%;
    margin:0;
}

#header #nv #display_box {
    white-space:nowrap;
}

#header #nv #display_box .form_message_head {
    margin-right:0;
}

#search_conditions:not([hidden]) {
    order:2;
    flex:0 0 100%;
    min-width:0;
}

#search_conditions:not([hidden]) #search_conditions_panel {
    position:static;
    box-sizing:border-box;
    width:100%;
    padding:3px 8px;
    background:rgba(255, 255, 255, 0.96);
    border-bottom:1px solid #aaa;
    color:#2d2d2d;
    line-height:24px;
}

#search_conditions:not([hidden]) #track_group_check {
    margin:0;
    border:0;
}

#search_conditions .debug-label {
    margin-right:12px;
    color:#a33;
}

@media (max-width:760px) {
    #header h1 {
        flex-basis:100%;
        width:100%;
    }

    #header #nv {
        flex-basis:100%;
    }
}

.popup_window {
    box-sizing:border-box;
    width:min(400px, calc(100vw - 32px));
    height:auto;
}

.popup_window .popup_container {
    width:100%;
    height:auto;
}

.popup_window #select_map_text {
    float:none;
}

.popup_window .popup_container ul {
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px 16px;
    margin:16px 10px 8px;
}

.popup_window .popup_container ul li {
    float:none;
    width:auto;
    margin:0;
}

.popup_window .popup_container a {
    display:block;
    padding:6px 8px;
}
