* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #EEF4FB;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  touch-action: none;
}

#canvas-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#labels-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.edge-label {
  position: absolute;
  left: 0;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(2, 132, 199, 0.65);
  color: #0369A1;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
  will-change: transform;
}

.building-label {
  position: absolute;
  left: 0;
  top: 0;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(5, 150, 105, 0.65);
  color: #0F172A;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  will-change: transform;
}

.building-label.invalid {
  border-color: #DC2626;
  color: #991B1B;
  background: rgba(254, 226, 226, 0.95);
}

.vertex-badge {
  position: absolute;
  left: 0;
  top: 0;
  background: #0284C7;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.2);
  will-change: transform;
}

#measure-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid #0284C7;
  color: #0369A1;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

#compass-widget {
  position: fixed;
  top: 106px;
  right: 12px;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.18));
}

.hidden {
  display: none !important;
}