p {
  font-size: 13px;
  color: #333;
  padding: 6px 10px;
}

.rain-ui {
  max-width: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.rain-header {
  display: flex;
  align-items: center;
}

h4 {
  position: relative;
  top: 20px;
  font-size: 20px;
  font-weight: 600;
  color: #f48424 !important;
}

.rain-top {
  display: grid;
  grid-template-columns: 220px 2fr;
  gap: 12px;
  align-items: stretch;
}

#map {
  width: 100%;
  height: 350px;
  border-radius: 10px;
}

#rainChart {
  height: 120px;
}

#summary {
  margin-top: 20px;
  font-size: 18px;
  color: #f48424 !important;
  font-weight: 600;
}

.rain-controls {
  margin: 10px 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

#logo {
  position: absolute;
  right: 0px;
  height: 45px;
  display: none;
}

#postcode {
  width: 90px;
  background-color: #d5d5d5 !important;
  border-radius: 8px;
  font-size: 14px !important;
  padding: 4px 8px !important;
  font-weight: 600;
  color: #555555 !important;
  border: solid 2px #949494 !important;
}
#postcode:hover,
#postcode:focus {
  background-color: #ffffff !important;
  border: solid 2px #f48424 !important;
  color: #f48424 !important;
}

/* Contex pill */

.rain-context {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #f48424;
  color: #fff;
}

.pill.subtle {
  background: #f6f6f6;
  color: #444;
  border: 1px solid #ddd;
}

/* toggle options  */
.rain-toggle {
  color: #616161;
  font-size: 13px;
}

/* Toggle container */
.rain-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

/* Hide native checkbox */
.rain-toggle input {
  display: none;
}

/* Slider track */
.toggle-slider {
  position: relative;
  width: 38px;
  height: 20px;
  background: #ccc;
  border-radius: 999px;
  transition: background 0.25s ease;
}

/* Knob */
.toggle-slider::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Checked state */
.rain-toggle input:checked + .toggle-slider {
  background: #f48424;
}

.rain-toggle input:checked + .toggle-slider::after {
  transform: translateX(18px);
}

/* Optional hover */
.rain-toggle:hover .toggle-slider {
  box-shadow: 0 0 0 2px rgba(242, 140, 40, 0.25);
}

/* Label text */
.toggle-label {
  line-height: 1;
}

/* select */

select#view,
select#range {
  position: relative;
  top: 0px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0 10px;
  font-size: 14px;
  height: 18px;
  line-height: 1;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #f48424;
  background-color: #d7d7d7;
  color: #333;
  cursor: pointer;
}

/* Hover */
select#view:hover,
select#range:hover {
  border-color: #f48424;
  background-color: #f3f3f3;
}

/* Focus */
select#view:focus,
select#range:focus {
  outline: none;
  border-color: #f48424;
  background-color: #f3f3f3;
  box-shadow: 0 0 0 2px rgba(242, 140, 40, 0.25);
}

.chart-wrap {
  position: relative;
  min-height: 250px; /* must match canvas height */
}

.rain-loader {
  position: absolute;
  inset: 0;
  z-index: 10;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(7px);

  color: #f48424;
  font-size: 13px;
}

.rain-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .rain-postcode {
    width: 100%;
  }
  select#view,
  select#range {
    height: 10px !important;
    font-size: 12px;
  }
  #rainChart {
    height: 60px;
  }
}

button {
  margin: 0px;
}
.rain-loader.hidden {
  display: none;
}

.rainfall-data-notes {
  font-size: 13px;
}

/* Disabled */
select#range:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rain-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: #f48424;
  border-radius: 50%;

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

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

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

.rain-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.rain-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rain-context {
  display: flex;
  gap: 8px;
  white-space: nowrap;
  justify-content: flex-end;
}

/* Mobile stacking */
@media (max-width: 900px) {
  .rain-controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .rain-context {
    justify-content: flex-start;
    margin-top: 6px;
  }
}

.is-hidden {
  display: none;
}

.center {
  margin: auto;
  padding: 4px;
}

/* =========================
   Button
   ========================= */

.qwc-button {
  border-radius: 8px;
  border: 2px solid #ffffff !important;
  background: #f48424 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  font-size: 14px !important;
  padding: 6px 10px !important;
  cursor: pointer;
}

.qwc-button:hover {
  background: #ffffff !important;
  color: #f48424 !important;
  border: 2px solid #f48424 !important;
}

.rainfall-copyright {
  padding-top: 35px;
  color: #7c7c7c !important;
  display: none;
}
