/* Keep the search and active-filter state ahead of the result list. */
html body #panel-regions .explorer-picker .filter-quick-controls{display:grid;gap:6px;margin:6px 0 10px;min-width:0}
html body #panel-regions .explorer-picker .filter-quick-controls .search-field{margin:0!important;min-height:38px!important;padding:4px 8px!important;width:100%!important;box-sizing:border-box}
html body #panel-regions .explorer-picker .filter-quick-controls input{min-width:0!important;width:100%!important;font-size:14px!important}
html body #panel-regions .explorer-picker .filter-current-state{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
html body #panel-regions .explorer-picker .filter-current-state #dashboard-filter-state{margin:0!important;flex:1 1 150px;font-size:14px!important;line-height:1.3!important}
html body #panel-regions .explorer-picker .filter-current-state #dashboard-reset{margin:0!important;min-height:30px!important;padding:4px 6px!important;font-size:14px!important}
html body #panel-regions .explorer-picker .dashboard-filter-explanation{padding:6px 8px!important;margin:6px 0!important;font-size:14px!important}
html body #panel-regions .explorer-picker .dashboard-filter-explanation>summary{min-height:26px!important;line-height:1.4!important}
html body #panel-regions .explorer-picker .dashboard-filter-explanation :is(p,small){display:block;line-height:1.4!important;margin:6px 0!important}
html body #panel-regions .explorer-picker #dashboard-pin-status:empty{display:none!important}
@media(min-width:1001px){
 html body #panel-regions .explorer-picker .filter-quick-controls{margin-block:4px 6px!important}
 html body #panel-regions .explorer-picker .redesign-categories{margin-block:4px!important;padding:4px!important}
 html body #panel-regions .explorer-picker .redesign-select{margin-block:3px!important}
 html body #panel-regions .explorer-picker .dashboard-pin-toggle{line-height:1.2!important;font-size:14px!important}
}

/* Search entry precedes all asynchronous pin/status and explanatory content. */
html body #panel-regions .explorer-picker .filter-region-entry{display:grid!important;gap:4px!important;min-width:0!important}
html body #panel-regions .explorer-picker .filter-region-entry #prefecture-list-title{font-size:16px!important;line-height:1.35!important;margin:0!important}
html body #panel-regions .explorer-picker .filter-region-entry .unified-search-shortcut{font-size:14px!important;line-height:1.3!important;min-height:34px!important;margin:0!important;padding:6px 8px!important}
html body #panel-regions .explorer-picker .dashboard-filter-explanation:not([open])>:not(summary){display:none!important}

/* Loaded pin explanations live inside the same closed disclosure as static help. */
html body #panel-regions .explorer-picker .dashboard-filter-explanation:not([open]) #dashboard-pin-status{display:none!important}
html body #panel-regions #prefecture-list-disclosure>summary{
 display:block;padding:7px 9px;border:1px solid #536f88;border-radius:6px;
 background:#102238;font-size:15px;line-height:1.35;cursor:pointer;
}
html body #panel-regions #prefecture-list-disclosure>summary::after{
 content:"＋";float:inline-end;margin-inline-start:8px;
}
html body #panel-regions #prefecture-list-disclosure[open]>summary::after{content:"−"}
html body #panel-regions #prefecture-list-disclosure:not([open])>:not(summary){display:none!important}
html body #panel-regions .explorer-picker :is(#dashboard-filter-details,#prefecture-list-disclosure) {
 margin-block:6px;
 padding:0!important;border:0!important;background:transparent!important;
}
html body #panel-regions .explorer-picker #dashboard-filter-details > summary {
 display:flex;align-items:center;justify-content:space-between;gap:8px;
 box-sizing:border-box;min-height:44px;padding:7px 9px;border:1px solid #536f88;
 border-radius:6px;background:#102238;color:#eef5f7;font-size:15px;line-height:1.35;cursor:pointer;
}
html body #panel-regions .explorer-picker #dashboard-filter-details > summary::after {content:"＋";flex:none}
html body #panel-regions .explorer-picker #dashboard-filter-details[open] > summary::after {content:"−"}
html body #panel-regions .explorer-picker #dashboard-filter-details > summary:focus-visible {outline:3px solid #72a9ff;outline-offset:2px}
html body #panel-regions .explorer-picker #dashboard-filter-details:not([open]) > :not(summary) {display:none!important}
html body #panel-regions .explorer-picker .filter-settings-column .dashboard-pin-toggle {box-sizing:border-box;min-height:44px!important}
@media (min-width:1001px) {
 html body[data-map-page="japan"] #panel-regions .explorer-picker .filter-settings-column .redesign-categories {
  grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr))!important;
  gap:2px 6px!important;
 }
 html body[data-map-page="japan"] #panel-regions .explorer-picker .filter-settings-column .redesign-categories label {
  box-sizing:border-box;min-height:44px!important;
 }
}
html body #panel-regions .explorer-picker .prefecture-results-toolbar{display:flex!important;flex-wrap:wrap;align-items:center;gap:4px 8px;margin:6px 0!important}
html body #panel-regions .explorer-picker .prefecture-results-toolbar #prefecture-list-hint{font-size:14px!important;line-height:1.25!important;margin:0!important;flex:1 1 130px}
html body #panel-regions .explorer-picker .prefecture-results-toolbar #prefecture-more{font-size:14px!important;min-height:30px!important;line-height:1.25!important;margin:0!important;padding:4px 6px!important}
@media(min-width:1001px){
 html body #panel-regions .explorer-picker #prefecture-list{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:3px!important;min-height:0!important;max-height:none!important;height:auto!important;overflow:visible!important}
 html body #panel-regions .explorer-picker #prefecture-list .prefecture-row{display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;gap:1px!important;min-width:0!important;min-height:43px!important;height:auto!important;margin:0!important;padding:3px 5px!important;line-height:1.2!important;font-size:14px!important}
 html body #panel-regions .explorer-picker #prefecture-list .prefecture-row>span{font-size:14px!important;line-height:1.2!important;min-width:0!important;overflow-wrap:anywhere}
 html body #panel-regions .explorer-picker #prefecture-list .list-message{grid-column:1/-1!important}
 html body #panel-regions .explorer-picker .list-toolbar:has(>button[hidden]){display:none!important}
 html body #panel-regions .explorer-picker #selected-region:empty{display:none!important}
}
@media(min-width:1001px){
 html body #panel-regions .explorer-picker>h3:first-child{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
 html body #panel-regions .explorer-picker .filter-region-entry{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:6px!important}
 html body #panel-regions .explorer-picker .filter-region-entry #prefecture-list-title{flex:1 1 auto!important;font-size:16px!important}
 html body #panel-regions .explorer-picker .filter-region-entry .unified-search-shortcut{flex:0 1 auto!important;width:auto!important;min-width:0!important;font-size:14px!important;min-height:30px!important;padding:4px 6px!important}
}

