html.wtgm-no-x,
body.wtgm-no-x { overflow-x: hidden !important; }

html.wtgm-no-scroll,
body.wtgm-no-scroll {
  overflow: hidden !important;
  height: 100dvh !important;
}

.wtgm-wrapper,
.wtgm-wrapper * { box-sizing: border-box; }

.wtgm-wrapper {
  width: 100vw;
  max-width: 100vw;
  height: var(--wtgm-root-height, 100dvh);
  max-height: var(--wtgm-root-height, 100dvh);
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.wtgm-root {
  width: 100%;
  max-width: 100%;
  height: var(--wtgm-root-height, 100dvh);
  display: flex;
  flex-direction: column;
  padding: 0 12px 0;
  overflow: hidden;
}

.wtgm-map-shell {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  height: var(--wtgm-map-height, calc(100dvh - 132px));
  min-height: 360px;
  margin-top: 0;
  min-width: 0;
}

.wtgm-map {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: #e8edf4;
}

.wtgm-map-overlay {
  position: absolute;
  z-index: 30;
  pointer-events: none;
}

.wtgm-map-overlay--top-right {
  top: 12px;
  right: 12px;
  left: auto;
}

.wtgm-map-overlay--top-center {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 360px);
}

.wtgm-controls-panel,
.wtgm-page-label {
  pointer-events: auto;
}

.wtgm-controls-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 260px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  padding: 12px;
}

.wtgm-mobile-controls-toggle {
  display: none;
  pointer-events: auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.wtgm-mobile-controls-toggle::after {
  content: '\25BE';
  margin-left: 8px;
  font-size: 12px;
}

.wtgm-mobile-controls-toggle[aria-expanded="true"]::after {
  content: '\25B4';
}

.wtgm-overlay-select {
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #d7dbe2;
  border-radius: 8px;
  background: #fff;
  color: #111;
}

.wtgm-toggle-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wtgm-toggle-column label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #111;
  white-space: nowrap;
}

.wtgm-toggle-column input[type="checkbox"] { margin: 0; }

.wtgm-toggle-column label.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

.wtgm-toggle-column label.is-disabled input {
  pointer-events: none;
}

.wtgm-page-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
  text-align: center;
  font-weight: 600;
  color: rgba(0, 0, 0, .85);
  white-space: nowrap;
}

.wtgm-fast-overlay-root {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 10;
}

.wtgm-timeline-wrap {
  position: sticky;
  bottom: 0;
  z-index: 45;
  width: 100%;
  margin: 0;
  padding: 6px 0 calc(env(safe-area-inset-bottom, 0px) + 6px);
  background: transparent;
  flex: 0 0 auto;
}

.wtgm-play-row {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 6px;
  padding: 0;
  background: transparent;
}

.wtgm-play-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 999px;
  padding: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.wtgm-scroller-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.wtgm-nav-btn {
  color: #000;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  z-index: 20;
  flex: 0 0 auto;
}

.wtgm-nav-btn.swiper-button-prev,
.wtgm-nav-btn.swiper-button-next {
  position: static !important;
  inset: auto !important;
  margin: 0 !important;
}

.wtgm-nav-btn.wtgm-prev::after,
.wtgm-nav-btn.wtgm-next::after {
  font-family: swiper-icons, sans-serif !important;
  font-size: 18px;
  line-height: 1;
  color: currentColor;
}
.wtgm-nav-btn.wtgm-prev::after { content: 'prev'; }
.wtgm-nav-btn.wtgm-next::after { content: 'next'; }

.wtgm-play {
  width: auto;
  min-width: 112px;
  height: 38px;
  padding: 0 12px;
  gap: 8px;
  border-radius: 999px;
  box-shadow: none;
  background: #fff;
}

.wtgm-play-icon {
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wtgm-play-word {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.wtgm-scroller {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  border-radius: 9999px;
  background: rgba(0,0,0,0.04);
  padding: 6px 8px;
}

.wtgm-scroller:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.wtgm-scroller-track {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: max-content;
}

.wtgm-scroller-track span {
  scroll-snap-align: center;
  flex: 0 0 auto;
  width: 42px;
  text-align: center;
  font-size: 11px;
  line-height: 1;
  color: rgba(0,0,0,0.75);
  user-select: none;
  box-sizing: border-box;
  border: 4px solid transparent;
  border-radius: 6px;
  padding: 6px 0;
}

.wtgm-scroller-track span.is-active {
  border-color: #000;
  color: #000;
  font-weight: 700;
}

.wtgm-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.84);
  color: #111;
  font-size: 14px;
  z-index: 2;
}

