.mini-map-panel {
 position: fixed;
 z-index: 35;
 top: clamp(60px, 15vh, 116px);
 left: 16px;
 width: min(var(--mini-map-width, 330px), calc(100vw - 24px), max(220px, calc(100dvh - 150px)));
 box-sizing: border-box;
 color: #f3f7ef;
 font-family: system-ui, sans-serif;
}
.mini-map-panel[hidden], .mini-map-panel [hidden] { display: none; }
.mini-map-panel header, .mini-map-actions {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 6px;
}
.mini-map-panel header {
 padding: 4px 5px 4px 11px;
 border-radius: 20px;
 background: #182022e8;
 margin-bottom: 7px;
 cursor: grab;
 touch-action: none;
 user-select: none;
}
.mini-map-panel header:active { cursor: grabbing; }
.mini-map-panel header strong { font-size: 13px; white-space: nowrap; }
.mini-map-panel button, .mini-map-panel select {
 border: 1px solid #ffffff40;
 border-radius: 12px;
 background: #242d2ff5;
 color: #f2f6ed;
 font: 12px system-ui, sans-serif;
 padding: 5px 8px;
}
.mini-map-panel select { min-width: 0; max-width: 57%; }
.mini-map-plan {
 position: relative;
 overflow: hidden;
 border-radius: 50%;
 background: #b9c4c870;
 box-shadow: inset 0 0 0 1px #ffffff42;
}
.mini-map-plan svg { display: block; width: 100%; }
.mini-map-plan [role=button] { cursor: pointer; }
.mini-map-plan polygon { fill-opacity: .35; stroke-width: 2.5; stroke-linejoin: round; }
.mini-map-plan .over-image polygon { fill-opacity: .17; stroke-opacity: .68; stroke-width: 1.6; }
.mini-map-plan [role=button]:hover polygon, .mini-map-plan [role=button]:focus-visible polygon,
.mini-map-plan .selected polygon { fill-opacity: .5; stroke-opacity: 1; stroke-width: 2.7; }
.mini-map-plan .calibrating { cursor: crosshair; }
.mini-map-plan .calibrating [role=button] { cursor: crosshair; }
.mini-map-guide { fill: #ffcf36; stroke: #1d2830; stroke-width: 2; pointer-events: none; }
.mini-map-guide-number { fill: #111820; font: bold 10px system-ui; dominant-baseline: central; text-anchor: middle; pointer-events: none; }
.mini-map-marker { fill: #ffc300; stroke: #fff; stroke-width: 2; pointer-events: none; filter: drop-shadow(0 1px 2px #18212c99); }
.mini-map-room-badge {
 position: absolute;
 transform: translate(-50%, 15px);
 max-width: 44%;
 pointer-events: none;
 text-align: center;
 padding: 4px 8px;
 border-radius: 7px;
 background: #fffffff2;
 color: #202a34;
 box-shadow: 0 2px 6px #17202738;
 font-size: 12px;
 line-height: 1.4;
}
.mini-map-room-badge.above { transform: translate(-50%, calc(-100% - 15px)); }
.mini-map-room-badge span { display: block; font-weight: 700; }
.mini-map-room-badge span:empty { display: none; }
.mini-map-actions { justify-content: center; margin-top: 5px; }
.mini-map-status, .mini-map-alignment { margin: 5px 0 0; padding: 5px 8px; background: #182022ec; border-radius: 9px; font-size: 12px; }
.mini-map-status:empty { display: none; }
.mini-map-lidar-guides {
 position: absolute;
 inset: 0;
 z-index: 30;
 pointer-events: none;
 overflow: hidden;
}
.mini-map-lidar-guides span {
 position: absolute;
 top: 0;
 left: 0;
 display: grid;
 place-items: center;
 width: 23px;
 height: 23px;
 border: 2px solid #202a34;
 border-radius: 50%;
 background: #ffcf36;
 color: #111820;
 font: bold 12px system-ui, sans-serif;
 box-shadow: 0 1px 5px #0008;
}
.mini-map-lidar-guides span[hidden] { display: none; }
.mini-map-aligning canvas { cursor: crosshair; }
.mini-map-aligning :is(#markers, #measureLayer, #roomNameLayer) { visibility: hidden; }

.mini-map-plan .plan-clickable image { cursor: pointer; }
.mini-map-lidar-center {
 position: absolute;
 top: 0;
 left: 0;
 width: 16px;
 height: 16px;
 z-index: 29;
 border: 2px solid #ffc300;
 border-radius: 50%;
 box-shadow: 0 0 0 1px #19232b, inset 0 0 0 1px #19232b;
 pointer-events: none;
}
.mini-map-lidar-center::after {
 content: '';
 position: absolute;
 top: 50%;
 left: 50%;
 width: 4px;
 height: 4px;
 border-radius: 50%;
 background: #ffc300;
 box-shadow: 0 0 0 1px #19232b;
 transform: translate(-50%, -50%);
}
.mini-map-lidar-center[hidden] { display: none; }
.mini-map-body { position: relative; }
.mini-map-panel .mini-map-resize {
 position: absolute;
 right: 0;
 bottom: 0;
 width: 32px;
 height: 32px;
 padding: 0;
 font-size: 19px;
 cursor: nwse-resize;
 touch-action: none;
}

.mini-map-actions { flex-wrap: wrap; }
.mini-map-plan svg.can-pan { cursor: grab; touch-action: none; }
.mini-map-plan svg.can-pan :is(image, [role=button]) { cursor: grab; }
.mini-map-plan svg.panning, .mini-map-plan svg.panning :is(image, [role=button]) { cursor: grabbing; }

.mini-map-search { margin: 0 0 5px; }
.mini-map-search input {
 box-sizing: border-box;
 width: 100%;
 padding: 6px 9px;
 border: 1px solid #ffffff40;
 border-radius: 12px;
 background: #182022ed;
 color: #f2f6ed;
 font: 12px system-ui, sans-serif;
}
.mini-map-search ul {
 list-style: none;
 margin: 4px 0 0;
 padding: 4px;
 max-height: 104px;
 overflow: auto;
 border-radius: 10px;
 background: #182022ed;
 color: #f2f6ed;
 font: 12px system-ui, sans-serif;
}
.mini-map-search li button { width: 100%; text-align: left; }
.mini-map-plan .search-match polygon { fill-opacity: .65; stroke-opacity: 1; stroke-width: 4; }
