html,
body {
  margin: 0;
  padding: 5;
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center; /* Center horizontally */
  align-items: center; /* Center vertically */
}

#map {
  position: relative; /* 🔧 This is the critical fix */
  width: 100%; /* Adjust width to your desired size */
  height: 100%; /* Adjust height to your desired size */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Optional: subtle shadow for effect */
  border-radius: 8px; /* Optional: rounded corners */
  overflow: hidden;
}

#map svg {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none; 
    z-index: 2; 

  }
  
  
#map svg circle {
  fill-opacity: 0.6;
  stroke: white;
  stroke-width: 1;
  pointer-events: auto;
}

header {
    display: flex;
    align-items: baseline;
    gap: 1em;
    margin-bottom: 1em;
  }
  
  label {
    margin-left: auto;
  }
  
  #timeDisplay,
  #anyTime {
    display: block;
  }
  
  #anyTime {
    color: #888;
    font-style: italic;
  }

  svg circle {
    --color-departures: steelblue;
    --color-arrivals: darkorange;
    --color: color-mix(
      in oklch,
      var(--color-departures) calc(100% * var(--departure-ratio)),
      var(--color-arrivals)
    );
    fill: var(--color);
    fill-opacity: 0.6;
    stroke: white;
    stroke-width: 1;
    pointer-events: auto;
  }

/* Shared color logic for both circles and legend blocks */
svg circle,
.legend > div {
  --color-departures: steelblue;
  --color-arrivals: darkorange;
  --color: color-mix(
    in oklch,
    var(--color-departures) calc(100% * var(--departure-ratio)),
    var(--color-arrivals)
  );
  background-color: var(--color);
}

/* Legend layout */
.legend {
  display: flex;
  gap: 1px;                  
  margin-block: 1em;          
  font-size: 0.9em;
  text-align: center;
  width: 100%;             
  max-width: 100%;         
}

.legend > div {
  flex: 1;
  color: white;
  padding: 0.5em 1em;
}



  
  