/* Wide desktop: settings and the ten initial prefectures share vertical space. */
@media(min-width:1500px){
 html body[data-design][data-map-page="japan"] #panel-regions .explorer-grid{grid-template-columns:520px minmax(0,1fr) minmax(280px,380px)!important}
 html body #panel-regions .explorer-picker .filter-results-columns{display:grid!important;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)!important;gap:10px!important;align-items:start!important}
 html body #panel-regions .explorer-picker :is(.filter-settings-column,.filter-results-column){min-width:0!important}
 html body #panel-regions .explorer-picker .filter-settings-column .redesign-categories{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0!important;padding:3px!important}
 html body #panel-regions .explorer-picker .filter-settings-column .redesign-categories label{min-height:25px!important;font-size:14px!important;line-height:1.2!important}
 html body #panel-regions .explorer-picker .filter-settings-column .redesign-select{grid-template-columns:85px minmax(0,1fr)!important;gap:2px!important;margin:4px 0!important}
 html body #panel-regions .explorer-picker .filter-settings-column .redesign-select>span{font-size:14px!important;line-height:1.2!important}
 html body #panel-regions .explorer-picker .filter-settings-column .redesign-select select{width:100%!important;min-width:0!important;min-height:32px!important}
 html body #panel-regions .explorer-picker .filter-results-column #prefecture-list{grid-template-columns:1fr!important}
 html body #panel-regions .explorer-picker .filter-results-column .prefecture-results-toolbar{margin-top:0!important}
 html body #panel-regions .explorer-picker .filter-results-column .prefecture-results-toolbar #prefecture-list-hint{flex-basis:100%!important}
 html body #panel-regions .explorer-picker .filter-results-column #prefecture-list .prefecture-row{min-height:41px!important}
}

/* English names and record totals need enough space to keep whole words. */
@media(min-width:1001px){
 html[lang="en"] body[data-map-page="japan"] #panel-regions .explorer-picker #prefecture-list .prefecture-row {
  flex-wrap:wrap!important;
  row-gap:2px!important;
 }
 html[lang="en"] body[data-map-page="japan"] #panel-regions .explorer-picker #prefecture-list .prefecture-row>span:first-child {
  flex:1 0 auto;
  max-width:100%;
  overflow-wrap:break-word;
  word-break:normal;
 }
 html[lang="en"] body[data-map-page="japan"] #panel-regions .explorer-picker #prefecture-list .prefecture-row>.row-value.muted {
  white-space:normal!important;
  max-width:72px;
  overflow-wrap:normal;
 }
}
@media(min-width:1500px){
 html[lang="en"] body[data-map-page="japan"] #panel-regions .explorer-picker .filter-results-columns {
  grid-template-columns:minmax(0,1fr) minmax(182px,1.25fr)!important;
 }
 html[lang="en"] body[data-map-page="japan"] #panel-regions .explorer-picker .filter-settings-column .redesign-select {
  grid-template-columns:minmax(0,1fr)!important;
 }
}
@media(min-width:1500px){
 html body[data-map-page="japan"]:not([data-dashboard-embed]) #panel-regions .explorer-picker .filter-quick-controls .search-field{display:flex!important}
 html body[data-map-page="japan"]:not([data-dashboard-embed]) #panel-regions .explorer-picker .filter-results-columns{
  grid-template-columns:minmax(0,1fr)!important;
 }
 html body[data-map-page="japan"]:not([data-dashboard-embed]) #panel-regions .explorer-picker #prefecture-list{
  max-height:280px!important;
  overflow-y:auto!important;
 }
 html[lang="en"] body[data-map-page="japan"]:not([data-dashboard-embed]) #panel-regions .explorer-picker .filter-settings-column .redesign-select{
  grid-template-columns:115px minmax(0,1fr)!important;
 }
}
