/* Source banner (Q4): small, fixed, dismissible — it must not move the Origin's layout. */
#klongmap-banner {
  position: fixed;
  left: 8px;
  bottom: 8px;
  z-index: 1040; /* below Bootstrap modals (1050) */
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100vw - 16px);
  padding: 4px 6px 4px 10px;
  font: 12px/1.4 'Sarabun', sans-serif;
  color: #135d9c;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #bad8fe;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
#klongmap-banner[hidden] { display: none; }
#klongmap-banner a { color: inherit; text-decoration: underline; }
#klongmap-banner .kb-status { color: #555; }
#klongmap-banner.kb-offline .kb-status { color: #c0392b; }
#klongmap-banner .kb-close {
  border: 0;
  background: none;
  color: #135d9c;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}

#klongmap-banner .kb-history {
  border: 1px solid #bad8fe;
  border-radius: 4px;
  background: #fff;
  color: #135d9c;
  font: inherit;
  padding: 0 6px;
  cursor: pointer;
  white-space: nowrap;
}
#klongmap-banner .kb-history[hidden] { display: none; }
#klongmap-banner a.kb-cctv {
  border: 1px solid #bad8fe;
  border-radius: 4px;
  background: #fff;
  padding: 0 6px;
  text-decoration: none;
  white-space: nowrap;
}

/* Time slider (ADR 0004): overlays the bottom of the page, never moves the Origin's layout. */
#klongmap-slider {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 1040;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 760px;
  padding: 6px 8px 6px 10px;
  font: 12px/1.4 'Sarabun', sans-serif;
  color: #135d9c;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #bad8fe;
  border-radius: 6px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}
#klongmap-slider[hidden] { display: none; }
#klongmap-slider.ks-past {
  color: #8a4b00;
  background: rgba(255, 244, 222, 0.97);
  border-color: #f0a830;
}
#klongmap-slider button {
  flex: none;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: #fff;
  color: inherit;
  font: inherit;
  line-height: 1;
  min-width: 32px;
  height: 30px;
  padding: 0 8px;
  cursor: pointer;
}
#klongmap-slider button:disabled { opacity: 0.4; cursor: default; }
#klongmap-slider .ks-close { border: 0; background: none; font-size: 18px; min-width: 24px; padding: 0 4px; }
#klongmap-slider .ks-live { position: relative; font-weight: bold; }
#klongmap-slider .ks-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d61924;
  border: 1px solid #fff;
}
#klongmap-slider .ks-dot[hidden] { display: none; }
#klongmap-slider .ks-track { flex: 1; min-width: 0; }
#klongmap-slider .ks-range { display: block; width: 100%; margin: 0; accent-color: #135d9c; cursor: pointer; }
#klongmap-slider.ks-past .ks-range { accent-color: #d98300; }
#klongmap-slider .ks-scale { display: flex; justify-content: space-between; gap: 8px; white-space: nowrap; }
#klongmap-slider .ks-when { font-weight: bold; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  #klongmap-slider { gap: 6px; padding: 6px; }
  #klongmap-slider .ks-start { display: none; }
  #klongmap-slider .ks-scale { justify-content: center; }
}
