/* ===== Graph Area ===== */
/* Left column wrapper: header on top, graph fills rest */
#graph-and-header {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#graph-container {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

#graph-area {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-right: 0;
  display: flex;
  flex-direction: column;
}

/* Sigma needs a non-zero height container */
#sigma-container {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

/* Labels canvas overlay */
#labels-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* Brand badge overlay — absolute so it doesn't change layout */
#brand-badge {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 3;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--brand-border);
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
  pointer-events: none;
}

#brand-badge img {
  height: 28px;
  display: block;
}

/* ===== Map Header ===== */
#map-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--brand-bg, #fff);
  border-bottom: 1px solid var(--brand-border, #e5e7eb);
}

#map-logo {
  height: 32px;
  flex-shrink: 0;
}

#map-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--brand-ink, #111827);
}

#graph-area {
  display: flex;
  flex-direction: column;
}

/* ===== Label visibility (CSS-only) ===== */
/* Improve readability of canvas-drawn zoom labels by brightening and adding shadow. */
#sigma-container canvas.sigma-labels,
#sigma-container canvas[data-sigma-layer="labels"] {
  mix-blend-mode: normal;
  filter: brightness(1.6) contrast(1.15) drop-shadow(0 0 1px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 3px rgba(0, 0, 0, 0.6));
}

/* Keep hover layer crisp (don’t inherit heavy filters) */
#sigma-container canvas.sigma-hovers,
#sigma-container canvas[data-sigma-layer="hovers"] {
  filter: none;
}

/* If Sigma renders hover labels as DOM tooltips, style them */
#sigma-container .sigma-tooltip,
#sigma-container .sigma-hover,
#sigma-container .sigma-label-hover {
  color: #111827 !important;
  background: #ffffff !important;
  border: 1px solid rgba(17, 24, 39, 0.15) !important;
  border-radius: 6px !important;
  padding: 2px 6px !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
  font-weight: 600;
}

/* Slight shadow to the bucket labels overlay so text pops on dark map */
#labels-overlay {
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.85));
}