/* Only the embedded search form; preserve the full desktop arrangement. */
html, body { max-width: 100%; }
#Panel1 .formItem { margin-right: 0; }
#Panel1 input[type="checkbox"] + label { white-space: nowrap; }
#Panel1 .div_sign, #DropDownList_area td, .gis-search-types td > div { white-space: nowrap; }
.gis-search-types td > div { display: flex; align-items: baseline; white-space: nowrap; }
.gis-search-child-option > span:not([style*="color:red"]) { display: inline-flex; align-items: baseline; white-space: nowrap; }
#Panel1 input[type="checkbox"] { flex-shrink: 0; }
@media (max-width: 1050px) {
    #DropDownList_area { display: flex !important; flex-wrap: wrap; width: calc(100% - 174px); }
    #DropDownList_area tbody, #DropDownList_area tr { display: contents; }
    #DropDownList_area td { display: inline-flex; min-width: 90px; align-items: baseline; }
    .gis-search-types table, .gis-search-types tbody { display: block; width: 100%; }
    .gis-search-types tr { display: flex; flex-wrap: wrap; }
    .gis-search-types td { flex: 1 1 190px; max-width: 100%; padding-left: 18px !important; }
}
@media (max-width: 900px) {
    #Panel1 { overflow-wrap: anywhere; }
    #Panel1 .row { margin-left: 0; margin-right: 0; }
    #Panel1 .formItem > .col-md-10 { width: 100% !important; max-width: 100%; flex: 0 0 100%; }
    #Panel1 .formItem > .sub_title { width: 100% !important; margin-left: 0 !important; }
    #Panel1 .formItem input[type="image"] { left: calc(100% - 35px) !important; }
    #div_search { position: relative !important; left: 0 !important; top: 0 !important; width: 100% !important; }
    #Panel1 > div > .sub_title, #Panel1 > div > div > .sub_title,
    #pa_city > .sub_title { display: block !important; width: auto; margin: 12px 16px 4px; line-height: 1.5; }
    #Panel1 .div_sign { display: flex; margin-left: 28px !important; margin-right: 16px; }
    .gis-search-primary-option { margin-left: 28px !important; }
    .gis-search-child-option { margin-left: 48px !important; }
    #DropDownList_area { display: block !important; margin-left: 27px !important; width: calc(100% - 54px); }
    #DropDownList_area tbody, #DropDownList_area tr { display: contents; }
    #DropDownList_area { display: flex !important; flex-wrap: wrap; }
    #DropDownList_area td { display: inline-flex; min-width: 90px; align-items: baseline; }
    #DropDownList_area label { margin-right: 12px; }
    .gis-search-types-row { display: block !important; }
    .gis-search-types { width: calc(100% - 32px) !important; margin: 0 16px; }
    .gis-search-types table, .gis-search-types tbody { display: block; width: 100%; }
    .gis-search-types tr { display: flex; flex-wrap: wrap; }
    .gis-search-types td { flex: 1 1 190px; max-width: 100%; padding-left: 2px !important; }
    #Panel1 label { max-width: 100%; }
    #Panel1 input[type="submit"] { max-width: 100%; white-space: normal; }
    #close_MIS_Frame { min-width: 24px; min-height: 24px; }
}
@media (max-width: 380px) {
    #Panel1 .header { padding-right: 42px; }
    #Panel1 .header > div[style*="margin-left"] { margin-left: 0 !important; }
    #Panel1 .pagebtn, #Panel1 .pagebtn_s { white-space: normal; padding: 6px; }
    #Panel1 .div_sign { margin-right: 8px; }
}
/* Keep the search heading and close control vertically centered in one row. */
#Panel1 .header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 0.5rem; padding-right: 15px; }
#Panel1 .header > h1 { margin: 0; }
#Panel1 .header > h1 + div { position: static !important; }
#Panel1 .header > div:last-child { grid-column: 1 / -1; }
#Panel1 .header #close_MIS_Frame { display: flex; align-items: center; justify-content: center; }

/* Keep nearby-place search buttons outside their text fields at every width. */
#Panel1 .gis-nearby-search-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 8px; }
#Panel1 .gis-nearby-search-field > .form-control { min-width: 0; width: 100%; }
#Panel1 .gis-nearby-search-field > input[type="image"] { position: static !important; top: auto !important; left: auto !important; min-width: 24px; min-height: 24px; cursor: pointer; }
#Panel1 .gis-nearby-search-field > #div_search { grid-column: 1 / -1; }
