.map-discovery{margin:12px 0 16px;border:1px solid #6a755f;border-radius:9px;background:#242b24;color:#ecebdc}
.map-discovery summary{cursor:pointer;padding:12px 14px;font-weight:700;list-style-position:inside}
.map-discovery summary:focus-visible,.map-discovery button:focus-visible,.map-discovery input:focus-visible,.map-discovery select:focus-visible{outline:3px solid #f0c25a;outline-offset:2px}
.map-discovery-body{padding:0 14px 14px}
.map-discovery-controls{display:flex;gap:10px;flex-wrap:wrap;align-items:end}
.map-discovery-controls label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#d4d9c8}
.map-discovery-controls input,.map-discovery-controls select{min-height:44px;padding:7px 9px;border:1px solid #768270;border-radius:5px;background:#151b18;color:#f5f2e7;font:14px system-ui}
.map-discovery-controls input{width:min(340px,100%)}
.map-discovery-keys{display:flex;gap:7px 12px;flex-wrap:wrap;margin:11px 0;font-size:12px;color:#d5dccf}
.map-discovery-keys span{white-space:nowrap}
.map-discovery-keys i{display:inline-block;width:10px;height:10px;vertical-align:baseline;margin-right:4px;border:2px solid;border-radius:50%}
.map-discovery-results{max-height:280px;overflow:auto;border-top:1px solid #4e5b4f;padding-top:8px}
.map-discovery-count{margin:0 0 7px;color:#d8dfd3;font-size:12px}
.map-discovery-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:5px 10px}
.map-discovery-result{display:flex;align-items:center;gap:7px;min-width:0;padding:5px 7px;border-radius:5px;background:#303a31}
.map-discovery-result svg{flex:none}
.map-discovery-result .map-discovery-label{min-width:0;flex:1;font-size:12px;line-height:1.3}
.map-discovery-result small{display:block;color:#bfcbbd;font-size:11px}
.map-discovery-result button{flex:none;min-height:44px;border:1px solid #a4ad94;border-radius:4px;background:#354638;color:#f6f2df;padding:5px 8px;cursor:pointer}
.world-discovery{max-height:25vh;overflow:auto}
@media(max-width:620px){.map-discovery-controls input{width:min(280px,100%)}.map-discovery-list{grid-template-columns:1fr}.world-discovery{max-height:30vh}}

.map-discovery-controls>*{min-width:0}.map-discovery-controls .map-discovery-query{flex:1;min-width:180px}.map-discovery-controls input{width:100%}.map-discovery-controls button,.map-discovery-pin button{min-height:44px;border:1px solid #a4ad94;border-radius:5px;background:#354638;color:#f6f2df;padding:7px 10px;cursor:pointer}.map-discovery-options{display:flex;gap:8px 16px;flex-wrap:wrap;margin:10px 0;font-size:12px}.map-discovery-options label{display:flex;align-items:center;gap:5px;min-height:32px}.map-discovery-options input{width:18px;height:18px}.map-discovery-pin:not(:empty){display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px;margin:8px 0;background:#3c321d;border:1px solid #d6b756;border-radius:5px;font-size:13px}.map-symbols>summary{font-size:12px;padding:7px 0}.world-discovery{max-height:none;overflow:visible;margin:8px 0 12px}.world-discovery .map-discovery-results{max-height:112px}.world-map-modal>h2{padding-right:32px;margin-bottom:6px}.world-map-modal .world-pin-help{margin:8px 0 0}#worldmap{touch-action:none}.worldwrap .maphover{max-width:210px;white-space:normal;pointer-events:none}
@media(max-width:620px){.map-discovery-controls{display:grid;grid-template-columns:1fr 1fr}.map-discovery-query{grid-column:1/-1;min-width:0!important}.map-discovery-controls select,.map-discovery-controls input{width:100%;max-width:100%}.map-discovery-controls>button{grid-column:1/-1}.world-discovery .map-discovery-results{max-height:105px}.world-map-modal{padding:14px 12px}.world-map-modal>p:first-of-type{display:none}.map-discovery-options{gap:0 10px}.map-discovery-options label{min-height:44px;font-size:11px}}

.map-discovery [hidden]{display:none!important}

@media(max-width:620px){.map-discovery-controls>button{grid-column:2;grid-row:1;align-self:end}.map-discovery-controls label:has(.map-discovery-detail){grid-column:1/-1}.map-discovery-query{grid-column:1/-1}.map-symbols>summary{min-height:44px;display:flex;align-items:center}.map-symbols .map-discovery-options{margin-top:0}}

/* World atlas: keep the map prominent, and make discovery an optional tool shelf. */
.world-map-modal{width:min(1440px,96vw)!important;max-width:96vw;box-sizing:border-box}
.world-map-modal .worldwrap{width:100%;box-sizing:border-box;border:2px solid #947c54;box-shadow:0 10px 32px #0008,inset 0 0 0 1px #edcf8b}
.world-map-modal #worldmap{display:block;width:100%!important;max-width:100%;max-height:none;background:#183c4e}
.world-map-modal .wmctl{background:#182a2cc9;border:1px solid #bba776;border-radius:8px;padding:5px;backdrop-filter:blur(3px)}
.map-discovery-summary-hint{display:inline-block;margin-left:8px;color:#bfcbba;font-size:12px;font-weight:400}
.map-discovery-chips{display:flex;flex-wrap:wrap;gap:6px;margin:1px 0 13px}
.map-discovery-chips button{min-height:38px;padding:7px 13px;border:1px solid #71846b;border-radius:20px;background:#25362d;color:#e9ecdf;font:600 12px system-ui;cursor:pointer}
.map-discovery-chips button:hover{background:#3b5240}
.map-discovery-chips button.on{border-color:#e5bd68;background:#71542a;color:#fff3d4;box-shadow:inset 0 0 0 1px #f0c25a55}
.map-discovery-pin small{display:block;margin-top:4px;color:#e1d3ae;font-size:11px;line-height:1.35}
.map-discovery-results{scrollbar-color:#869b78 #233024}
.world-discovery .map-discovery-results{max-height:180px}
@media(max-width:620px){
 .world-map-modal{display:flex;flex-direction:column;width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px);max-height:calc(100dvh - 12px);padding:12px 10px!important}
 .world-map-modal>h2{order:0;margin:0 30px 10px 0}
 .world-map-modal>.worldwrap{order:1;flex:none;margin:0}
 .world-map-modal>.world-discovery{order:2;margin:10px 0 0}
 .world-map-modal>.world-pin-help{order:3;margin:7px 0 0}
 .world-map-modal>p:first-of-type{display:none}
 .world-map-modal .wmctl{left:6px;right:6px;top:auto;bottom:6px;justify-content:center;flex-wrap:wrap}
 .world-map-modal .wmctl button{min-height:36px}
 .world-discovery>summary{padding:10px 11px}
 .map-discovery-summary-hint{display:block;margin:2px 0 0 18px}
 .world-discovery .map-discovery-body{padding:0 10px 12px}
 .map-discovery-chips{gap:5px}
 .map-discovery-chips button{flex:1 1 auto;padding:7px 9px}
 .world-discovery .map-discovery-controls{grid-template-columns:1fr 1fr;gap:8px}
 .world-discovery .map-discovery-controls>label:first-child{display:none}
 .world-discovery .map-discovery-controls>button{grid-column:2;grid-row:1}
 .world-discovery .map-discovery-controls label:has(.map-discovery-detail){grid-column:1;grid-row:1}
 .world-discovery .map-discovery-query{grid-column:1/-1}
 .world-discovery .map-discovery-results{max-height:170px}
}


@media(min-width:621px){
 .world-map-modal{display:flex;flex-direction:column}
 .world-map-modal>h2{order:0;margin:0 32px 5px 0}
 .world-map-modal>p:first-of-type{order:1;margin:0 0 10px}
 .world-map-modal>.worldwrap{order:2}
 .world-map-modal>.world-discovery{order:3;margin:11px 0 0}
 .world-map-modal>.world-pin-help{order:4}
}

