.bgm {--mg:#c9a55c;--ml:rgba(201,165,92,.26);--mf:#dfd9cc;--md:#9e9eaa;--mb:#15181c;color:var(--mf);font:14px/1.6 system-ui,"Microsoft YaHei",sans-serif;min-width:0}
.bgm *{box-sizing:border-box}.bgm [hidden]{display:none!important}
.bgm input:not([type=checkbox]),.bgm select,.bgm textarea{border:1px solid var(--ml);border-radius:4px;background:#111417;color:var(--mf);padding:.5rem .6rem;font:inherit;max-width:100%}
.bgm input[type=checkbox]{accent-color:var(--mg)}.bgm button{font:inherit;cursor:pointer}.bgm .bgm-btn{font-size:12px;padding:.32rem .7rem;border:1px solid var(--ml);border-radius:4px;color:var(--mf);background:#1a1c20}.bgm .bgm-btn:hover,.bgm .bgm-btn:focus-visible{border-color:var(--mg);color:#eee2c5}
.bgm button:focus-visible,.bgm a:focus-visible,.bgm input:focus-visible,.bgm select:focus-visible{outline:2px solid var(--mg);outline-offset:2px}
.bgm-toolbar{display:flex;gap:7px 10px;align-items:center;flex-wrap:wrap;margin:0 0 10px}.bgm-caption{color:var(--md);font-size:12px}.bgm-legend{display:flex;gap:5px;flex-wrap:wrap;align-items:center;margin:0 0 8px}.bgm .bgm-chip{background:#15171b;border:1px solid #37383a;color:#8d9095;border-radius:14px;padding:4px 9px;font-size:12px;display:inline-flex;align-items:center;gap:5px;min-height:30px}.bgm .bgm-chip[aria-pressed=true]{color:#e5dcce;border-color:var(--ml);background:#202023}.bgm-chip::before{content:"";height:6px;width:6px;border:1px solid var(--dot);border-radius:50%;background:transparent}.bgm-chip[aria-pressed=true]::before{background:var(--dot)}.bgm-hide{display:inline-flex;gap:5px;align-items:center;font-size:12px;margin-left:auto}
.bgm-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(235px,28%);border:1px solid var(--ml);border-radius:7px;overflow:hidden;background:#101316}
.bgm-pane{position:relative;isolation:isolate;min-width:0}.bgm-view{width:100%;height:clamp(400px,64vh,780px);background:#101518;z-index:0;font:inherit}
.bgm-view .leaflet-bar{border:1px solid #584c35!important;box-shadow:0 2px 9px #0006!important}.bgm-view .leaflet-bar a{background:#181b20;color:#e1c789;border-color:#4a4232}.bgm-view .leaflet-bar a:hover{background:#2d2c27}.bgm-view .leaflet-bar a.leaflet-disabled{color:#626260}.bgm-view .leaflet-control-scale-line{background:#121519be;color:#cbc4b6;text-shadow:none;border-color:#b9a278}
.bgm-status{display:flex;justify-content:space-between;gap:8px;align-items:center;background:#13161a;border-top:1px solid var(--ml);padding:5px 9px;font-size:11px;color:#aba99e}.bgm-hud{font-variant-numeric:tabular-nums;color:#e1c997}
.bgm-aside{padding:17px 15px;overflow-y:auto;max-height:min(74vh,845px);border-left:1px solid var(--ml);scrollbar-width:thin;scrollbar-color:#5b513d #16191c}.bgm-aside h3{margin:.4rem 0 .5rem;line-height:1.5;color:#e3d2ad;font-size:18px;font-weight:600}
.bgm-aside p{margin:0 0 .75rem;font-size:13px;line-height:1.7;overflow-wrap:anywhere}.bgm-label{font-size:11px;letter-spacing:.1em;color:#bfaa7e}.bgm-list{list-style:none;margin:6px 0;padding:0}.bgm-list li{margin:0;border-bottom:1px solid #ffffff0c}.bgm-list button{padding:7px 0;border:0;background:transparent;color:#d9d3c7;font-size:12.5px;line-height:1.55;text-align:left;width:100%}.bgm-list small{display:block;color:#999b9f;font-size:10px}.bgm-color{display:inline-block;width:6px;height:6px;background:var(--dot);border-radius:50%;margin-right:6px}.bgm-info{border-left:2px solid #877245;background:#1b1c1d;padding:7px 10px;margin:10px 0;color:#bcb8ae;font-size:12px}
.bgm-actions{display:flex;gap:6px;flex-wrap:wrap;margin:9px 0}.bgm-flag-form label{display:grid;font-size:12px;margin-bottom:9px;gap:3px}.bgm-flag-form textarea{resize:vertical;width:100%;min-height:66px}
.bgm-pin{background:none;border:0}.bgm-marker{width:23px;height:28px;display:grid;place-items:center;filter:drop-shadow(0 1px 2px #000a)}.bgm-marker svg{width:23px;height:28px}.bgm-marker.bgm-active svg{filter:drop-shadow(0 0 4px #f9d67b)}.bgm-active:before{content:"";position:absolute;bottom:-4px;left:2px;width:20px;height:9px;border:1px solid #edc875;border-radius:50%;animation:bgm-pulse 1.6s ease-out infinite}@keyframes bgm-pulse{to{transform:scale(2.4);opacity:0}}@media(prefers-reduced-motion:reduce){.bgm-active:before{animation:none}}
.bgm-view .leaflet-tooltip{color:#e5d9bd;background:#1a1c20;border:1px solid #6b5836;font:12px/1.5 system-ui,sans-serif;box-shadow:none;padding:3px 6px}.bgm-view .leaflet-tooltip:before{display:none}
.bgm-meta{font-size:12px;color:#92949c;margin:8px 0}.bgm-meta>summary{cursor:pointer;display:list-item}.bgm-detail-note{font-size:12px;color:#bcb8ac}.bgm-nameplate{display:inline-block;color:#c5af84;font-size:11px;letter-spacing:.13em}.bgm-compass{position:absolute;right:10px;top:12px;display:grid;place-items:center;width:27px;height:45px;line-height:1;color:#dcc69c;pointer-events:none;font:11px Georgia,serif;text-shadow:0 1px 2px #000}.bgm-compass:after{content:"";display:block;height:25px;width:9px;clip-path:polygon(50% 0,100% 100%,50% 74%,0 100%);background:linear-gradient(90deg,#d3be91 50%,#82765f 50%)}
@media(max-width:900px){.bgm-layout{grid-template-columns:minmax(0,1fr) minmax(196px,29%)}}
@media(max-width:710px){.bgm-layout{grid-template-columns:1fr}.bgm-view{height:clamp(340px,55vh,580px)}.bgm-aside{border-left:0;border-top:1px solid var(--ml);max-height:40vh}.bgm-aside h3{font-size:16px}.bgm-hide{margin-left:0}.bgm-toolbar{gap:6px}.bgm-status{flex-wrap:wrap}.bgm-toolbar select{max-width:100%;flex:1 1 160px}}
.bgm .bgm-map-note{margin:6px 0 0;font-size:11.5px;color:#a49e90}
.bgm-reference{width:min(1050px,95vw);border:1px solid #665a40;border-radius:8px;background:#121519;color:#e0d6be;margin:auto;padding:0;max-height:94dvh;box-shadow:0 16px 90px #000}.bgm-reference::backdrop{background:#070809c9}.bgm-refbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 15px}.bgm-reference strong{font:600 18px/1.3 Georgia,"Microsoft YaHei",serif}.bgm-refview{height:min(64vh,690px);background:#151a1a}.bgm-reffoot{padding:9px 14px;font-size:12px;color:#b8b4a8;display:flex;align-items:center;justify-content:space-between;gap:10px}.bgm-refview .leaflet-bar a{background:#191b1f;color:#cfb77d;border-color:#534d3e}

.bgm-grid{position:absolute;inset:0 auto auto 0;z-index:1;pointer-events:none}.bgm-compass{z-index:2}.bgm-online{display:flex;gap:5px;flex-wrap:wrap;margin-left:auto}.bgm-detail-head{display:flex;align-items:center;gap:12px;min-width:0}.bgm-detail-head>div{min-width:0}.bgm-view{background:#0c1218}
@media(max-width:710px){.bgm-online{margin-left:0}}

/* Contain the toolbar and the drawer at their own grid width. */
.bgm,.bgm-toolbar,.bgm-legend,.bgm-layout,.bgm-pane,.bgm-view,.bgm-aside,.bgm-online,.bgm-actions{min-width:0;max-width:100%}
.bgm{width:100%;overflow-wrap:anywhere}
.bgm-toolbar{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:7px 9px}
.bgm-toolbar>.bgm-caption{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:7px;min-width:0;max-width:100%;flex:0 1 clamp(198px,34%,350px)}
.bgm-toolbar>.bgm-caption select{min-width:0;max-width:100%;width:100%;text-overflow:ellipsis}
.bgm-toolbar>.bgm-btn{flex:0 1 auto;min-width:0;max-width:100%}
.bgm-online{display:flex;align-items:center;flex-flow:row wrap;gap:5px;margin-left:auto;flex:0 1 auto}
.bgm-online .bgm-btn{flex:0 1 auto;min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.bgm-toolbar .bgm-btn,.bgm-actions .bgm-btn,.bgm-aside h3,.bgm-side-title{overflow-wrap:anywhere}
.bgm-layout{width:100%;grid-template-columns:minmax(0,1fr) minmax(0,clamp(200px,29%,340px))}
.bgm-aside{overflow-x:hidden;padding-inline:clamp(9px,1.2vw,15px)}
.bgm-aside label,.bgm-aside :is(input[type=search],input[type=text],textarea){min-width:0;max-width:100%}
.bgm-aside input[type=search]{width:100%}
.bgm-aside .bgm-detail-head>*:last-child,.bgm-status>*{min-width:0;overflow-wrap:anywhere}
.bgm-grid{max-width:100%}
@media(max-width:760px){
 .bgm-layout{grid-template-columns:minmax(0,1fr)}
 .bgm-toolbar>.bgm-caption{flex:1 1 min(100%,240px)}
 .bgm-online{margin-left:0}
 .bgm-aside{border-left:0;border-top:1px solid var(--ml);max-height:45vh}
}
@media(max-width:485px){
 .bgm-toolbar>.bgm-caption,.bgm-online{flex:1 1 100%}
 .bgm-online .bgm-btn{flex:1 1 110px;text-align:center}
 .bgm-toolbar>.bgm-btn{white-space:normal;padding-inline:.48rem}
}

.bgm-embed-view{height:min(66vh,720px);overflow:hidden;background:#141820}.bgm-embed-frame{display:block;width:100%;height:100%;border:0}.bgm-online-dialog .bgm-reffoot a{flex:none}.bgm-online-dialog .bgm-reffoot span{min-width:0}
@media(max-width:710px){.bgm-online-dialog .bgm-reffoot{flex-direction:column;align-items:flex-start}}

/* On desktop the title, toolbar and legend precede the map. Reserve their space
   in the viewport and keep the complete index panel visible with its own scroll. */
@media (min-width: 1051px) {
  .bgm .bgm-aside {
    align-self: start;
    max-height: min(845px, max(300px, calc(100vh - 350px)));
    max-height: min(845px, max(300px, calc(100svh - 350px)));
  }
}
