.directory-result-list{display:grid;gap:14px;min-width:0}
.result-pagination>span{display:none}
.result-pagination a{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:9px 12px;border:1px solid var(--st-edge,#68432c);border-radius:10px;color:var(--st-accent,#ff9a4d);text-decoration:none}
.result-pagination a:hover{border-color:var(--st-highlight,#ffc18e);color:var(--st-highlight,#ffc18e)}
.result-pagination a[rel=next]{margin-left:auto}
@media(min-width:901px){
 #discovery{height:auto;align-items:start}
 #directory-results{display:block;height:auto;overflow:visible}
 #directory-results .directory-result-list{display:grid;grid-auto-rows:max-content;gap:14px;height:auto;max-height:none;overflow:visible;padding:0;align-content:start}
 #directory-results .directory-result-list>.studio-result{min-height:160px;height:auto}
 #directory-results .result-pagination{gap:12px;margin:0;padding:18px 0 0}
 #discovery>.directory-aside{position:sticky;top:var(--directory-top-offset,100px);min-width:0;align-self:start}
 #discovery .directory-aside>.map-wrap{position:relative;top:0;display:flex;flex-direction:column;height:clamp(320px,54dvh,580px);max-height:calc(100dvh - var(--directory-top-offset,100px) - 16px);min-height:0;align-self:start}
 #studio-map{flex:1;min-height:0;height:auto}
 #discovery .map-note{flex:none}
}

#discovery,.directory-aside>.map-wrap{scroll-margin-top:var(--directory-top-offset,100px)}
.directory-search-history{margin-top:1em;min-width:0}
#map-status:empty{display:none}
@media(max-width:900px){.directory-aside{position:static;margin-top:16px}}

/* Match the photo pager fade without animating the map. */
#directory-results{transition:opacity 200ms ease-in-out;overflow-anchor:none}
#directory-results.is-page-loading{opacity:.2;transition-duration:500ms}
@media(prefers-reduced-motion:reduce){#directory-results{transition:none}}

/* The map's result strip stays visible even between searches. */
#discovery .map-note{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;min-height:39px;padding:8px 12px}
#discovery .map-found-count{font-weight:400;color:var(--st-accent)}
#discovery .map-note-message:not(:empty){font-size:11px}
@media(min-width:901px){.result-toolbar{display:none}}
/* On mobile the same live total remains next to the same switch in both views.
   The map's second counter is for desktop only; keep its loading status and credits. */
@media(max-width:900px){
 .result-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}
 .result-toolbar .map-toggle{justify-self:end;margin-left:0;white-space:nowrap}
 #discovery .map-found-count{display:none}
}

#discovery .map-found-count:empty,#discovery .map-found-count[hidden]{display:none}

/* Directory only: position the shared MapLibre attribution inside the results strip.
   The tiny button and horizontal drawer are styled in shared/vector-map.css. */
#discovery .map-note{position:relative;flex-wrap:nowrap;min-width:0}
#discovery .map-note-credits{
 position:relative;flex:0 0 18px;width:18px;height:18px;margin-left:auto;z-index:5;
 --credits-bg:var(--st-panel);--credits-border:var(--st-edge);
 --credits-text:var(--st-ink);--credits-muted:var(--st-muted);
}
/* Restore the existing rotating loader, keeping the message short. */
#discovery .map-note-message.is-loading{display:inline-flex;align-items:center;gap:7px}
#discovery .map-note-message.is-loading::before{content:'';display:block;box-sizing:border-box;flex:0 0 12px;width:12px;height:12px;border:2px solid var(--st-edge);border-top-color:var(--st-accent);border-radius:50%;animation:directory-spin .7s linear infinite}
@media(prefers-reduced-motion:reduce){#discovery .map-note-message.is-loading::before{animation:none}}

/* One persistent selection card replaces transient MapLibre marker popups. */
#discovery .map-wrap .studio-map-preview[hidden]{display:none}
#discovery .map-wrap .studio-map-preview{
 position:absolute;left:12px;bottom:54px;z-index:8;width:min(310px,calc(100% - 24px));
 padding:14px 15px 12px;background:var(--map-surface,var(--st-panel));color:var(--map-text,var(--st-ink));
 border:1px solid var(--map-line,var(--st-edge));border-radius:14px;box-shadow:0 8px 26px #0005;
 font-family:'Work Sans',sans-serif;overflow-wrap:anywhere;
}
.studio-map-preview .studio-map-preview-close{
 position:absolute;right:8px;top:7px;display:grid;place-items:center;width:30px;height:30px;
 border:0;border-radius:7px;background:transparent;color:inherit;font:24px/1 sans-serif;cursor:pointer;
}
.studio-map-preview .studio-map-preview-close:hover{background:var(--map-bg,var(--st-bg))}
.studio-map-preview-eyebrow{margin:0 30px 5px 0;color:var(--map-muted,var(--st-muted));font-size:10px;letter-spacing:.06em;text-transform:uppercase}
.studio-map-preview-title{margin:0 25px 4px 0;color:inherit;font-size:17px;font-weight:650;line-height:1.3}
.studio-map-preview-location{margin:0 0 12px;color:var(--map-muted,var(--st-muted));font-size:12px}
.studio-map-preview-actions{display:flex;gap:9px;flex-wrap:wrap;align-items:center}
.studio-map-preview-actions :is(button,a){display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:6px 9px;border:1px solid var(--map-line,var(--st-edge));border-radius:8px;background:transparent;color:inherit;font:600 11px/1.3 'Work Sans',sans-serif;text-decoration:none;cursor:pointer}
.studio-map-preview-actions a{background:var(--map-accent,var(--st-accent));border-color:var(--map-accent,var(--st-accent));color:var(--map-bg,var(--st-button-ink))}
.studio-map-preview :is(a,button):focus-visible{outline:2px solid var(--map-accent,var(--st-accent));outline-offset:2px}
#directory-results .studio-result.is-selected{border-color:var(--st-highlight,var(--st-accent));outline:2px solid var(--st-highlight,var(--st-accent));outline-offset:1px}
#studio-map .studio-pin.is-selected{background:var(--map-accent);color:var(--map-bg);box-shadow:0 0 0 4px color-mix(in srgb,var(--map-accent) 28%,transparent),0 2px 8px #0005}
@media(max-width:900px){#discovery .map-wrap .studio-map-preview{left:10px;bottom:53px;width:min(340px,calc(100% - 20px))}}
/* The preview sits beside the MapLibre canvas, so mirror its light/dark variables. */
#discovery .map-wrap:has(#studio-map[data-map-appearance="light"]) .studio-map-preview{--map-bg:#f5f5f3;--map-surface:#fff;--map-line:#c8cbd0;--map-text:#20252b;--map-muted:#4b525b;--map-accent:var(--st-accent,#a65431)}
#discovery .map-wrap:has(#studio-map[data-map-appearance="dark"]) .studio-map-preview{--map-bg:#111216;--map-surface:#202228;--map-line:#4a4e58;--map-text:#f2f3f5;--map-muted:#c0c4cc;--map-accent:var(--st-accent,#d29b68)}

/* Keep directory actions at the bottom, including cards without activity tags. */
.studio-result .result-copy{display:flex;flex-direction:column;min-width:0}
.studio-result .result-actions{margin-top:auto;padding-top:12px}
