.map-hud,.map-drawer-close{display:none}
@media(min-width:761px){
 body.logged-in:has(#mapView.active) .app-shell{display:block}
 body.logged-in:has(#mapView.active) main{display:block}
 body.logged-in:has(#mapView.active) .sidebar{display:contents}
 body.logged-in:has(#mapView.active) .sidebar>:not(.nav-tabs){display:none}
 body.logged-in.map-menu-open:has(#mapView.active) .sidebar{position:fixed;left:14px;top:157px;bottom:auto;width:290px;max-height:calc(100dvh - 291px);overflow:auto;display:flex;z-index:1050;border:1px solid #728473;border-radius:14px;background:#10231ff7}
 body.logged-in.map-menu-open:has(#mapView.active) .sidebar>.login-card{display:block}
 body.logged-in.map-menu-open:has(#mapView.active) .sidebar>.nav-tabs{display:grid;order:-1}
 body.logged-in:has(#mapView.active) .sidebar{backdrop-filter:none}
 body.logged-in:has(#mapView.active) .topbar{display:none}
 body.logged-in #mapView.active{--map-tools-bottom:26px;position:relative;display:block;padding:0}
 body.logged-in #mapView #map{width:100%;height:100dvh;max-height:none;min-height:0;border:0;border-radius:0}
 .logged-in #mapView .details-panel{display:none}
 .logged-in.map-address-open #mapView.active .details-panel{display:block;position:absolute;z-index:990;right:14px;top:116px;width:min(380px,40vw);max-height:calc(100dvh - 242px - var(--map-tools-bottom));background:#11241ff7;border:1px solid #778572;border-radius:14px;box-shadow:0 8px 24px #09171355}
 .logged-in #mapView .map-drawer-close{display:block;float:right;position:relative;z-index:2}
 .logged-in #mapView .map-hud{display:block;position:absolute;z-index:950;color:#eff7e9;border:1px solid #84927a;background:linear-gradient(145deg,#263e36,#10221f);border-radius:12px;box-shadow:0 5px 16px #06141050;text-align:left;cursor:pointer}
 .logged-in #mapView .map-hud[hidden]{display:none}
 #mapMenu{top:108px;left:14px;padding:10px 15px;font-weight:800}
 #mapMission{top:14px;right:14px;max-width:33vw;padding:10px 15px}
 .map-hud small,.map-hud strong{display:block}.map-hud small{color:#f6cc80}.map-hud strong{font-size:16px}
 .logged-in #mapView #mapHero{display:flex;align-items:center;gap:10px;top:14px;left:14px;width:min(260px,32vw);padding:6px 13px 6px 6px}
 .map-portrait{width:58px;height:73px;overflow:hidden;border-radius:7px;background:#09100f}
 .map-portrait .rpg-avatar{display:block;width:100px;height:150px;max-height:none;max-width:none;margin-left:-21px;object-fit:contain}
 #mapHero>span:last-child{overflow:hidden}
 #mapHero strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .map-portrait{flex-shrink:0}
 #mapHero progress{width:140px;max-width:100%;height:6px;accent-color:#8bd897}
 body.logged-in:has(#mapView.active) .sidebar>.nav-tabs{display:none}
 body.logged-in.map-menu-open:has(#mapView.active) .nav-tabs button{min-height:42px;text-align:left}
 body.logged-in.map-menu-open:has(#mapView.active) .nav-tabs button::before{content:attr(data-icon);margin-right:.45em}
 body.logged-in:has(#mapView.active) .team-chat{left:14px;bottom:75px;width:min(250px,22vw)}
 body.logged-in:has(#mapView.active) .team-chat.chat-open{width:min(370px,42vw)}
 #mapView .map-location-control{position:fixed;right:58px;bottom:var(--map-tools-bottom);margin:0;display:flex;align-items:center;gap:4px;padding:4px;background:rgba(17,36,30,.82);border:1px solid #ffffff50;border-radius:10px;backdrop-filter:blur(5px)}
 #mapView .map-location-control .map-location-button{width:34px;height:34px;margin:0;color:#eff7e9;background:transparent;border:0;box-shadow:none}
 #mapView .map-location-control .map-location-message{left:auto;right:0;bottom:100%;z-index:1}
 #mapView .map-status-control{display:flex;align-items:center;color:#eff7e9;border-right:1px solid #ffffff40}
 #mapView .map-status-control select{min-width:0;width:126px;margin:0;padding:6px;background:#19322aba;color:inherit;border:0;font:600 13px system-ui}
 #mapView .map-status-control select option{background:#19322a;color:white}
 #mapView .map-status-control label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 #mapView .map-hint{position:fixed;right:14px;bottom:calc(var(--map-tools-bottom) + 56px);margin:0}
 @media(max-width:1040px){.logged-in #mapView.active{--map-tools-bottom:80px}}
 #mapView .leaflet-top.leaflet-right{top:102px}
 body.map-address-open #mapView .leaflet-top.leaflet-right{right:min(405px,43vw)}
}

#characterDialog{box-sizing:border-box;width:min(1100px,calc(100vw - 24px));max-height:90dvh;overflow:auto;overscroll-behavior:contain;padding:0;border:1px solid #577162;border-radius:16px;background:#10221e;color:var(--text)}
#characterDialog::backdrop{background:rgb(3 12 9 / .7)}
#characterView{padding:clamp(12px,2vw,24px)}
#characterView>.section-heading{position:sticky;top:0;z-index:2;padding:8px 0;background:#10221e;display:flex;flex-direction:row;align-items:center;justify-content:space-between}

/* Menu panels stay above the map without replacing its viewport. */
.menu-dialog{box-sizing:border-box;width:min(1120px,calc(100vw - 32px));max-width:none;max-height:90dvh;padding:0;overflow:auto;overscroll-behavior:contain;border:1px solid #577162;border-radius:16px;background:#10221e;color:var(--text);box-shadow:0 20px 70px #0009}
.menu-dialog::backdrop{background:rgb(3 12 9 / .58)}
.menu-dialog-content{padding:0 24px 24px;min-width:0;overflow-wrap:anywhere}
.menu-dialog-close{position:sticky;top:8px;display:block;margin:8px 8px 0 auto;width:44px;height:44px;padding:0;border:1px solid #577162;border-radius:12px;background:#10221e;color:var(--text);font-size:28px;line-height:1;z-index:2;cursor:pointer}
.menu-dialog-close:focus-visible{outline:2px solid #b4ed57;outline-offset:2px}
@media(max-width:760px){.menu-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 24px);border-radius:12px}.menu-dialog-content{padding:0 12px 16px}.menu-dialog .section-heading{flex-wrap:wrap;gap:10px}.menu-dialog .admin-grid,.menu-dialog .management-grid,.menu-dialog .team-layout{grid-template-columns:minmax(0,1fr)}}
