:root {
  --accent: #f48424;
  --accent-soft: rgba(244, 132, 36, 0.25);
  --border-ui: #ccc;
  --bg-ui: #a6a6a6;
  --text-ui: #c7c7c7;
}

.iap-rain__top {
  padding-top: 40px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.iap-rain__controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.is-hidden {
  display: none;
}

.iap-rain__top .iap-rain__controls .iap-input {
  font-size: 15px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid #9c9c9c;
  background: #dcdcdc;
  color: #7b7b7b;
  width: 80px !important;
  font-weight: 600;
  outline: none;
}

.iap-input:hover,
.iap-input:focus {
  color: #353535;
  border-color: #777777;
  background: #f8f8f8;
}

.iap-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: var(--iap-text);
  cursor: pointer;
}

.iap-btn:hover {
  border-color: var(--iap-primary);
}

.iap_info {
  font-size: 13px;
  color: #4a4a4a;
}

.iap-toggle {
  font-size: 14px;
  display: flex;
  gap: 8px;
  font-weight: 500;
  color: #4a4a4a;
  align-items: center;
  opacity: 0.92;
  user-select: none;
  padding-bottom: 10px;
}

.iap-loader .spinner {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;

  box-sizing: border-box;
  border: 3px solid rgba(230, 137, 16, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;

  animation: spin 0.9s linear infinite;
  flex-shrink: 0;
}

.iap-loader .spinner p {
  padding: 5px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.iap-toggle input {
  transform: translateY(1px);
  accent-color: var(--iap-primary);
}

.iap_pillWrap {
  height: 40px;
}

.iap-rain__pills {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}

.iap-pill {
  padding: 2px 3px;
  border-radius: 6px;
  background: #dadada;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #d2d2d2;
}

.iap-pill--subtle {
  opacity: 0.75;
}

.iap-map {
  height: 320px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}

/* KEY: fixed chart wrapper height prevents "infinite growth" */
.iap-chartWrap {
  position: relative;
  height: 360px;
  margin-top: 18px;
  /* stable height */
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.22);
}

.iap-chartWrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.iap-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(3px);
  z-index: 2;
  font-size: 12px;
}
.iap-loader p {
  padding: 8px;
}

.iap-hidden {
  display: none !important;
}

.iap-summary {
  margin-top: 10px;
  font-size: 14px;
  opacity: 0.92;
}

/* =========================
   checkbox
   ========================= */

.iap-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;

  width: 20px;
  height: 20px;
  min-width: 18x;
  min-height: 18px;

  border-radius: 4px;
  border: 2x solid var(--border-ui);
  background: #bcbcbc;

  display: grid;
  place-items: center;

  flex-shrink: 0;
  box-sizing: border-box;

  cursor: pointer;
  transition: all 0.2s ease;
}

/* Checkmark */
.iap-toggle input[type="checkbox"]::after {
  content: "";
  width: 2px;
  height: 6px;

  border: solid #f4f4f4;
  border-width: 0px 2px 2px 0;
  background: none;

  transform: rotate(45deg) scale(0);
  transition: transform 0.15s ease;
}

/* Checked */
.iap-toggle input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.iap-toggle input[type="checkbox"]:checked::after {
  transform: rotate(45deg) scale(2);
}

/* Focus */
.iap-toggle input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.iap-copyright {
  text-align: right;
  color: #a1a1a1;
  margin-top: 20px;
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 600px) {
  .iap-rain__top {
    margin: 0;
    padding-top: 20px;
  }

  .iap_info {
    font-size: 12px;
    padding-left: 0;
  }

  .iap-toggle {
    font-size: 13px;
    padding-bottom: 10px;
  }
  .iap-pill {
    font-size: 11px;
  }
  .iap-chartWrap {
    height: 220px;
    margin-top: 15px;
  }
  .iap-map {
    height: 230px;
  }
}


.leaflet-bar,
.leaflet-control {
  background: none;
  border: none;
  height: 0; /* hide leaflet logo  */
}
