/* History appears beside the search field without moving results or the map. */
.history-desk { position:relative; min-width:0; }
.map-search-desk { flex:1; max-width:520px; }
.search-history-popover { position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:20; max-height:min(360px,50dvh); overflow-y:auto; overscroll-behavior:contain; padding:4px 8px; border:1px solid var(--line); border-radius:8px; background:var(--surface); box-shadow:0 8px 24px #23324726; animation:history-appear .12s ease-out; }
.search-history-popover[hidden],.search-history-popover [hidden] { display:none; }
.history-heading,.recent-searches-heading { display:flex; align-items:center; gap:8px; min-height:40px; }
.history-heading h3 { flex:1; margin:0; padding-left:6px; font-size:13px; font-weight:650; color:var(--ink); }
.history-heading button,.recent-searches-heading button { min-height:40px; padding:6px; border:0; background:transparent; font-size:12px; color:var(--muted); white-space:nowrap; }
.search-history-popover [data-close-history] { width:40px; font-size:20px; }
.search-history-popover .recent-visit-list { display:block; margin:0; padding:0; list-style:none; }
.recent-visit-list li { display:flex; align-items:stretch; min-width:0; border-top:1px solid var(--line); }
.recent-visit-list .recent-visit-open { display:flex; flex:1; flex-direction:column; align-items:flex-start; justify-content:center; gap:3px; min-width:0; min-height:60px; padding:8px 6px; border:0; border-radius:4px; background:transparent; text-align:left; }
.recent-visit-open strong { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; font-weight:600; color:var(--ink); }
.recent-visit-title { display:flex; align-items:center; gap:8px; width:100%; min-width:0; }
.recent-visit-title strong { flex:1; min-width:0; }
.recent-visit-year { flex-shrink:0; color:var(--muted); font-size:10px; }
.recent-visit-open small { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--muted); }
#discovery-header #recent-complexes small { display:block; max-width:100%; margin:0; }
.recent-visit-list .recent-visit-remove { flex:0 0 44px; align-self:center; min-height:44px; padding:6px; border:0; background:transparent; color:var(--muted); font-size:18px; }
.query-history { border-top:1px solid var(--line); }
.query-history > summary { min-height:44px; padding:10px 6px; font-size:12px; color:var(--muted); cursor:pointer; }
.recent-searches { min-width:0; }
.recent-searches-heading > span { flex:1; font-size:11px; color:var(--muted); }
.recent-searches ul { display:flex; gap:6px; margin:0; padding:3px 3px 8px; overflow-x:auto; list-style:none; scrollbar-width:thin; }
.recent-searches li { display:flex; flex:0 0 auto; max-width:100%; border:1px solid var(--line); border-radius:6px; }
.recent-searches li button { min-height:44px; border:0; background:transparent; }
.recent-searches [data-recent-search] { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; min-width:0; padding:6px 8px; text-align:left; }
.recent-searches [data-recent-search] span { max-width:24ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; color:var(--ink); }
.recent-searches small { max-width:26ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; color:var(--muted); }
.recent-searches [data-remove-search-history] { flex-shrink:0; width:44px; padding:6px; color:var(--muted); font-size:18px; }
@keyframes history-appear { from { opacity:0; transform:translateY(-3px); } to { opacity:1; transform:translateY(0); } }
@media(prefers-reduced-motion:reduce) { .search-history-popover { animation:none; } }
