/* Modal background */
.chart-modal-bg {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.32);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-modal {
  background: #fff;
  border-radius: 1.1em;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 2.2em 2em 1.5em 2em;
  min-width: 340px;
  max-width: 98vw;
  min-height: 220px;
  position: relative;
  animation: popin 0.18s cubic-bezier(.4,1.6,.6,1) 1;
}

@keyframes popin {
  from { transform: scale(0.92); opacity: 0.2; }
  to { transform: scale(1); opacity: 1; }
}

.close-modal {
  position: absolute;
  top: 0.7em;
  right: 1.1em;
  font-size: 2em;
  color: #00b6e6;
  cursor: pointer;
  font-weight: bold;
  transition: color 0.15s;
}
.close-modal:hover {
  color: #e00;
}

.modal-range-btns {
  display: flex;
  gap: 0.5em;
  margin: 1.1em 0 0.7em 0;
  justify-content: center;
}
.modal-range-btn {
  background: #f8fafd;
  color: #00b6e6;
  border: none;
  border-radius: 0.7em;
  padding: 0.4em 1.1em;
  font-size: 1em;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.modal-range-btn.active, .modal-range-btn:hover {
  background: #00b6e6;
  color: #fff;
}

@media (max-width: 600px) {
  .chart-modal { min-width: 90vw; padding: 1.2em 0.5em 1em 0.5em; }
  .chart-modal-bg { align-items: flex-end; }
}
