body { margin:0; padding:0; font-family:sans-serif; }
#topbar { position: absolute; top: 0; left: 0; width: 100%; height: 50px; background:#f5f5f5; border-bottom:1px solid #ccc; display:flex; align-items:center; padding:0 10px; box-sizing:border-box; z-index:103; }
#sidebar { position: fixed; top: 50px; left: 0; width: 220px; height: calc(100vh - 50px); background: #fff; border-right: 1px solid #ccc; padding: 10px; box-sizing: border-box; z-index: 102; transition: width .3s ease; overflow-y:auto; }
#sidebar.collapsed { width: 70px; }
#map { position: absolute; top: 50px; left: 220px; width: calc(100% - 220px); height: calc(100vh - 50px); transition: left .3s ease, width .3s ease; }
#sidebar.collapsed ~ #map { left: 70px; width: calc(100% - 70px); }
#sidebar button { width: 100%; height: 40px; display:flex; align-items:center; gap:8px; padding:0 10px; margin:8px 0; border:none; background:#eee; border-radius:6px; cursor:pointer; overflow:hidden; white-space:nowrap; }
#sidebar button:hover { background:#ddd; }
#modeBox { position:absolute; bottom:10px; right:10px; z-index:102; background:#fff; border:1px solid #ccc; padding:6px 10px; }
#rightSidebar { position:fixed; top:50px; right:0; width:60px; height:calc(100vh - 50px); background:#fff; border-left:1px solid #ccc; box-sizing:border-box; transition: width .3s ease; z-index:102; overflow:hidden; display:none; }
#rightSidebar.expanded { width:260px; }
#rightSidebar .toggleRightSidebar { display:flex; align-items:center; justify-content:center; gap:6px; width:100%; height:40px; cursor:pointer; border-bottom:1px solid #ccc; }
#rightSidebar #infoContent { padding:10px; overflow-y:auto; height:calc(100% - 40px); }
.building-info { border-bottom:1px solid #ccc; padding:8px 0; }
.marker-icon { background:#d00; color:#fff; width:22px; height:22px; display:flex; align-items:center; justify-content:center; border-radius:50%; font-weight:700; font-size:14px; }
.marker-label { font-size:12px; margin-top:2px; background:#fff; padding:1px 4px; border-radius:3px; border:1px solid #ccc; }
#loadingModal{ display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:1000; justify-content:center; align-items:center; }
#loadingContent{ background:#fff; padding:16px 20px; border-radius:6px; }
input[type="file"]{ display:none; }
.section-title{ font-size:12px; color:#555; margin-top:12px; }
.control-block{ margin-top:8px; padding-top:8px; border-top:1px solid #ddd; }
.clickable{ display:flex; justify-content:center; align-items:center; height:36px; cursor:pointer; }
#diag { position:fixed; bottom:6px; left:6px; background:#fff; border:1px solid #ccc; font:11px/1.4 monospace; padding:6px 8px; z-index:1000; border-radius:6px; max-width:46vw; max-height:40vh; overflow:auto; display:none; }
/* Collapsed left sidebar: hide labels, show icons only */
#sidebar button .icon { width:24px; display:inline-flex; justify-content:center; }
#sidebar button .label { display:inline; }
#sidebar.collapsed .section-title,
#sidebar.collapsed .control-block,
#sidebar.collapsed input,
#sidebar.collapsed select,
#sidebar.collapsed label { display:none; }
#sidebar.collapsed button { justify-content:center; }
#sidebar.collapsed button .label { display:none; }
#sidebar.collapsed button .icon { margin:0; }
/* Right sidebar building count badge (visible only when collapsed) */
#rightSidebar .count-badge { font-size:12px; background:#333; color:#fff; border-radius:12px; padding:2px 6px; display:none; }
#rightSidebar:not(.expanded) .count-badge { display:inline-block; }
#rightSidebar.expanded .count-badge { display:none; }

#rightSidebar:not(.expanded) #infoContent { display:none; }

.building-controls{margin-top:6px;}
.building-controls input[type=range]{width:100%;}
