/* Keep delayed responses from making a previous search mode visible again. */
html[data-mk-search-mode="nearby"] #mk3u-pref-results,
html[data-mk-search-mode="nearby"] #kyoboku-map-wrap,
html[data-mk-search-mode="nearby"] #mksv3-results,
html[data-mk-search-mode="nearby"] .mk10-result-shell,
html[data-mk-search-mode="nearby"] .mksearch-result-shell,
html[data-mk-search-mode="map"] #mk3u-pref-results,
html[data-mk-search-mode="map"] #kyoboku-nearby-loading,
html[data-mk-search-mode="map"] #kyoboku-nearby-results,
html[data-mk-search-mode="map"] #mksv3-results,
html[data-mk-search-mode="map"] .mk10-result-shell,
html[data-mk-search-mode="map"] .mksearch-result-shell {display:none!important;}
html[data-mk-search-mode="map"] #kyoboku-map-wrap {display:block!important;}
/* Size the complete dialog within the visible Safari viewport. Only the list scrolls. */
#kyoboku-pref-modal.mk-search-pref {
    position:fixed!important; inset:auto 0 auto 0!important;
    top:var(--mk-search-vtop,0px)!important;
    height:var(--mk-search-vh,100dvh)!important;
    padding:12px!important; overflow:hidden!important;
    align-items:center!important; justify-content:center!important;
}
#kyoboku-pref-modal.mk-search-pref .kyoboku-pref-panel {
    display:flex!important; flex-direction:column!important;
    height:auto!important; min-height:0!important;
    max-height:calc(var(--mk-search-vh,100dvh) - 24px)!important;
    width:min(720px,100%)!important; overflow:hidden!important;
    margin:0!important; transform:none!important;
}
#kyoboku-pref-modal.mk-search-pref .kyoboku-pref-header {
    position:relative!important; top:auto!important;
    display:flex!important; flex:0 0 auto!important;
    align-items:center!important; justify-content:space-between!important;
    gap:8px; padding:12px 16px!important;
}
#kyoboku-pref-modal.mk-search-pref .kyoboku-pref-header h3 {
    margin:0!important; padding:0!important; font-size:18px!important; line-height:1.5!important;
}
#kyoboku-pref-modal.mk-search-pref #kyoboku-pref-close {
    display:inline-flex!important; flex:0 0 auto!important;
    align-items:center; justify-content:center;
    min-width:84px; min-height:44px; padding:8px 10px!important;
    font-family:inherit; font-weight:600; line-height:1.4; font-size:14px!important;
    color:#285331!important; background:#f0f5ef!important;
    border:1px solid #cfddcd!important; border-radius:8px;
    white-space:nowrap; cursor:pointer;
}
#kyoboku-pref-modal.mk-search-pref .kyoboku-pref-content {
    flex:1 1 auto!important; min-height:0!important;
    overflow-y:auto!important; overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch; padding:8px 16px 16px!important;
}
#kyoboku-pref-modal.mk-search-pref .kyoboku-pref-submit-wrap {
    position:relative!important; bottom:auto!important;
    display:flex!important; flex:0 0 auto!important;
    align-items:stretch; gap:8px; padding:12px 16px!important;
}
#kyoboku-pref-modal.mk-search-pref .mk-search-pref-cancel {
    display:block!important; flex:0 0 76px; min-height:46px;
    padding:10px 8px; color:#285331; background:#fff;
    border:1px solid #a9bda6; border-radius:8px;
    font-family:inherit; font-size:14px; font-weight:600; cursor:pointer;
}
#kyoboku-pref-modal.mk-search-pref .kyoboku-pref-submit {
    flex:1 1 auto!important; min-width:0; width:auto!important;
    min-height:46px; padding:12px 8px!important;
    font-size:14px!important; line-height:1.5;
}
#kyoboku-pref-modal.mk-search-pref button:focus-visible {outline:3px solid #8aa85a;outline-offset:2px;}
@media(max-width:767px) {
    #kyoboku-pref-modal.mk-search-pref .kyoboku-pref-panel {border-radius:14px!important;}
}
