.visible {
    display: block;
    visibility: visible;
}
.visible-inline {
    display: inline;
    visibility: visible;
}
.hidden {
    display: none;
    visibility: hidden;
}
.control-ui {
    padding: 7px;
}
#search-control-ui,
#results-control-ui {
    z-index: 0;
    background-color: white;
    font-size: 12px;
    max-height: 500px;
    overflow: auto;
    width: 400px;
    padding: 8px;
    border-radius: 2px;
    -webkit-background-clip: padding-box;
    box-shadow: rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px;
    min-width: 40px;
    background-clip: padding-box;
}
#results-control-ui {
    font-family: Arial, sans-serif;
    font-size: 14px;
}
#result-template-div {
    background-color: #fff;
}
#results-control-ui p {
    margin-bottom: 5px;
}
#results-control-ui .result,
#results-control-ui .active-result {
    border-top: 1px solid lightgray;
    display: block;
    padding: 5px;
}
#results-control-ui .active-result {
    background-color: #eef;
}

p.result-bounds {
    color: #600;
}

p.result-viewport {
    color: #006;
}

#bias-viewport-checkbox-label {
    color: #060;
}

/* Map geocode: input + Geocode button on one row */
#search-control-ui .mappoly-geocode-query-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin: 10px 0 5px 0;
    width: 100%;
    box-sizing: border-box;
}
#search-control-ui .mappoly-geocode-wrap {
    flex: 1 1 auto;
    min-width: 0;
}
#search-control-ui .mappoly-geocode-query-row #geocode-button {
    flex: 0 0 auto;
}
#query-input {
     width: 78%;
     margin: 10px 5px 5px 0;
 }
#search-control-ui .mappoly-geocode-query-row #query-input {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}
#radius-input {
    width: 78%;
    margin: 10px 5px 5px 0;
}
#geocode-button {
    padding: 1px 3px;
}
#draw-button {
    padding: 1px 3px;
}
#show-hide-options-div {
    font-size: 10px;
}
#show-hide-options-div a,
#status-display-div p a,
#view-all-in-map-link {
    color: blue;
    cursor: pointer;
}
#status-display-div p span {
    display: inline;
}
#search-options-div table,
#search-options-div table tbody,
#search-options-div table tbody tr,
#search-options-div table tbody tr td,
#search-options-div table tbody tr td acronym,
#search-options-div table tbody tr td input,
#search-options-div table tbody tr td select,
#search-options-div table tbody tr td select option,
#search-options-div table tbody tr th,
#search-options-div table tbody tr th a,
#search-options-div table tbody tr th input,
#search-options-div table tbody tr th label,
#search-options-div table tbody tr th select,
#search-options-div table tbody tr th select option {
    font-size: 12px;
    margin: 3px 0;
}
.headers {
    color: red;
    padding: 50px;
}
th {
    color: gray;
    text-align: left;
}
th a {
    color: lightblue;
}
td {
    /*padding-right: 5px;*/
}
td.vtop,
td.vtop-strong {
    vertical-align: top;
}
td.vtop-strong {
    font-weight: bold;
}
.warn {
    color: red;
}
.examples {
    color: gray;
}
.left-column {
    text-align: right;
}
.gray {
    color: gray;
}
.bold {
    font-weight: bold;
}
.address-components {
    margin: 0 0 10px 20px;
}
.learn-more-link {
    text-decoration: none;
    font-weight: bold;
}
span.OK {
    color: green;
}
span.UNKNOWN_ERROR {
    color: red;
}
span.OVER_QUERY_LIMIT {
    color: orange;
}
span.REQUEST_DENIED {
    color: red;
}
span.INVALID_REQUEST {
    color: red;
}
span.ZERO_RESULTS {
    color: #990;
}
span.OK {
    color: green;
}
.geocode-button{
    background-color: #EFEFEF;
    border: 1px solid #DEDEDE;
    padding: 4px;
    text-align: center;
    border-radius: 2px;
}

