/* Mobile responsiveness refinements for the NetherLux demo. */
html, body, #root {
  max-width: 100%;
  overflow-x: hidden;
}

@media (max-width: 767px) {
  /* Keep module headers usable on phones. */
  #cold-room,
  #fire,
  #lift,
  #plant,
  #energy,
  #door {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  #cold-room > div:last-child,
  #fire > div:last-child,
  #lift > div:last-child,
  #plant > div:last-child,
  #energy > div:last-child,
  #door > div:last-child {
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  #cold-room > div:last-child button,
  #fire > div:last-child button,
  #lift > div:last-child button,
  #plant > div:last-child button,
  #energy > div:last-child button,
  #door > div:last-child button {
    width: 100% !important;
  }

  /* Plant simulation buttons should not overflow on mobile. */
  #plant + div > .mb-3 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.5rem !important;
  }

  #plant + div > .mb-3 button {
    width: 100% !important;
    min-width: 0 !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    font-size: 0.72rem !important;
  }

  /* Oman map: shorter, cleaner and no overlay card covering the pins. */
  .oman-map-shell {
    padding: 10px !important;
    gap: 10px !important;
  }

  .oman-map-frame {
    height: 300px !important;
    border-radius: 16px !important;
  }

  .oman-map-titlebar {
    left: 10px !important;
    top: 10px !important;
    max-width: calc(100% - 20px) !important;
    padding: 8px 10px !important;
    font-size: 11px !important;
    gap: 6px !important;
  }

  .oman-map-titlebar span {
    display: none !important;
  }

  .oman-map-feature {
    display: none !important;
  }

  .oman-site-list {
    grid-template-columns: 1fr !important;
  }

  .oman-map-listbar-head {
    display: block !important;
  }
}

@media (max-width: 380px) {
  #plant + div > .mb-3 {
    grid-template-columns: 1fr !important;
  }

  .oman-map-frame {
    height: 280px !important;
  }
}
