html, body { height: 100%; overflow: hidden; }
body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif; }
#map { position: absolute; top: 0; bottom: 0; width: 100%; }

/* Summary box */
#leftColumn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  width: 320px; /* Fix column width so sibling collapse doesn't shrink it */
}

#summaryBox {
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 14px;
  line-height: 1.4;
  width: 67%;
  margin-bottom: 8px;
}
#summaryBox .title { font-weight: 600; margin-bottom: 8px; color: #333; }
#summaryBox .row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }

.rightBox {
  position: absolute;
  right: 12px;
  background: rgba(255,255,255,0.96);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 13px;
  line-height: 1.4;
  z-index: 2;
  min-width: 320px;
}
.rightBox#threeDBox { min-width: 0; }
.collapsed { min-width: 0; width: max-content; padding-right: 12px; }
#threeDContent, #filterContent {
  max-height: 34vh;
  overflow: auto;
  scrollbar-gutter: stable both-edges;
  padding-right: 12px;
  box-sizing: border-box;
}

/* Ensure collapsed boxes hide their content definitively */
#threeDBox.collapsed #threeDContent,
#filterBox.collapsed #filterContent {
  display: none !important;
}

/* Collapsed style for left column boxes - width to title only and tighter header padding */
#summaryBox.collapsed #summaryContent,
#hoverBox.collapsed #hoverContent {
  display: none !important;
}
#summaryBox .collapsible-header, #hoverBox .collapsible-header { padding: 6px 8px; }
#summaryBox.collapsed .collapsible-header, #hoverBox.collapsed .collapsible-header { padding: 2px 6px; }
#summaryBox.collapsed, #hoverBox.collapsed { width: max-content; }
#hoverBox.collapsed { min-width: 0; }

/* Always-visible custom scrollbars (WebKit/Blink) */
#threeDContent::-webkit-scrollbar, #filterContent::-webkit-scrollbar {
  width: 10px;
}
#threeDContent::-webkit-scrollbar-track, #filterContent::-webkit-scrollbar-track {
  background: #f2f2f2;
  border-radius: 8px;
}
#threeDContent::-webkit-scrollbar-thumb, #filterContent::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 8px;
}
#threeDContent::-webkit-scrollbar-thumb:hover, #filterContent::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

#modeToggle {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

#modeToggle label {
  margin-right: 16px;
  cursor: pointer;
  font-weight: 500;
}

/* Fixed hover info box */
#hoverBox {
  background: rgba(255, 255, 255, 0.95);
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 13px;
  line-height: 1.4;
  width: 67%;
  display: block;
  margin-top: 8px;
}
#hoverBox .precinct-title { 
  font-weight: 600; 
  margin-bottom: 6px; 
  color: #333; 
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}
#hoverBox .info-row { 
  margin-bottom: 3px; 
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

/* Zoom indicator box */
#zoomBox {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 12px;
  font-weight: 500;
  z-index: 1;
  color: #333;
}

/* Guide button */
#guideBtn {
  position: absolute;
  left: 12px;
  bottom: 90px; 
  z-index: 3;
  background: #2a6db0;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
#guideBtn:hover { background: #245f98; }

#aboutBtn {
  position: absolute;
  left: 12px;
  bottom: 50px; /* tighter gap above zoom (12px) */
  z-index: 3;
  background: #2a6db0;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-size: 13px;
}
#aboutBtn:hover { background: #245f98; }

/* Allow interacting with the map while intro overlay is shown */
.introjs-overlay { pointer-events: none !important; }
.introjs-tooltip { pointer-events: auto; }
/* Ensure helper/highlight layers don't block clicks on targeted controls */
.introjs-helperLayer { pointer-events: none !important; background: transparent !important; }
.introjs-tooltipReferenceLayer { pointer-events: none !important; }
.introjs-disableInteraction { pointer-events: none !important; }
/* Green outline for highlighted element during guide */
.introjs-helperLayer {
  border: 6px solid #25DB9E !important; /* dark green */
  box-shadow: none !important;
}
/* Enlarge guide tooltip */
.introjs-tooltip {
  max-width: 520px !important;
  width: 420px;
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.5;
}
.introjs-tooltiptext { font-size: 14px; }

/* Welcome modal */
#welcomeModal {
  position: fixed;
  inset: 0;
  display: none; /* shown on load via JS */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  z-index: 5;
}
.welcome-card {
  background: #fff;
  padding: 16px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.2);
  max-width: 360px;
  width: calc(100% - 48px);
  color: #333;
}
.welcome-card h3 { margin: 0 0 8px 0; font-size: 18px; }
.welcome-card p { margin: 0 0 12px 0; font-size: 14px; line-height: 1.4; }
.welcome-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn { border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn.secondary { background: #e9eef3; color: #2a2a2a; }
.btn.primary { background: #2a6db0; color: #fff; }
.btn.primary:hover { background: #245f98; }