@media (max-width: 900px) {
  .wtgm-root { padding: 0 8px 8px; }
  .wtgm-map-shell { height: var(--wtgm-map-height, calc(100vh - 185px)); min-height: 460px; }
  .wtgm-map-overlay--top-right { top: 8px; left: 8px; right: 8px; }
  .wtgm-map-overlay--top-center { top: auto; bottom: 10px; left: 8px; right: 8px; transform: none; max-width: none; }
  .wtgm-controls-panel { width: 100%; gap: 10px; padding: 10px; }
  .wtgm-overlay-select { width: 100%; }
}

@media (max-width: 767px) {
  .wtgm-root {
    padding: 0 8px 0;
  }

  .wtgm-timeline-wrap {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 4px);
  }

  .wtgm-map-overlay--top-right {
    top: 60px;
    right: 8px;
    left: auto;
    width: auto;
    max-width: none;
  }

  .wtgm-mobile-controls {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    width: auto;
    max-width: none;
  }

  .wtgm-mobile-controls-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    min-height: 40px;
    padding: 0 14px;
    white-space: nowrap;
    position: relative;
    z-index: 2;
  }

  .wtgm-mobile-controls .wtgm-controls-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    z-index: 40;
    width: min(280px, calc(100vw - 150px));
    max-width: calc(100vw - 150px);
    max-height: min(62vh, 520px);
    overflow: auto;
    margin: 0;
  }

  .wtgm-mobile-controls.is-open .wtgm-controls-panel {
    display: flex;
    flex-direction: column;
  }
}

.wtgm-layer-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wtgm-panel-title {
  margin: 0 0 2px;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: .02em;
}

.wtgm-layer-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.2;
  color: #111;
}

.wtgm-layer-option input[type="radio"] {
  margin: 0;
  flex: 0 0 auto;
}

.wtgm-toggle-column {
  padding-top: 2px;
  border-top: 1px solid rgba(15,23,42,.08);
}

.wtgm-map-overlay--bottom-left {
  left: 12px;
  bottom: 96px;
}

.wtgm-legend-panel {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 8px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15,23,42,.16);
  max-width: min(420px, calc(100vw - 48px));
}

.wtgm-legend-panel.is-hidden {
  display: none;
}

.wtgm-legend-image {
  display: block;
  max-width: min(400px, calc(100vw - 64px));
  max-height: 84px;
  width: auto;
  height: auto;
}

@media (max-width: 900px) {
  .wtgm-map-overlay--top-right {
    left: 12px;
    right: 12px;
  }

  .wtgm-controls-panel {
    width: min(320px, calc(100vw - 24px));
  }

  .wtgm-map-overlay--bottom-left {
    left: 12px;
    right: 12px;
    bottom: 92px;
  }

  .wtgm-legend-panel {
    max-width: 100%;
    width: fit-content;
  }

  .wtgm-legend-image {
    max-width: min(100%, 320px);
  }
}

/* v20 separator + full-height legend overrides */
.wtgm-section-separator {
  width: 100%;
  height: 1px;
  background: rgba(15,23,42,.18);
  margin: 2px 0 2px;
}

.wtgm-toggle-column {
  border-top: 0 !important;
  padding-top: 0 !important;
}

.wtgm-map-overlay--bottom-left {
  top: 90px !important;
  bottom: auto !important;
  left: 12px !important;
  right: auto !important;
  display: flex !important;
  align-items: stretch !important;
}

.wtgm-legend-panel {
  height: 100% !important;
  max-height: none !important;
  min-height: 0 !important;
  width: auto !important;
  max-width: min(140px, 18vw) !important;
  padding: 10px 8px !important;
  align-items: stretch !important;
}

.wtgm-legend-image {
  display: block !important;
  height: 100% !important;
  max-height: none !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain !important;
}

@media (max-width: 900px) {
  .wtgm-map-overlay--bottom-left {
    top: auto !important;
    bottom: 92px !important;
    left: 12px !important;
    right: auto !important;
  }

  .wtgm-legend-panel {
    height: auto !important;
    max-height: 42vh !important;
    max-width: min(120px, 26vw) !important;
  }

  .wtgm-legend-image {
    height: auto !important;
    max-height: 40vh !important;
  }
}

