:root {
  --bg: #fbfaf7; --fg: #1f1d1a; --muted: #6b665e; --line: #e2ded6; --link: #1d4ed8;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #171614; --fg: #ece8e1; --muted: #a39e94; --line: #34312c; --link: #93b4ff; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.6 Georgia, serif; }
a { color: var(--link); }
header { display: flex; flex-wrap: wrap; gap: 1rem; align-items: baseline; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
header .brand { font-weight: bold; color: var(--fg); text-decoration: none; }
header nav { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .9rem; }
main { max-width: 46rem; margin: 0 auto; padding: 1rem; }
.kind { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.links { border-top: 1px solid var(--line); margin-top: 2rem; font-size: .95rem; }
.links dt { color: var(--muted); margin-top: .5rem; }
.links dd { margin: 0; }
.list .kind { text-transform: none; }

body:has(#map) main { max-width: none; padding: 0; }
#map { display: flex; height: calc(100vh - 3.2rem); }
#cy { flex: 1; min-width: 0; }
#panel { width: 20rem; padding: 1rem; border-left: 1px solid var(--line); overflow-y: auto; }
@media (max-width: 700px) {
  #map { flex-direction: column; height: auto; }
  #stage { height: 65vh; flex: none; }
  #panel { width: auto; border-left: 0; border-top: 1px solid var(--line); }
}

#stage { flex: 1; min-width: 0; position: relative; display: flex; }
#tools { position: absolute; top: .75rem; left: .75rem; display: flex; flex-wrap: wrap; gap: .4rem; }
#tools button { font: inherit; font-size: .85rem; padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--fg); cursor: pointer; }
#tools select { font: inherit; font-size: .85rem; padding: .25rem .5rem; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--fg); }
#tools button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

#search { margin-left: auto; position: relative; width: min(18rem, 100%); }
#search .pagefind-ui__drawer { position: absolute; right: 0; z-index: 10; width: min(30rem, calc(100vw - 2rem)); max-height: 70vh; overflow-y: auto; background: var(--bg); border: 1px solid var(--line); padding: 0 1rem; }
:root { --pagefind-ui-scale: .7; --pagefind-ui-primary: var(--link); --pagefind-ui-text: var(--fg); --pagefind-ui-background: var(--bg); --pagefind-ui-border: var(--line); --pagefind-ui-tag: var(--line); --pagefind-ui-font: inherit; }
