/* Compact search-selection header: one surface inside the existing Results panel.
   At 480px readouts may wrap to keep the two 36px utility buttons accessible. */
.results-search-header{flex:none;min-width:0;background:var(--surface);border:0;border-bottom:1px solid var(--line);border-radius:0;padding:8px 12px;box-sizing:border-box}
.results-search-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.8fr) auto;align-items:center;gap:8px;min-width:0}
#results-search-header .results-search-controls>label{grid-column:1;grid-row:1;display:block;min-width:0;margin:0}.results-search-controls>label>span{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#results-search-header .results-search-controls>label:nth-child(2){grid-column:2;border-left:1px solid var(--strong);padding-left:12px}
.results-search-controls .search-summary{display:block;width:100%;min-width:0;min-height:36px;height:36px;padding:4px 0;margin:0;border:0;border-radius:4px;background:transparent;color:var(--ink);font:600 14px/20px var(--font-body);text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.results-search-controls .search-summary:hover{background:var(--control-background);color:var(--green)}.results-search-controls .search-summary:focus-visible{outline:2px solid var(--green);outline-offset:2px}
#results-search-header .results-search-controls .page-control-actions{grid-column:3;grid-row:1;display:block;min-width:0;margin:0;padding:0}.results-search-controls .scope-actions{justify-content:flex-end;display:flex;gap:8px;width:auto;margin:0;padding:0}
.results-search-controls .scope-actions button{display:inline-flex;align-items:center;justify-content:center;width:36px;min-width:36px;height:36px;min-height:36px;padding:6px;margin:0;border:1px solid var(--strong);border-radius:8px;background:var(--control-background);color:var(--green)}
.results-search-controls #preview-relax{order:-1}.results-search-controls .control-icon{width:22px;height:22px}.results-search-controls .scope-actions button:hover{background:var(--line)}.results-search-controls .scope-actions button:focus-visible{outline:2px solid var(--green);outline-offset:2px}
.map-layout .map-results-shell{display:flex;flex-direction:column}.map-layout .map-destinations{flex:1 1 auto;min-height:0;height:auto!important;max-height:none!important;box-sizing:border-box}.map-layout .bulk-actions{top:calc(var(--results-search-height,53px) + 10px)}
.control-dock .entry:has(>.preference-strip):not(:has(>.results-search-header)){width:fit-content;margin-inline:auto}
.control-dock .entry>.results-search-header{width:min(100%,650px)}
@media(max-width:480px){.results-search-header{padding:8px}.results-search-controls{grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:6px}.results-search-controls>label:nth-child(2){padding-left:6px}.results-search-controls .scope-actions{gap:4px}.results-search-controls .search-summary{font-size:13px;line-height:18px}.results-search-controls .scope-actions button{width:36px;min-width:36px}.control-dock .entry>.results-search-header{flex-basis:100%}}
@media print{.results-search-header{display:none}}
/* Keep map controls behind the floating panel rather than over its search actions. */
.map-layout .suitability-map{z-index:0}
/* Moving search out leaves Preferences as the only control-dock content. */
.control-dock .preference-strip .preference-readout-row{display:flex}

.map-results-shell .compare-now{position:absolute;top:calc(var(--results-search-height,53px) + 10px);left:12px;z-index:20;min-height:32px;padding:4px 10px;font:500 14px/22px var(--font-body);border:1px solid var(--strong);border-radius:8px;background:var(--control-background);color:var(--green)}
@media print{.compare-now{display:none!important}}

.map-results-shell .result-sort,.viewer-tools .result-sort{display:flex;align-items:center;justify-content:center;position:relative;flex:none;width:32px;height:32px;margin:0;border:1px solid var(--strong);border-radius:8px;background:var(--surface);color:var(--ink);box-shadow:0 2px 6px #0002}
.result-sort select{position:absolute;inset:0;opacity:0;width:100%;height:100%;padding:0;cursor:pointer}.result-sort:focus-within{outline:2px solid var(--green);outline-offset:2px}.result-sort:hover{background:var(--control-background)}

#detail-viewer .viewer-tools{float:right;display:flex;gap:8px;align-items:center;margin:0 0 8px 16px}#detail-viewer .viewer-tools .viewer-close{float:none}#detail-viewer .viewer-tools .control-icon{width:20px;height:20px;max-height:none}#detail-viewer[data-kind=year] #viewer-title{padding-right:100px}
@media print{#detail-viewer .viewer-tools{display:none!important}}

/* Opaque toolbar stays above scrolling cards. */
.map-layout .results-toolbar{display:flex;align-items:center;gap:6px;flex:none;min-height:52px;box-sizing:border-box;padding:8px 12px;background:#fff;border-bottom:1px solid var(--line);z-index:20}
body.dark .map-layout .results-toolbar{background:var(--surface)}
.map-layout .results-toolbar .bulk-actions{position:static;top:auto;right:auto;padding:0;background:transparent;gap:6px;flex:none}
.map-layout .results-toolbar .compare-now{position:static;top:auto;left:auto;flex:none;margin:0;padding:4px 6px;font-size:12px}
.results-view-title{margin-left:auto;text-align:right;font:600 13px/17px var(--font-body);color:var(--ink);min-width:0}
.map-results-shell .results-list-top{min-height:0;padding:0}
.map-results-shell .results-list-top .no-full-matches{margin:8px 4px}
@media print{.results-toolbar{display:none!important}}

.map-layout .results-toolbar .results-view-title{order:-1;margin-left:0;margin-right:auto;text-align:left}
.map-layout .results-toolbar .bulk-actions{order:2}
.map-layout .results-toolbar .compare-now{order:1}