.wtgm-iw { width: 520px; max-width: min(520px, calc(100vw - 64px)); }
.wtgm-iw h3 { margin: 0 0 10px; font-size: 20px; line-height: 1.2; text-align: center; }
.wtgm-iw p { margin: 10px 0 0; text-align: center; }
.wtgm-iw-mini { width: 100%; height: 340px; overflow: hidden; border: 1px solid #dbe4ef; border-radius: 12px; background: #fff; }
.wtgm-iw-mini iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

@media (max-width: 767px) { .wtgm-iw { width: min(92vw, 520px); max-width: min(92vw, 520px); } .wtgm-iw-mini { height: 250px; } }

@media (max-width: 767px) {
  .wtgm-map-overlay--bottom-left {
    top: 88px !important;
    bottom: auto !important;
    left: 8px !important;
    right: auto !important;
  }

  .wtgm-legend-panel {
    max-width: min(96px, 22vw) !important;
  }

  .wtgm-legend-image {
    max-width: 100% !important;
  }
}

/* ===== MOBILE VIEW OPTIONS DROPDOWN: RIGHT SIDE, HALF HEIGHT, SCROLL ARROWS ===== */
@media (max-width: 767px) {
  /* leave room so Google Map / Satellite control is not covered */
  .wtgm-map-overlay--top-right {
    top: 72px !important;
    right: 8px !important;
    left: auto !important;
    width: auto !important;
    max-width: none !important;
  }

  .wtgm-mobile-controls {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    width: auto;
    max-width: none;
  }

  .wtgm-mobile-controls-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    min-height: 40px;
    padding: 0 14px;
    white-space: nowrap;
    position: relative;
    z-index: 3;
  }

  .wtgm-mobile-controls .wtgm-controls-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    z-index: 40;
    width: min(280px, calc(100vw - 150px)) !important;
    max-width: calc(100vw - 150px) !important;
    margin: 0 !important;

    /* half-height and scrollable */
    max-height: min(50dvh, 320px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;

    /* room for sticky arrows */
    padding-top: 30px !important;
    padding-bottom: 30px !important;

    scrollbar-width: thin;
  }

  .wtgm-mobile-controls.is-open .wtgm-controls-panel {
    display: flex !important;
    flex-direction: column;
  }

  /* top and bottom directional arrows */
  .wtgm-mobile-controls .wtgm-controls-panel::before,
  .wtgm-mobile-controls .wtgm-controls-panel::after {
    position: sticky;
    left: 0;
    right: 0;
    display: none;
    align-items: center;
    justify-content: center;
    width: calc(100% + 24px);
    margin-left: -12px;
    height: 22px;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.97);
    pointer-events: none;
    z-index: 5;
  }

  .wtgm-mobile-controls .wtgm-controls-panel::before {
    content: "▲";
    top: -18px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .wtgm-mobile-controls .wtgm-controls-panel::after {
    content: "▼";
    bottom: -18px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
  }

  .wtgm-mobile-controls .wtgm-controls-panel.has-overflow.show-up::before {
    display: flex;
  }

  .wtgm-mobile-controls .wtgm-controls-panel.has-overflow.show-down::after {
    display: flex;
  }

  /* keep legend on the left and away from the dropdown */
  .wtgm-map-overlay--bottom-left {
    top: 88px !important;
    bottom: auto !important;
    left: 8px !important;
    right: auto !important;
  }

  .wtgm-legend-panel {
    max-width: min(96px, 22vw) !important;
  }

  .wtgm-legend-image {
    max-width: 100% !important;
  }
}

/* ===== FINAL MOBILE OVERRIDES ===== */
/* right-side dropdown, smaller height, scroll arrows,
   play button next to date/time, white hour background */