/* Radius / draw-circle tools: hidden by default; desktop only */
#mappoly-radius-tool,
#mappoly-draw-circle-tool,
#address-mode,
#circle-mode,
.terra-raw-circle-btn,
button#mappoly-radius-tool,
button#mappoly-draw-circle-tool,
.mapboxgl-ctrl #mappoly-radius-tool,
.mapboxgl-ctrl #mappoly-draw-circle-tool,
.mappoly-top-controls #mappoly-radius-tool,
.mappoly-top-controls #mappoly-draw-circle-tool,
.map-toolbar-controls #address-mode,
.desktop-only-radius-tool,
button[title="Draw circle"],
button[aria-label="Draw circle"],
button[title*="Draw circle"] {
    display: none !important;
}
#mappoly-controls-overlay.hidden,
#search-control-ui[hidden] {
    display: none !important;
}
/* exact complement of the mobile/portrait hide query below, so a tool button and its overlay are never split */
@media screen and (min-width: 992px) and (orientation: landscape), screen and (min-width: 1201px) {
    #mappoly-radius-tool,
    #mappoly-draw-circle-tool,
    button#mappoly-radius-tool,
    button#mappoly-draw-circle-tool,
    .mapboxgl-ctrl #mappoly-radius-tool,
    .mapboxgl-ctrl #mappoly-draw-circle-tool,
    .mappoly-top-controls #mappoly-radius-tool,
    .mappoly-top-controls #mappoly-draw-circle-tool,
    button[title="Draw circle"],
    button[aria-label="Draw circle"],
    button[title*="Draw circle"] {
        display: block !important;
    }
    #address-mode,
    #circle-mode,
    .terra-raw-circle-btn,
    .map-toolbar-controls #address-mode,
    .desktop-only-radius-tool {
        display: block !important;
    }
}

/* Hide Mapbox "Reset bearing to north" on mobile and portrait */
@media screen and (max-width: 991px), screen and (orientation: portrait) and (max-width: 1200px) {
    .mapboxgl-ctrl-compass,
    .mapboxgl-ctrl button.mapboxgl-ctrl-compass,
    .mapboxgl-ctrl-group .mapboxgl-ctrl-compass {
        display: none !important;
    }
    #mappoly-radius-tool,
    #mappoly-draw-circle-tool,
    #address-mode,
    #circle-mode,
    .terra-raw-circle-btn,
    #mappoly-controls-overlay,
    #search-control-ui {
        display: none !important;
    }
}

/* Mobile / narrow: keep radius UI and draw tools usable */
@media screen and (max-width: 900px) {
    #mappoly-controls-overlay {
        left: 52px !important;
        right: 8px;
        top: 10px !important;
        max-width: none;
        width: auto;
        z-index: 12 !important;
    }
    #search-control-ui,
    #results-control-ui {
        width: 100% !important;
        max-width: 100%;
        max-height: min(45vh, 320px);
        box-sizing: border-box;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    #search-control-ui .mappoly-geocode-query-row {
        flex-wrap: nowrap;
        width: 100%;
    }
    #search-control-ui .mappoly-geocode-query-row #query-input {
        min-width: 0;
        flex: 1 1 auto;
    }
    #search-control-ui .mappoly-geocode-query-row #geocode-button {
        flex: 0 0 auto;
        white-space: nowrap;
    }
    #radius-input {
        width: calc(100% - 70px);
        max-width: none;
        box-sizing: border-box;
    }
    .mappoly-top-controls {
        flex-direction: column !important;
        align-items: stretch !important;
        z-index: 5 !important;
        position: relative;
    }
    .mappoly-top-controls button {
        pointer-events: auto !important;
        position: relative;
        z-index: 6;
        min-width: 40px;
        min-height: 40px;
        padding: 8px 10px;
    }
    .mappoly-top-controls button svg {
        width: 22px;
        height: 22px;
    }
    /* Keep Mapbox logo/attrib from covering draw tools in landscape */
    .mapboxgl-ctrl-bottom-left,
    .mapboxgl-ctrl-bottom-right {
        z-index: 1;
    }
    .mapboxgl-ctrl-top-left {
        z-index: 4;
    }
    @media (orientation: landscape) and (max-height: 500px) {
        .mapboxgl-ctrl-logo,
        .mapboxgl-ctrl-attrib {
            pointer-events: none;
        }
        .mapboxgl-ctrl-attrib a {
            pointer-events: none;
        }
        .mappoly-top-controls,
        .mappoly-top-controls button {
            pointer-events: auto !important;
            z-index: 6;
            min-width: 44px;
            min-height: 44px;
        }
        .mappoly-top-controls button svg {
            width: 24px;
            height: 24px;
        }
    }
}