@media (max-width: 767px) {
  /* keep top-right controls lower so Map / Satellite stays visible */
  .wtgm-map-overlay--top-right {
    top: 72px !important;
    right: 8px !important;
    left: auto !important;
    width: auto !important;
    max-width: none !important;
  }

  .wtgm-mobile-controls {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 8px !important;
    width: auto !important;
    max-width: none !important;
  }

  .wtgm-mobile-controls-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: flex-end !important;
    min-height: 40px !important;
    padding: 0 14px !important;
    white-space: nowrap !important;
    position: relative !important;
    z-index: 3 !important;
  }

  /* smaller dropdown so it feels better on short screens */
  .wtgm-mobile-controls .wtgm-controls-panel {
    display: none;
    position: absolute !important;
    top: calc(100% + 8px) !important;
    right: 0 !important;
    left: auto !important;
    z-index: 40 !important;
    width: min(270px, calc(100vw - 150px)) !important;
    max-width: calc(100vw - 150px) !important;
    margin: 0 !important;

    /* smaller than before */
    max-height: min(38dvh, 248px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;

    padding: 10px 10px 26px 10px !important;
    gap: 10px !important;
    scrollbar-width: thin;
  }

  .wtgm-mobile-controls.is-open .wtgm-controls-panel {
    display: flex !important;
    flex-direction: column !important;
  }

  /* tighten internal spacing a little on phones */
  .wtgm-layer-fieldset {
    gap: 7px !important;
  }

  .wtgm-panel-title {
    font-size: 11px !important;
    margin-bottom: 2px !important;
  }

  .wtgm-layer-option {
    font-size: 12px !important;
    gap: 7px !important;
  }

  .wtgm-toggle-column {
    gap: 7px !important;
  }

  .wtgm-toggle-column label {
    font-size: 12px !important;
    gap: 6px !important;
  }

  /* up/down arrows for scroll direction */
  .wtgm-mobile-controls .wtgm-controls-panel::before,
  .wtgm-mobile-controls .wtgm-controls-panel::after {
    position: sticky;
    left: 0;
    right: 0;
    display: none;
    align-items: center;
    justify-content: center;
    width: calc(100% + 20px);
    margin-left: -10px;
    height: 20px;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.97);
    pointer-events: none;
    z-index: 5;
  }

  .wtgm-mobile-controls .wtgm-controls-panel::before {
    content: "▲";
    top: -10px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .wtgm-mobile-controls .wtgm-controls-panel::after {
    content: "▼";
    bottom: -18px;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
  }

  .wtgm-mobile-controls .wtgm-controls-panel.has-overflow.show-up::before {
    display: flex;
  }

  .wtgm-mobile-controls .wtgm-controls-panel.has-overflow.show-down::after {
    display: flex;
  }

  /* keep legend on the left */
  .wtgm-map-overlay--bottom-left {
    top: 88px !important;
    bottom: auto !important;
    left: 8px !important;
    right: auto !important;
  }

  .wtgm-legend-panel {
    max-width: min(96px, 22vw) !important;
  }

  .wtgm-legend-image {
    max-width: 100% !important;
  }

  /* --- date/time pill and play button on same visual row --- */

  /* leave room on the right for the Play/Pause button */
  .wtgm-map-overlay--top-center {
    top: auto !important;
    bottom: 12px !important;
    left: 12px !important;
    right: 132px !important;
    transform: none !important;
    max-width: none !important;
  }

  .wtgm-page-label {
    width: 100% !important;
    min-height: 36px !important;
    justify-content: flex-start !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* move Play/Pause next to the date/time tag */
  .wtgm-timeline-wrap {
    position: relative !important;
    padding-top: 0 !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 4px) !important;
  }

  .wtgm-play-row {
    position: absolute !important;
    top: -54px !important;
    right: 8px !important;
    width: auto !important;
    margin: 0 !important;
    z-index: 50 !important;
    justify-content: flex-end !important;
    pointer-events: none !important;
  }

  .wtgm-play-pill {
    pointer-events: auto !important;
    padding: 3px !important;
  }

  .wtgm-play {
    min-width: 108px !important;
    height: 36px !important;
    padding: 0 12px !important;
    gap: 8px !important;
    background: #fff !important;
  }

  .wtgm-play-icon {
    font-size: 18px !important;
  }

  .wtgm-play-word {
    font-size: 13px !important;
  }

  /* white background behind the hours */
  .wtgm-scroller {
    background: rgba(255, 255, 255, 0.96) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,.08) !important;
    padding: 6px 8px !important;
  }

  .wtgm-scroller-track span {
    background: transparent !important;
  }

  .wtgm-scroller-track span.is-active {
    background: #fff !important;
  }
}